https://github.com/richrd/teeworlds-econ
Node.js API for communicating with a Teeworlds server via Econ.
https://github.com/richrd/teeworlds-econ
Last synced: 8 months ago
JSON representation
Node.js API for communicating with a Teeworlds server via Econ.
- Host: GitHub
- URL: https://github.com/richrd/teeworlds-econ
- Owner: richrd
- Created: 2020-04-14T12:36:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T14:36:45.000Z (over 3 years ago)
- Last Synced: 2025-07-04T18:09:06.465Z (12 months ago)
- Language: TypeScript
- Size: 365 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Teeworlds Econ API
With Teeworlds Econ API you can intereact with Teeworlds via its Econ cosole.
This lets you conveniently react to any events on the server as well as send
commands to it and respond to the results. The `TwEconCLient` provodes a basic
API for interaction, listening to events and sending commands. `TwStateManager`
on the other hand is a higher level abstraction that keeps track of server
state and game state as well as some other things.
## Prerequisites
To use this you need a Teeworlds server with econ enabled. To enable it add the
following to your Teeworlds server config:
```
ec_port [port]
ec_password [password]
```
If you plan on connecting to econ from a different machine than the Teeworlds
server itself you also need to add this to your config:
```
ec_bindaddr 0.0.0.0
```
## Usage
```
import { TwEconClient } from "./TwEconClient";
const host = "localhost"
const port = 8303
const password = "secret"
const econClient = new TwEconClient(host, port, password);
econ.connect();
```
## Developing
```
yarn install
yarn dev
```