Kiesp Posted September 12, 2006 Share Posted September 12, 2006 hi there.. every time i make a while loop i get an error.. an example from my recent script: global $war HotKeySet("{end}","attack") ;set the end key to a function called attack. $wow = WinActive("World of Warcraft") ; checks to see if the wow window is in focus. ;if wow window is focused it will i will check if the end key is pressed. if so it ;will send the key 5 every 250 millisecond until it is pressed again. While $wow = 1 func attack() $war = not $war While $war send("5") sleep(250) WEnd EndFunc WEnd the error msg is attached is there an error in the script or is it a bug? http://www.autoitscript.com/forum/index.php?showtopic=69911 <-- Best hacker ever :D Link to comment Share on other sites More sharing options...
lod3n Posted September 12, 2006 Share Posted September 12, 2006 (edited) $title = "World of Warcraft" global $war = 0 HotKeySet("{end}","wartoggle") winwaitactive($title) While WinActive($title) sleep(250) if $war = 1 Then send("5") EndIf WEnd func wartoggle() $war = not $war EndFunc Edited September 12, 2006 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
AzKay Posted September 12, 2006 Share Posted September 12, 2006 global $war HotKeySet("{end}","attack") ;set the end key to a function called attack. $wow = WinActive("World of Warcraft") ; checks to see if the wow window is in focus. ;if wow window is focused it will i will check if the end key is pressed. if so it ;will send the key 5 every 250 millisecond until it is pressed again. While $wow = 1 Sleep(100) WEnd func attack() $war = not $war While $war send("5") sleep(250) WEnd EndFunc # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Kiesp Posted September 12, 2006 Author Share Posted September 12, 2006 thx alot both of u... i just edited it to make it more me http://www.autoitscript.com/forum/index.php?showtopic=69911 <-- Best hacker ever :D Link to comment Share on other sites More sharing options...
AzKay Posted September 12, 2006 Share Posted September 12, 2006 # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now