- Resource collection 💰
- Hero upgrades 👑
- Building upgrades 🧱
- Laboratory upgrades 🔬
- Assistant assignment ⏩️
- Normal attacks ⚔️
- Full upgrade priority control 🚦
- Multiple accounts 👥
- View bot status on desktop or web app 🚦
- Resume / pause bot execution from desktop or web app ⏯️
- iPhone shortcut to auto resume / pause bot when CoC is opened by user ⏯️
- Telegram and web app notifications 🔔
- Automatic CoC app updates 🔼
- Install python packages with setup.py
- Android Debug Bridge
- Add to system path
- Verify with:
adb --version
- Verify with:
- Add to system path
- BlueStacks
- Device profile: Samsung Galaxy S22 Ultra
- Display resolution: 1920 x 1080
- Frame rate: 60 (NOTE: Inconsistent touch events at lower fps)
- Enable Android Debug Bridge
- Install Clash of Clans from Google Play
- Default troop deployment size
- Standard or XL scenery
- minitouch
(OPTIONAL: pyminitouch should automate this)
- Download prebuilt binary
- Run
adb shell getprop ro.product.cpu.abito determine appropriate architecture
- Run
- Open BlueStacks
- Connect to Android Debug Bridge:
adb connect 127.0.0.1:5555 - Push the binary to BlueStacks:
adb push <path-to-minitouch> /data/local/tmp/ adb shell chmod 755 /data/local/tmp/minitouch
- Verify with:
adb shell /data/local/tmp/minitouch
- Verify with:
- Download prebuilt binary
-
Install and configure dependencies listed above
-
Enter user configurations in
configs.py❗️ Important: setup.py creates
configs.pyfrom configs.template.py❗️ Important: By default, all capabilities are enabled. Many configurations can be overridden in real time if using the desktop or web app.
Note: If using priority upgrades, instructions for defining upgrade priorities can be found in
configs.py.Note: To configure Telegram notifications, first set up a Telegram bot and send
/start. Enter the API token generated during the setup process forTELEGRAM_BOT_TOKEN.Note: If local OCR is too slow, you can offload it to groq. Just make an account and set up an API key to use for
GROQ_API_KEYinconfigs.py. The free tier will hit the token rate limit after a while after which the bot will revert to local OCR. -
Start web app:
python app/app.py💡 Tip: It is recommended to host the web app on pythonanywhere using the provided wsgi.py template and this tutorial. Free accounts can host a single web app for an extendable period of 1 month (the bot can automatically extend hosting). If you want to enable automatic pythonanywhere hosting extension, enter your pythonanywhere username and passowrd into
PA_USERNAMEandPA_PASSWORDrespectively inconfigs.py.❗️ Important: If hosting from a personal device, configure port forwarding as necessary
- Each bot instance can be accessed at
WEB_APP_ADDRESS/<instance_name>(the default instance name ismain) - View a demo of the web app here
- Each bot instance can be accessed at
-
Setup iPhone shortcut:
Note: An older version of the shortcut is provided that does not require Scriptable, but is incapable of handling request errors
- Download Scriptable and create a new script named "CoC Bot Script" with the contents of CoC_Bot_Script.js
- Open the provided shortcut
- Enter your
WEB_APP_URLinto theurlitem of the Dictionary - Adjust the
iditem containing an array of instance names as necessary - Create an Automation task that runs when CoC opens and is set to run immediately
-
Start the bot:
python src/main.pyNote: On MacOS, if
DISABLE_DEVICE_SLEEP = Trueinconfigs.py, the user password is required to toggle thedisablesleepflag in power management settings💡 Tip: The BlueStacks window can be minimized without disrupting the bot as all interactions are handled through Android Debug Bridge
💡 Tip: If not using the bot for development purposes, it can be built into an executable or desktop app for convenience using build.sh. The desktop app GUI or command-line arguments can be used to specify the instance to run if using multiple bot instances. View a demo of the desktop app here.
- To run bots for multiple accounts just create additional BlueStacks instances with BlueStacks' multi-instance manager, set up the instance as usual, and append new instance names and their Android Debug Bridge addresses to
INSTANCE_IDSandADB_ADDRESSESinconfigs.py. Specify the instance to run using the--idflag (e.g.python src/main.py --id main).
- To run bots for multiple accounts just create additional BlueStacks instances with BlueStacks' multi-instance manager, set up the instance as usual, and append new instance names and their Android Debug Bridge addresses to