Post by Victor on Mar 16, 2022 3:18:49 GMT
Hey guys it'll be too much text but anyways, help if you can and want ❤. I've been playing a lot with MMM lately and found out how to accurately use these two conditions, however, I'm tyring to make a Macro to Follow/Unfollow/Block people on Instagram (Theres apps for that, but I want to do it on my own with a Macro cuz it's fun) and Ive been trying to do this:
I'm already at the "Following" section of someone elses account, I'm not following any of those accounts so of course all there is on screen is their usernames, profile pics and a big blue "Follow" button on each of them, for example, also note that I'm using an android Emulator so it is Instagrams Android/Mobile user interface.
Step 1: Detect Image / Mouse to Click to find that blue "Follow" button and click just before to open that persons profile. Works great.
Step 2: Detect Image / Mouse to Click to find the three dots upper right corner. By screenshoting the three buttons it worked at first but then started bugging, so I only cropped 1 out of the three dots so it detects only the first of the three and it works great like that.
Step 3: Detect Image / Mouse to Click to find the "Block" section, depending if that persons profile is Public or Private there's an extra option here, so I can't just do a simple left click on "Block" because it will be constantly changing. Also if I select the entire word sometimes it bugs so I sorted it out by only screenshoting the "BL" "BLO" "CK" or "K" as it's not a button itself, but a section in a content box, so there's no outline on the "Block" option and bla bla bla I'm making it find the word basically. Only that way I was able to make it work 100% of the times.
Step 4: Detect Image / Mouse to Click to find the blue "Block" confirmation button. It's a long button so it was bugging as well so I did the same thing as in step 3. Works normally.
Step 5: Detect Image / Mouse to Click to find the Back arrow top left to obviously go back and go to the next one.
Now, I've managed it to work 'till this point because if I loop the macro, it'll just still go to the first person on the list even though there's no "Follow" button but a "Unblock" button instead of searching for the next "Follow" button which is right under it. I can just go back again to the main profile and then back to the "Following" section so it will be a new still unblocked profile on top but I've already taken the challenge to make it work the way I want it to work (if possible, you'll tell me) and I also don't wanna add those extra steps
Now, that's a quite specific task, so it could be replicated on Instagrams web page, or just somewhere where the target image repeats a couple times so the macro must look for the next option available when the last one already changed, for example having a 1x10 table and filling it with 0's and make the macro change all of those 0's to 1's, I'm not sure. If it just wont work tell me or if you know a better way to do all this correct me and I'll replicate. I'll leave my lines here under so you can see how I organized it.
1 | RUN ACTION | MOUSE TO IMAGE | image path C:\Users\victo\Pictures\Macro\Follow button.bmp::at 1071 277 135 750::match full::move mouse no::save to vars X Y | AND | 2 | RUN ACTION | MOUSE CLICK | Left click at 900 %Y% 1 times with 100 ms delay (By making the mouse click at 900 %Y% I'm forcing it to click right at the middle betwen the persons username and the "Follow" button while mantaining the same %Y% value so, in my head, if the macro on the second run finds the next "Following" button 1 line under, it'll save that new %Y% value and just click at X:900 where I want it to click)
2 | RUN ACTION | WAIT SECONDS | 1 | AND | 2 | IF | DETECT IMAGE | image path C:\Users\victo\Pictures\Macro\dot.bmp::match full::move mouse no::save to vars X2 Y2 | IMAGE FOUND | MOUSE CLICK | Left click at %X2% %Y2% 1 times with 100 ms delay
4 | RUN ACTION | WAIT SECONDS | 1 | AND | 4 | RUN ACTION | MOUSE TO IMAGE |
image path C:\Users\victo\Pictures\Macro\ck.bmp::at 659 718 100 100::match full::move mouse no::save to vars X3 Y3 | AND | 4 | RUN ACTION | MOUSE CLICK | Left click at %X3% %Y3% 1 times with 100 ms delay
4 | RUN ACTION | WAIT SECONDS | 1 | AND | 4 | IF | DETECT IMAGE | image path C:\Users\victo\Pictures\Macro\ck2.bmp::match full::move mouse no::save to vars X4 Y4 | IMAGE FOUND | MOUSE CLICK | Left click at %X4% %Y4% 1 times with 100 ms delay
5 | RUN ACTION | WAIT SECONDS | 1 | AND | 5 | IF | DETECT IMAGE | image path C:\Users\victo\Pictures\Macro\back arrow.bmp::match full::move mouse no::save to vars X5 Y5 | IMAGE FOUND | MOUSE CLICK | Left click at %X5% %Y5% 1 times with 100 ms delay
I'm already at the "Following" section of someone elses account, I'm not following any of those accounts so of course all there is on screen is their usernames, profile pics and a big blue "Follow" button on each of them, for example, also note that I'm using an android Emulator so it is Instagrams Android/Mobile user interface.
Step 1: Detect Image / Mouse to Click to find that blue "Follow" button and click just before to open that persons profile. Works great.
Step 2: Detect Image / Mouse to Click to find the three dots upper right corner. By screenshoting the three buttons it worked at first but then started bugging, so I only cropped 1 out of the three dots so it detects only the first of the three and it works great like that.
Step 3: Detect Image / Mouse to Click to find the "Block" section, depending if that persons profile is Public or Private there's an extra option here, so I can't just do a simple left click on "Block" because it will be constantly changing. Also if I select the entire word sometimes it bugs so I sorted it out by only screenshoting the "BL" "BLO" "CK" or "K" as it's not a button itself, but a section in a content box, so there's no outline on the "Block" option and bla bla bla I'm making it find the word basically. Only that way I was able to make it work 100% of the times.
Step 4: Detect Image / Mouse to Click to find the blue "Block" confirmation button. It's a long button so it was bugging as well so I did the same thing as in step 3. Works normally.
Step 5: Detect Image / Mouse to Click to find the Back arrow top left to obviously go back and go to the next one.
Now, I've managed it to work 'till this point because if I loop the macro, it'll just still go to the first person on the list even though there's no "Follow" button but a "Unblock" button instead of searching for the next "Follow" button which is right under it. I can just go back again to the main profile and then back to the "Following" section so it will be a new still unblocked profile on top but I've already taken the challenge to make it work the way I want it to work (if possible, you'll tell me) and I also don't wanna add those extra steps
Now, that's a quite specific task, so it could be replicated on Instagrams web page, or just somewhere where the target image repeats a couple times so the macro must look for the next option available when the last one already changed, for example having a 1x10 table and filling it with 0's and make the macro change all of those 0's to 1's, I'm not sure. If it just wont work tell me or if you know a better way to do all this correct me and I'll replicate. I'll leave my lines here under so you can see how I organized it.
1 | RUN ACTION | MOUSE TO IMAGE | image path C:\Users\victo\Pictures\Macro\Follow button.bmp::at 1071 277 135 750::match full::move mouse no::save to vars X Y | AND | 2 | RUN ACTION | MOUSE CLICK | Left click at 900 %Y% 1 times with 100 ms delay (By making the mouse click at 900 %Y% I'm forcing it to click right at the middle betwen the persons username and the "Follow" button while mantaining the same %Y% value so, in my head, if the macro on the second run finds the next "Following" button 1 line under, it'll save that new %Y% value and just click at X:900 where I want it to click)
2 | RUN ACTION | WAIT SECONDS | 1 | AND | 2 | IF | DETECT IMAGE | image path C:\Users\victo\Pictures\Macro\dot.bmp::match full::move mouse no::save to vars X2 Y2 | IMAGE FOUND | MOUSE CLICK | Left click at %X2% %Y2% 1 times with 100 ms delay
4 | RUN ACTION | WAIT SECONDS | 1 | AND | 4 | RUN ACTION | MOUSE TO IMAGE |
image path C:\Users\victo\Pictures\Macro\ck.bmp::at 659 718 100 100::match full::move mouse no::save to vars X3 Y3 | AND | 4 | RUN ACTION | MOUSE CLICK | Left click at %X3% %Y3% 1 times with 100 ms delay
4 | RUN ACTION | WAIT SECONDS | 1 | AND | 4 | IF | DETECT IMAGE | image path C:\Users\victo\Pictures\Macro\ck2.bmp::match full::move mouse no::save to vars X4 Y4 | IMAGE FOUND | MOUSE CLICK | Left click at %X4% %Y4% 1 times with 100 ms delay
5 | RUN ACTION | WAIT SECONDS | 1 | AND | 5 | IF | DETECT IMAGE | image path C:\Users\victo\Pictures\Macro\back arrow.bmp::match full::move mouse no::save to vars X5 Y5 | IMAGE FOUND | MOUSE CLICK | Left click at %X5% %Y5% 1 times with 100 ms delay