|
Post by band84 on Nov 17, 2019 6:29:54 GMT
Hello
I have the need to click an icon who move horizontally each time
First problem with for next i don't know if it work with negative steps then when reached the pixel with the desired colr (part of the icon) how to click at the found cordinates?
the lines 10 and 11 can't work (i can't enter) it)
There is any other way to reach the goal? this icon is the last on the right then scanning from right to left each pxel i'm sure to click it correctly
Many thanks in advance
Beppe
insert code here 7 | FOR | I | = | 1000 TO 500 | NEXT
8 | IF | PIXEL COLOR | Color [R=38, G=38, B=38]::At Location [X:%i% Y:235] | IS THE SAME | EXIT FOR
9 | FOR | NEXT
10 | %i% | 235 | 1000 | Left Click Down
11 | %i% | 235 | 49 | Left Click Release
|
|
|
Post by zeak on Nov 17, 2019 23:47:23 GMT
Hi Band, I'm not sure what you mean by negative steps, Mouse locations can't handle %I% but they can handle %INTEGER% I also added an extra bit so that it doesn't click on the edge of the button and change Click Down/Released to just Click. 1 | FOR | I | = | 1000 TO 500 | NEXT 2 | IF | PIXEL COLOR | Color [R=38, G=38, B=38]::At Location [X:%i% Y:235] | IS THE SAME | EXIT FOR 3 | FOR | NEXT 4 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::%i% 5 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::-5 6 | %INTEGER% | 235 | 1000 | Left Click Give it a try and let me know if you need anything else. Zeak
|
|
|
Post by zeak on Nov 18, 2019 3:01:55 GMT
Hi Band, I'm not sure what you mean by negative steps, Mouse locations can't handle %I% but they can handle %INTEGER% I also added an extra bit so that it doesn't click on the edge of the button and change Click Down/Released to just Click. 1 | FOR | I | = | 1000 TO 500 | NEXT 2 | IF | PIXEL COLOR | Color [R=38, G=38, B=38]::At Location [X:%i% Y:235] | IS THE SAME | EXIT FOR 3 | FOR | NEXT 4 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::%i% 5 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::-5 6 | %INTEGER% | 235 | 1000 | Left Click Give it a try and let me know if you need anything else. Zeak So this wont work with %i% counting down. Try using this below, It uses GOTO MACRO LINE instead of FOR Loop. 1 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::1000 * | FOR LOOP 2 | IF | PIXEL COLOR | Color [R=38, G=38, B=38]::At Location [X:%INTEGER% Y:235] | IS THE SAME | GOTO MACRO LINE | ACTION 3 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::-1 4 | IF | INTEGER VARIABLE | %INTEGER% | IS | 500 | GOTO MACRO LINE | ACTION 5 | RUN ACTION | GOTO MACRO LINE | FOR LOOP * | ACTION 6 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::%INTEGER% 7 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::-5 8 | %INTEGER% | 235 | 1000 | Left Click
|
|
WWO
Full Member
Posts: 21
|
Post by WWO on Mar 7, 2021 11:46:48 GMT
Hi Band, I'm not sure what you mean by negative steps, ... aka 7 | FOR | I | = | 100 TO 0 | STEP -1 | NEXT 8 | RUN ACTION | DEBUG | logger::INFO::Countdown timer now at %I% 9 | FOR | NEXT
|
|
|
Post by philranger on Mar 8, 2021 12:04:39 GMT
Hello,
Most (but not all) software support keyboard shortcuts, which can often be reached by holding the ALT key + the letter that becomes underlined in the menu (for example, alt-f opens the file menu, then alt-SomeOtherLetter opens that sub-menu or action). Maybe that would be a way to get around the problem? Once the menus are opened, you can often navigate through them using the arrow keys as well.
|
|