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 & install dependencies
- cCreate a
.env
file containing your credentials like so:
DW_USERNAME=myUserName
DW_PASSWORD=secretPassword
- start Election via:
npm start <characterName>
- 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
-
(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 [character] bar.js # for JavaScript
npm start [character] bar.ts # fot 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.
@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