Options
All
  • Public
  • Public/Protected
  • All
Menu

ogame-bot-api

Api to create a bot for ogame

This Api allow direct intercation on user account.

It is writen in typescript

It uses puppeteer to simulate user interactions and get game informations.

Api

There is two API:

  • the LobbyApi that is used to login the user and get user servers info
  • the GameApi that is used to interact with the game itself, create and list ressources/ship/research...

Documentation can be found here

Supported feature

  • LobbyApi
    • Login
    • List servers
    • List user servers
    • Connect to game api
  • GameApi
    • list and upgrade
      • resources
      • mines
      • storage
      • researsh
    • lists and create
      • ships
      • defenses

Examples

Multiples examples can be found in examples folder

Here is a simple one to list user resources.

const { LobbyApi } = require('ogame-bot-api');

async function main() {
    const api = new LobbyApi();
    await api.login('mail@gmail.com', 'password');
    const account = await api.selectLastPlayedAccount();
    const game = await api.loadGame(account);

    const resources = await game.resourcesList();
    console.log(resources);

    await game.stop();
}

main();

A simple one to create a ship

const { LobbyApi } = require('ogame-bot-api');

function main() {
    const api = new LobbyApi();
    await api.login('mail@gmail.com', 'password');
    const account = await api.selectLastPlayedAccount();
    const game = await api.loadGame(account);

    const ships = await game.shipList();
    if (await game.canCreate(ships.fighterLight)) {
        await game.createShip(ships.fighterLight);
        console.log('Ship created !');
    } else {
        console.log(`Can't create ship`);
    }

    await game.stop();
}

Bot

Index

Modules

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc