Difference between revisions of "Private Server Common Tasks"

From Screeps Wiki
Jump to navigation Jump to search
Line 61: Line 61:
 
Although it isn't required, it is likely that you will want to run this command at least twice to create a portal in each direction.
 
Although it isn't required, it is likely that you will want to run this command at least twice to create a portal in each direction.
 
<code>storage.db["rooms.objects"].insert({ room: "W5N5", type: "portal", x: 25, y: 25, destination: { x: 25, y: 25, room: "E5N5" }, ticksToDecay: 100000 });</code>
 
<code>storage.db["rooms.objects"].insert({ room: "W5N5", type: "portal", x: 25, y: 25, destination: { x: 25, y: 25, room: "E5N5" }, ticksToDecay: 100000 });</code>
  +
  +
== Complete All Construction sites ==
  +
  +
This fills up the progress of all construction sites. As soon as a creep does any construction on them, they'll be done.
  +
<code>storage.db['rooms.objects'].update({ type: 'constructionSite' },{ $set: { progress: 99999 }})</code>

Revision as of 03:09, 27 October 2017

Server CLI

Setting GCL

In server CLI

storage.db['users'].update({ username: 'username' },{ $set: { gcl: 65000000000 }})

Setting RCL

In server CLI

storage.db['rooms.objects'].update({ _id: 'idOfController' },{ $set: { level: 8 }})

Setting Credits

In server CLI

storage.db['users'].update({ username: 'username' },{ $set: { money: 2000000 }})

Setting User CPU Limit

In server CLI

storage.db['users'].update({ username: 'username' },{ $set: { cpu: 500 }})

Adding a new room

In server CLI

map.generateRoom(roomName, options)

for options use "help(map)" this will display the help data for map editing stuff

map.generateRoom("W11N11", {sources: 13, controller: false})

The above code for example will generate a room with 13 sources & no controller.

Opening / closing a room

In server CLI

map.openRoom("W5N1", [timestamp])

timestamp is optional
e.g. on timestamp usage is to add: Date.now() + (300*1000)
This will mean that the room will open in 5 minutes.

map.closeRoom("W5N1")

Adding NPC Terminals

In server CLI

storage.db['rooms.objects'].insert({ type: 'terminal', room: 'W0N0', x: 0, y:0 })

Repeat as many times as desired changing rooms (Use highway rooms or SK rooms) NPC orders should appear on the market automatically after a little while

Manipulating Memory

In server CLI (you need the user id first)

storage.env.get(storage.env.keys.MEMORY + '41dbd8207f1bf62');
storage.env.get('memory:41dbd8207f1bf62');

Adding Portals

Although it isn't required, it is likely that you will want to run this command at least twice to create a portal in each direction.

storage.db["rooms.objects"].insert({ room: "W5N5", type: "portal", x: 25, y: 25, destination: { x: 25, y: 25, room: "E5N5" }, ticksToDecay: 100000 });

Complete All Construction sites

This fills up the progress of all construction sites. As soon as a creep does any construction on them, they'll be done.

storage.db['rooms.objects'].update({ type: 'constructionSite' },{ $set: { progress: 99999 }})