Tools

## Websites

Mapexplorer - world map browser.

Leaderboard History - leaderboard history viewer

Player Count Tracker - player count history viewer

## Scripts

https://github.com/LightningWB/TheTravelers.online-Tools - Usage: copy main.js and paste it into the browser console (`ctrl`+`shift`+`i`).

https://github.com/CoherentNonsense/sprint-client - Usage: copy install.js and paste it into the browser console(`ctrl`+`shift`+`i`).

https://github.com/slippyice/travelers-bresenhamLineAlgorithm - Adaption of the bresenham line algorithm, to be used with bots.

https://github.com/slippyice/thetravelers-mod-texturepacks - Usage: copy/paste code into the browser console (ctrl+shift+i).

## Making Bots

### In Browser

 thetravelers.online's client is written in javascript, and all the code can be viewed in the folder resources\_v109 in the web inspector.

Example to doublestep automatically

```
function autoDoublestep() {
    setTimeout(() => {
        DSTEP.click();
        ENGINE.addCycleTrigger(autoDoublestep);
    }, 0);
}
ENGINE.addCycleTrigger(autoDoublestep);

```

### In node.js

https://www.npmjs.com/package/travelersapi

### In python

https://pypi.org/project/thetravelers.online-Api/

### API Documentation

To view all the events sent to you, you can paste this useful script into the browser console:

```
window.gsend = SOCKET.send;
SOCKET.send = a => (console.log("i>", a), window.gsend(a));
window.adata = ENGINE.applyData;
ENGINE.applyData = (...a) => (console.log("I<", ...a), window.adata(...a));

```

This will show you events. They are also documented below.

#### Base Data

After logging in, the server will send you the base data:

(note: these are incomplete. use the script above to see all the data that is sent)

```
export type DataBase = {
 username: string;
 x: number;
 y: number;
 supplies: { [key: string]: { count: number; data: { name: string, … } };
 exe\_js?: string;
 gained\_xp?: number;
 skills: {
 sp: number;
 level: number;
 next\_level\_xp: number;
 hp: number;
 max\_hp: number;
 max\_sp: number;
 dmg: number;
 max\_carry: number;
 carry: number;
 skill\_points: number;
 xp: number;
 };
 craft\_queue?: { [key: string]: { item\_id: string; remaining: number } };
 proximity?: { objs: { char: string; x: number; y: number }[] };
};

```

Also, the data will contain a state

```
export type GameEventData = {
 state: "event";
 event\_data: {
 visited: boolean;
 stage\_data: {
 title: string;
 desc: string;
 visited: string; // desc for visited
 btns: Buttons;
 };
 };
};
export type GameLootingData = {
 state: "looting";
 loot: {
 items: LootContainer;
 title: string;
 desc: string;
 visitdesc: string;
 visited: boolean;
 };
};
export type GameIntData = {
 state: "int";
};
export type GameTravelData = { state: "travel" };

```

int stands for "interaction", this is when you are speaking to another player.

Each tick, you will get a partial update of that data.

#### Actions

```
export type SendMsg =
 /// (in state: "travel") To move in a certain direction. Same as pressing the arrow keys.
 /// (in state: "event") To select a button in an event. Option is the ID of the button, not the button name.
 /// (in state: "looting") To exchange a piece of loot. Item is the item ID (name), not the title.
 action: "loot\_exchange";
 which: true | false;
 item: string;
 amount: number;
 }
 /// (in state: "looting") To exit the looting screen and exchange the items
 /// (in state: "travel") To add doublestep. This requires you have >= 11 stamina (skills.sp).
 /// (in state: "travel") To purchase skill upgrades. Each upgrade costs 1 skill point (skills.skill\_points).
 action: "skill\_upgrade";
 carry: number;
 dmg: number;
 hp: number;
 sp: number;
 }
 /// (in state: "travel") To press a button on an equipped item. Each item has a different set of options, these are just examples. This information will probably be on the items page of the wiki eventually.
 action: "equipment";
 option: "find\_all" | "dig" | "dig\_with\_shovel";
 }
 /// (in state: "travel") To equip an item. These are just examples, item accepts any item id
 /// (in state: "int") To try to leave player interaction. I think both players have to agree or something idk

```

## Custom Server Backend

Main engine

Plugin to provide all game logic

Landing page for the server browser