代码拉取完成,页面将自动刷新
module.exports = {
run: function(room){
if(Memory.grafana[room] == null) Memory.grafana[room] = {setup:1};
Memory.grafana.global = {
cpu: Game.cpu.getUsed()
}
let progress = 0;
let lvl = Game.rooms[room].controller.level;
let storageEnergy = Memory.rooms[room].storage?Game.rooms[room].storage.store.getUsedCapacity('energy'):0;
switch(lvl){
case 1: progress = 0; break;
case 2: progress = 200; break;
case 3: progress = 45200; break;
case 4: progress = 180200; break;
case 5: progress = 585200; break;
case 6: progress = 1800200; break;
case 7: progress = 5445200; break;
case 8: progress = 16380200; break;
}
progress += lvl==8?0:Game.rooms[room].controller.progress;
Memory.grafana[room] = {
lvl: Game.rooms[room].controller.level,
lvlProgress: progress,
storageEnergy: storageEnergy,
energyAvailable: Game.rooms[room].energyAvailable
};
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。