MasonMill Posted December 21, 2009 Posted December 21, 2009 Hi Guys,Is this Do Until function proper? It seems like when it hits the sleep(1000) it just moves on past the until. Just wondering if my $FullStamina is the problem or the do until. Here is a part of my script.$FullStamina = PixelSearch(185, 287, 195, 295, 0xCCA028, 1)Func LowHealth() $LowLife = Pixelsearch(1728, 43, 1738, 52, 0x741A1A, 1) If @error Then sleep(1000) send("o");shieth sleep(3000) send("b");toggle rest sleep(1000) send("u");trigger rest sleep(1000) send("b");toggle rest sleep(1000) send("u");trigger rest Do sleep(1000) Until $FullStamina send("{SPACE}");stand up sleep(4000) send("{F9}");sends a command to other computer sleep(2000) send("o");unshieth sleep(1000) EndIf EndFunc
somdcomputerguy Posted December 21, 2009 Posted December 21, 2009 Try put the $FullStamina = PixelSearch(185, 287, 195, 295, 0xCCA028, 1) line in the Do loop - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
MasonMill Posted December 21, 2009 Author Posted December 21, 2009 Does the same thing, its like it either skips the loop or it just sleeps the 1000 then moves on to hit space bar.
strikeraid Posted December 21, 2009 Posted December 21, 2009 Maybe do the above suggestion and instead of having "Until $fullstamina" put "Until $fullstamina = 1" or "Until $fullstamina = true"
MasonMill Posted December 21, 2009 Author Posted December 21, 2009 Sounded like it would work, but to no avail. Anyone have any other suggestions? It seems simple enough, I don't know why it doesn't work. This is my first DO Until loop though so I haven't ever used it.
jebus495 Posted December 21, 2009 Posted December 21, 2009 (edited) Sounded like it would work, but to no avail. Anyone have any other suggestions? It seems simple enough, I don't know why it doesn't work. This is my first DO Until loop though so I haven't ever used it. Since you didn't post the attempt you made I'm gonna take a guess at what went wrong and offer a solution. $FullStamina = PixelSearch(185, 287, 195, 295, 0xCCA028, 1) Func LowHealth() $LowLife = Pixelsearch(1728, 43, 1738, 52, 0x741A1A, 1) If @error Then sleep(1000) send("o");shieth sleep(3000) send("b");toggle rest sleep(1000) send("u");trigger rest sleep(1000) send("b");toggle rest sleep(1000) send("u");trigger rest Do $FullStamina = PixelSearch(185, 287, 195, 295, 0xCCA028, 1) If IsArray($FullStamina) Then $FullStamina[2] = 1 Sleep(1000) Until $FullStamina[2] = 1 send("{SPACE}");stand up sleep(4000) send("{F9}");sends a command to other computer sleep(2000) send("o");unshieth sleep(1000) EndIf EndFunc This is of course only one way of doing it. I'm guessing you put the pixelsearch in the Do Until loop but forgot to test it for @error. I purposely chose to use a method you haven't used here yet in case you've never seen it. Always nice to learn something new. Edited December 21, 2009 by jebus495
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