module.exports = { setup(){}, begin(room){ if(!room.memory.jobs) room.memory.jobs = { harvesters: 1 } }, tick(room){ if(!(Game.time % 100)) calculateJobs(room); } } function calculateJobs(room) { room.memory.jobs.harvesters = 10 - Object.keys(Game.creeps).length; }