Jump to content
Sign in to follow this  

Mouse Pointer & Pixel Color change

Recommended Posts


Aim: To verify if the cursor has changed.

I do know that a cursor change in normal Window mode can be easily verified. But in game i belive it different story.

I want to get the cursor change to trigger some event / function.

The cursor basically changes from a arrow (some well designed graphic arrow ) to glowing sword (basically when its on monsters).

basic function needed would be:

$var=get the mouse pos ( x , y)

$ y= get mousepointer color ($var[0], $var[1])

Now the problem comes here:

I dont know what is considered as the exact location of a pointer. Meaning since i would be using one square pixel as color change of the cursor.

Sure i could use the pixel search function but , the problem is cursor as "n" number of different colored shades making it impossible to limit it to a single color variation search.

So i decided if i could find the exact pin point square pix which is considered as the cursor position in terms of x and y.

Once i have exact x , y i can get color of that particular pixel say its FFFFFF For e.g.

My second problem (my lack of knowlege)

after i get $y = Some decimal value of the color

$hex_y = Hex($y , 6) --> This gives hex value of the color say ACDHH (Just for random something)

Now i want to compare the variable value of $hex_y = FFFFFF

IF true mouse click ($var[0], $var[1]) --> Basically click on current location.

Please help me with the syntax for comparing:

IF $hex_y=="FFFFFF" THEN

execute some FUNC

This part is not correct syntax wise, comparing a variable equals to some hex value

Anyhelp appreciated

Share this post

Link to post
Share on other sites

Err..Did everyone Skip this one?? Ok i think i got one more trick to find that out..But if someone already knows an easy way please post.

Thank y ou

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.