|
Post by dracneer on Jan 17, 2022 19:41:18 GMT
1. I would like to use some sort of loop that increments at a number greater than one. IE: "For I = 1 to "Z" Step 20." I want to use "I" as a mouse x/y coordinate. Thus I could click on a series of "boxes" that are consistently an equal distance from each other.
2. I would love to also be able to detect how many of those boxes exist so I can make the loop cycle that many times.
3. Grabbing a pixel color has proven to be far more challenging than expected as the boxes colors are not a solid. Any tricks to this one?
Thanks in advance. I'm new so be kind.
|
|
|
Post by Steve on Jan 18, 2022 5:38:31 GMT
Hi dracneer1. I'd use a defined counter variable via an IF statement like this: * | DEFINE VARS 1 | RUN ACTION | DEFINE INTEGER VARIABLE | start_count::0 2 | RUN ACTION | DEFINE INTEGER VARIABLE | end_count::800 3 | RUN ACTION | DEFINE INTEGER VARIABLE | increment_count::50 * | START_LOOP 4 | RUN ACTION | MESSAGE PROMPT | %start_count%/%end_count%::%start_count%/%end_count%::1::OK 5 | RUN ACTION | MOUSE CLICK | Left click at %start_count% %end_count% 1 times with 0 ms delay 6 | RUN ACTION | DEFINE INTEGER VARIABLE | %start_count%::+%increment_count% 7 | IF | INTEGER VARIABLE | %start_count% | LESS THAN EQUAL TO | %end_count% | GOTO MACRO LINE | START_LOOP 2. and 3. Are the boxes static? I mean do they change often? If not, then perhaps look for an image and not a single pixel. If you can do this then you may be able to map out your screen res to into sections and capture the count of found images across the screen. This count could then be your increment_count variable above. Note above at line 5 that ive used %start_count% and %end_count% as the mouse X and mouse Y variables. This tactic can be used on all mouse movement functions. Have a look at examples of image and pixel detection from this forum and the condition pages: www.turnssoft.com/conditions.html#detectimagewww.turnssoft.com/conditions.html#definepixelrangevariablewww.turnssoft.com/conditions.html#pixelrangewww.turnssoft.com/conditions.html#pixelrangesave
|
|
|
Post by zeak on Jan 18, 2022 23:42:52 GMT
Are the boxes static? I mean do they change often? If not, then perhaps look for an image and not a single pixel. Hi Steve, I've been testing this with a game I also play, the main issue I've been having is trying to count the number of images on the screen, partially when they move slightly, overlap slightly or between two sections being counted. Is it possible to get a function that can count the number of selected images in a area or even out put there location in an array/list? Cheers, Zeak
|
|
|
Post by Steve on Jan 19, 2022 7:00:39 GMT
Hi zeakYeah id say its possible. It would probably involve splitting the screen into sections bound by the dimensions of the image we are trying to detect and count. Love the suggestion hey. Thanks.
|
|