screepers/screeps_console

Name: screeps_console

Owner: screepers

Description: Standalone Interactive Screeps Console

Created: 2016-05-23 01:14:04.0

Updated: 2018-02-16 22:08:38.0

Pushed: 2018-02-18 21:17:14.0

Homepage:

Size: 793

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

screeps_console

This project streams the Screeps console output to the terminal. It strips out any html tags and adds colors.

Screeps Interactive Console

Requirements
Installation

Note: This application runs on both Python 2 and Python 3.

  1. Make sure you have pip installed. On Mac OS X do sudo easy_install pip
  2. Make sure virtualenv is installed- pip install virtualenv
  3. Clone this GitHub repo and go into the cloned directory
  4. Determine where your Python is installed with which python - assume it is /path/to/python and replace that below
  5. Set up the virtualenv with the command virtualenv -p /path/to/python env
  6. Use that new virtualenv with the command source env/bin/activate
  7. Run make
  8. Run make install
  9. Run screepsconsole from inside the terminal
Settings

The settings file is created automatically and placed in ~.screepsconsole.yaml.

Typically there is little reason to edit it manually. When you attempt to connect to a server for the first time it will ask for your credentials (and if it's a private server for the host), which will then be saved for future use.

When using the “screeps.com” server the console will automatically create a token and use that instead of storing your credentials.

Launching

The interactive shell can be used for both reading console output and sending console commands to the server.

reepsconsole

By default it connects to the main server, but it can also connect to PTR.

reepsconsole ptr

The system also works with private servers. Any label can be used, and unlike the main server the system will ask for a host (include the port) and whether the shard uses https.

reepsconsole screepsplus

It is possible to clear a saved connection.

reepsconsole clear connectionname

You can also call the python script directly.

screeps_console/interactive.py
Streaming Console

To stream the console output directly to your terminal's stdout without the ability to send command use the console.py application.

screeps_console/console.py

Like the Interactive version different servers can be specified.

screeps_console/console.py ptr

The output can also be sent in JSON.

screeps_console/console.py main json
Interactivity

The interactive console allows you to directly interact with your screeps program through the in game console. Most of the time what you put in will be sent directly to the screeps server to be processed. There are a few built in commands however.

Scrolling

Scrolling can be done one line at a time using alt up and alt down. Using PageUp and PageDown (FN+up and FN+down on Apple) can be used to scroll through the console buffer a bit quicker.

Shards

By default all output from all shards is displayed and console commands go to shard0. This can be changed with the shard commands.

Filters

Console output can be filtered using regular expressions and the filter command. Only commands that match at least one filter will be displayed.

Colors and Severity

Console output can have colors, in both the website version and the shell. To get the best of both worlds use font tags that also have a severity attribute.

t color="#999999" severity="2">Message goes here!</font>

The severity can be anywhere from 0 to 5, with five being the most extreme. In addition you can highlight a log line by giving it the 'type' of 'highlight'.

t color="#ffff00" type="highlight>This message will stand out!</font>

If you do not care about coloring the web console output you can use a simpler format.

 severity="2">Message goes here</log>
 type="highlight>This message will stand out!</log>

An example logger is included in the docs folder to demonstrate how this works.


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.