Jump to content

Pixel Help


Recommended Posts

Hi, I have this simple script..

While 1

$var = Pixelgetcolor(28,59)

If Hex($var) = 0x637131 then

MouseClick

Sleep(5000)

Continueloop(1)

Endif

Wend

I don't realize what is wrong iwth it...

I want it to check in coordinates (28,59) of screen.. (I got no error so far)

Then I want to check if that color is 0x637131 (which is a shade of green).. This is where I gotthe error...

And after that, If it sees the color, I want it to click there..

I may have to do:

While 1

$var = Pixelgetcolor(28,59)

If Hex($var) = 0x637131 then

MouseClick("Left", 28, 59, 1)

Sleep(5000)

Continueloop(1)

Endif

Wend

and if it does NOT see the correct color, I want it to try it again with a 5 second delay

Can someone please help me

THANK YOU FOR YOUR TIME AND HELP IF SO!

Link to comment
Share on other sites

  • Moderators

Hi, I have this simple script..

I don't realize what is wrong iwth it...

I want it to check in coordinates (28,59) of screen.. (I got no error so far)

Then I want to check if that color is 0x637131 (which is a shade of green).. This is where I gotthe error...

And after that, If it sees the color, I want it to click there..

I may have to do:

and if it does NOT see the correct color, I want it to try it again with a 5 second delay

Can someone please help me

THANK YOU FOR YOUR TIME AND HELP IF SO!

If '0x' & Hex($var, 6) = 0x637131 Then

Edit:

Or you could just do:

While 1
    If (Pixelgetcolor(28,59) == 0x637131) Then
        MouseClick(x, y, clicks, speed)
        Sleep(5000)
        Continueloop
    Endif
WEnd
Compare Codes, I didn't look past the Hex part the first time. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

If '0x' & Hex($var, 6) = 0x637131 Then

Edit:

Or you could just do:

While 1
    If (Pixelgetcolor(28,59) == 0x637131) Then
        MouseClick(x, y, clicks, speed)
        Sleep(5000)
        Continueloop
    Endif
WEnd
Compare Codes, I didn't look past the Hex part the first time.

Thanks..jsut i need as bit of edit, if it does find that pixel and its cotrrect color, I don't want it to rechec (continueloop)

instead I want it to go to a new function..

lets jsut say the new function is:

Send("F1")

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...