ogame-tbot / TBot

OGame bot
81 stars 35 forks source link
gameforge-captcha ogame ogame-bot ogamebot tbot

TBot - OGame bot

TBot

OGame Bot

GitHub all releases GitHub release (latest SemVer) Discord

TBot is a .NET 6 OGame bot based on ogamed deamon by alaingilbert

Feel free to publish issues or pull requests

TBot supports Ogame v11.15!

How to Update from 0.3.1

Be sure to remove .ogame folder from /home/username/ (linux) or C:/Users/username (win) before logging in

Stories in Ready

Disclaimer

Scripting and botting are forbidden by the OGame rules. I adopt a series of measures to prevent detection and thus ban, but I cannot, and never will, guarantee anything. Use this bot at your own risk!!

Testing and PR are very much appreciated!

Support TBot

Do you like the project? Buy me a beer!

Donate with PayPal

Configuration

TBot configuration consists in two files:

The settings.json should be compiled as follows:

{
        "TelegramMessenger": {
                "Active": true,
                "API": "<API TOKEN ID>",
                "ChatId": "<your chat id>",
                "TelegramAutoPing": {
                        "Active": true,
                        "EveryHours": 0
                }
        },
        "Instances": [
                {
                        "Alias": "Account alias",
                        "Settings": "<instance_settings>.json"
                },
                {
                        "Alias": "Another account",
                        "Settings": "<another_instance_settings>.json"
                }
        ],
    "WebUI": {
        "Enable": true,
        "Urls": "http://localhost:9090",
        "MaxLogsToShow": 2000
    }
}

NB: The settings should be pointing to a path relative to settings.json directory.

Important Notices

You must use different ports for each instance and for webUI. They all must be open and free.

Instances from the same lobby account can share the same cookies file;

If you run instances from different lobby accounts you must use different cookies files.

Be warned that Ogame's servers have a limit on the number of requests per second. If you run too many instances, you may get IP banned, or end up with banned accounts. Use proxies to avoid this.

Features

TBot has a wide variety of useful features. They all can be configured and customized editing the instance's settings file. Here follows a short explanation of each of them, read the Wiki for a more indepth explanation.

WebUI

Since 0.3.0 TBot includes a webUI where you can check and change the settings, read the logs in a filterable table and play manually with your account(s), all in the same place, even remotely.

Telegram

You can control and get info for TBot through a Telegram Bot. In order to enable it, you need to follow theese steps:

Settings Hot Reload

TBot supports the editing of instance settings even while it is running. It will take care of turning on and off features as well as the specific feature config settings. You can change settings from WebUI or editing the files directly.

Hot reloading of instances is only partially supported at the moment. You can add and remove instances while the bot is running, but the feature is still in beta so there may be bugs.

Running on Windows

Running on Linux/MacOS

Running on Amazon Web Services

WARNING: Ogame is positively blocking IPs from datacenters. You probably need a residential proxy to run on AWS, or any other VPS.

Some successful tests have been done to run TBot on the smallest instance of LightSail (1 vCPU, 20 GB SSD, 500 MB RAM and 1 TB outbound traffic) on Amazon Linux 2, which is free for a three month trial. In order to run it, steps should be as follow:

Very important: if you run TBot by using the command ./TBot and then disconnect from the ssh connection, it'll kill TBot. In order to prevent this, you have to use a service called screen, and run the TBot instance like this:

$ screen ./TBot

then press <Ctrl + a + d> in order to detach the console.

Once it is detached you may close the ssh instance and TBot will run fine. You can repeat the process in order to run another instance of TBot on the server, as long as you detach it every time after you run the command.

The testing was done on the smallest LightSail instance has been running up to 4 instances of TBot (different accounts each), with no problems so far, however if you run a 5th instance, it can cause the server to run out of RAM and it'll crash.

Captcha solving

TBot implements an automatic captcha solving mechanism.

However, being based on ogamed, it supports manual captcha solving as well as Ninja Captcha Autoresolve service.

To manually solve captcha navigate to host:port/bot/captcha

To configure Ninja Capthca Service follow this guide and insert the obtained APIKey in settings.json

Development

Feel free to fork and make pull requests or give suggestions posting an Issue or joining the Discord chat.

Also, a proper documentation about how to deal with settings would no doubt be helpful, especially for new users.

Building

We write and build TBot with Visual Studio 2022 Community Edition, thus .NET 6 SDK is enough for command line compilation.

Releases are automated by GitHub Actions, take a look at the workflows if you are interested in the build process.

Portability

TBot is currently developed and mantained for Windows 64bit, Windows 32bit, Linux x86_64, MacOS 64bit, MacOS ARM, Linux ARMv7 and Linux ARM64.