icatian Posted June 4, 2012 Report Share Posted June 4, 2012 hi all, i'm a newbie of this forum and also on macro express programming. I'm trying to get a macro which check for a pixel color in a row (known x position then) and clicks when he finds that color on it. example: variable = myneededcolor move mouse x-position from 300 to 900 (relative to active window) if pixel color is = myneededcolor stop mouse left mouse click else move mouse "x1" position from 300 to 900 (another row) is that possible? Thx to all anyway Quote Link to comment Share on other sites More sharing options...
icatian Posted June 4, 2012 Author Report Share Posted June 4, 2012 or also if mouse finds a link on a determined row it should be good! Quote Link to comment Share on other sites More sharing options...
acantor Posted June 5, 2012 Report Share Posted June 5, 2012 Yes, it's possible. In pseudo code, the script might look something like this: N1 = Width of Window N2 = 0 // Initial X value N3 = 100 // Y value of the row you want to search N4 = 12345678 // Colour of target pixel Repeat N1 times Move Mouse Cursor to (N2, N3) N5 = Pixel Colour Under the Mouse Cursor If N5 = N4 // Found! Mouse Left Click Stop Macro Else // Not found N2 = N2 + 1 End If Repeat End Quote Link to comment Share on other sites More sharing options...
icatian Posted June 5, 2012 Author Report Share Posted June 5, 2012 thx for that script, now mouse moves right, but no click happens also over the right pixel color... maybe is too difficult to find the right vertical row with that color! Is it possible to set this script to find that pixel in a little box instead of a vertical row? or also find a link (<IFMOUSE:19> cursor hand) in that box it will be suitable i think, thx for help again!!! Quote Link to comment Share on other sites More sharing options...
icatian Posted June 5, 2012 Author Report Share Posted June 5, 2012 i'm trying this way: Macro Playback Speed: Normal Speed Delay 1 Seconds Variable Set Integer %N1% to 200 Variable Set Integer %N2% to 650 Variable Set Integer %N3% to 837 Repeat with Variable using %N1% Mouse Move Screen %N2%, %N3% If Mouse Cursor is Hand Point Mouse Left Button Click Macro Stop Else Variable Modify Integer: %N2% = %N2% + 1 End If Repeat End but no click happens too Quote Link to comment Share on other sites More sharing options...
acantor Posted June 6, 2012 Report Share Posted June 6, 2012 If you are hunting for the shape of the mouse cursor, you may need a delay before the IF statement. Try 300 ms; you may be able to reduce it to 10 or 20 ms, but start big and through trial and error, figure out how short a delay is enough. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.