<commit_before>let mod = new ActionObj('Help');
module.exports = mod;

const targetInitFunc = function(creep) {
    //if(creep.room.storage) return false;
    const needBuildStructures = creep.room.cachedFind(FIND_CONSTRUCTION_SITES);
    const builders = _.filter(creep.room.cachedFind(FIND_MY_CREEPS), c => c.memory.role === C.BUILDER && _.sum(c.carry)<c.carryCapacity);
    return needBuildStructures.length>0 && builders.length>0 ? builders[0] : false;
};
mod.nextTarget = function() {
    return Util.Mark.handleMark(this.creep, targetInitFunc, this.actionName);
};

mod.word = '➡︎ help';

mod.loop = function(creep) {
    return this.loop0(creep, (creep, target) => {
        const result = creep.transfer(target, RESOURCE_ENERGY);
        if(result == ERR_NOT_IN_RANGE) {
            creep.moveTo(target, {visualizePathStyle: {stroke: '#ffaa00'}});
        }
    });
};
<commit_msg>not to help builder if storage present<commit_after>let mod = new ActionObj('Help');
module.exports = mod;

const targetInitFunc = function(creep) {
    if(creep.room.storage) return false;
    const needBuildStructures = creep.room.cachedFind(FIND_CONSTRUCTION_SITES);
    const builders = _.filter(creep.room.cachedFind(FIND_MY_CREEPS), c => c.memory.role === C.BUILDER && _.sum(c.carry)<c.carryCapacity);
    return needBuildStructures.length>0 && builders.length>0 ? builders[0] : false;
};
mod.nextTarget = function() {
    return Util.Mark.handleMark(this.creep, targetInitFunc, this.actionName);
};

mod.word = '➡︎ help';

mod.loop = function(creep) {
    return this.loop0(creep, (creep, target) => {
        const result = creep.transfer(target, RESOURCE_ENERGY);
        if(result == ERR_NOT_IN_RANGE) {
            creep.moveTo(target, {visualizePathStyle: {stroke: '#ffaa00'}});
        }
    });
};

{'fraction_non_alphanumeric': 0.14991671293725709, 'fraction_numerical': 0.006662965019433648, 'mean_word_length': 4.104815864022663, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2712996', 'n_tokens_mistral': 628, 'n_tokens_neox': 619, 'n_words': 110}