mirror of
https://github.com/paradizelost/screeps.git
synced 2024-11-25 02:14:44 -06:00
fix
This commit is contained in:
commit
e1130cfe10
@ -44,10 +44,15 @@ let Phase1 = {
|
|||||||
require('proc.spawning').spawnmover(room)
|
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)){
|
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){
|
if(Game.rooms[room].find(FIND_MINERALS)[0].ticksToRegeneration < 1000){
|
||||||
console.log("Spawning Miner in " + room)
|
console.log("Spawning Miner in " + room)
|
||||||
require('proc.spawning').spawnminer(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")}}
|
} 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)
|
//require('proc.market').sellEnergy(room)
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ let roleMiner = {
|
|||||||
if(creep.harvest(mysource) == ERR_NOT_IN_RANGE) {
|
if(creep.harvest(mysource) == ERR_NOT_IN_RANGE) {
|
||||||
creep.travelTo(mysource);
|
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)}})) ) {
|
} 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){
|
if(creep.memory.renewto == undefined){
|
||||||
creep.memory.renewto = 1200
|
creep.memory.renewto = 1200
|
||||||
@ -32,6 +33,9 @@ let roleMiner = {
|
|||||||
creep.moveTo(spawn);
|
creep.moveTo(spawn);
|
||||||
}
|
}
|
||||||
} else {
|
} 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) ;}});
|
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(storagetargets){
|
||||||
if(this.transferAll(creep,storagetargets) == ERR_NOT_IN_RANGE) {
|
if(this.transferAll(creep,storagetargets) == ERR_NOT_IN_RANGE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user