1
votes

I have done a decent amount of researching and I apologize in advance if I have missed the answer to this question in the documentation or forums somewhere.

I would like to do a pixel search of several area's and have a script react to the area when my mouse moves over that area, my idea was to use a custom cursor with a pixel shade not found in the application I'm manipulating, but Pixelsearch nor PixelgetColor seem to recognize the mouse, am I doing something wrong or did I miss something, or is this simply not possible?

Loop  
{
PixelSearch, pxcolor, pxcolor1, 872, 367, 893, 394, 0x5F415F, 3, Fast
sleep, 200
if pxcolor < 0
click left
sleep, 200
}

So basically, the script is doing a constant check for a pixel of that shade in that area, and when my mouse moves over that area (the cursor being what contains the pixel shade), the script reacts.

What happens instead is it only sees the pixels of the window, and takes no notice of my cursor.

1
It's probably easier for someone to help you if you share the relevant fragment of your code and describe where it doesn't do what you expected. - Frank van Puffelen
It looks like you did the right thing: I asked for more information and you added it to the question. Now essentially we can delete both comments and the next person to come by has a better chance to answer the question, without having to read an entire thread of comments and figure out who said what. - Frank van Puffelen

1 Answers

1
votes

Trie something like this out, may do what you need

#Persistent
SetTimer, WatchCursor, 100
return

WatchCursor:
MouseGetPos, xpos, ypos, id, control
if Xpos between 600 and 800 
  {
     if ypos between 400 and 600
       ToolTip, React Here
  }
else if Xpos between 200 and 400 
  {
     if ypos between 100 and 300
      ToolTip, Also React Here
  }
else
    ToolTip
return

Hope it helps