2022-08-16 21:55:40 +03:00
2022-08-16 21:55:40 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-08-16 21:55:40 +03:00
2022-07-04 10:44:45 +03:00
2022-08-16 21:55:40 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-08-16 21:47:08 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-07-04 10:44:45 +03:00
2022-08-16 21:55:40 +03:00

eBot

Script uses eeriks/eRepublik package to automate eRepublik gameplay

How to run ebot

  1. Install Docker/Docker Desktop
  2. Create root folder where to place Your bots (eg /home/user/ebot/, c:\\Users\user\ebot)
  3. Create a bot folder for each account inside root folder (eg /home/user/ebot/player_a, c:\\Users\user\ebot\player_b)
  4. 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
  1. Build docker image: docker build --build-arg version="development" --tag ebot .
  2. 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)
  3. 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

How to run from source

Setup on Linux/Unix/MacOS

  1. Install latest Python (minimum required version is 3.8)
  2. Clone repository
git clone git@bitbucket.org:keriks/erepublik-bot.git
cd erepublik-bot/
  1. Create and activate virtual environment and install dependencies
python3 -m venv venv
source venv/bin/activate
pip install -Ur requirements.txt
  1. Configure default config.json file or delete it and run
python -m ebot

Setup on Windows

  1. Install requirements:

  2. 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/
  1. Create and activate virtual environment and install dependencies
python3 -m venv venv
venv\Scripts\activate
pip install -Ur requirements.txt
  1. 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

  1. Double click executable to run bot with open console
  2. As background service using NSSM:
    1. Download NSSM
    2. open cmd prompt and enter nssm install <servicename> replace <servicename> with Your players name e.g., nssm install bot_player_a
    3. Follow instructions in NSSM - usage
Description
No description provided
Readme 122 KiB
Languages
Python 94.6%
Shell 4.8%
Dockerfile 0.4%
Makefile 0.1%