Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help scanning pixel.
#1
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.
#2
Macro Macro1438
Code:
Copy      Help
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.
#3
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.
#4
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
Code:
Copy      Help
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.
#5
OK, thanks again, my current macro is working successfully.


Forum Jump:


Users browsing this thread: 1 Guest(s)