Skip to content

Screepspl.us agent with Compute Engine

Stefan edited this page Aug 23, 2018 · 6 revisions

If you are using the Grafana service from screepspl.us, there is a free and easy solution for running the agent remotely. I use the Compute Engine from Google Cloud Platform. After setting up your account, here is what you can do to start the agent:

  1. Create an instance with google cloud compute, least expensive machine will work. I used micro with a Debian boot disk. I used all the default settings.
  2. Once your machine is ready to use, start an SSH session. I just used the browser window. (VM instances -> Remote Access -> SSH -> Open in browser window)
  3. Install git and nodejs
sudo apt-get install -y git
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
  1. Clone the screepspl.us agent and install
git clone https://github.com/ScreepsPlus/node-agent.git
cd node-agent
npm install
  1. Log in to screepspl.us and get your token, make a copy of config.js.sample and use nano to edit config.js
cp config.js.sample config.js
nano config.js
  1. Test to make sure the service is running as expected. (If you get a TypeError and selected memory.stats in your config, make sure you've defined Memory.stats ingame)
node app.js
  1. Start the agent running in another thread so that it continues after you log out of the SSH session:
screen -d -m -S screeps node app.js
  1. Complete the instructions at https://screepspl.us/agent to set up your screeps codebase.
  2. Support this excellent service and its author with patreon! https://www.patreon.com/ags131