Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Trying to figure out how to reset $script at this point. I believe what happens is, based on this. when initReady is called for init.js, $script is still the last script in memory which is topCommand.js for me. There is a Java API call though to set $script, so figuring out how to solve this now.
- [02-05-2016 @ 19:48:19] Loaded module: commands/streamCommand.js (Enabled)
- [02-05-2016 @ 19:48:19] >> addHook: ./commands/topCommand.js[-1]
- function () {
- if ($.bot.isModuleEnabled("./commands/topCommand.js")) {
- $.registerChatCommand("./commands/topCommand.js", "top5", 7);
- $.registerChatCommand("./commands/topCommand.js", "top5time", 7);
- }
- }
- [02-05-2016 @ 19:48:19] Loaded module: commands/topCommand.js (Enabled)
- [02-05-2016 @ 19:48:19] Bot locked & loaded!
- [02-05-2016 @ 19:48:19] >> addHook: ./commands/topCommand.js[101]
- function () {
- $.registerChatCommand("./init.js", "chat", 1);
- $.registerChatCommand("./init.js", "module", 1);
- $.registerChatCommand("./init.js", "reconnect", 2);
- }
- Notice that topCommand.js is reloaded.. because of $script in addHook:
- function addHook(hook, handler) {
- var scriptFile = $script.getPath().replace('\\', '/').replace('./scripts/', ''),
- i = getHookIndex(scriptFile, hook);
- if (hook == 'initReady') $.consoleLn(">> addHook: " + scriptFile + "[" + i + "] " + handler);
- if (i > -1) {
- hooks[i].handler = handler;
- } else {
- hooks.push(new Hook(scriptFile, hook, handler));
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment