代码拉取完成,页面将自动刷新
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);
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。