lewisgibson / monopoly-go-bot

Automate playing Monopoly Go! using Python and Bluestacks.
47 stars 12 forks source link

buttons not found #7

Closed DrEffect closed 1 year ago

DrEffect commented 1 year ago

the bot doesnt find the right buttons, oftern it didnt found any button and if it find a button on the completly wron position, maybe some settings error on my site?

Krazalm commented 1 year ago

I just fixed mine by replacing new images. U can also put any img and it will click them

DrEffect commented 1 year ago

maybe you can upload Your Fixed images anywhere?:-)

Krazalm commented 1 year ago

I dont think it will work due to my computer color tone I recommend to do it in ur pc manually

DrEffect commented 1 year ago

just take a screenshot of it? Any special recommendations for the Screenshot? hopefully i will get it work.... somethin else where i have a look on it? cause its detected, completely the whole buttons

Am Mo., 7. Aug. 2023 um 13:36 Uhr schrieb Krazalm @.***

:

I dont think it will work due to my computer color tone I recommend to do it in ur pc manually

— Reply to this email directly, view it on GitHub https://github.com/lewisgibson/monopoly-go-bot/issues/7#issuecomment-1667693200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIUEUNCRMGTAOSP4R3UMUC3XUDHNHANCNFSM6AAAAAA3FINDNU . You are receiving this because you authored the thread.Message ID: @.***>

Krazalm commented 1 year ago

these are my images(16) jail-roll megaheist quick-wins-tap-to-claim shutdown-marker skip taptoclaim upgrade zz__quick-wins-exit advertisement-close bank-heist-door build cancel Capture Capture2 community-chest-collect community-chest-start

lewisgibson commented 1 year ago

Although we do image detection in black and white (xor comparison) there are still some issues with slight variations of grey. The solution is to probably make the searching a little more aggressive.

lewisgibson commented 1 year ago

You can change the confidence parameter here if you wish to do that: https://github.com/lewisgibson/monopoly-go-bot/blob/main/main.py#L56

DrEffect commented 1 year ago

higher is more aggresiv i think?

lewisgibson commented 1 year ago

higher is more aggresiv i think?

It's the other way around. A value of 1.00 (100%) means the screen capture and the target image need to be 100% identical. A value of 0.75 (75%) means they need 75% similarity.

The comparison is done using OpenCV's matchTemplate call in TM_CCOEFF_NORMED mode.

https://stackoverflow.com/a/55469775 https://docs.opencv.org/4.0.1/df/dfb/group__imgproc__object.html#ga3a7850640f1fe1f58fe91a2d7583695d

Krazalm commented 1 year ago

Hey edited ur code

Optimized and Enhanced Code:

The code has been enhanced for improved readability and performance. Configurable settings have been organized for easier management. The code now relies on the pyautogui library(it works) for faster mouse input and has been optimized for efficiency. Logging has been introduced to track the code's execution.

Notable Changes:

main.py.txt

higher is more aggresiv i think?

It's the other way around. A value of 1.00 (100%) means the screen capture and the target image need to be 100% identical. A value of 0.75 (75%) means they need 75% similarity.

The comparison is done using OpenCV's matchTemplate call in TM_CCOEFF_NORMED mode.

https://stackoverflow.com/a/55469775 https://docs.opencv.org/4.0.1/df/dfb/group__imgproc__object.html#ga3a7850640f1fe1f58fe91a2d7583695d

Krazalm commented 1 year ago

Will also do a priority list function although its 2 am for me im a do it tommorow i got whole day 😊

DrEffect commented 1 year ago

ok slowly it will work, but now when i build and doent have money, it always try to build, is there anywhere a routine to stop doing the Same?

lewisgibson commented 1 year ago

@DrEffect Building is experimental. Delete the images to remove build support.