Skip to content

ericvaladas/da.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b407536 · Mar 16, 2019

History

61 Commits
Feb 21, 2019
Dec 14, 2018
Dec 14, 2018
Dec 14, 2018
Dec 17, 2018
Dec 14, 2018
Dec 19, 2018
Dec 19, 2018

Repository files navigation

darkages

A Dark Ages client for Node.js applications.

Installation

npm install darkages

Usage

ES6

import { Client } from 'darkages';

const client = new Client('username', 'password');
client.connect();

CommonJS

const Darkages = require('darkages');

const client = new Darkages.Client('username', 'password');
client.connect();

Example

const client = new Client('username', 'password');

client.events.on(0x0A, packet => {
  const channel = packet.readByte();
  const message = packet.readString16();
  const [ name, whisper ] = message.split('" ');

  if (whisper === 'ping') {
    const response = new Packet(0x19);
    response.writeString8(name);
    response.writeString8('pong');
    client.send(response);
  }
});

client.connect();

About

A Dark Ages client for Node.js applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published