Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script sometimes stops working + Towers don't place on Garden #1

Open
Kinetic1000 opened this issue Dec 13, 2021 · 3 comments
Open

Comments

@Kinetic1000
Copy link

just left the script running and sometimes it stops on the tower xp screen and it looks like OK is being pressed (the button gets smaller then goes back to its normal size) but nothing happens

Microsoft Windows [Version 10.0.19042.1348]
(c) Microsoft Corporation. All rights reserved.

C:\Users\redacted\Downloads\btdb2-xp-master>python bot.py
Opponent disconnected, attempting to reset
Found ok button
Opponent disconnected, attempting to reset
Traceback (most recent call last):
File "C:\Users\redacted\Downloads\btdb2-xp-master\bot.py", line 201, in
ok_pos = find_template_center('templates/ok2.png')
File "C:\Users\redacted\Downloads\btdb2-xp-master\bot.py", line 64, in find_template_center
res = cv2.matchTemplate(cvImg, template, cv2.TM_CCOEFF_NORMED)
cv2.error: OpenCV(4.5.4) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\templmatch.cpp:1175: error: (-215:Assertion failed) _img.size().height <= _templ.size().height && _img.size().width <= _templ.size().width in function 'cv::matchTemplate'

C:\Users\redacted\Downloads\btdb2-xp-master>

@Kinetic1000
Copy link
Author

also on garden the tower doesn't place because it's too close to the track

@Kinetic1000 Kinetic1000 changed the title Script sometimes stops working Script sometimes stops working + Towers don't place on Garden Dec 13, 2021
@trimbe
Copy link
Owner

trimbe commented Dec 13, 2021

I'm not sure how you're hitting that error, unless you're resizing the window very small or something?

The map detection will occasionally break (I think because of animations in the pixel I'm sampling), but in my experience it happens very rarely so I haven't gotten around to fixing that. Especially with the impending nerf to surrender farming.

@Kinetic1000
Copy link
Author

I'm not sure how you're hitting that error, unless you're resizing the window very small or something?

The map detection will occasionally break (I think because of animations in the pixel I'm sampling), but in my experience it happens very rarely so I haven't gotten around to fixing that. Especially with the impending nerf to surrender farming.

the window resizes smaller when the script starts though it's probably supposed to do that, and the issue happens every time on garden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants