var controller_spawns = require("controller_spawns"); var controller_creeps = require("controller_creeps"); var controller_towers = require("controller_towers"); var ai_main = require("ai_main"); module.exports.loop = function () { ai_main.run_front(); controller_creeps.run(); controller_towers.run(); controller_spawns.run(); if (Game.time % 60 == 30) clear_dead_creeps_from_memory(); ai_main.run_back(); } /* GLOBAL FUNCTIONS */ function clear_dead_creeps_from_memory() { for (var cr in Memory.creeps) { if (Game.creeps[cr] == null) { delete (Memory.creeps[cr]); } } }