Adding vip exempt to bot

so when i try to add this code to the bot i seem to get this wierd error and idea how to fix this maybe?

Error

[05-31-2019 @ 15:23:05.501 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: core/chatModerator.js: JavaScript Error: Encountered code generation error while compiling function "null": Program too complex: too big jump offset (chatModerator.js#1085)

Code

             /**
             * @commandpath moderation vips [links / caps / symbols / spam / emotes / colors / longmessages / spamtracker / fakepurge] [true / false] - Enable or disable if vips get moderated by that filter
             */
            if (action.equalsIgnoreCase('vips')) {
                if (!subAction) {
                    $.say($.whisperPrefix(sender) + $.lang.get('chatmoderator.vips.usage'));
                    return;
                }

                if (subAction.equalsIgnoreCase('links')) {
                    if (!args[2]) {
                        $.say($.whisperPrefix(sender) + $.lang.get('chatmoderator.vips.toggle.link', getModerationFilterStatus(vips.Links)));
                        return;
                    }

                    if (args[2].equalsIgnoreCase('true') || args[2].equalsIgnoreCase('false')) {
                        vips.Links = args[2].equalsIgnoreCase('true');
                        $.inidb.set('chatModerator', 'vipsModerateLinks', vips.Links);
                        $.say($.whisperPrefix(sender) + (vips.Links ? $.lang.get('chatmoderator.vips.links.allowed') : $.lang.get('chatmoderator.vips.links.not.allowed')));
                        $.log.event(sender + ' changed vips moderation for links to ' + args[2]);
                        return;
                    }
                } else if (subAction.equalsIgnoreCase('caps')) {
                    if (!args[2]) {
                        $.say($.whisperPrefix(sender) + $.lang.get('chatmoderator.vips.toggle.caps', getModerationFilterStatus(vips.Caps)));
                        return;
                    }

                    if (args[2].equalsIgnoreCase('true') || args[2].equalsIgnoreCase('false')) {
                        vips.Caps = args[2].equalsIgnoreCase('true');
                        $.inidb.set('chatModerator', 'vipsModerateCaps', vips.Caps);
                        $.say($.whisperPrefix(sender) + (vips.Caps ? $.lang.get('chatmoderator.vips.caps.allowed') : $.lang.get('chatmoderator.vips.caps.not.allowed')));
                        $.log.event(sender + ' changed vips moderation for caps to ' + args[2]);
                        return;
                    }
                } else if (subAction.equalsIgnoreCase('symbols')) {
                    if (!args[2]) {
                        $.say($.whisperPrefix(sender) + $.lang.get('chatmoderator.vips.toggle.symbols', getModerationFilterStatus(vips.Symbols)));
                        return;
                    }

                    if (args[2].equalsIgnoreCase('true') || args[2].equalsIgnoreCase('false')) {
                        vips.Symbols = args[2].equalsIgnoreCase('true');
                        $.inidb.set('chatModerator', 'vipsModerateSymbols', vips.Symbols);
                        $.say($.whisperPrefix(sender) + (vips.Symbols ? $.lang.get('chatmoderator.vips.symbols.allowed') : $.lang.get('chatmoderator.vips.symbols.not.allowed')));
                        $.log.event(sender + ' changed vips moderation for symbols to ' + args[2]);
                        return;
                    }
                } else if (subAction.equalsIgnoreCase('spam')) {
                    if (!args[2]) {
                        $.say($.whisperPrefix(sender) + $.lang.get('chatmoderator.vips.toggle.spam', getModerationFilterStatus(vips.Spam)));
                        return;
                    }

                    if (args[2].equalsIgnoreCase('true') || args[2].equalsIgnoreCase('false')) {
                        vips.Spam = args[2].equalsIgnoreCase('true');
                        $.inidb.set('chatModerator', 'vipsModerateSpam', vips.Spam);
                        $.say($.whisperPrefix(sender) + (vips.Spam ? $.lang.get('chatmoderator.vips.spam.allowed') : $.lang.get('chatmoderator.vips.spam.not.allowed')));
                        $.log.event(sender + ' changed vips moderation for spam to ' + args[2]);
                        return;
                    }
                } else if (subAction.equalsIgnoreCase('emotes')) {
                    if (!args[2]) {
                        $.say($.whisperPrefix(sender) + $.lang.get('chatmoderator.vips.toggle.emotes', getModerationFilterStatus(vips.Emotes)));
                        return;
                    }

                    if (args[2].equalsIgnoreCase('true') || args[2].equalsIgnoreCase('false')) {
                        vips.Emotes = args[2].equalsIgnoreCase('true');
                        $.inidb.set('chatModerator', 'vipsModerateEmotes', vips.Emotes);
                        $.say($.whisperPrefix(sender) + (vips.Emotes ? $.lang.get('chatmoderator.vips.emotes.allowed') : $.lang.get('chatmoderator.vips.emotes.not.allowed')));
                        $.log.event(sender + ' changed vips moderation for emotes to ' + args[2]);
                        return;
                    }
                } else if (subAction.equalsIgnoreCase('colors')) {
                    if (!args[2]) {
                        $.say($.whisperPrefix(sender) + $.lang.get('chatmoderator.vips.toggle.colors', getModerationFilterStatus(vips.Colors)));
                        return;
                    }

                    if (args[2].equalsIgnoreCase('true') || args[2].equalsIgnoreCase('false')) {
                        vips.Colors = args[2].equalsIgnoreCase('true');
                        $.inidb.set('chatModerator', 'vipsModerateColors', vips.Colors);
                        $.say($.whisperPrefix(sender) + (vips.Colors ? $.lang.get('chatmoderator.vips.colors.allowed') : $.lang.get('chatmoderator.vips.colors.not.allowed')));
                        $.log.event(sender + ' changed vips moderation for colors to ' + args[2]);
                        return;
                    }
                } else if (subAction.equalsIgnoreCase('longmessages')) {
                    if (!args[2]) {
                        $.say($.whisperPrefix(sender) + $.lang.get('chatmoderator.vips.toggle.long.msg', getModerationFilterStatus(vips.LongMsg)));
                        return;
                    }

                    if (args[2].equalsIgnoreCase('true') || args[2].equalsIgnoreCase('false')) {
                        vips.LongMsg = args[2].equalsIgnoreCase('true');
                        $.inidb.set('chatModerator', 'vipsModerateColors', vips.LongMsg);
                        $.say($.whisperPrefix(sender) + (vips.LongMsg ? $.lang.get('chatmoderator.vips.long.messages.allowed') : $.lang.get('chatmoderator.vips.long.messages.not.allowed')));
                        $.log.event(sender + ' changed vips moderation for long messages to ' + args[2]);
                        return;
                    }
                }
            }

Ok i have fixed this by adding a function vipCommands(event); and put it in that function and it worked now i know why that script has the extraCommands(event);

Hi, I was wondering if you’d be willing to share the script and language files? I would be pretty interested in it. Thanks a bunch!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.