Mining changes

This commit is contained in:
Dan Hamik 2022-05-16 13:26:51 -05:00
parent 2a94fffaae
commit aa2d7fdfce
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
let assignMiners = {
tick: function(roomname) {
let sources = Game.rooms[roomname].find(FIND_SOURCES );
let sources = Game.rooms[roomname].find(FIND_SOURCES);
for(let source of sources){
let allminers = Game.rooms[roomname].find(FIND_MY_CREEPS, {filter: (creep) =>{return ( creep.memory.role=='sourceminer'|| creep.memory.role == ("phase" + Game.rooms[roomname].memory.phase + "worker") )}});
//let allstorage = Game.rooms[name].find(FIND_STRUCTURES, {filter: (s) => {return ( s.structureType == STRUCTURE_CONTAINER || s.structureType == STRUCTURE_STORAGE)}})

View File

@ -49,7 +49,7 @@ let Phase0Worker = {
let droppedenergy = creep.pos.findClosestByRange(FIND_DROPPED_RESOURCES, {filter: {resourceType: RESOURCE_ENERGY}});
let ruins=creep.pos.findClosestByRange(FIND_RUINS, {filter: ruin => ruin.store.getUsedCapacity(RESOURCE_ENERGY) > 0});
if(droppedenergy == undefined && ruins==undefined){
if(Game.getObjectById(creep.memory.destsource.id)==undefined){creep.memory.destsource=undefined}
if((Game.getObjectById(creep.memory.destsource.id)==undefined)){creep.memory.destsource=undefined}
let mysource=Game.getObjectById(creep.memory.destsource.id)
//mysource=creep.pos.findClosestByRange( FIND_SOURCES )
if(creep.harvest(mysource) == ERR_NOT_IN_RANGE){