S7V7N Posted April 28, 2017 Posted April 28, 2017 Hey guys! So i have a question on how I can make a script work, not dealing so good with this one I want to make loops inside loops if possible I want it to do 1 thing and wait like 5 minutes to do it again but everytime i try it the next step on the scripts waits 5 minutes to work I want it to infinite do that inside the script but somehow don't mess with the rest of the script expandcollapse popupWhile 1 Local $i = 0 Do ;find a mob $mob = PixelSearch($x1,$y1,$x2,$y2,$HuntingForColor,10) if not @error Then ;attack the mob MouseClick("left", $mob[0], $mob[1], 1, 1) Sleep(10000) EndIf Until $i = 0 ;are we wealthy enough? $pot = PixelSearch(884, 323,1061, 531,0x000002,1) $hpBar = PixelSearch(866, 125,894, 137, 0x00FF00, 1) if @error Then ;eat MouseClick("left",910,299,1,1) Sleep(0800) EndIf While 1 <- I want this to be made every 10 minutes but don't mess with the rest of the script $hpBar = PixelSearch(866, 125,894, 137, 0x00FF00, 1) if @error Then ;eat MouseClick("left",910,299,1,1) Sleep(600000) EndIf Wend While 1 <- I want this to be made every 5 minutes but don't mess with the rest of the script ;find a mob $mob = PixelSearch($x1,$y1,$x2,$y2,$HuntingForColor,10) if not @error Then ;attack the mob MouseClick("left", $mob[0], $mob[1], 1, 1) Sleep(300000) EndIf Wend Wend Example how i wanted it to work (but it doesn't) ^ hope you get the point Any help is appreciated!
S7V7N Posted April 28, 2017 Author Posted April 28, 2017 Not on topic: How do I edit my post? OT: So resuming those 2 functions or how you call it only work once every x time the rest of the script is always looping, that's what i want
Developers Jos Posted April 28, 2017 Developers Posted April 28, 2017 @S7V7N, Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts