Skip to content
Warren Earle edited this page Jun 28, 2016 · 1 revision

My plan is to use the builders for repairs Example :

var targets = creep.room.find(FIND_STRUCTURES, { filter: object => object.hits < object.hitsMax });

targets.sort((a,b) => a.hits - b.hits);

if(targets.length > 0) {
    if(creep.repair(targets[0]) == ERR_NOT_IN_RANGE) {
        creep.moveTo(targets[0]);    
    }
}

Clone this wiki locally