ancapism-client
v1.1.0
Published
Client for Ancapism
Downloads
1
Readme
Ancapism Node.JS Client
A client for Ancapism
Docs are at http://docs.tbk321.com/
First Program
NPM is the reccommended way to obtain Ancapism Client. npm i -s ancapism-client
To use it, simply import the pacakge, and create a new Client.
TS: import { Client, emotes, directions } from "ancapism-client"
JS: const { Client, emotes, directions } = require("ancapism-client")
Check the docs for more information on the emotes and directions variables. They are utilities to help you with movement and emoting. Optionally, you can also supply another argument updateInterval
which is the speed at which we will request chunks & data from the server in milliseconds. 10000 is the default and reccommended value.
The new client
variable has a few diffrent events, but you should mostly be concerned with the "ready" event. client.on("ready")
will be fired when the client is logged it. It is highly reccommended that you put all of the code interacting with the client here unless it is tied to another event like "message" or "debug". Check the docs for all of the events.
Sample program:
"TypeScript";
import { Client, emotes, directions } from "ancapism-client";
"JavaScript";
const { Client, emotes, directions } = require("ancapism-client");
const client = new Client("http://derpy.live:1338", "botuser101", "supersecurePasswd");
client.on("ready", () => {
client.send("Hello world!");
setInterval(() => {
client.move(directions.northX, directions.northZ);
}, 1000);
});
client.on("debug", console.log);