Git Product home page Git Product logo

node-agent's Introduction

ScreepsPlus node agent

NPM info

Circle CI

Requirements

Node.js 6+

Setup

Prerequisites

  1. Token from ScreepsPl.us
  2. Screeps Login info
  3. Node + NPM

NPM

npm install -g screepsplus-agent
screepsplus-agent

Manual

  1. Download
  2. Configure with config.js
  3. npm install
  4. node app.js

Docker

To use with docker, just do the following:

docker build -t screepsplus-agent .
docker run -d -v $(pwd):/config/ --restart=always --name screepsplus-agent screepsplus-agent

Docker-compose

A docker-compose.yml is included.

Config Methods

It is now possible to use the console to output stats, just set method to 'console' in config.js and use console.log('STATS;'+formattedStats)

For this to work, type based format is REQUIRED

NOTE: you should use ';' instead of newLine ("\n") as a delimiter

Stat formats supported by ScreepsPl.us:

Memory.stats object

The usual grafana data format

{
  rooms: {
  	W0N0:{
  		level:2
  	}
  }
}

Type based format

This is a more advanced system that allows you to send raw stats pre-formatted. There should always be a 3 line header,

type
tick
time

followed by the raw stat data

For ScreepsPl.us, type can be one of 3 values: 'text/grafana' 'text/influxdb' 'application/json'

Where application/json inserts into graphite.

text/grafana Format

1 stat per line: stat value

EX: room.W0N0.level 5

text/influxdb Format

1 stat per line: stat[,tag1=value,tag2=value,...] key=value[,key=value,...]

EX: room,name=W0N0 level=5,energy=300,energyCapacity=300

NOTE: as of this writing this README, influxdb support is enabled, but cannot be accessed without requesting influxdb credentials

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.