bigassmuffin Posted May 10, 2006 Share Posted May 10, 2006 Hi, I have this simple script..While 1 $var = Pixelgetcolor(28,59) If Hex($var) = 0x637131 then MouseClick Sleep(5000) Continueloop(1) EndifWendI 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) EndifWendand if it does NOT see the correct color, I want it to try it again with a 5 second delayCan someone please help meTHANK YOU FOR YOUR TIME AND HELP IF SO! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 10, 2006 Moderators Share Posted May 10, 2006 (edited) 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 WEndCompare Codes, I didn't look past the Hex part the first time. Edited May 10, 2006 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 More sharing options...
bigassmuffin Posted May 10, 2006 Author Share Posted May 10, 2006 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 WEndCompare 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now