screepsmod-admin-utils
Version:
## This is a Collection of utilities for Screeps Private Server admins
21 lines (19 loc) • 444 B
JavaScript
/* config.yml
gclToCPU
maxCPU
baseCPU
stepCPU
*/
module.exports = config => {
config.utils.gclToCPU = {
enabled: false,
maxCPU: 300,
baseCPU: 20,
stepCPU: 10
}
const set = (k, v) => { config.utils.gclToCPU[k] = v }
config.utils.on('config:update:gclToCPU', v => set('enabled', !!v))
for (const k of ['maxCPU', 'baseCPU', 'stepCPU']) {
config.utils.on(`config:update:${k}`, v => set(k, v))
}
}