Sign in to follow this  
Followers 0
Max in montreal

loops

7 posts in this topic

i need to create a loop, i need the loop to keep going untill a pixel color is x or y.

so how do i say

do

bla bla

until $var = x or $var = y

i guess its the OR i am looking for.

thanks in advance.

Share this post


Link to post
Share on other sites



$PixelSearch = PixelSearch( 0, 0, 20, 300, 0xFF0000 )
Do
    Sleep(10)
    PixelSearch( 0, 0, 20, 300, 0xFF0000 )
Until IsArray($PixelSearch)

This will loop until the pixelsearch returns it's coordinates.

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites

What exactly is x and y, you're referring to?

Are you wanting to run a script until the pixelcolor at a certain coordinate is returned to a certain color?

If it's at a coordinate...

While 1
$var = PixelGetColor( x,y ) ;Where x and y are the coordinates
If $var[0]=$xcol Then ;Where $xcol is the desired pixel color in decimal value
ExitLoop
ElseIf $var[1]=$ycol Then ;Where $ycol is the desired pixel color in decimal value
ExitLoop
EndIf
Wend

A little more basic and easier to understand, if it's what you need.

Share this post


Link to post
Share on other sites

let me rephrase my question...

this is what i have...

Do

$var = 0

$var = PixelGetColor( 975, 892) ; get the color to see if its a turbo or a 6 man

sleep (100)

until $var = 16777215 or $var = 16777213

the second $var is a made up number, but can i some how throw an OR in there like i did?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

thats great, never used exit loop before...thank you, its perfect!

Max

Edited by Max in montreal

Share this post


Link to post
Share on other sites

let me rephrase my question...

this is what i have...

Do

$var = 0

$var = PixelGetColor( 975, 892) ; get the color to see if its a turbo or a 6 man

sleep (100)

until $var = 16777215 or $var = 16777213

the second $var is a made up number, but can i some how throw an OR in there like i did?

I just had to ask... what was wrong with this code that you couldn't use it?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

$var = 0

Do

$var = 0

$var = PixelGetColor( 975, 892) ; get the color to see if its a turbo or a 6 man

sleep (100)

if $var = 21648 Then

ExitLoop

until $var = 16777215

MouseClick("left", 975, 892, 2)

so i changed it to the above, im getting an error

this is the way i did it, thanks all!

Edited by Max in montreal

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