Sign in to follow this  
Followers 0
Ravel

pixel check

10 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Ravel

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Ravel

Share this post


Link to post
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}")

Share this post


Link to post
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?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

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