anrar4 / autobtd6 Goto Github PK
View Code? Open in Web Editor NEWThe scripts contained in this repository allow you to automatically play any gamemode on any map in Bloons TD6
The scripts contained in this repository allow you to automatically play any gamemode on any map in Bloons TD6
I created my own playthrough by recording a playthrough, everything seems in order until I want to play the playthrough...
(OwnML) E:\Visual Studio projects\SerpentAI\AutoBTD6>python replay.py monkey_meadow#easy#1920x1080.btd6
2023-09-20 01:19:37.762547: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
[2023-09-20 01:19:38] stats logging enabled!
[2023-09-20 01:19:38] "-mk" (for monkey knowledge enabled) or "-nomk" (for monkey knowledge disabled) must be specified! exiting!
(OwnML) E:\Visual Studio projects\SerpentAI\AutoBTD6>python replay.py monkey_meadow#easy#1920x1080.btd6 -nomk
2023-09-20 01:19:48.899565: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
[2023-09-20 01:19:49] stats logging enabled!
[2023-09-20 01:19:49] ignoring playthroughs with monkey knowledge enabled!
[2023-09-20 01:19:49] invalid arguments! exiting!
Why is it telling me that I have invalid arguments?
when implement this
D:\AutoBTD6-main>py replay.py mm -mk -r
Traceback (most recent call last):
File "C:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 62, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模組。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\AutoBTD6-main\replay.py", line 2, in
from ocr import custom_ocr
File "D:\AutoBTD6-main\ocr.py", line 3, in
import keras
File "C:\Python\lib\site-packages\keras_init_.py", line 21, in
from keras import models
File "C:\Python\lib\site-packages\keras\models_init_.py", line 18, in
from keras.engine.functional import Functional
File "C:\Python\lib\site-packages\keras\engine\functional.py", line 24, in
import tensorflow.compat.v2 as tf
File "C:\Python\lib\site-packages\tensorflow_init_.py", line 37, in
from tensorflow.python.tools import module_util as module_util
File "C:\Python\lib\site-packages\tensorflow\python_init.py", line 36, in
from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
File "C:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 77, in
raise ImportError(
ImportError: Traceback (most recent call last):
File "C:\Python\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 62, in
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模組。
I don't know which DLL missing
Can I ask every pip's version .
here is my pip's version :
absl-py 1.3.0
ahk 0.14.2
astunparse 1.6.3
cachetools 5.2.0
certifi 2022.12.7
charset-normalizer 2.1.1
flatbuffers 22.12.6
gast 0.4.0
google-auth 2.15.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
grpcio 1.51.1
h5py 3.7.0
idna 3.4
importlib-metadata 5.2.0
Jinja2 3.1.2
keras 2.11.0
keyboard 0.13.5
libclang 14.0.6
Markdown 3.4.1
MarkupSafe 2.1.1
MouseInfo 0.1.3
numpy 1.19.3
oauthlib 3.2.2
opencv-python 4.6.0.66
opt-einsum 3.3.0
packaging 22.0
Pillow 9.3.0
pip 20.2.3
protobuf 3.19.6
pyasn1 0.4.8
pyasn1-modules 0.2.8
PyAutoGUI 0.9.53
PyGetWindow 0.0.9
PyMsgBox 1.0.9
pyperclip 1.8.2
PyRect 0.2.0
PyScreeze 0.1.28
pytweening 1.0.4
requests 2.28.1
requests-oauthlib 1.3.1
rsa 4.9
setuptools 49.2.1
six 1.16.0
tensorboard 2.11.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow 2.11.0
tensorflow-estimator 2.11.0
tensorflow-intel 2.11.0
tensorflow-io-gcs-filesystem 0.29.0
termcolor 2.1.1
typing-extensions 4.4.0
urllib3 1.26.13
Werkzeug 2.2.2
wheel 0.38.4
wrapt 1.14.1
zipp 3.11.0
I am new to python and a video tutorial would be quite handy for the install :). Thank you!
Hi, I'm working on a feature that allows users to wait for a spesific round before performing an action.
This is to allow playthroughs to be possible on advanced maps like glacial trail since it allows selling after an interval and round dependant placements.
However, the image recognition model cannot recognise the /
in the displayed round and recognises it as a 2
.
Please could you release the data and code you used to train the model so that I can train it on the slash aswell (or suggest an alternate solution).
Thanks!
Hi, I wanted to ask if there is a more userfriendly guide avaiable. I tried it with the written guide on the page, but I couldnt get everything to work.
title
Traceback (most recent call last):
File "C:\Users\orsin\Desktop\AutoBTD6-main\replay.py", line 1, in
from helper import *
File "C:\Users\orsin\Desktop\AutoBTD6-main\helper.py", line 20, in
ahk = AHK()
File "C:\Users\orsin\AppData\Roaming\Python\Python310\site-packages\ahk_sync\engine.py", line 138, in init
transport = TransportClass(executable_path=executable_path, directives=directives)
File "C:\Users\orsin\AppData\Roaming\Python\Python310\site-packages\ahk_sync\transport.py", line 662, in init
super().init(executable_path=executable_path, directives=directives)
File "C:\Users\orsin\AppData\Roaming\Python\Python310\site-packages\ahk_sync\transport.py", line 325, in init
self._executable_path: str = _resolve_executable_path(executable_path=executable_path)
File "C:\Users\orsin\AppData\Roaming\Python\Python310\site-packages\ahk_sync\transport.py", line 291, in _resolve_executable_path
raise AhkExecutableNotFoundError(
ahk._sync.transport.AhkExecutableNotFoundError: Could not find AutoHotkey.exe on PATH. Provide the absolute path with the executable_path
keyword argument or in the AHK_PATH environment variable. You may be able to resolve this error by installing the binary extra: pip install "ahk[binary]"
I installed ahk[binary] too but it didn't fix anything
So i made a playthrough for the new expert map, but it doesnt work for some reason
hero etienne
map dark dungeons
mode easy
Code is:
place etienne hero0 at 763, 1282
place sub sub0 at 1827, 1150
upgrade sub0 path 0
upgrade sub0 path 0
place dart dart0 at 326, 1064
upgrade dart0 path 2
upgrade dart0 path 2
upgrade dart0 path 2
upgrade dart0 path 0
upgrade dart0 path 0
place dart dart1 at 2137, 1177
upgrade dart1 path 2
upgrade dart1 path 2
upgrade dart1 path 2
upgrade dart1 path 0
upgrade dart1 path 0
upgrade sub0 path 1
upgrade sub0 path 1
upgrade sub0 path 1
upgrade dart0 path 2
upgrade dart1 path 2
retarget sub0
retarget sub0
retarget sub0
place dart dart2 at 995, 1272
upgrade dart2 path 2
upgrade dart2 path 2
upgrade dart2 path 2
upgrade dart2 path 0
upgrade dart2 path 0
upgrade dart2 path 2
upgrade sub0 path 1
place bomb bomb0 at 1229, 1318
upgrade bomb0 path 1
upgrade bomb0 path 1
upgrade bomb0 path 1
upgrade bomb0 path 1
upgrade bomb0 path 0
upgrade bomb0 path 0
$ python replay.py l
Traceback (most recent call last):
File "C:\Users\Cobalt\Desktop\AutoBTD6-main\replay.py", line 1, in
from helper import *
File "C:\Users\Cobalt\Desktop\AutoBTD6-main\helper.py", line 4, in
import pyautogui
File "C:\Users\Cobalt\AppData\Roaming\Python\Python311\site-packages\pyautogui_init_.py", line 542, in
from . import _pyautogui_win as platformModule
ImportError: cannot import name 'pyautogui_win' from partially initialized module 'pyautogui' (most likely due to a circular import) (C:\Users\Cobalt\AppData\Roaming\Python\Python311\site-packages\pyautogui_init.py)
I'm pretty certain this issue could be solved with experience in coding but I have none. Scowered and no solution was found. Could you please teach how to fix this?
hello
the money detection system isn't working sometimes with 1920x1080 (i'm also playing with my own 1920x1080 recorded map).
sometimes the detected money is -1 or sometimes it's not recognizing a number for example:
my real amount of money is 1,700 but it only recognizes 700.
all in the title
For every hero after Obyn, the hero selector selects the hero after the hero it's supposed to.
Example:
Obyn is desired hero -> Obyn is selected as expected
(same goes for first three heroes, they are selected as expected)
Churchill is desired hero -> Benjamin is selected
(same goes for each hero after this, it selects the hero after them)
Thanks for the amazing code. It's going to be a lot of fun to play with.
I ran into an issue running Dark Castle hard. I tried several times with the exact same result: camo balloons ended the run every time before the village came out. I edited the playthrough file and moved the village + path 1 before the upgrading of druids, and that resulted in only 1 camo balloon getting through. However, much later on round 40, the moab almost ended the run (it would have if I didn't have shields + nails from MK).
Some side issues:
the terminal is on my second screen, and the game on full screen on my main
what can i do to fix that ?
Hi, I tried to record the gameplay using the provided tool, but when i try to run it i get this error, any idea what i did wrong?
Traceback (most recent call last): File "D:\branch\AutoBTD6\replay.py", line 1218, in <module> main() File "D:\branch\AutoBTD6\replay.py", line 194, in main allAvailablePlaythroughs = getAllAvailablePlaythroughs(['own_playthroughs'], considerUserConfig=True) File "D:\branch\AutoBTD6\helper.py", line 538, in getAllAvailablePlaythroughs if considerUserConfig and not canUserUsePlaythrough({'filename': filename, 'fileConfig': fileConfig}): File "D:\branch\AutoBTD6\helper.py", line 478, in canUserUsePlaythrough mapConfig = parseBTD6InstructionsFile(playthrough['filename']) File "D:\branch\AutoBTD6\helper.py", line 224, in parseBTD6InstructionsFile newStep = {'action': 'upgrade', 'name': matches.group('name'), 'key': keybinds['path'][str(matches.group('path'))], 'pos': monkeys[matches.group('name')]['pos'], 'path': int(matches.group('path')), 'cost': adjustPrice(towers['monkeys'][monkeys[matches.group('name')]['type']]['upgrades'][int(matches.group('path'))][monkeyUpgrades[int(matches.group('path'))] - 1], newMapConfig['difficulty'], gamemode, {'action': 'upgrade', 'path': int(matches.group('path'))}, monkeys[matches.group('name')], matches.group('discount'))} KeyError: 'hero'
C:\Users\USER\Documents\1\1\AutoBTD6-main>py record_playthrough.py
mapname >
dark_castle
gamemode >
deflation
hero >
obyn_greenfoot
started recording to "own_playthroughs/dark_castle#deflation#1920x1080.btd6"
place obyn_greenfoot hero0 at 547, 470
place super super0 738, 685
selected monkey: super0
BTD6 not focused
BTD6 not focused
stopping recording!
BTD6 not focused
Traceback (most recent call last):
File "C:\Users\USER\Documents\1\1\AutoBTD6-main\record_playthrough.py", line 309, in
time.sleep(60)
File "C:\Users\USER\Documents\1\1\AutoBTD6-main\record_playthrough.py", line 30, in signalHandler
writeBTD6InstructionsFile(config)
File "C:\Users\USER\Documents\1\1\AutoBTD6-main\helper.py", line 172, in writeBTD6InstructionsFile
os.mkdir(folder)
FileNotFoundError: [WinError 2] The specified file could not be found: 'own_playthroughs'
Traceback (most recent call last): File "C:\Users\Гриб\Downloads\AutoBTD6-main\replay.py", line 1230, in main() File "C:\Users\Гриб\Downloads\AutoBTD6-main\replay.py", line 662, in main if not activeWindow or not isBTD6Window(activeWindow.title.decode()): AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
D:\Games\Bloons TD 6\AutoBTD6-main\AutoBTD6-main>py replay.py file dark_castle#chimps#2560x1440#noMK#noLL.btd6 -mk
D:\Games\Bloons TD 6\AutoBTD6-main\AutoBTD6-main\helper.py:20: SyntaxWarning: invalid escape sequence '\P'
ahk = AHK(executable_path="D:\Python\python3.12\Scripts\AutoHotkey.exe")
D:\Games\Bloons TD 6\AutoBTD6-main\AutoBTD6-main\helper.py:122: SyntaxWarning: invalid escape sequence '/'
"^(?:(?:own_|unvalidated_|unsuccessful_)?playthroughs/)?(?P\w+)#(?P\w+)#(?P(?P<resolution_x>\d+)x(?P<resolution_y>\d+))(?:#(?P.+))?.btd6$",
D:\Games\Bloons TD 6\AutoBTD6-main\AutoBTD6-main\helper.py:318: SyntaxWarning: invalid escape sequence '\w'
"^(?Pplace|upgrade|retarget|special|sell|remove) ?(?P[a-z_]+)? (?P\w+)(?: (?:(?:at|to) (?P\d+), (?P\d+))?(?:path (?P[0-2]))?)?(?: for (?P\d+|???))?(?: with (?P\d{1,2}|100)% discount)?$",
Traceback (most recent call last):
File "D:\Games\Bloons TD 6\AutoBTD6-main\AutoBTD6-main\replay.py", line 1, in
from helper import *
File "D:\Games\Bloons TD 6\AutoBTD6-main\AutoBTD6-main\helper.py", line 2, in
import keyboard
ModuleNotFoundError: No module named 'keyboard'
D:\Games\Bloons TD 6\AutoBTD6-main\AutoBTD6-main>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.