https://github.com/ericvaladas/da.js
A Dark Ages client for Node.js applications.
https://github.com/ericvaladas/da.js
Last synced: about 1 month ago
JSON representation
A Dark Ages client for Node.js applications.
- Host: GitHub
- URL: https://github.com/ericvaladas/da.js
- Owner: ericvaladas
- Created: 2016-01-17T22:45:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-03-16T01:16:17.000Z (over 7 years ago)
- Last Synced: 2025-10-23T01:24:44.009Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 208 KB
- Stars: 9
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# darkages
A Dark Ages client for Node.js applications.
## Installation
```
npm install darkages
```
## Usage
### ES6
```js
import { Client } from 'darkages';
const client = new Client('username', 'password');
client.connect();
```
### CommonJS
```js
const Darkages = require('darkages');
const client = new Darkages.Client('username', 'password');
client.connect();
```
### Example
```js
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();
```