This commit is contained in:
dan 2020-11-17 11:47:15 -06:00
parent e1130cfe10
commit c03125c5c0
4 changed files with 7 additions and 14 deletions

View File

@ -44,15 +44,10 @@ let Phase1 = {
require('proc.spawning').spawnmover(room)
}
if((Game.rooms[room].find(FIND_MY_STRUCTURES, {filter: {structureType: STRUCTURE_EXTRACTOR}}).length > 0)&&(creepcounts["miner"] < 1 || creepcounts["miner"]==undefined)&&(Game.rooms[room].energyAvailable >= Game.rooms[room].energyCapacityAvailable)){
<<<<<<< HEAD
if(Game.rooms[room].find(FIND_MINERALS)[0].ticksToRegeneration < 1000){
console.log("Spawning Miner in " + room)
require('proc.spawning').spawnminer(room)
} else { if(Game.flags.debug && Game.flags.debug.room == Game.rooms[room]){console.log("Not spawning miner in " + room + ", waiting for regen")}}
=======
console.log("Spawning Miner in " + room)
require('proc.spawning').spawnminer(room)
>>>>>>> 1ff4251f0330951b8788d86218fc0b5a1906d5f4
}
//require('proc.market').sellEnergy(room)
}

View File

@ -68,15 +68,17 @@ module.exports.loop = function () {
console.log(e)
}
}
//console.log('done running creeps')
}
let flags = Game.flags
for(let flag in flags){
//console.log('running flags')
require('flag.' + flag ).run()
}
for(let name in Memory.rooms) {
// console.log('cleaning up old rooms')
let myroom = Game.rooms[name]
if(!Game.rooms[name]){delete Memory.rooms[name]}
}
console.log("----End loop for "+ Game.time +'----')
}
}

View File

@ -16,7 +16,6 @@ let roleMiner = {
if(creep.harvest(mysource) == ERR_NOT_IN_RANGE) {
creep.travelTo(mysource);
}
<<<<<<< HEAD
} else if ((creep.ticksToLive < 300 || creep.ticksToLive <= creep.memory.renewto) && (Game.rooms[creep.room.name].find(FIND_MY_SPAWNS, {filter: (r) =>{return ( r.store[RESOURCE_ENERGY]>1)}})) ) {
if(creep.memory.renewto == undefined){
creep.memory.renewto = 1200
@ -33,9 +32,6 @@ let roleMiner = {
creep.moveTo(spawn);
}
} else {
=======
} else {
>>>>>>> 1ff4251f0330951b8788d86218fc0b5a1906d5f4
let storagetargets = creep.pos.findClosestByRange(FIND_STRUCTURES, {filter: (s) => {return ((s.structureType == STRUCTURE_STORAGE || s.structureType == STRUCTURE_CONTAINER || s.structureType == STRUCTURE_TERMINAL || s.structureType == STRUCTURE_FACTORY ) && _.sum(s.store) < s.storeCapacity) ;}});
if(storagetargets){
if(this.transferAll(creep,storagetargets) == ERR_NOT_IN_RANGE) {