|
Post by Johnc on Jan 3, 2019 2:07:52 GMT
Hi Steve, Happy New Year! I have the following codes to detect if the pixel is within a playing video: 4 | IF | PIXEL COLOR | At Location [X:1052 Y:836] | CHANGES::2::1::0 | GOTO macro line | down 2 | ELSE | 2 | RUN ACTION | WAIT MILLISECONDS | 1 5 | 1052 | 836 | 200 | Left Click 6 ... If so, skip to line 6. If not, continue to execute line 5. However, it works pretty slowly if the pixel is not within a playing video because it has to wait for the minimum 1 second time-out! Is there a faster way to confirm a video/still image? Thanks!
|
|
|
Post by Steve on Jan 4, 2019 0:12:52 GMT
Hi John,
Happy new year to you too!
Do you need a timeout value?
Maybe a better option will be to use something other than CHANGES to detect if the video is playing? What program are you using to play video....maybe the program does something behind the scenes with the file system? perhaps the program writes a temp file, interacts with the registry, etc. Perhaps looking for the other environmental queues that the video player gives us is the better approach and not looking for a pixel change on the video player program itself.
|
|
|
Post by Johnc on Jan 4, 2019 2:10:03 GMT
Well, I have got this youtube ad-quitter coded as follows:
1 | X | X | 200 | Keypress volumemute 2 | IF | PIXEL COLOR | At Location [X:1181 Y:805] | CHANGES::2::1::0 | GOTO macro line | down 2 | ELSE | 2 | RUN ACTION | WAIT MILLISECONDS | 1 3 | 1181 | 805 | 200 | Left Click 4 | IF | PIXEL COLOR | At Location [X:1052 Y:836] | CHANGES::2::1::0 | GOTO macro line | down 2 | ELSE | 2 | RUN ACTION | WAIT MILLISECONDS | 1 5 | 1052 | 836 | 200 | Left Click 152 | IF | PIXEL COLOR | Color [R=0, G=0, B=0]::At Location [X:1628 Y:837] | IS NOT THE SAME | WAIT MILLISECONDS | 1 | ELSE | 2 | RUN ACTION | GOTO macro line | down 2 7 | 1628 | 837 | 200 | Left Click 8 | RUN ACTION | WAIT Milliseconds | 1 9 | 1628 | 837 | 500 | Mouse Movement
Since the famous youtube ad came up too frequently to block the lower part of the video, I just needed to press the X mark on the ad window to close the ad lol! But I don't want to left click when the video is running fine without the blocking ad, since this will cause the video to pause. The above script is almost there... just that the min timeout is still too long at 1 sec. Can we get a 0.1sec time out somehow? Thanks!
|
|
|
Post by Johnc on Jan 4, 2019 2:30:42 GMT
Another idea is to create a new Pixel Color condition:
2 | IF | PIXEL COLOR | At Location [X:1181 Y:805] | IS_STABLE:for 200ms | GOTO macro line | down 2 | ELSE | 2 | RUN ACTION | WAIT MILLISECONDS | 1
something like this... lol
|
|
|
Post by Steve on Jan 4, 2019 22:47:20 GMT
Well, I have got this youtube ad-quitter coded as follows: 1 | X | X | 200 | Keypress volumemute 2 | IF | PIXEL COLOR | At Location [X:1181 Y:805] | CHANGES::2::1::0 | GOTO macro line | down 2 | ELSE | 2 | RUN ACTION | WAIT MILLISECONDS | 1 3 | 1181 | 805 | 200 | Left Click 4 | IF | PIXEL COLOR | At Location [X:1052 Y:836] | CHANGES::2::1::0 | GOTO macro line | down 2 | ELSE | 2 | RUN ACTION | WAIT MILLISECONDS | 1 5 | 1052 | 836 | 200 | Left Click 152 | IF | PIXEL COLOR | Color [R=0, G=0, B=0]::At Location [X:1628 Y:837] | IS NOT THE SAME | WAIT MILLISECONDS | 1 | ELSE | 2 | RUN ACTION | GOTO macro line | down 2 7 | 1628 | 837 | 200 | Left Click 8 | RUN ACTION | WAIT Milliseconds | 1 9 | 1628 | 837 | 500 | Mouse Movement Since the famous youtube ad came up too frequently to block the lower part of the video, I just needed to press the X mark on the ad window to close the ad lol! But I don't want to left click when the video is running fine without the blocking ad, since this will cause the video to pause. The above script is almost there... just that the min timeout is still too long at 1 sec. Can we get a 0.1sec time out somehow? Thanks! Ok i see. Well this is tricky one John lol I would have thought that the video pixels would be changing all the time during a running youtube video. Unless the ad window has a predictable few pixels. Potentially I can see this working on a loop looping for a series of pixels that match the 'skip' button. But...its going to be tricky.
|
|
|
Post by Johnc on Jan 5, 2019 1:41:17 GMT
"Potentially I can see this working on a loop looping for a series of pixels that match the 'skip' button. But...its going to be tricky."
You r a step ahead of me Steve lol! I am currently binding this macro to F9. So when I see an ad, I just press F9... twice... It is not automatic but it has saved my ears and given me peace lol!
Yes, the "close ad" button is opaque so the pixel color should be stable.
That's why I think the suggested IS_STABLE pixel condition below might be useful in a situation like this one. (not a time-out parameter, but a simple IF...ELSE)
2 | IF | PIXEL COLOR | At Location [X:1181 Y:805] | IS_STABLE:for 200ms | GOTO macro line | down 2 | ELSE | 2 | RUN ACTION | WAIT MILLISECONDS | 1
|
|