Sign in to follow this  
Followers 0
MasonMill

Correct Do...Until?

6 posts in this topic

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

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

Does the same thing, its like it either skips the loop or it just sleeps the 1000 then moves on to hit space bar.

Share this post


Link to post
Share on other sites

Maybe do the above suggestion and instead of having "Until $fullstamina" put "Until $fullstamina = 1" or "Until $fullstamina = true"

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by jebus495

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0