Jump to content
Sign in to follow this  
Sumoman

Pixel Search

Recommended Posts

Sumoman

I was wondering if you can use the pixelsearch command in an IF THEN statement.

something like: IF Pixelsearch(12,40,100,200)=1677555 THEN

If not, then would:

DO

PixelSearch(1,1,100,100,1556765)

IF NOT @error THEN

dfaefdasfesdageaefd

EndIF

@error=0

UNTIL 1=2

reset @error everytime it goes through the loop? would that work?

Share this post


Link to post
Share on other sites
-TS-

DO
PixelSearch(1,1,100,100,1556765)
IF NOT @error THEN
dfaefdasfesdageaefd
EndIF

@error=0
UNTIL $1=2
make sure you use a $var in the until statment

yes that should work, not 100% sure, never use the search command.

Share this post


Link to post
Share on other sites
Sumoman

What's the significance of an @var compared to a $var?

Share this post


Link to post
Share on other sites
-TS-

DO
PixelSearch(1,1,100,100,1556765)
IF NOT @error THEN
dfaefdasfesdageaefd
EndIF

@error=0
UNTIL 1=2; you dont have a $ for 1*****

that what i was pointing out

Share this post


Link to post
Share on other sites
Sumoman

what i meant was, why is it:

IF NOT @error

instead of :

IF NOT $error

Share this post


Link to post
Share on other sites
-TS-

OOOk i see,

:D i have no clue what the dif is :huh2:

Share this post


Link to post
Share on other sites
-TS-

i red alittle about it, @ is a micro and $ is a var, so there are treated diffenly.

Im not 100% sure, i just started relearning autoit last week.

Share this post


Link to post
Share on other sites
Sumoman

>.<

oh well, thanks for the help anyway

Share this post


Link to post
Share on other sites
Sumoman

hmmmm

@error=0

is invalid, and if i don't reset it to 0 it always hits true in a loop...

any ideas on how to reset it?

Share this post


Link to post
Share on other sites
-TS-

The @error code is only valid until the next function is called. Consequently, you may need to backup the status of @error in a variable if you are testing it in a While-WEnd loop.

Try

SetError ( 0 )

maybe that will help.

Share this post


Link to post
Share on other sites
Sumoman

errrr nm that was a problem with my script itself, @error does reset itself. :D

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.