-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscript.js
More file actions
26 lines (18 loc) · 923 Bytes
/
script.js
File metadata and controls
26 lines (18 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const fs = require('fs');
exports.mod = (mod_info) => {
const modConfig = JSON.parse(fs.readFileSync(__dirname + '/mod.config.json'));
logger.logInfo(`[MOD] ${modConfig.name}. Loading...`);
for(const b in global._database.bots) {
const botDifficultyFilePath = __dirname + '/db/bots/' + b + '/aiconfig.json';
if(fs.existsSync(botDifficultyFilePath)) {
var data = fs.readFileSync(botDifficultyFilePath, 'utf8');
data = JSON.parse(data);
global._database.bots[b].difficulty.easy = data;
global._database.bots[b].difficulty.normal = data;
global._database.bots[b].difficulty.hard = data;
global._database.bots[b].difficulty.impossible = data;
logger.logDebug(`[MOD] ${modConfig.name}; Applied ${b} ai config data`);
}
}
logger.logSuccess(`[MOD] ${modConfig.name}; Complete.`);
}