Use at your own risk.
I'm not responsible if you get banned for using this bot. I personally never got banned using this bot and have been using it for 2+ years so you should be fine.
Bot for grepolis written in Python.
This bot only uses requests to communicate with the game so it's entirely possible to run this bot on another server unlike some other bots I have seen for this game made with Selenium.
I personally stopped playing grepolis a couple months ago and therefore stopped working on this project and will probably not be updating this.
Most of the code is pretty self explanatory.
I used the bot for over 2 years and never got banned, even when I was sending 10 support/attack requests in a second to time attacks/destroy enemy colony ships.
There's a limit to the amount of attack requests you can send in a minute which I think is 10.
There's no limit to the amount of support requests you can send which makes the bot really powerful to save your cities when you know the arrival time of a colony ship.
Features include:
- Sending and timing attacks
- farming villages
- building buildings
- recruiting units
-
GoldBot to automatically exchange resources for gold
To get a local copy up and running follow these simple steps.
- Version of Python greater than 3.6
- You need the Administrator in Grepolis ! (You can easily get the gold to buy him using the goldbot)
Youtube tutorial: GrepoBot setup
- Clone the repo
git clone https://github.com/B1GJ/GrepoBot.git
- Install necessary packages
pip install -r requirements.txt
- Create a .env file in the source directory
touch .env
- Copy/paste below and fill in with ur own values.
WORLD="" CSRF_TOKEN="" H_TOKEN="" DISCORD_HOOK=""
- Open grepolis and login to your favorite world.
- In the top left, the first characters will contain the world name. For example, nl105.

- Open the network tab in your browser and filter on XHR.
- Click on any request
- In the request headers, you will find the CSRF_TOKEN (sid) and H_TOKEN (h_token).
- Paste these in your .env file.
Warning: These tokens change everytime you log out and log back in so you'll have to change these quite often.
This is the main file that will run the bot.
This will instantiate an instance of the GrepoBot class and call the main() method.
GrepoBot takes a list of City objects as an input.
City takes the bb_code of the town as an input.
Be sure to change all the bb_codes to the bb_codes of your cities.
Once you've done that you can just run main.py
python main.pyExample output running main.py

By default this will:
- Farm all villages of all cities and wait between 600 and 650 seconds before starting the next cycle.
- Check for possible buildings to upgrade and upgrade them if possible
- Constantly checks the market to see if it's possible to exchange resources for gold. After 3 times you'll have to manually fill in a captcha. The bot will automatically send a message to a discord Webhook to alert the user when a captcha is required.
- Constantly checks the commands to see if we're getting attacked. If we're getting attacked, it will send a message to a discord Webhook to alert the user. Also possible to automatically dodge an attack (but disabled by default)

To time attack or support requests. Click the link below to watch a demo on how to time your attack/support.
Constantly checks the market to see if it's possible to exchange resources for gold. After 3 times you'll have to manually fill in a captcha. The bot will automatically send a message to a discord Webhook to alert the user when a captcha is required.
I was able to farm around 500-1000 gold a day using this bot on a single world. You'll make a lot of gold combining the farmbot and this goldbot on a newly started world since a lot of players will be asking for resources in the beginning.
