diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..31d2658 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ScreepsAutocomplete"] + path = ScreepsAutocomplete + url = git@github.com:Garethp/ScreepsAutocomplete.git diff --git a/ScreepsAutocomplete b/ScreepsAutocomplete new file mode 160000 index 0000000..3c6f928 --- /dev/null +++ b/ScreepsAutocomplete @@ -0,0 +1 @@ +Subproject commit 3c6f92884f7547d2c87ae2a52b5c84b086219e37 diff --git a/main.js b/main.js index bc2fd8d..6eb8d35 100644 --- a/main.js +++ b/main.js @@ -19,14 +19,14 @@ var creepsConfig = { minimumCreeps: 2, role: roleUpgrader } -} +}; module.exports.loop = function(){ // Cleanup Creeps for (var name in Memory.creeps){ if (!Game.creeps[name]){ delete Memory.creeps[name]; - console.log("Clearning non-existing creep memory: ", name); + console.log("Cleaning non-existing creep memory: ", name); } } @@ -35,7 +35,7 @@ module.exports.loop = function(){ for (var i in creepRolePriority){ var roleName = creepRolePriority[i]; var defaults = creepsConfig[roleName]; - var creepsOfKind = _.filter(Game.creeps, (creep) => creep.memory.role == roleName); + var creepsOfKind = _.filter(Game.creeps, (creep) => {return creep.memory.role == roleName}); if (creepsOfKind.length < creepsConfig[roleName].minimumCreeps){ var newName = Game.spawns.Spawn1.createCreep(creepsConfig[roleName].bodyParts, undefined, @@ -51,4 +51,4 @@ module.exports.loop = function(){ creepsConfig[role].role.run(creep); } console.log("tick"); -} \ No newline at end of file +}; \ No newline at end of file