Jump to content
Sign in to follow this  
amorgan

long loop variable issue

Recommended Posts

amorgan

I am attempting to create a verification code of sorts and I will paste a copy of it so far just to give an idea.

I have a number of boxes that I want to be verified. Like if box is empty then click in it, but this is purely by color as if I were trying to click on a .jpg in certain spots.

I am new at this so please forgive me:

;locations of the rectangles to search for this color 16777215

$PS1 =PixelSearch(1227,98,1243,112,16777215,95)

$PS2 =PixelSearch(1227,117,1243,131,16777215,95)

$PS3 =PixelSearch(1227,136,1243,150,16777215,95)

$PS4 =PixelSearch(1226,156,1242,170,16777215,95)

$PS5 =PixelSearch(1227,174,1243,188,16777215,95)

$PS6 =PixelSearch(1227,193,1243,207,16777215,95)

$PS7 =PixelSearch(1227,211,1243,225,16777215,95)

$PS8 =PixelSearch(1227,231,1243,245,16777215,95)

$PS9 =PixelSearch(1227,250,1243,264,16777215,95)

$PS10=PixelSearch(1227,268,1243,282,16777215,95)

$PS11=PixelSearch(1226,288,1242,302,16777215,95)

$PS12=PixelSearch(1226,307,1242,321,16777215,95)

$PS13=PixelSearch(1227,327,1243,341,16777215,95)

$PS14=PixelSearch(1227,345,1243,359,16777215,95)

$PS=$PS1

;attempt at loop

Do

Pixelgetcolor($PS[0],$PS[1])

$PS=$PS+1

Until $PS=@error ; once @error is found want to find a way to select that area

The way I want it to work is, if the first field has that color in it then move on and search second field and on and on. but if the color is not in first field to stop search and only select that field.

Any suggestions?

Thanks in advance for any help you may be able to give.

Share this post


Link to post
Share on other sites
amorgan

I am attempting to create a verification code of sorts and I will paste a copy of it so far just to give an idea.

I have a number of boxes that I want to be verified. Like if box is empty then click in it, but this is purely by color as if I were trying to click on a .jpg in certain spots.

I am new at this so please forgive me:

;locations of the rectangles to search for this color 16777215

$PS1 =PixelSearch(1227,98,1243,112,16777215,95)

$PS2 =PixelSearch(1227,117,1243,131,16777215,95)

$PS3 =PixelSearch(1227,136,1243,150,16777215,95)

$PS4 =PixelSearch(1226,156,1242,170,16777215,95)

$PS5 =PixelSearch(1227,174,1243,188,16777215,95)

$PS6 =PixelSearch(1227,193,1243,207,16777215,95)

$PS7 =PixelSearch(1227,211,1243,225,16777215,95)

$PS8 =PixelSearch(1227,231,1243,245,16777215,95)

$PS9 =PixelSearch(1227,250,1243,264,16777215,95)

$PS10=PixelSearch(1227,268,1243,282,16777215,95)

$PS11=PixelSearch(1226,288,1242,302,16777215,95)

$PS12=PixelSearch(1226,307,1242,321,16777215,95)

$PS13=PixelSearch(1227,327,1243,341,16777215,95)

$PS14=PixelSearch(1227,345,1243,359,16777215,95)

$PS=$PS1

;attempt at loop

Do

Pixelgetcolor($PS[0],$PS[1])

$PS=$PS+1

Until $PS=@error ; once @error is found want to find a way to select that area

The way I want it to work is, if the first field has that color in it then move on and search second field and on and on. but if the color is not in first field to stop search and only select that field.

Any suggestions?

Thanks in advance for any help you may be able to give.

Nevermind, replaced it with

$x=1233

$y=102

Func target()

Send("{LCTRL DOWN}")

MouseClick("left")

Send("{LCTRL UP}")

MouseClick("left", $x,$y, 2)

EndFunc

$a1=1227

$a2=98

$a3=1243

$a4=112

Do

$PS1=PixelSearch($a1,$a2,$a3,$a4,16777215,95)

$a2=$a2+17

$a4=$a4+17

Until $PS1=@error

MouseMove($a1+8,$a2-8)

target()

And it worked.

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  

×