1 Star 0 Fork 0

Leviaton/Screeps

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dept.grafana.js 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
Lev 提交于 2020-02-17 12:50 . first commit
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
};
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/Chorolop/Screeps.git
git@gitee.com:Chorolop/Screeps.git
Chorolop
Screeps
Screeps
master

搜索帮助