代码拉取完成,页面将自动刷新
var B = require('behaviors');
module.exports = {
run: function(creep){
const pos1 = new RoomPosition(22,32,'W42N28');
const pos2 = new RoomPosition(23,31,'W42N28');
let obj_list = pos2.lookFor("creep");
if(creep.pos.isEqualTo(pos1) && obj_list.length == 0) creep.move(TOP_RIGHT);
const room = creep.room.name;
const pos = new RoomPosition(Memory.rooms[room].Upgrade.x, Memory.rooms[room].Upgrade.y, room);
const closepoint = new RoomPosition(Memory.rooms[room].closepoint.x, Memory.rooms[room].closepoint.y, room);
if(creep.store.getUsedCapacity() == 0) {
if(creep.pos.isNearTo(pos)) B.GetResource(creep, pos, 'energy');
else creep.moveTo(pos,{visualizePathStyle: {stroke: '#ffffff'},reuse:200});
if(creep.pos.isEqualTo(pos)) creep.moveTo(closepoint);
}else{
if(creep.upgradeController(creep.room.controller) == ERR_NOT_IN_RANGE)
creep.moveTo(closepoint,{visualizePathStyle: {stroke: '#ffff00'},reuse:200});
}
}
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。