steve1316 / granblue-automation-pyautogui

Educational application aimed at automating user-defined workflows for the mobile game, "Granblue Fantasy", using a variety of CV technologies in the backend such as OpenCV, PyAutoGUI and EasyOCR and a frontend coded in Typescript.
https://github.com/steve1316/granblue-automation-pyautogui/wiki
121 stars 36 forks source link

question:about Random clicking feature #96

Closed gyaosu closed 2 years ago

gyaosu commented 2 years ago

Thank you, steve1316. I am finding it useful. I am not good at English, so please forgive me for posting using translation software (DeepL).

I have a question about Random clicking feature It is true that in the debug mode log, for example

0:00:57 [DEBUG] Starting process to find the ATTACK button image... 0:00:58 [DEBUG] Match found with 0.9828353524208069 >= 0.8 at Point (1681, 474) 0:00:58 [DEBUG] Old coordinates: (1681, 474) 0:00:58 [DEBUG] New coordinates: (1671, 465)

But when I look at the actual screen, it looks like I'm always clicking on the same place.

Does this mean that the random click is working, but the coordinates are so different that you can't see it?

Or can you visually confirm that you are clearly clicking on a different spot on the screen each time?

Thank you for your time.

Translated with www.DeepL.com/Translator (free version)

steve1316 commented 2 years ago

Click location is acquired from a randomized range between 20-80% of the dimensions of the provided template image. Most of the image assets are small already so 20-80% would result in a relatively small randomized area of possible click locations.

Sometimes the algorithm is lucky enough to give you a randomized click location that would be visibly noticeable from the original click location. But most of the time the new click location returned from the algorithm makes it look like the cursor is clicking the same location but it is not.

gyaosu commented 2 years ago

Thank you steve1316. I understand now. It's a great performance. Thank you very much.