Skip to content

joseferben/whywouldyoubot

Repository files navigation

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 using Discord

  2. Create a bot in-game and copy the API key

createbot.png

  1. Install the SDK

npm install @wwyb/sdk

  1. Create a file bot.js and implement `bot.act`` to control your bot
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);
});
  1. Run your bot API_KEY=<your key> node bot.js