Posts: 4
Threads: 2
Joined: May 2010
I need help with scanning a certain coordinate or pixel for a certain color.
Then, if the color of the pixel matches a specified color, mouse click on that certain pixel/coordinate.
Thanks in advance for anyone helping a newbie such as myself. Alan.
Posts: 12,141
Threads: 143
Joined: Dec 2002
Macro
Macro1438
int x y color
;...
if pixel(x y)=color
,lef x y
If need to wait, use 'Wait' dialog to create the code.
If have QM 2.3.2, also try 'Find Image' dialog.
Posts: 4
Threads: 2
Joined: May 2010
Gintaras, thanks a lot for your help.
Is there a way to activate the script on a specific window without and have it working in the background? keep in mind that the window in being clicked.
Posts: 12,141
Threads: 143
Joined: Dec 2002
Function pixel(), if window specified, activates the window, because it cannot get pixel color from background windows. If flag 2 used, does not activate, but then the pixel may belong to another window that covers the specified window.
If need to get pixel color from a window that is covered by other windows, you need QM 2.3.2. Use 'Find Image' dialog to create the code. Check 'The window can be in background'. Capture the color and the window. Add a RECT variable that sets the coordinates.
Example
Macro
Macro1426
RECT r
r.left=310; r.top=40; r.right=r.left+4; r.bottom=r.top+4
scan "color:0xB96456" win("Quick Macros Forum • Post a reply - Mozilla Firefox" "MozillaUIWindowClass") r 1|2|0x100
If then you'll use lef to click the point, and specify the window, it will activate the window. Cannot click background windows.
Posts: 4
Threads: 2
Joined: May 2010
OK, thanks again, my current macro is working successfully.