Tampermonkey Bot Joiner Script for territorial.io

Job ID: 40401693

Budget: £10 – £20 GBP

I need a small Tampermonkey / Greasemonkey userscript that lets me spin up automated “test bots” for the browser-game Territorial.io. The goal is simple: each bot should join a public match, appear under a name I supply, then idle—no territory captures, no resource moves, just present in the lobby and on the map for load-testing purposes.

Key details you must deliver
• Complete JavaScript source as a userscript ready to paste into Tampermonkey (Chrome) and Greasemonkey (Firefox).
• A clean section inside the script where I can type or paste the list of bot names; the script cycles through that array when new tabs are opened.
• Config constants (server region, game size, etc.) grouped at the top so I can tweak them without hunting through code.
• Step-by-step setup notes: how to install, how many browser tabs to open safely, and how to launch multiple instances.
• Inline comments explaining every major function so I can maintain or extend it after future game patches.
• A short “update checklist” at the end of the file describing what to look for when the game’s DOM or network calls change.

Behavior requirements
1. On load, the script waits for the Territorial.io lobby to finish rendering, inserts one of my predefined names in the name box, selects “Play”, and joins the first available public match.
2. Once spawned on the map, it sends no further clicks or keystrokes—pure spectator mode.
3. If the match ends or the connection drops, it automatically returns to the lobby and repeats the cycle with the next name on the list.
4. Random delays (human-like jitter) between each UI action so anti-bot measures are less likely to flag the account.

Acceptance criteria
• I can paste a list such as ["LoadTest-01","LoadTest-02",...] directly into the script and see those exact names appear in-game.
• Opening five browser tabs results in five independent bots, each joining the next available match within 15 seconds of page load.
• Code passes ESLint default rules and runs in the latest Chrome and Firefox without additional libraries.

If Territorial.io updates their front-end and the script breaks within 30 days, I expect a quick patch from you as part of the job.