forked from VladThePaler/screeps.behaviour-action-pattern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.js
40 lines (30 loc) · 1.36 KB
/
commands.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// useful commands
// Recycle a creep
Creep.action.recycling.assign(Game.creeps['<creepName>']);
// flush road construction traces
_.forEach(Memory.rooms, r => delete r.roadConstructionTrace);
// remove all construction Sites
_.forEach(Game.constructionSites, s => s.remove());
// spawn something...
Game.spawns['<spawnName>'].createCreepBySetup(Creep.setup.worker);
// or
Game.rooms['<roomName>'].spawnQueueLow.push({parts:[MOVE,WORK,CARRY],name:'max',setup:'worker'});
// clear spawn queues for a room
// clear low priority queue
Memory.rooms['<roomName>'].spawnQueueLow = [0];
// clear medium priority queue
Memory.rooms['<roomName>'].spawnQueueMedium = [0];
// clear high priority queue
Memory.rooms['<roomName>'].spawnQueueHigh = [0];
// move Creep
Game.creeps['<creepName>'].move(RIGHT);
// force recycle a Creep
Game.creeps['<creepName>'].data.creepType="recycler";
// To override a module file create a copy of an existing module and name it "custom.<originalModuleName>". Then call this method (without ".js"):
getPath('<originalModuleName>', true);
// To completely re-evaluate all modules:
delete Memory.modules;
// create market order (replace [roomName] with target room or remove it for subscription tokens)
Game.market.createOrder(type, resourceType, price, totalAmount, roomName);
//accept market sell or buy order
Game.market.deal(orderId, amount, roomName);