Jump to content

Recommended Posts

Posted

Long time reader, first time poster.

I want to write a script that will do the following:

-When a pixel at a set position is color x, perform function x. If it is color y, perform function y. If it is color z, perform function z.

-The function would either be to left click a certain point on the screen or press a certain button.

Any help on a example script would really be appreciated. This is would be my first real script so I do not have a whole lot of code knowledge yet but I want to learn it >_<

Posted (edited)

This works. I tried it before I posted it in another thread because I questioned the hex/dec thing myself. But I don't know why it does work.

$var = PixelGetColor( 120, 160 ) ;$var is decimal value
;MsgBox(0,"The color is", $var)
If $var = 0xc0c0c0 Then          ;but matches with equiv hex value
MouseClick("left", 20, 780)
EndIf
Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Posted

So to do a key instead it would be

then enter('key') ?

Also how often does it scan for pixel changes? Could I put a delay on the scans?

Thanks for the fast reply

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
×
×
  • Create New...