https://github.com/joseferben/whywouldyoubot
An MMO where players write their bots in TypeScript.
https://github.com/joseferben/whywouldyoubot
mmorpg react remix-run sqlite typescript
Last synced: 8 months ago
JSON representation
An MMO where players write their bots in TypeScript.
- Host: GitHub
- URL: https://github.com/joseferben/whywouldyoubot
- Owner: joseferben
- Created: 2022-04-15T17:20:00.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-26T08:40:54.000Z (over 2 years ago)
- Last Synced: 2024-12-11T06:37:57.726Z (about 1 year ago)
- Topics: mmorpg, react, remix-run, sqlite, typescript
- Language: TypeScript
- Homepage: https://www.whywouldyoubot.gg
- Size: 3.72 MB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Why Would You Bot?
This is an MMO where players can create their own bots to play the game alongside them. Think Old School RuneScape but bots are an official part of the game.
## Your first bot
1. Login at [whywouldyoubot.gg](https://www.whywouldyoubot.gg) using Discord
2. Create a bot in-game and copy the API key

3. Install the SDK
`npm install @wwyb/sdk`
4. Create a file bot.js and implement `bot.act`` to control your bot
```typescript
import { Bot } from "@wwyb/sdk";
if (!process.env.API_KEY) throw new Error("API_KEY not set");
const bot = new Bot({
apiKey: process.env.API_KEY,
});
bot.act(async (state) => {
const { x, y } = state.me;
const xRandom = Math.random() > 0.5 ? 2 : -2;
const yRandom = Math.random() > 0.5 ? 2 : -2;
const target = { x: x + xRandom, y: y + yRandom };
console.log("walking to", target);
return bot.walkTo(target);
});
```
5. Run your bot
`API_KEY= node bot.js`