<commit_before>'use strict';
module.exports = exports = function(creep) {
    var spawn = Game.spawns[creep.memory.spawnName];
    var target = creep.pos.findClosest(Game.HOSTILE_CREEPS, {
        filter: h => h.pos.inRangeTo(spawn.pos, 12)
    });

    if (target) {
        if (creep.getActiveBodyparts(Game.RANGED_ATTACK) > 0) {
            let damageCanDeal = 0;
            let inRangeEnemies = creep.pos.findInRange(Game.HOSTILE_CREEPS, 3);
            inRangeEnemies.forEach((e) => {
                let range = creep.pos.getRangeTo(e.pos);
                if (range === 3) {
                    damageCanDeal += 1;
                } else if (range === 2) {
                    damageCanDeal += 4;
                } else if (range === 1) {
                    damageCanDeal += 10;
                }
            });

            if (damageCanDeal >= 10) {
                creep.rangedMassAttack();
            } else if (target.pos.inRangeTo(creep.pos, 3)) {
                creep.rangedAttack(target);
            } else {
                creep.moveTo(target);
            }

            return;
        } else if (creep.getActiveBodyparts(Game.ATTACK) > 0) {
            creep.moveTo(target);
            creep.attack(target);
            return;
        }
    }

    var rallyPoint = spawn.pos;
    if (Game.flags.BoushleyRally) {
        rallyPoint = Game.flags.BoushleyRally.pos;
    }

    creep.moveTo(rallyPoint);
};<commit_msg>Put men with melee guard in front.<commit_after>'use strict';
module.exports = exports = function(creep) {
    var spawn = Game.spawns[creep.memory.spawnName];
    var target = creep.pos.findClosest(Game.HOSTILE_CREEPS, {
        filter: h => h.pos.inRangeTo(spawn.pos, 12)
    });

    if (target) {
        if (creep.getActiveBodyparts(Game.RANGED_ATTACK) > 0) {
            let damageCanDeal = 0;
            let inRangeEnemies = creep.pos.findInRange(Game.HOSTILE_CREEPS, 3);
            inRangeEnemies.forEach((e) => {
                let range = creep.pos.getRangeTo(e.pos);
                if (range === 3) {
                    damageCanDeal += 1;
                } else if (range === 2) {
                    damageCanDeal += 4;
                } else if (range === 1) {
                    damageCanDeal += 10;
                }
            });

            if (damageCanDeal >= 10) {
                creep.rangedMassAttack();
            } else if (target.pos.inRangeTo(creep.pos, 3)) {
                creep.rangedAttack(target);
            } else {
                creep.moveTo(target);
            }

            return;
        } else if (creep.getActiveBodyparts(Game.ATTACK) > 0) {
            creep.moveTo(target);
            creep.attack(target);
            return;
        }
    }

    var rallyPoint = spawn.pos;
    if (Game.flags.BoushleyRally) {
        rallyPoint = Game.flags.BoushleyRally.pos;
    }

    var x = rallyPoint.x;
    var y = rallyPoint.y;

    if (creep.getActiveBodyparts(Game.ATTACK) > 0) {
        y += 1;
    } else {
        y -= 1;
    }

    creep.moveTo(x, y);
};
{'fraction_non_alphanumeric': 0.12397775596990514, 'fraction_numerical': 0.01144913313706248, 'mean_word_length': 1.5210222588623248, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '6028542', 'n_tokens_mistral': 1028, 'n_tokens_neox': 976, 'n_words': 171}