Hmmm i also changed my code again so probably that was not helping also
But if the upkeep costs are up and this put against the benefits of having roads ... .... maybe the links are not so bad whit 3%
Hmmm i also changed my code again so probably that was not helping also
But if the upkeep costs are up and this put against the benefits of having roads ... .... maybe the links are not so bad whit 3%
jep i wake up with all my roads gone 2 ... ...
Maintenance was more than my simple maintenance creep was able to maintain after the change...
Well i am still learning... tnx for the advice and suggestions for the code improvement.
I was doing a quicky on SR (just sort for STRUCTURE_ROAD) it allows me to faster programming and i know what i mean ... when i make a not proper var. "of course when i 'll share the work next time i'll take a extra look".
PS. it is a old bad habit for my (basic time) to even use single Capital letters as a variable "like if A = X then C+B=A end if just a sample plz dont kill me ;-)"
Ohw how would this do on CPU movement control?
if(!creep.pos.isNearTo(roadsToRepair)) {
creep.moveTo(roadsToRepair);
}
###Code for repairing roads.
improvements are welcomed
module.exports = function (creep) {
if(creep.energy == 0) {
var spwn = creep.pos.findClosest(FIND_MY_SPAWNS);
creep.moveTo(spwn);
if((spwn) > [199]) {
spwn.transferEnergy(creep);
}}
else{
var SR = creep.pos.findClosest(FIND_STRUCTURES, {
filter: function(object){
if(object.structureType != STRUCTURE_ROAD ) {
return false;
}
if(object.hits > object.hitsMax / 3) {
return false;
}
return true;
}
});
creep.moveTo(SR);
creep.repair(SR);}
};