diff --git a/index.js b/index.js index f3da73f..748123e 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ const waitUntil = require("async-wait-until"); const msgpack = require("msgpack"); /** - * An event representing a raw websocket message. + * An event representing a message from the Moomoo.io server. */ class RawMessageEvent extends events.Event { constructor(msg) { @@ -71,6 +71,11 @@ class MoomooClient extends events.EventTarget { }]); } + /** + * Controls the direction of the client. + * @param {number} direction The direction to face. + * @param {boolean} move Whether we should also move in the direction. + */ direction(direction = 0, move = false) { this.send("2", [ direction, @@ -80,6 +85,15 @@ class MoomooClient extends events.EventTarget { ]); } + /** + * Stops movement. + */ + stopMovement() { + this.send("3", [ + null, + ]); + } + /** * Sends a ping on the minimap. */ @@ -89,6 +103,10 @@ class MoomooClient extends events.EventTarget { ]); } + /** + * Joins a tribe by its name. + * @param {string} tribeName The name of the tribe to join. + */ joinTribe(tribeName) { this.send("10", [ tribeName,