Ravel Posted February 20, 2006 Share Posted February 20, 2006 I have a quick question for you guys... I am trying to right a code for a script that will allow it to loop but pause if a certain decimal color code does not exist. And when it exists again to start looping again. I have learned alot so far, but this is another new thing that i think auto it has the capability to do, but I dont know how to put all the commands together to get the result that i want. As of now I dont have any code written. Any code that you all could provide would go a long way to helping me reach my goal. THanks for your help. Link to comment Share on other sites More sharing options...
greenmachine Posted February 20, 2006 Share Posted February 20, 2006 This sounds familiar. Which game/program are you trying to automate with pixel checks? Sample code - you have to supply x, y, and color to find: While 1 Do Sleep (10) Until PixelGetColor ($x, $y) = $Color ; code to do when the color is found WEnd Link to comment Share on other sites More sharing options...
Ravel Posted February 20, 2006 Author Share Posted February 20, 2006 (edited) This sounds familiar. Which game/program are you trying to automate with pixel checks? Sample code - you have to supply x, y, and color to find: While 1 Do Sleep (10) Until PixelGetColor ($x, $y) = $Color ; code to do when the color is found WEnd um the game is DFBHD. WHat i would like to do is have a command cycle once i bring up my crosshairs. I have the decimal code for the crosshair point. But I want the command to stop cycling once i take away the crosshairs. Is it possible to forgo the coordinates, and just use the decimal color code? Edited February 20, 2006 by Ravel Link to comment Share on other sites More sharing options...
greenmachine Posted February 20, 2006 Share Posted February 20, 2006 Well the program needs to know where you're looking for your pixel color. If it could be anywhere on the whole screen, you're going to want to look at PixelSearch (however, that's going to take forever to search the whole screen). If it stays in 1 place, use the coords. You have to. Link to comment Share on other sites More sharing options...
Ravel Posted February 20, 2006 Author Share Posted February 20, 2006 (edited) Ok this is what i have so far While 1 Do Sleep (10) Until PixelGetColor (320, 240) = 610992; color is decimal Send("'"); code to do when the color is found, also need to figure out the command to send this code 10 times Send("."); also need to send 10 times WEnd is this correct? Edited February 20, 2006 by Ravel Link to comment Share on other sites More sharing options...
greenmachine Posted February 20, 2006 Share Posted February 20, 2006 You could use either of these methods for sending 10 times: For $i = 1 To 10 Send ("'") Next For $i = 1 To 10 Send (".") Next Send ("{' 10}") Send ("{. 10}") Link to comment Share on other sites More sharing options...
Ravel Posted February 20, 2006 Author Share Posted February 20, 2006 You could use either of these methods for sending 10 times: For $i = 1 To 10 Send ("'") Next For $i = 1 To 10 Send (".") Next Send ("{' 10}") Send ("{. 10}") Ok so: While 1 Do Sleep (10) Until PixelGetColor (320, 240) = 610992; color is decimal Send ("{' 10}"); Send ("{. 10}"); WEnd should work? The decimal color thing is fine? I dont need a particular command to tell the program whether it is hex or decimal? Link to comment Share on other sites More sharing options...
greenmachine Posted February 20, 2006 Share Posted February 20, 2006 According to the helpfile (which you should look at, since it is very useful), PixelGetColor returns the color in decimal. So yes, if that color is accurate, then it is in the right format. Link to comment Share on other sites More sharing options...
Ravel Posted February 20, 2006 Author Share Posted February 20, 2006 According to the helpfile (which you should look at, since it is very useful), PixelGetColor returns the color in decimal. So yes, if that color is accurate, then it is in the right format.Hey thanks for the help. I do review the help file quit frequently. However, sometimes i still need help. Link to comment Share on other sites More sharing options...
greenmachine Posted February 20, 2006 Share Posted February 20, 2006 Hey thanks for the help. I do review the help file quit frequently. However, sometimes i still need help.That's why we're here. 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