1.3.4 • Published 10 years ago

teeworlds-econ v1.3.4

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Teeworlds External Console

NPM version License

Teeworlds external console client.

Installation

Install via npm:

npm install --save teeworlds-econ

Configure Teeworlds external console:

ec_port         8303
ec_password     secret
ec_output_level 2

Usage

Initialize and connect

const TeeworldsEcon = require('teeworlds-econ');

const host = 'localhost'
const port = 8303
const password = 'secret'

const econ = new TeeworldsEcon(host, port, password);

econ.on('online', (err) => {
  console.log('Connected');
});

econ.on('error', (err) => {
  console.error('%s error: %s', err.name, err.message);
});

econ.connect();

Handling game events

econ.on('enter', (e) => {
  console.log('%s (%s) has entered the %s', e.player, e.client, e.team);
});

econ.on('leave', (e) => {
  console.log('%s has left the game', e.player);
});

econ.on('chat', (e) => {
  console.log('%s: "%s"', e.player, e.message);
});

econ.on('pickup', (e) => {
  console.log('%s picked up %s', e.player, e.weapon);
});

econ.on('kill', (e) => {
  console.log('%s killed %s with %s', e.killer, e.victim, e.weapon);
});

Commands

econ.say('gg'); // Send message to chat
econ.svMotd('Welcome!'); // Set message of the day
econ.status().then((status) => { // Fetch players list
  console.log(status);
});
econ.exec('sv_map dm2').then(() => { // Change current map to dm2
  console.log('Map changed');
});

All supported game events

  • enter { player, team, client }
  • leave { player, client }
  • pickup { player, weapon, client }
  • chat { type, player, message, team, client }
  • kill { killer, victim, weapon, killerClient, victimClient }
  • flaggrab { player, client }
  • flagreturn {}
  • capture { player, client }
  • netban { ip, reason, minutes, life }

License

MIT

1.3.4

10 years ago

1.3.3

10 years ago

1.3.2

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago