This project streams the Screeps console output to the terminal. It strips out any html tags and adds colors.
- python
- ncurses (typically already on most *nix systems)
- pip
- cygwin (if on Windows)
Note: This application requires Python 2, not 3.
- Make sure you have
pip
installed. On Mac OS X dosudo easy_install pip
- Make sure
virtualenv
is installed-pip install virtualenv
- Clone this GitHub repo and go into the cloned directory
- Determine where your Python is installed with
which python
- assume it is/path/to/python
and replace that below - Set up the
virtualenv
with the commandvirtualenv -p /path/to/python env
- Use that new
virtualenv
with the commandsource env/bin/activate
- Run
make
- Run
make install
- Create settings (as per the instructions below)
- Run
screepsconsole
from inside the terminal
The settings file is a yaml file. Begin by copying the settings.dist file to .settings.yaml in the directory you will be calling the shell from, or you can store the file in your home directory.
cp .settings.dist.yaml ~/.screeps_settings.yaml
The settings file is in yaml and takes various authentication tokens.
# Copy this to .settings.yaml and fill it out.
# Screeps account info
# Your username is your full email address.
screeps_username:
screeps_password:
screeps_ptr: false
# Proxy configuration
http_proxy:
http_proxy_port:
To stream the console output directly to your terminal's stdout run the
console.py
application.
$ ./screeps_console/console.py
This project also offers an interactive shell that can be used for both reading console output and sending console commands to the server.
If you've installed using the provided make file you can launch
$ screepsconsole
You can also call the python script directly.
$ ./screeps_console/interactive.py
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.
about
- displays information about the program.clear
- resets the console display.console
- allows users to suppress normal console output and only sure user interactions.disconnect
- disconnects the console from the Screeps server.exit
- exits the shell.filter
- applies filters to the console output.list
- lists these and other built in commands and aliases.pause
- disables autoscrolling (hit enter on an empty terminal to reenable).reconnect
- reconnects the console to the Screeps server.themes
- lists available themes when called without an argument, or switches. Otherwise switches themes when called with the theme name as the first argument.time
- displays the time (in ticks) on the Screeps server.
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.
Console output can be filtered using regular expressions and the filter
command. Only commands that match at least one filter will be displayed.
filter list
- this lists each current regex filter and its index.
filter add REGEX
- add a regular expression to the filter list.
filter clear
- remove all filters.
filter contains STRING
- add a filter that looks for log lines that contain the
supplied string.
filter remove INDEX
- remove a regular expression using it's index.
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.
<font 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'.
<font 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.
<log severity="2">Message goes here</log>
<log type="highlight>This message will stand out!</log>
An example logger is included in the docs folder to demonstrate how this works.