<commit_before>module.exports = {
    run: function(creep) {
            if (creep.memory.working == true && creep.carry.energy == 0) {
            creep.memory.working = false;
        }
        else if (creep.memory.working == false && creep.carry.energy == creep.carryCapacity) {
            creep.memory.working = true;
        }

        if (creep.memory.working == true) {
            var structure = creep.pos.findClosestByPath(FIND_STRUCTURES, {
              filter: (s) => (s.structureType == STRUCTURE_STORAGE
                            || s.structureType == STRUCTURE_EXTENSION)
                            && s.energy < s.energyCapacity 
            });
            if (structure != undefined) {
                if (creep.transfer(structure, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
                    creep.moveTo(structure);
                }
            }   
        }
        else {
            var source = Game.getObjectById('576a9bd757110ab231d880ca');
            if (creep.harvest(source) == ERR_NOT_IN_RANGE) {
                creep.moveTo(source);
            }    
        }
    }
};



// var source = 
// creep.memory.sourceId = source.id;<commit_msg>harvesterclosefix<commit_after>module.exports = {
    run: function(creep) {
            if (creep.memory.working == true && creep.carry.energy == 0) {
            creep.memory.working = false;
        }
        else if (creep.memory.working == false && creep.carry.energy == creep.carryCapacity) {
            creep.memory.working = true;
        }

        if (creep.memory.working == true) {
            var depositStorage = Game.getObjectById('57808dd70affe1b058f22b5c')
            if (depositStorage != undefined) {
                if (creep.transfer(depositStorage, RESOURCE_ENERGY) == ERR_NOT_IN_RANGE) {
                    creep.moveTo(depositStorage);
            }   
        }
        else {
            var source = Game.getObjectById('576a9bd757110ab231d880ca');
            if (creep.harvest(source) == ERR_NOT_IN_RANGE) {
                creep.moveTo(source);
            }    
        }
    }
};



// var source = 
// creep.memory.sourceId = source.id;
{'fraction_non_alphanumeric': 0.11813953488372093, 'fraction_numerical': 0.022325581395348838, 'mean_word_length': 1.6555555555555554, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6502315', 'n_tokens_mistral': 683, 'n_tokens_neox': 642, 'n_words': 95}