pyclashbot / py-clash-bot Goto Github PK
View Code? Open in Web Editor NEWAn inherently undetectable Clash Royale automation bot
Home Page: https://pyclashbot.app/
An inherently undetectable Clash Royale automation bot
Home Page: https://pyclashbot.app/
Use favicon from master:docs/public/favicon.ico
After it started clash royale, nothing happens. in the logs it says:"
[start] Successfully initialized Clash app
INFO:2023-09-13 22:20:53,243 Successfully initialized Clash app
INFO:2023-09-13 22:20:57,244 [start] Manually waiting for clash main page. 4.0/10
INFO:2023-09-13 22:21:01,245 [start] Manually waiting for clash main page. 8.0/10
INFO:2023-09-13 22:21:05,246 [start] Manually waiting for clash main page. 12./10
INFO:2023-09-13 22:21:05,246 [start] Waiting for clash main menu
INFO:2023-09-13 22:21:40,550 [start] Stopping"
( i manually stopped the bot. )
just nothing happens in the main menu. and when i manually press play, it says over and over i dont have a card selected, if i select a card in the bar, it gets placed like 0.5 secounds after selecting, on the left side of the left tower.
Describe the bug
Account switching is not working
To Reproduce
f"Switching accounts to account number {str(account_number)}"
), it crashes with:Error: [Errno 2] No such file or directory: 'C:\\Users\\matmi\\OneDrive\\Desktop\\ssid_account_index_log.txt'
Desktop (please complete the following information):
the bot does the same thing over and over again. closing memu, opening memu, closing memu, opening memu.... endless
some statuses extend past the text area
Make bot sentient
CodeFactor found an issue: The if statement can be replaced with 'return bool(test)'
It's currently on:
pyclashbot\image_rec.py:59
Hello, I have followed all the steps you mention in the guide, still not working
Could you please do a video-tutorial about how to install & make it working?
After following steps appears a CMD window that automatically closes
Thank you
CodeFactor found an issue: Starting a process with a shell, possible injection detected, security issue.
It's currently on:
pyclashbot\auto_update.py:61
Commit a79130c
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Hello Dear developer i am having memu is not detected issue but i freshly installed memu should i installed a specific version of memu maybe ?
Using Android Debug Bridge for emulator and client interaction would allow for the mouse and keyboard to be used while bot is running.
ADB can be accessed using pymemuc or adb-shell or pure-python-adb, all valid options to investigate.
Expected behavior
The bot keeps stopping.
Desktop (please complete the following information):
In the build workflow, all builds are treated like releases, never pre-releases (when tag ends with rc)
Issue mentioned
pyclashbot_main_.py:292
Commit 3744009
CodeFactor found an issue: Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
It's currently on:
pyclashbot\auto_update.py:32
Commit a79130c
Describe the bug
ssid account index log file not found
Desktop (please complete the following information):
When I tried both Windows and with PIP. the bot install and I followed the instruction to configure MEMU emulator, but I get the below message, Screenshot|:
I tick the fight, 1 account , and Giant card, when I hit start, I get error as shown in the screenshot above. Let me know if am missing any steps.
just make loop for fights. it takes alot of time to check clan / upgrade cards etc.
CodeFactor found multiple issues last seen at 819cc80:
download link to memu not visually appealing
Verify path returned by Github API is valid and not a path traversal exploit.
Info on vulnerability here.
Describe the bug
Clashbot goes into a loop, clicking the corner of the clash royale app while trying to identify if its in the main menu of clash royale. (only starts happening after i connect to my supercell ID)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Clashbot would have identified that it is already in the main menu of clash royale and start operating as per the jobs ticked. (It works if i do not log in my supercell ID, meaning just the base game as a new account)
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Sorry, i am extremely new to this community, and I am trying to give as much details as I can. Please pardon me if I'm missing out any key details you might need to identify any errors.
CodeFactor found an issue: Unexpected duplicate selector "html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul", first used at line 778 (no-duplicate-selectors)
It's currently on:
docs\index.html:787
Thread does not stop when expected
Expected behavior
WorkerThread should stop on button press.
Desktop (please complete the following information):
C:\Users\Tim\Desktop\bot>pyclashbot
Traceback (most recent call last):
File "c:\users\tim\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File "c:\users\tim\appdata\local\programs\python\python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Users\Tim\AppData\Local\Programs\Python\Python38\Scripts\pyclashbot.exe_main.py", line 4, in
File "c:\users\tim\appdata\local\programs\python\python38\lib\site-packages\pyclashbot_main.py", line 9, in
from pyclashbot.battlepass import check_if_can_collect_bp, collect_bp
File "c:\users\tim\appdata\local\programs\python\python38\lib\site-packages\pyclashbot\battlepass.py", line 4, in
from pyclashbot.client import check_quit_key_press, click, screenshot, scroll_down, scroll_down_fast, scroll_up_fast
File "c:\users\tim\appdata\local\programs\python\python38\lib\site-packages\pyclashbot\client.py", line 9, in
from pyclashbot.image_rec import check_for_location, find_references, get_first_location
File "c:\users\tim\appdata\local\programs\python\python38\lib\site-packages\pyclashbot\image_rec.py", line 12, in
def get_first_location(locations: list[Union[list[int], None]], flip=False):
TypeError: 'type' object is not subscriptable
Handle following exception when there is not network connection on autoupdate:
Checking for new version to install...
Traceback (most recent call last):
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\connection.py", line 174, in _new_conn
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\util\connection.py", line 72, in create_connection
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\socket.py", line 955, in getaddrinfo
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\connectionpool.py", line 1040, in _validate_conn
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\connection.py", line 358, in connect
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\connection.py", line 186, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000027C3B7F9810>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\requests\adapters.py", line 489, in send
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\connectionpool.py", line 785, in urlopen
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\urllib3\util\retry.py", line 592, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/matthewmiglio/py-clash-bot/releases/latest (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000027C3B7F9810>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 120, in run
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\Lib\site-packages\cx_Freeze\initscripts\Console.py", line 16, in run
File "pyclashbot\__main__.py", line 351, in <module>
File "pyclashbot\__main__.py", line 318, in main_loop
File "D:\a\py-clash-bot\py-clash-bot\pyclashbot\auto_update.py", line 164, in auto_update
File "D:\a\py-clash-bot\py-clash-bot\pyclashbot\auto_update.py", line 139, in install_latest_release
File "D:\a\py-clash-bot\py-clash-bot\pyclashbot\auto_update.py", line 70, in get_asset_info
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\requests\api.py", line 73, in get
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\requests\api.py", line 59, in request
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\requests\sessions.py", line 587, in request
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\requests\sessions.py", line 701, in send
File "C:\hostedtoolcache\windows\Python\3.10.5\x64\lib\site-packages\requests\adapters.py", line 565, in send
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: /repos/matthewmiglio/py-clash-bot/releases/latest (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000027C3B7F9810>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
fix bare exceptions at pyclashbot\client.py:79 and pyclashbot\client.py:84
idk what this means I'm completely new and it might be a simple fix but I can't seem to get it
scroll in the deadspace on left or right
Since the February season update, the bot stucks at "Waiting for clash main menu".
The program currently has issues on:
Resolution | Scaling |
---|---|
4k | 150% |
Tested working settings:
Resolution | Scaling |
---|---|
2k | 100% |
1080p | 100% |
1080p Vertical | 100% |
Add replies to this issue with additions to these lists, I will edit them in.
Since only Trophy Road and Path of Legends are the only game modes that give chests to unlock, I think it would be great to provide an option for the bot to play that game mode. Also, if the bot can be taught to play on meta decks like royal giant, etc... That'd be great to up the chances of winning and receiving a chest to unlock.
Describe the solution you'd like
Provide an option for the bot to play Trophy Road or Path of Legends.
Describe alternatives you've considered
Adding instructions for the bot to play other on meta decks like royal giant or lavahound, etc...
Additional context
That's all folks.
README no longer needs info on memu install and configuration (handled by program).
README should now include a demo of the program running instead.
Error in download_from_url method should be handled,
urllib.error.HTTPError: HTTP Error 503: Egress is over the account limit.
Skip update for that round, ensure tests pass.
make pymemuc make an emulator then configure it if there is somehow no existing emulators
Describe the bug
When a falure occurs the bot closes MEmu to restart it, but it gets stuck "closing all things MEmu related"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect the bot to reopen the virtual MEmu client so that it can continue playing the game, but it just gets stuck.
Desktop (please complete the following information):
Additional context
After the recent update the bot crashes whenever it's about to enable a 2v2 match, could that be because of new graphics?
CodeFactor found an issue: Unexpected duplicate selector "html body[for="html-export"]:not([data-presentation-mode])[html-show-sidebar-toc] .md-sidebar-toc ul", first used at line 749 (no-duplicate-selectors)
It's currently on:
docs\src\index.css:758
Commit 52360be
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should miss the tower
Screenshots
Desktop (please complete the following information):
Additional context
Describe the bug
Card Mastery Collection is broken, failure getting to battle deck page
INFO:2023-06-22 17:35:48,584 Start Button Event
INFO:2023-06-22 17:35:48,585 Running first startup sequence.
INFO:2023-06-22 17:35:48,585 Running first startup sequence.
INFO:2023-06-22 17:35:48,597 Restarting
INFO:2023-06-22 17:35:48,598 Closing everything Memu related. . .
INFO:2023-06-22 17:35:53,235 Configuring VM
INFO:2023-06-22 17:36:09,212 Starting emulator...
INFO:2023-06-22 17:36:48,242 Clash Royale started
INFO:2023-06-22 17:36:58,252 Waiting for clash main menu in Launcher
INFO:2023-06-22 17:37:26,081 Done waiting for clash main menu
INFO:2023-06-22 17:37:31,082 Switching accounts. . .
INFO:2023-06-22 17:37:31,082 Checking if there are card mastery rewards to collect
INFO:2023-06-22 17:37:31,082 Getting to card collection tab...
INFO:2023-06-22 17:37:32,626 Getting to battle deck page...
INFO:2023-06-22 17:38:11,354 Stopping
INFO:2023-06-22 17:38:42,243 failure with get_to_battle_deck_page()
INFO:2023-06-22 17:38:42,243 Failed to get to card page while collecting card mastery rewards
INFO:2023-06-22 17:38:42,243 Failed when checking if has card mastery rewards
To Reproduce
Steps to reproduce the behavior:
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Links to routed components, like the contributing page, lead to a 404, whereas navigating to them through links on the page functions properly.
This problem lies in the single-page routing of react-router-dom.
Possible fix for issue described here.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
CodeFactor found an issue: Unexpected duplicate selector "html body h6", first used at line 318 (no-duplicate-selectors)
It's currently on:
docs\index.html:335
Image recognition broken in implementation in request state.
Image recognition methods are successfully implemented in src/pyclashbot/bot/card_detection.py but fail elsewhere.
broken code:
def find_request_button(vm_index):
folder_str = "request_button"
img = screenshot(vm_index)
size = get_file_count(folder_str)
names = make_reference_image_list(size)
locations: list[list[int] | None] = find_references(
image=img, folder=folder_str, names=names, tolerance=0.97
)
print(locations)
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.