1.0.1 • Published 4 years ago

mindustry-node-control v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Mindustry Node Control

The node.js library that allows you to manage your Mindustry server.

Installation

Using npm:

npm i mindustry-node-control

Usage

First you have to import module:

const { Server } = require('mindustry-node-control');

// For locally hosted server
const myServer = new Server('127.0.0.1');

Get ping:

myServer.ping((ping) => {
    console.log(`${server.hostname}:${server.socketPort} ping is ${ping}!`);
});

Send command:

// Create a connection
myServer.connect(() => {
    server.command('host');
});

NOTE: For this module to work, you need to open socket input on the server, run this command in the server console:

config socketInput true

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

For license see LICENSE.txt