3.6 KiB
3.6 KiB
eBot
Script uses eeriks/eRepublik package to automate eRepublik gameplay
How to run ebot
- Install Docker/Docker Desktop
- Create root folder where to place Your bots (eg
/home/user/ebot/
,c:\\Users\user\ebot
) - Create a bot folder for each account inside root folder (eg
/home/user/ebot/player_a
,c:\\Users\user\ebot\player_b
) - Copy
docker-compose.yaml
(text) file inside root folder (eg/home/user/ebot/docker-compose.yaml
,c:\\Users\user\ebot\docker-compose.yaml
) and change names accordingly:
version: '3'
services:
player_a:
image: ebot
volumes:
- ./player_a:/app/player
restart: always
- Build docker image:
docker build --build-arg version="development" --tag ebot .
- Create config file for each account and place them inside each of the bot's folder named
config.json
(eg/home/user/ebot/player_a/config.json
,c:\\Users\user\ebot\player_b\config.json
) - You're all done! To run the bots:
- Linux/Unix/MacOS: execute from the ebot root folder
docker-compose up -d
- Windows: Somehow from the Desktop app run
docker-compose.yaml
. TBD
- Linux/Unix/MacOS: execute from the ebot root folder
How to run from source
Setup on Linux/Unix/MacOS
- Install latest Python (minimum required version is 3.8)
- Clone repository
git clone git@bitbucket.org:keriks/erepublik-bot.git
cd erepublik-bot/
- Create and activate virtual environment and install dependencies
python3 -m venv venv
source venv/bin/activate
pip install -Ur requirements.txt
- Configure default
config.json
file or delete it and run
python -m ebot
Setup on Windows
-
Install requirements:
-
Clone repository (all future commands are meant to be run from
CMD
Start > Search cmd > Open
git clone git@bitbucket.org:keriks/erepublik-bot.git
cd erepublik-bot/
- Create and activate virtual environment and install dependencies
python3 -m venv venv
venv\Scripts\activate
pip install -Ur requirements.txt
- Configure default
config.json
file or delete it and run
python -m ebot
Creating standalone executable
Compilation on Linux/Unix/MacOS
./upgrade.sh
./compile.sh
Compilation on Windows
venv\Scripts\activate
compile.bat
Running, updating standalone versions as services
Running on Linux/Unix/MacOS
#!/bin/bash
#Change variable 'bot' to desired value
bot="player_name"
_bot_exe="bot_${bot}"
#Create separate folder for (each) account (-p don't warn if folder exists)
mkdir -p $bot
# stop previous process to update executable
killall "$_bot_exe"
# Sleep 3 seconds to allow bot to exit gracefully
sleep 3
# find latest versions name
newver=$(ls -dtr1 dist/* | tail -1)
# Hard link latest version
cp -lfp "$newver" "${bot}/${_bot_exe}"
cd "${bot}"
./"${_bot_exe}" &
disown -h %1
Running on Windows
- Double click executable to run bot with open console
- As background service using NSSM:
- Download NSSM
- open cmd prompt and enter
nssm install <servicename>
replace<servicename>
with Your players name e.g.,nssm install bot_player_a
- Follow instructions in NSSM - usage