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
Size: 793
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This project streams the Screeps console output to the terminal. It strips out any html tags and adds colors.
Note: This application runs on both Python 2 and Python 3.
pip
installed. On Mac OS X do sudo easy_install pip
virtualenv
is installed- pip install virtualenv
which python
- assume it is /path/to/python
and replace that belowvirtualenv
with the command virtualenv -p /path/to/python env
virtualenv
with the command source env/bin/activate
make
make install
screepsconsole
from inside the terminalThe 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.
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
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
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.shard
- controls the active shards.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.
By default all output from all shards is displayed and console commands go to
shard0. This can be changed with the shard
commands.
shard
- by itself it outputs the shard that console input will go to.shard SHARDNAME
- changes the shard that console input goes to.shard focus SHARDNAME
- changes the console output and only displays
messages from this shard.shard clear
- display all output from all shards, but leave the console
input pointed at the same shard.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.
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.