Jump to content

pixel check


Ravel
 Share

Recommended Posts

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. :o

Link to comment
Share on other sites

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 by Ravel
Link to comment
Share on other sites

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 by Ravel
Link to comment
Share on other sites

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

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

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...