0.1.2 • Published 6 years ago

ne-bot-api v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

Nobody Edits Bot API

npm GitHub

Requires Node.js 12.0+

Early alpha. Hopefully no API breaks... Not every functionality is implemented right now. Cool idea for future: hook events such as activating keys and let the bot completely control those actions.

Documentation still TODO. Feel free to open a PR. You can check the available methods by reading the code right now. Be sure to check out the example, it shows most of the functionality.

Beware, there are probably bugs. Physics are not being processed right now.

Important: Never use hardcoded IDs for backgrounds & foregrounds etc., they might change in the future.

Events

Events will fire before the change is applied to the objects if appropriate. This enables reading both new and old state.

Event nameArgumentsDescription
bot:kickmessageYour bot got kicked by the server. Can happen for example by deleting the API key.
bot:disconnectYour bot got disconnected from the server.
player:coin:gold|blue:got|lostplayer, new coin countA player got/lost a gold/blue coin.
player:chatplayer, messageA player sends a chat message.
player:dieplayerA player died.
player:joinedplayerA player joined the room.
player:jumpplayerA player jumps.
player:​key:activateplayer, which keyA player activated a key. Example key parameter: "red key".
player:leftplayerA player left the room.
player:movex, y, x dir, y dir, x spd, y spdA player updated the moe state.
player:togglegodplayerA player enabled/disabled god mode.
player:tp:toplayerplayer, destination playerA player got teleported to another player.
player:resetplayer, x, yA player got reset and teleported to (x, y) (pixel coordinates).
player:respawnplayer, x, yA player respawned at (x, y) (pixel coordinates).
room:bgplayer, x, y, bg objectA player placed a background block at (x, y) (tile coordinates).
room:fgplayer, x, y, fg objectA player placed a foreground block at (x, y) (tile coordinates).
room:dataplayer, x, y, dataA player changed data of block at (x, y) (tile coordinates).
room:goldcrownplayerThe gold crown changed owner. Player may be null if no one owns the gold crown.
room:namenew nameThe room name was changed.
room:codenew codeThe room code was changed.
room:categorynew categoryThe room category was changed.
room:visiblenew lobby visibility valueThe room lobby visibility was changed.
room:autoSavenew auto-save settingThe room auto-save setting was changed.
room:allowSpectatenew allow spectate settingThe room allow spectate setting was changed.
room:allowParticleActionsnew allow particle actions settingThe room allow particle actions setting was changed.
room:playsplaysThe amount of plays of the room got updated.
room:​key:deactivatewhich keyA key got deactivated.
room:resetThe room has been reset.
room:loadThe room has been reloaded from save.
room:saveautosavedThe room was saved. The argument is true if the save was triggered by autosave.
system:chatmessageThe system sends a chat message.

Questions

Why JS and no other language?! >:(

Because NE is completely JS so it fit well. It's also easy to pick up. Feel free to write a port to another language.

Why no docs?

No time. Atm the code is the documentation. Feel free to write some docs and create a PR.

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago