0.0.0 • Published 7 years ago

moomoo.js v0.0.0

Weekly downloads
2
License
Apache License 2....
Repository
github
Last release
7 years ago

MooMoo.js

This is a simple bot API for MooMoo.io.

Note that this is not an AI library, only the endpoint.

Installation

Organization

The structure of a simple multiboxing bot can be as follow:

Moo 1
├─┬ ThingManager 1
│ ├── Thing 1
│ ├── Thing 2
│ └── Thing 3
├─┬ PlayerManager 1
│ ├── Player 1
│ ├── Player 2
│ └── Player 3
├── LBs
├── Alliances
├─┬ Conn 1
│ └─┬ Interface 1
│   ├── Player 1
│   └── Inputs 1
└─┬ Conn 2
  └─┬ Interface 2
    ├── Player 2
    └── Inputs 2
NamePer/MultiAbout
Mooper IPUsed for each server / IP
Thing Managerper MooAka TM - Used to control things
Thingmulti per TMA, well, thing
Player Managerper MooAka PM - Used to control players
Playermulti per PMAn unknown player
LBsper MooLeaderboard manager
Alliancesper MooAlliance "manager"
Connmulti per MooA simple socket connection
Interfaceper ConnAn advanced socket to attach events onto
Inputsper InterfaceA class to control the inputs and let you move

Documentation

To gain access of the library, you first must need to install it, and then use require("moomoo.js") to get the main module.

A sample bot is below:

var moo = require("moomoo.js");
var bot = moo("52.89.68.23");
bot.create("Bot", {
  spawn: "re",
}).on("identify", con => {
  console.log("Identified!");
  con.spawn().then(me => {
    console.log(`I'm at ${me.x}, ${me.y}`);
    if (bot.als.exists("BOT")) {
      con.join("BOT");
    } else {
      con.create("BOT").then(r => {
        r.on("ask", u => {
          if (u.name == "Bot") {
            con.accept(u);
          } else {
            con.reject(u);
          }
        });
      });
    }
  });
});