I got ImageSearch working. That was hard for me. But apparently, depending on whatever parameters(any ideas?) FB icons change in size. They do change in position, hence why i bothered with ImageSearch in the first place.... but now that i found out that they ALSO change in size... i am completely lost how to proceed with my script. I am willing to learn and to look stuff up. But here i dont even know where to start.
I am testing on ONE laptop, with Win10, browser size/zoom is always at 90%, i made no changes in windows during my testing.
The settings wheel(where one changes resolution and latency) is different, from livestream to livestream. Does it have to do with the given uploader/creator/fb page?
There are also MORE than two version of the like button. The two are, the one on top of the comments and the one near the write comment field(bottom left). But of those two, there are multiple variations in sizes.
Here is my script. I have no problem to get it to work for a SPECIFIC livestream. I simply take screenshots, cut them out, the script works.
I test it in 10 other livestreams and in 9 out of 10 is does NOT work.
ANY AND ALL IDEAS ARE WELCOME. Everything that has the potential to get me to think of other solutions could lead to the solution.
Code: Select all
^!z::
sleep, % RndSleep(2000, 3000)
Random, XRdmOffset, -40, -50
Random, YRdmOffset, -40, -50
Random, XRdmCenter, 776, 776
Random, YRdmCenter, 713, 713
Xsum := (XRdmCenter + XRdmOffset)
Ysum := (YRdmCenter + YRdmOffset)
MouseMove, %Xsum%, %Ysum% ;moves mouse over the video to make the settings wheel appear
sleep, % RndSleep(1000, 1500)
CoordMode, Pixel, screen ; Interprets the coordinates below as relative to the screen rather than the active window.
ImageSearch, FoundX, FoundY, 0, 0, 1366, 768, *40 FBwheel2.bmp ;;;<--;;;
if (ErrorLevel = 2)
sleep, 3000
else if (ErrorLevel = 1)
sleep, 3000
else
{
sleep, % RndSleep(400, 600)
Random, XRdmOffset, 10, 20 ;randomized the area that the mouse will move to and click
Random, YRdmOffset, 10, 20
Xsum := (FoundX + XRdmOffset)
Ysum := (FoundY + YRdmOffset) ;Randomization finished
MouseMove, %Xsum%, %Ysum% ;clicks the settings wheel
sleep, % RndSleep(400, 600)
MouseClick, left, %Xsum%, %Ysum% ;clicks the settings wheel
sleep, % RndSleep(400, 600)
}
sleep, % RndSleep(400, 600)
return