screepers/screeps-multimeter

Name: screeps-multimeter

Owner: screepers

Description: The most useful tool on your screeps workbench.

Created: 2016-12-22 16:04:16.0

Updated: 2018-02-02 02:16:53.0

Pushed: 2017-07-15 17:58:40.0

Homepage: null

Size: 674

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

NPM version

screeps-multimeter

Multimeter is a hackable console for the game Screeps. It lets you access your Screeps console without loading up the full website (and as a result lets you play Screeps for much longer on a single battery charge), and is hackable with plugins.

screenshot of main interface

Features:

Installation
install -g screeps-multimeter
imeter

When you run multimeter for the first time, it will ask you for your Screeps API token and save it into a config file in the current directory. You will also need to specify the name of the shard to use.

The main interface has a command line on the bottom. In type /help to see a list of the available commands. Type /quit to exit the program.

Colors and Formatting

Console coloring and formatting is made possible by blessed's tags. Some of the tags you can use are:

Colors can be specified as a name, e.g. red, blue, yellow, cyan (see colorNames from blessed for a complete list), or as a hex code, e.g. #ffff00.

Plugins

Multimeter currently ships with these plugins enabled by default. To select which plugins are loaded, edit the plugins array in your screeps-multimeter.json.

Plugin: Alias

The alias plugin can be used to easily store and access commonly used console commands. Create a new alias by using /alias NAME COMMAND. Now, /NAME will automatically expand to COMMAND. For example, this alias will let you list all damaged creeps by typing /damagedCreeps:

as damagedCreeps _.filter(Game.creeps, (c) => c.hits < c.hitsMax)
agedCreeps

Aliases can also take parameters. There will be available in variables like $1, $2, etc. The entire passed string is available as $args. For example:

as hitsLeft "Creep " + $1 + " has " + Game.creeps[$1].hits + " hits left"
sLeft Ryan
Plugin: Watch

The watch plugin will log an expression to your console on every tick. To install it, copy watch-client.js to your script and add some code to your loop function:

watcher = require('watch-client');
rts.loop = function() {
 Rest of your code...

tcher();

There are two ways to watch expressions. You can log it to the console normally by using /watch console EXPR. You can also log to a status bar at the bottom of the screen using /watch status EXPR. For example, /watch status _.keys(Game.creeps).length will keep a count of the number of live creeps at the bottom of the terminal.

Contributing

If you have feedback, bugs, or feature requests for multimeter, don't hesitate to look through the issues and add your thoughts. Please search to see if someone else has already filed a related issue before you submit a new one.

Multimeter is built for hacking! The easiest way to add a feature to multimeter is to make a new plugin for it. If you need to change something and it can't be done with a plugin, you can fork multimeter and submit a pull request. Ideally, you can add the necessary hooks so that other plugins can take advantage of them.

Contributors

Multimeter has been built by a collection of users. Github provides a list of all contributors to the project.

Publishing

To release a new version:

Name the release “$VERSION released” and write the release notes using these bullet point templates:


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.