1 Star 0 Fork 0

Leviaton/Screeps

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
act.bTLinker.js 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
Lev 提交于 2020-02-17 12:50 . first commit
module.exports = {
run: function(){
//Check creep
if(!Game.creeps['LINKER']){
if(Game.rooms['W35N28'].energyAvailable > 300 && Game.spawns['Ber'].spawing == null)
Game.spawns['Ber'].spawnCreep([CARRY,CARRY,CARRY,CARRY,MOVE,MOVE],'LINKER');
return;
}else if(Game.creeps['LINKER'].spawning) return;
//Motivate creep
var creep = Game.creeps['LINKER'];
var Link = Game.getObjectById('5df87103324dd070219ce64c');
if(creep.store.getUsedCapacity() == 0){
if(creep.pos.isNearTo(creep.room.storage)) creep.withdraw(creep.room.storage, RESOURCE_ENERGY, creep.store.getFreeCapacity());
else creep.moveTo(creep.room.storage);
}else{
if(creep.pos.isNearTo(Link)) creep.transfer(Link, RESOURCE_ENERGY);
else creep.moveTo(Link);
}
var target = Game.getObjectById('5df90721ca55d738c5650108');
var amount = target.store.getFreeCapacity();
Link.transferEnergy(target);
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/Chorolop/Screeps.git
git@gitee.com:Chorolop/Screeps.git
Chorolop
Screeps
Screeps
master

搜索帮助