Deepest World (https://deepestworld.com/) is a browser sandbox MMORPG intended to be played by bots. This can be a starter to enter the game.
Steps to get up and running:
- install Node.js & NPM from https://nodejs.org/en/download or any package manager you like
- create an account & a character on https://deepestworld.com/
- checkout repository (choose one option) & install dependencies
# Option 1: Checkout using GIT & HTTPS
git clone https://github.com/deepestworldcommunity/starter.git
# Option 2: Checkout using GIT & SSH
git clone [email protected]:deepestworldcommunity/starter.git
# Option 3: Checkout using GitHub CLI
gh repo clone deepestworldcommunity/starter
# Install dependencies
cd starter
npm install
- create a
.env
file or copy the.env.example
file add edit it accordingly, so it contains your credentials like so:
DW_USERNAME=myUserName
DW_PASSWORD=secretPassword
DW_CHARACTER=Charactername
You might wonder how you would create a .env
file under Windows, you can use this to create an empty one:
echo. > .env
- start Electron via:
npm start
- go to src/starter.js and change the first line to:
let attackMode = true
-
make further changes to adjust your bot or start a new one from scratch, I'd suggest using a different file
-
(optional) check out the
src/starter.ts
and use TypeScript
Using esbuild code will be transpiled (even TypeScript) and bundled together
foo.js / foo.ts
export default function foo() {
console.log('Hello World')
}
bar.js / bar.ts
import foo from './foo'
foo()
npm start bar.js # for JavaScript
npm start bar.ts # for TypeScript
Electron is basically a limited version of a browser, but it also has an additional benefit: regular browsers tend to throttle (slow down) JavaScript execution when their window/tab is no longer focussed. This is usually a good thing, it preserves resources (CPU and energy consumption). But slowing down you AI code will probably most likely result in poor performance or death for your character.
Have you checked out the developer tools of Electron? You can do so
via Ctrl + Shift + I
under Windows/Unix or Option + Command + I
, there might be an error.
A common pitfall for beginners is that your JavaScript code is not available in strict mode. (For further information see here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode)
@types/node
- type support for build-in Node.js modulesdotenv
- library to parse the.env
files, you also can use regular environment variables, if you prefer thoseelectron
- browser like app to prevent throttlingesbuild
- bundler to produce one output filetypescript
- to improve your coding experience