Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including screepsmod-admin-utils with all npm packages installed. Try it out:

var screepsmodAdminUtils = require("screepsmod-admin-utils")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

screepsmod-admin-utils v1.11.2


This is a Collection of utilities for Screeps Private Server admins

JavaScript Style Guide License Version Downloads CircleCI



utils.addNPCTerminals(interval = 10)

Creates NPC Terminals.

The interval defines how often they are added, with the default value of 10 matching the behavior of the public server.

A simple way to understand the interval is that it will place rooms where x % interval === 0 && y % interval === 0.


Removes all NPC Terminals.


Removes all Bots.


Sets the tick rate to value (in milliseconds)


Gets the current tick rate


Sets socket update rate (in ms)


Returns current socket update rate


Sets the shard name


Returns current cpu limit for username.

utils.setCPULimit(username, value)

Sets cpu limit to value for username. Will be overriden if GCLToCPU scaling is enabled.

utils.enableGCLToCPU([maxCPU], [baseCPU], [stepCPU])

Enables GCLToCPU scaling which raises all user's CPU limit based on their GCL. The formula is "Math.min( (gclLevel * stepCPU + baseCPU), maxCPU )". Parameters are optional and default to maxCPU = 300, baseCPU = 20, stepCPU = 10. Enabling through the CLI will not persist after a server restart. Update the values in your config.yml to persist the settings.


Disables GCLToCPU scaling. Disabling through the CLI will not persist after a server restart. Update the values in your config.yml to persist the setting.


Reloads the serverConfig section of a screeps-launcher config.yml

Config file

config.yml example: (This can be the same file as screeps-launcher's config.yml)

# Most of these fields will live reload on save. 
# Values set here will override any saved via CLI on server startup
  tickRate: 200
  socketUpdateRate: 200
  whitelist: # Does not restrict login, only restricts spawning
  - ags131
  - zeswarm
  shardName: 'screepsplus1'
    POWER_CREEP_SPAWN_COOLDOWN: 3600000 # 1 Hour
  welcomeText: |
    <div>Powered by screepsmod-admin-utils</div>
  statsToken: ...splusToken... # This enables submitting stats to S+ Grafana. Note: shardName MUST be set
  gclToCPU: true
  maxCPU: 100
  baseCPU: 20
  stepCPU: 10


A few extra endpoints are implemented enabling some extra debuging and tools

GET /stats Lots of useful stats on server performance GET /api/user/world-start-room Dynamically returns a start room for the client GET /api/experimental/pvp Same as on mmo, returns active pvp rooms. GET /api/experimental/nukes Same as on mmo, returns nukes.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free