-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
66 lines (50 loc) · 1.75 KB
/
Copy pathmain.js
File metadata and controls
66 lines (50 loc) · 1.75 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
let reserve = require("Reserve");
let claim = require("claim");
let c = require('allClaimed');
module.exports.loop = function () {
let rooms = [];
rooms.push(Game.rooms['W52N87']);
rooms.push(Game.rooms['W53N87']);
rooms.push(Game.rooms['W53N86']);
rooms.forEach(function (room) {
let per = room.controller.progress / room.controller.progressTotal * 100;
console.log("room " + room.name +
" energy=" + room.energyAvailable + " @ " +
room.controller.progress + '/' +
room.controller.progressTotal +
' ' + per.toFixed(2) + '%');
});
c.run();
reserve.run();
for (let name in Memory.creeps) {
if (!Game.creeps[name]) {
delete Memory.creeps[name];
console.log('Clearing non-existing creep memory:', name);
}
}
let spawningCreep;
if (Game.spawns['Spawn1'].spawning) {
spawningCreep = Game.creeps[Game.spawns['Spawn1'].spawning.name];
Game.spawns['Spawn1'].room.visual.text(
'🛠️' + spawningCreep.memory.role,
Game.spawns['Spawn1'].pos.x + 1,
Game.spawns['Spawn1'].pos.y,
{align: 'left', opacity: 0.8});
}
if (Game.spawns['Spawn2'].spawning) {
spawningCreep = Game.creeps[Game.spawns['Spawn2'].spawning.name];
Game.spawns['Spawn2'].room.visual.text(
'🛠️' + spawningCreep.memory.role,
Game.spawns['Spawn2'].pos.x + 1,
Game.spawns['Spawn2'].pos.y,
{align: 'left', opacity: 0.8});
}
if (Game.spawns['Spawn3'].spawning) {
spawningCreep = Game.creeps[Game.spawns['Spawn3'].spawning.name];
Game.spawns['Spawn3'].room.visual.text(
'🛠️' + spawningCreep.memory.role,
Game.spawns['Spawn3'].pos.x + 1,
Game.spawns['Spawn3'].pos.y,
{align: 'left', opacity: 0.8});
}
}