Sign in to follow this  
Followers 0
Falc0

Help with Pixel Color Search

10 posts in this topic

MouseClick("left", 1018, 133, 20)
$var = PixelGetColor( 228 , 223 )
MsgBox(0,"Checking for events.....", $var
MouseClick("left", 219, 430, 1)

Not sure if the code is right but what I need it to do is check those coordinates and if it returns back white to shut down the bot, but if it comes back a different color return to what it was doing...

I've tried looking at the Help File but I can't figure out how to do it.


RK-DemonSpawned

Share this post


Link to post
Share on other sites



While 1
  If PixelGetColor( 228 , 223 ) = 0;White
     Exit
  EndIf
;Check what is happening
WEnd

Share this post


Link to post
Share on other sites

Thank you very much. :D


RK-DemonSpawned

Share this post


Link to post
Share on other sites

Gah when I try this I get this error

If PixelGetColor( 228, 223 )=0;White

Error: "If" statements must have a "Then" keyword.

Where would I add the "Then" in the code?

Note: code is 2 posts above


RK-DemonSpawned

Share this post


Link to post
Share on other sites

Gah when I try this I get this error

If PixelGetColor( 228, 223 )=0;White

Error: "If" statements must have a "Then" keyword.

Where would I add the "Then" in the code?

Note: code is 2 posts above

Where do you think it should be placed ?

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I was thinking before Exit, but I tried that and got the same error.

So I am not too sure of where to put it now.


RK-DemonSpawned

Share this post


Link to post
Share on other sites

I was thinking before Exit, but I tried that and got the same error.

So I am not too sure of where to put it now.

If PixelGetColor( 228, 223 )=0 then ;White :D

Share this post


Link to post
Share on other sites

suggestion: these kind of questions are easily found in the helpfile.....

Here's the Cut&Paste for the If statement:

If...Then

--------------------------------------------------------------------------------

Conditionally run a single statement.

If <expression> Then statement

Parameters

expression If the expression is true, the statement is executed.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Where do you think it should be placed ?

Damn, I was going to ask that very same question, you beat me to it.

Falc0, read the code in English, not as code. Try putting the "Then" where it makes the sentence sound correct.

Share this post


Link to post
Share on other sites

Damn, I was going to ask that very same question, you beat me to it.

Falc0, read the code in English, not as code.  Try putting the "Then" where it makes the sentence sound correct.

Hmm...I see. That actually makes sense to me :D

By the way thanks Josbe :huh2:


RK-DemonSpawned

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