tom13 Posted July 1, 2007 Share Posted July 1, 2007 Hi, I made this piece of code: If $InsideBG = True Then ;If we are inside the battleground Sleep(90000) Send("{LCTRL 2}") Sleep(200) Send("{1}") Sleep(1000) Send("{LCTRL 2}") Sleep(200) Send("{1}") Sleep(1000) Send("{LCTRL 2}") Sleep(200) Send("{g}") $Loop = 0 Do $Loop = $Loop + 1 Sleep(random(2500,3000)) Send("{z}") StatusCheck() Until $InsideBG = False or $Dead = True or $Loop = 15 EndIf As you can see there is a do ... until inside a if ... endif, when I start my script it gives an error, If I remove the do ... until part there is no error anymore. Does anyone knows why this error occurs? Thanks in advance. Link to comment Share on other sites More sharing options...
i542 Posted July 1, 2007 Share Posted July 1, 2007 (edited) Func _SomeStupidFuncName() $Loop = $Loop + 1 Sleep(random(2500,3000)) Send("{z}") StatusCheck() If $InsideBG = False or $Dead = True or $Loop = 15 Then AdlibDisable() EndFuncoÝ÷ Ù©Ýjëh×6If $InsideBG = True Then ;If we are inside the battleground Sleep(90000) Send("{LCTRL 2}") Sleep(200) Send("{1}") Sleep(1000) Send("{LCTRL 2}") Sleep(200) Send("{1}") Sleep(1000) Send("{LCTRL 2}") Sleep(200) Send("{g}") $Loop = 0 AdlibEnable("_SomeStupidFuncName",100) ;change the number which fits you best. EndIf Edited July 1, 2007 by i542 I can do signature me. Link to comment Share on other sites More sharing options...
Kogmedia Posted July 1, 2007 Share Posted July 1, 2007 (edited) $InsideBG = True $Loop = 0 $Dead = False If $InsideBG = True Then ;If we are inside the battleground Sleep(90000) Send("{LCTRL 2}") Sleep(200) Send("{1}") Sleep(1000) Send("{LCTRL 2}") Sleep(200) Send("{1}") Sleep(1000) Send("{LCTRL 2}") Sleep(200) Send("{g}") $Loop = 0 Do $Loop = $Loop + 1 Sleep(random(2500,3000)) Send("{z}") ;StatusCheck() Until $InsideBG = False or $Dead = True or $Loop = 15 EndIf This works for me....No Errors Edited July 1, 2007 by Kogmedia [font="Verdana"]Keith (Kogmedia)[/font]My ScriptQuick Search - Internet / Hard Drive Search Link to comment Share on other sites More sharing options...
weaponx Posted July 1, 2007 Share Posted July 1, 2007 How can you have this condition when the outer IF condition always has to be true? Until $InsideBG = False Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 2, 2007 Share Posted July 2, 2007 How can you have this condition when the outer IF condition always has to be true?Until $InsideBG = FalseThe StatusCheck() function might be changing the state of that flag.As for the Do/Until loop, I don't see the problem. Perhaps you should be using "random(2500,3000, 1)" to get an integer result, but I don't know that non-integer inputs cause errors for Sleep(). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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