Bots Home
|
Create an App
nepy-test
Author:
nepy_star
Description
Source Code
Launch Bot
Current Users
Created by:
Nepy_Star
const commandPrefix = '/'; const j4c_TIPTEXT = 'just4cindy'; const COLOR_KINGOFDAY = '#F9DBFE'; const COLOR_KINGOFKINGS = '#F07EDB'; const COLOR_just4cindy = '#618EB0'; const COLOR_just4cindy = '#618EB0'; const COLOR_VIPTICKETS = '#DAC0E9'; const COLOR_WHEEL = '#9D96F9'; const COLOR_BACKWARNING = '#FF0000'; const COLOR_TEXTWARNING = '#FFFFFF'; const COLOR_STARTAPP = '#FF0000'; const COLOR_INFO = '#0600FF'; const DEVNICK = 'Nepystar'; const TB_DEVNICK1 = 'cindy'; const TB_DEVNICK2 = 'cindy'; const APP_AUTOWHEEL = 'auto_wheel'; const APP_AUTOWHEELLONG = 'Auto-Reset Tip Goal & Wheel of Fortune'; const APP_AUTORESET = 'autoreset'; const APP_AUTORESETLONG = 'Auto-Reset Tip Goal'; const APP_WHEEL = 'wheel'; const APP_WHEELLONG = 'Wheel of Fortune'; const APP_VIPTICKETS = 'vip'; const APP_VIPTICKETSLONG = 'VIP Tickets'; const APP_just4cindy = 'j4c'; const APP_just4cindyLONG = 'cindy'; const APP_NOAPP = 'noapp'; const APP_NOAPPLONG = 'No application running'; const APP_KOK = 'kok'; const APP_KOKLONG = 'King of Kings'; const APP_KOD = 'kod'; const APP_KODLONG = 'King of the Day'; const CROWN_KOK = ':crown2 '; const CROWN_KOD = ':smallCrown '; const WELCOME_PIC = ':hello '; const ONLY_BC_MOD_FAN = 'This command is only available to the broadcaster, moderators and fans.'; const ONLY_BC_MOD = 'This command is only available to the broadcaster or moderators.'; const ONLY_BC_FAN = 'This command is only available to the broadcaster or fans.'; const ONLY_BC = 'This command is only available to the broadcaster.'; const HEADER_FOOTER = '===================================='; const CMD_STARTAPP = 'startapp'; const CMD_STOPAPP = 'stopapp'; const CMD_STARTVIPTICKETS = 'vipstart'; const CMD_STOPVIPTICKETS = 'vipstop'; const CMD_CHANGESTATUS = 'status'; const CMD_WHEELCHANGELIST = 'wprice'; const CMD_WHEELMULTISPIN = 'wmulti'; const CMD_CLEARVIPTICKETS = 'vipclear'; const CMD_TIMER = 'timer'; const CMD_TIMERSTOP = 'timerstop'; const CMD_ADDVIPTICKETS = 'vipadd'; const CMD_DELVIPTICKETS = 'vipdel'; const CMD_HELP = 'help'; const CMD_LB3 = 'lb3'; const CMD_LB = 'lb'; const CMD_WHEELREWARDS = 'rewards'; const CMD_CHECKVIPTICKETS = 'vipcheck'; const CMD_LISTVIPTICKETS = 'viplist'; var app_started = ''; var theBC = cb.room_slug; var timer_start; var timer_minutes = 60; var current_status = ''; var display_tip_amount = 'No'; var total_tip_noj4c = 0; var tippersArray = new Array; var display_lb3 = 'No'; tippersArray = []; var j4c_started = 'No'; var j4c_current_tip = 0; var j4c_notice = 0; var j4c_notice_cb = 0; var auto_times_goal_reached = 0; var auto_last_time_goal_reached = null; var auto_current_goal_tipped = 0; var auto_tip_goal = 0; var wheel_tip_amount = 0; var wheel_notice = 0; var wheel_rewards_dressed = new Array(); var wheel_rewards_naked = new Array(); var wheel_type = 'dressed'; var wheel_multi = 'no'; var vip_modfan_add = 'No'; var vip_tip_amount = 0; var vip_holders = new Array(); var vip_start_time; var vip_stop_time; var kok_activation = 'No'; var current_kok_name = ''; var current_kok_tip = 0; var kok_notice = 0; var kok_notice_cb = 0; var kod_activation = 'No'; var current_kod_name = ''; var current_kod_tip = 0; cb.settings_choices = [{ name: 'current_description', type: 'str', defaultValue: 'Hello Guys !', minLength: 1, maxLength: 255, label: 'Status of room?' }, { name: 'KingOfKingsActivation', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'Display a crown for the King of Kings?' }, { name: 'KingOfKingsUser', type: 'str', defaultValue: '', minLength: 1, maxLength: 255, label: 'Username of the King of Kings?' }, { name: 'KingOfKingsAmount', type: 'int', minValue: 0, default: 8100, label: 'Highest tip of the King of Kings?' }, { name: 'KingOfKingsNotice', type: 'int', minValue: 0, default: 777, label: 'Time interval to display the King of Kings notice in seconds (0 = never)?' }, { name: 'KingOfDayActivation', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'Display a crown for the best tipper of the day?' }, { name: 'TipAmountDisplay', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'Display tip totals at the beginning of messages?' }, { name: 'Leaderboard3Display', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'Display the top 3 leaderboard after each tip?' }, { name: 'AppStarted', type: 'choice', choice1: 'Auto-Reset Tip Goal & Wheel of Fortune', choice2: 'Auto-Reset Tip Goal', choice3: 'Wheel of Fortune', choice4: 'VIP Tickets', defaultValue: 'Auto-Reset Tip Goal + Wheel of Fortune', label: 'Which app(s) do you want to start?' }, { name: 'AutoResetGoal', type: 'int', minValue: 0, default: 666, label: 'Auto-Reset: Tokens to reach the goal?' }, { name: 'just4cindyStarted', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'Start the just4cindy Function?' }, { name: 'just4cindyNotice', type: 'int', minValue: 0, default: 30, label: 'Time interval to display the just4cindy notice in seconds (0 = never)?' }, { name: 'VIPTicketsAmount', type: 'int', minValue: 1, default: 111, label: 'VIP Ticket Price?' }, { name: 'VIPIncludeModsFans', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: 'Moderators and fans can add/del users (and themselves) to VIP Tickets list?' }, { name: 'VIPAutoMods', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: 'Automatically give Mods a VIP Ticket when they enter the room?' }, { name: 'VIPAutoFans', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: 'Automatically give Fans a VIP Ticket when they enter the room?' }, { name: 'WheelTipAmount', type: 'int', minValue: 1, default: 111, label: 'Tokens to spin the Wheel of Fortune?' }, { name: 'WheelMultiSpin', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: 'Enable multi-spin?' }, { name: 'WheelNotice', type: 'int', minValue: 0, default: 30, label: 'Time interval to display the Wheel of Fortune notice in seconds (0 = never)?' }, { name: 'pos1', type: 'str', minLength: 1, maxLength: 255, label: 'Wheel Reward Dressed 1', defaultValue: 'Required...', required: false }, { name: 'pos2', type: 'str', minLength: 1, maxLength: 255, label: 'Wheel Reward Dressed 2', defaultValue: 'Required...', required: false }, { name: 'pos3', type: 'str', minLength: 1, maxLength: 255, label: 'Wheel Reward Dressed 3', defaultValue: 'Required...', required: false }, { name: 'pos4', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 4', required: false }, { name: 'pos5', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 5', required: false }, { name: 'pos6', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 6', required: false }, { name: 'pos7', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 7', required: false }, { name: 'pos8', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 8', required: false }, { name: 'pos9', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 9', required: false }, { name: 'pos10', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 10', required: false }, { name: 'pos11', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 11', required: false }, { name: 'pos12', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 12', required: false }, { name: 'pos13', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 13', required: false }, { name: 'pos14', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 14', required: false }, { name: 'pos15', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 15', required: false }, { name: 'pos16', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 16', required: false }, { name: 'pos17', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 17', required: false }, { name: 'pos18', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 18', required: false }, { name: 'pos19', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 19', required: false }, { name: 'pos20', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 20', required: false }, { name: 'pos21', type: 'str', minLength: 0, maxLength: 255, label: 'Wheel Reward Dressed 21', required: false }]; cb.onDrawPanel(function (user) { var auto_number_reached = ''; if (auto_times_goal_reached == 0) { auto_j4c_number_reached = ' time(s) / Never'; auto_number_reached = 'Never' } else { auto_j4c_number_reached = ' time(s) / ' + Math.floor(((new Date()).getTime() - auto_last_time_goal_reached.getTime()) / 60000) + ' min ago'; auto_number_reached = '' + Math.floor(((new Date()).getTime() - auto_last_time_goal_reached.getTime()) / 60000) + ' min ago' } if ((app_started == APP_AUTOWHEEL) || (app_started == APP_AUTORESET)) { if (j4c_started == 'Yes') { return { 'template': '3_rows_of_labels', 'row1_label': 'Received / Goal (Total):', 'row1_value': '' + auto_current_goal_tipped + ' / ' + auto_tip_goal + ' (' + ((auto_times_goal_reached * auto_tip_goal) + auto_current_goal_tipped) + ')', 'row2_label': 'Tokens "just4cindy":', 'row2_value': '' + j4c_current_tip + ' tokens', 'row3_label': 'Hit Goal / Last Time:', 'row3_value': '' + auto_times_goal_reached + auto_j4c_number_reached } } else { return { 'template': '3_rows_of_labels', 'row1_label': 'Received / Goal (Total):', 'row1_value': '' + auto_current_goal_tipped + ' / ' + auto_tip_goal + ' (' + ((auto_times_goal_reached * auto_tip_goal) + auto_current_goal_tipped) + ')', 'row2_label': 'Hit Goal For:', 'row2_value': '' + auto_times_goal_reached + ' time(s)', 'row3_label': 'Last Reached:', 'row3_value': '' + auto_number_reached } } } else if (app_started == APP_WHEEL) { if (j4c_started == 'Yes') { return { 'template': '3_rows_11_21_31', 'row1_value': 'Wheel of Fortune - Multi: ' + wheel_multi, 'row2_value': 'Tip ' + wheel_tip_amount + ' tokens to spin the Wheel', 'row3_value': 'Tokens "just4cindy": ' + j4c_current_tip + ' tokens' } } else { return { 'template': '3_rows_11_21_31', 'row1_value': 'Wheel of Fortune - Multi: ' + wheel_multi, 'row2_value': 'Tip ' + wheel_tip_amount + ' tokens to spin the Wheel', 'row3_value': 'Type ' + commandPrefix + CMD_WHEELREWARDS + ' to display all rewards in chat' } } } else if (app_started == APP_VIPTICKETS) { if (j4c_started == 'Yes') { return { 'template': '3_rows_11_21_31', 'row1_value': 'VIP Tickets', 'row2_value': 'Price: ' + vip_tip_amount + ' tokens - Holders: ' + vip_holders.length, 'row3_value': 'Tokens "just4cindy": ' + j4c_current_tip + ' tokens' } } else { return { 'template': '3_rows_11_21_31', 'row1_value': 'VIP Tickets', 'row2_value': 'Ticket Holders: ' + vip_holders.length, 'row3_value': 'Tip ' + vip_tip_amount + ' tokens to get a ticket' } } } else { if (j4c_started == 'Yes') { return { 'template': '3_rows_11_21_31', 'row1_value': 'No App started', 'row2_value': 'Tokens without "just4cindy": ' + total_tip_noj4c + ' tokens', 'row3_value': 'Tokens "just4cindy": ' + j4c_current_tip + ' tokens' } } else { return { 'template': '3_rows_11_21_31', 'row1_value': 'No app started', 'row2_value': '', 'row3_value': 'Tokens received: ' + total_tip_noj4c + ' tokens' } } } }); cb.onTip(function (tip) { var tip_message = tip['message']; var number_spin = 0; tip_message = tip_message.toLowerCase(); cb.log("Tip detected"); var indexTipper = findTipper(tip['from_user'], 'add'); cb.log("Tipper: " + tip['from_user'] + " - Index: " + indexTipper + " - Tip amount: " + tip['amount']); tippersArray[indexTipper][1] = tippersArray[indexTipper][1] + parseInt(tip['amount']); cb.log("Display Top 3 Leaderboard: " + display_lb3); if (display_lb3 === 'Yes') { displayTop3Leaderboard('all') } isKingOfDay(tip['from_user'], tip['amount']); isKingOfKings(tip['from_user'], tip['amount']); if ((j4c_started === 'Yes') && (startsWith(tip_message, j4c_TIPTEXT))) { j4c_current_tip += tip['amount']; notice_just4cindy_tip(tip['from_user']) } else { total_tip_noj4c += tip['amount']; if (startsWith(tip_message, j4c_TIPTEXT)) { notice_j4c_notactivated(tip['from_user']) } if (app_started === APP_AUTOWHEEL) { auto_current_goal_tipped += tip['amount']; if (auto_current_goal_tipped >= auto_tip_goal) { auto_goalReached(tip['from_user']) } if (tip['amount'] >= wheel_tip_amount) { number_spin = Math.floor(tip['amount'] / wheel_tip_amount) } else { number_spin = 0 } cb.log("Number of spin: " + number_spin); if ((number_spin > 0) && (wheel_multi == 'yes')) { cb.sendNotice('Spining the wheel for ' + tip['from_user'] + ' (' + number_spin + ' time(s))...'); cb.log("Number of spin: " + number_spin); spinWheel(tip['from_user'], number_spin) } else if (number_spin > 0) { cb.sendNotice("Spining the wheel for " + tip['from_user'] + " (1 time)..."); cb.log("Numberof spin: 1"); spinWheel(tip['from_user'], 1) } ChangeStatus(current_status); start_myapp() } else if (app_started === APP_AUTORESET) { auto_current_goal_tipped += tip['amount']; if (auto_current_goal_tipped >= auto_tip_goal) { auto_goalReached(tip['from_user']) } ChangeStatus(current_status); start_myapp() } else if (app_started === APP_WHEEL) { if (tip['amount'] >= wheel_tip_amount) { number_spin = Math.floor(tip['amount'] / wheel_tip_amount) } else { number_spin = 0 } if ((number_spin > 0) && (wheel_multi == 'yes')) { cb.sendNotice('Spining the wheel for ' + tip['from_user'] + ' (' + number_spin + ' time(s)...)'); cb.log("Number of spin: " + number_spin); spinWheel(tip['from_user'], number_spin) } else if (number_spin > 0) { cb.sendNotice("Spining the wheel for " + tip['from_user'] + " (1 time)..."); cb.log("Number of spin: 1"); spinWheel(tip['from_user'], 1) } } else if (app_started === APP_VIPTICKETS) { if (tip['amount'] >= vip_tip_amount) { if (!cb.limitCam_userHasAccess(tip['from_user'])) { vip_holders.push(tip['from_user']); cb.limitCam_addUsers([tip['from_user']]); cb.log("User " + tip['from_user'] + " tipped " + tip['amount'] + " and got a ticket for " + APP_VIPTICKETSLONG); cb.sendNotice("You received a ticket for the " + APP_VIPTICKETSLONG + "! thanks for your tip.", tip['from_user'], '', COLOR_INFO); cb.sendNotice(tip['from_user'] + " received a ticket for the " + APP_VIPTICKETSLONG + ".", theBC, '', COLOR_INFO); start_myapp() } else { cb.log("User " + tip['from_user'] + " tipped " + tip['amount'] + " but has already a ticket for " + APP_VIPTICKETSLONG); cb.sendNotice("You already have a ticket for the " + APP_VIPTICKETSLONG + ". thanks for your tip.", tip['from_user'], '', COLOR_INFO) } } } } cb.drawPanel() }); cb.onEnter(function (viewer) { var user = viewer['user']; var isMod = viewer['is_mod']; var isFan = viewer['in_fanclub']; var isDev = ((user == DEVNICK) || (user == TB_DEVNICK1) || (user == TB_DEVNICK2)); var running_app = ''; var text_app = ''; var outnot = ''; if (app_started == APP_AUTOWHEEL) { running_app = APP_AUTOWHEELLONG; text_app = " - Notice every " + (wheel_notice / 1000) + " sec. - Multi-spin: " + wheel_multi } else if (app_started == APP_AUTORESET) { running_app = APP_AUTORESETLONG } else if (app_started == APP_WHEEL) { running_app = APP_WHEELLONG; text_app = " - Notice every " + (wheel_notice / 1000) + " sec. - Multi-spin: " + wheel_multi } else if (app_started == APP_VIPTICKETS) { running_app = APP_VIPTICKETSLONG } else { running_app = APP_NOAPPLONG } if (user === theBC) { cb.sendNotice(getCommandList(user, isMod, isFan, isDev), user, '', COLOR_INFO) } else { outnot += WELCOME_PIC + "\n" + HEADER_FOOTER; outnot += "\n\nWelcome to " + theBC + "'s Room, " + user; outnot += "\n\nRunning application(s): " + running_app + text_app; outnot += "\n" + APP_just4cindyLONG + " activation: " + j4c_started + " - Notice every " + (j4c_notice / 1000) + " sec."; outnot += "\n" + APP_KOKLONG + " activation: " + kok_activation + " - Notice every " + (kok_notice / 1000) + " sec."; outnot += "\n" + APP_KODLONG + " activation: " + kod_activation; outnot += "\n\n" + HEADER_FOOTER; cb.sendNotice(outnot, user, '', COLOR_INFO) } if ((cb.settings.VIPAutoMods === 'Yes') && (isMod) && (app_started === APP_VIPTICKETS) && (!cb.limitCam_userHasAccess(user))) { vip_holders.push(user); cb.limitCam_addUsers([user]); cb.sendNotice("You have automatically been added to the " + APP_VIPTICKETSLONG + " list of ticket holders, because you are moderator.", user, '', COLOR_INFO); cb.sendNotice(user + " has automatically been added to the " + APP_VIPTICKETSLONG + " list of ticket holders, because he is moderator.", theBC, '', COLOR_INFO) } if ((cb.settings.VIPAutoFans === 'Yes') && (isFan) && (app_started === APP_VIPTICKETS) && (!cb.limitCam_userHasAccess(user))) { vip_holders.push(user); cb.limitCam_addUsers([user]); cb.sendNotice("You have automatically been added to the " + APP_VIPTICKETSLONG + " list of ticket holders, because you are fan.", user, '', COLOR_INFO); cb.sendNotice(user + " has automatically been added to the " + APP_VIPTICKETSLONG + " list of ticket holders, because he is fan.", theBC, '', COLOR_INFO) } }); cb.onLeave(function (viewer) { var user = viewer['user']; if ((app_started === APP_VIPTICKETS) && (cb.limitCam_userHasAccess(user))) { cb.sendNotice("User " + user + " has left the room, but has a ticket for the " + APP_VIPTICKETSLONG + ". You can remove him from the list by typing '" + commandPrefix + CMD_DELVIPTICKETS + " " + user + "'.", theBC, '', COLOR_INFO) } }); cb.onMessage(function (msg) { cb.log("Message detected"); if (msg['m'][0] == commandPrefix) { cb.log("Command maybe detected"); var regexCommandSplit = '^' + commandPrefix + '(\\S+)(?:\\b\\s*)(.*)?'; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); var cmdSplit = msg['m'].match(reCmdSplit); var cmd; var cmdval; var cmdValArray; if (cmdSplit) { cmd = cmdSplit[1]; cmdval = cmdSplit[2]; if (cmdval != null) { cmdval = cmdval.replace(/^\s+|\s+$/g, '') } if (cmdval != null) { cmdValArray = cmdval.split(regexListSplit) } else { cmdValArray = '' } } } var m = msg['m']; var user = msg['user']; var isBC = (user == theBC); var isMod = msg['is_mod']; var isFan = msg['in_fanclub']; var isDev = ((user == DEVNICK) || (user == TB_DEVNICK1) || (user == TB_DEVNICK2)); switch (cmd) { case CMD_LB3: if (cmdval) { if ((isBC) || (isMod) || (isFan) || (isDev)) { if (cmdval == 'all') { cb.log("User " + user + " send the Top 3 Leaderboard to all users."); displayTop3Leaderboard('all') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command not correct."); cb.sendNotice("Usage: " + commandPrefix + CMD_LB3 + "\nUse '" + commandPrefix + CMD_LB3 + " all' to send the Top 3 Leaderboard to all user.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC, mod and fan"); cb.sendNotice(ONLY_BC_MOD_FAN + "\nUse '" + commandPrefix + CMD_LB3 + "' to display the Top 3 Leaderboard.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("Displaying Top 3 Leaderboard to " + user); displayTop3Leaderboard(user) } msg['X-Spam'] = true; break; case CMD_LB: if (cmdval) { if ((isBC) || (isMod) || (isFan) || (isDev)) { if (cmdval == 'all') { cb.log("User " + user + " send the Leaderboard to all users."); displayLeaderboard('all') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command not correct."); cb.sendNotice("Usage: " + commandPrefix + CMD_LB + "\nUse '" + commandPrefix + CMD_LB + " all' to send the Leaderboard to all user.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC, mod and fan."); cb.sendNotice(ONLY_BC_MOD_FAN + "\nUse '" + commandPrefix + CMD_LB + "' to display the Leaderboard.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("Displaying Leaderboard to " + user); displayLeaderboard(user) } msg['X-Spam'] = true; break; case CMD_WHEELCHANGELIST: if ((app_started == APP_AUTOWHEEL) || (app_started == APP_WHEEL)) { if (cmdval) { if ((isBC) || (isDev)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command not correct."); cb.sendNotice("Usage: " + commandPrefix + CMD_WHEELCHANGELIST + "\nUse '" + commandPrefix + CMD_WHEELCHANGELIST + "' to change from 'dressed' to 'naked' or from 'naked' to 'dressed'.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC."); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { if ((isBC) || (isDev)) { var old_wheel_type; if (wheel_type == 'dressed') { old_wheel_type = 'dressed'; wheel_type = 'naked' } else { old_wheel_type = 'naked'; wheel_type = 'dressed' } cb.log("Wheel of Fortune Prices List changed by " + user + ". From '" + old_wheel_type + "' to '" + wheel_type + "'."); cb.sendNotice("The prices list of the Wheel of Fortune has been set to '" + wheel_type + "' by " + user, '', '', COLOR_INFO, 'bolder') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC."); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. The Wheel of Fortune app is not started."); cb.sendNotice("Command incorrect. The Wheel of Fortune is not started.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_WHEELREWARDS: if ((app_started == APP_AUTOWHEEL) || (app_started == APP_WHEEL)) { if (cmdval) { if ((isBC) || (isMod) || (isFan) || (isDev)) { if (cmdval == 'all') { cb.log("User " + user + " send the Wheel of Fortune Rewards List '" + wheel_type + "' to all users."); DisplayWheelRewardsList('all') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command not correct."); cb.sendNotice("Usage: " + commandPrefix + CMD_WHEELREWARDS + "\nUse '" + commandPrefix + CMD_WHEELREWARDS + " all' to send the Wheel Rewards List to all user.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC, mod and fan."); cb.sendNotice(ONLY_BC_MOD_FAN + "\nUse '" + commandPrefix + CMD_WHEELREWARDS + "' to display the Wheel of Fortune Rewards List.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("Displaying Wheel Rewards List '" + wheel_type + "' to " + user + "."); DisplayWheelRewardsList(user) } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. The Wheel of Fortune app is not started."); cb.sendNotice("Command incorrect. The Wheel of Fortune is not started.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_HELP: cb.log("User " + user + " called the help."); cb.sendNotice(getCommandList(user, isMod, isFan, isDev), user, '', COLOR_INFO); msg['X-Spam'] = true; break; case CMD_STARTAPP: if ((isBC) || (isDev)) { if (cmdval) { switch (cmdval) { case APP_AUTOWHEEL: if (app_started == APP_AUTOWHEEL) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App already running."); cb.sendNotice(APP_AUTOWHEELLONG + " are already running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { app_started = APP_AUTOWHEEL; cb.log("User " + user + " started '" + APP_AUTOWHEELLONG + "'. App running: " + app_started); start_myapp(); wheel_activation = 'Yes'; wheel_notice = wheel_notice_cb; noticeWheelOfFortune(); DisplayChangeApp() } break; case APP_AUTORESET: if ((app_started == APP_AUTORESET) || (app_started == APP_AUTOWHEEL)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App already running."); cb.sendNotice(APP_AUTORESETLONG + " is already running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { app_started = APP_AUTORESET; cb.log("User " + user + " started '" + APP_AUTORESETLONG + "'."); start_myapp(); DisplayChangeApp() } break; case APP_WHEEL: if ((app_started == APP_WHEEL) || (app_started == APP_AUTOWHEEL)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App already running."); cb.sendNotice(APP_WHEELLONG + " is already running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { app_started = APP_WHEEL; cb.log("User " + user + " started '" + APP_WHEELLONG + "'. App running: " + app_started); wheel_activation = 'Yes'; wheel_notice = wheel_notice_cb; noticeWheelOfFortune(); start_myapp(); DisplayChangeApp() } break; case APP_VIPTICKETS: if (app_started == APP_VIPTICKETS) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App already running."); cb.sendNotice(APP_VIPTICKETSLONG + " is already running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { app_started = APP_VIPTICKETS; vip_holders = []; wheel_activation = 'No'; cb.log("User " + user + " started '" + APP_VIPTICKETSLONG + "'. App running: " + app_started); start_myapp(); DisplayChangeApp() } break; case APP_just4cindy: if (j4c_started == 'Yes') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App already running."); cb.sendNotice(APP_just4cindyLONG + " is already running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " started '" + APP_just4cindyLONG + "'."); j4c_started = 'Yes'; j4c_notice = j4c_notice_cb; noticejust4cindy(); start_myapp(); DisplayChangeApp() } break; case APP_KOK: if (kok_activation == 'Yes') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App already running."); cb.sendNotice(APP_KOKLONG + " is already running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " started '" + APP_KOKLONG + "'."); kok_activation = 'Yes'; kok_notice = kok_notice_cb; noticeKingOfKings(); start_myapp(); DisplayChangeApp() } break; case APP_KOD: if (kod_activation == 'Yes') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App already running."); cb.sendNotice(APP_KODLONG + " is already running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " started '" + APP_KODLONG + "'."); kod_activation = 'Yes'; start_myapp(); DisplayChangeApp() } break; default: cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command does not exist."); cb.sendNotice("This command does not exist.\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_AUTOWHEEL + "' to start the " + APP_AUTOWHEELLONG + ".\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_AUTORESET + "' to start only the " + APP_AUTORESETLONG + ".\n Use '" + commandPrefix + CMD_STARTAPP + " " + APP_WHEEL + "' to start only the " + APP_WHEELLONG + ".\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_VIPTICKETS + "' to start the " + APP_VIPTICKETSLONG + ".\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_just4cindy + "' to start the " + APP_just4cindyLONG + "\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_KOK + "' to start the " + APP_KOKLONG + "\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_KOD + "' to start the " + APP_KODLONG + ".", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder'); break } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command not correct."); cb.sendNotice("Usage: " + commandPrefix + CMD_STARTAPP + " <short name of the app>\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_AUTOWHEEL + "' to start the " + APP_AUTOWHEELLONG + ".\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_AUTORESET + "' to start only the " + APP_AUTORESETLONG + ".\n Use '" + commandPrefix + CMD_STARTAPP + " " + APP_WHEEL + "' to start only the " + APP_WHEELLONG + ".\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_VIPTICKETS + "' to start the " + APP_VIPTICKETSLONG + ".\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_just4cindy + "' to start the " + APP_just4cindyLONG + "\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_KOK + "' to start the " + APP_KOKLONG + "\nUse '" + commandPrefix + CMD_STARTAPP + " " + APP_KOD + "' to start the " + APP_KODLONG + ".", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC."); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_STOPAPP: if ((isBC) || (isDev)) { if (cmdval) { switch (cmdval) { case APP_AUTOWHEEL: if (app_started == APP_AUTOWHEEL) { cb.log("User " + user + " stopped " + APP_AUTOWHEEL + ". No app running now."); app_started = APP_NOAPP; wheel_activation = 'No'; wheel_notice = 0; noticeWheelOfFortune(); start_myapp(); DisplayChangeApp() } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App is not running."); cb.sendNotice(APP_AUTOWHEELLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } break; case APP_AUTORESET: if (app_started == APP_AUTOWHEEL) { cb.log("User " + user + " stopped " + APP_AUTORESET + ". " + APP_WHEELLONG + " is still running."); app_started = APP_WHEEL; start_myapp(); DisplayChangeApp() } else if (app_started == APP_AUTORESET) { cb.log("User " + user + " stopped " + APP_AUTORESET + ". No app running now."); app_started = APP_NOAPP; start_myapp(); DisplayChangeApp() } else { cb.log("User " + user + " tried to use '" + msg['m'] + ". App is not running."); cb.sendNotice(APP_AUTORESETLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } break; case APP_WHEEL: if (app_started == APP_AUTOWHEEL) { cb.log("User " + user + " stopped " + APP_WHEEL + ". " + APP_AUTORESET + " is still running."); app_started = APP_AUTORESET; wheel_activation = 'No'; wheel_notice = 0; noticeWheelOfFortune(); start_myapp(); DisplayChangeApp() } else if (app_started == APP_WHEEL) { cb.log("User " + user + " stopped " + APP_WHEEL + ". No app running now."); app_started = APP_NOAPP; wheel_activation = 'No'; wheel_notice = 0; noticeWheelOfFortune(); start_myapp(); DisplayChangeApp() } else { cb.log("User " + user + " tried to use '" + msg['m'] + ". App is not running."); cb.sendNotice(APP_AUTOWHEELLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } break; case APP_VIPTICKETS: if (app_started == APP_VIPTICKETS) { cb.log("User " + user + " stopped '" + APP_VIPTICKETS + "'. No app running now."); app_started = APP_NOAPP; start_myapp(); DisplayChangeApp() } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App is not running."); cb.sendNotice(APP_VIPTICKETSLONG + " is not running.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } break; case APP_just4cindy: if (j4c_started == 'No') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App is not nunning."); cb.sendNotice(APP_just4cindyLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " stopped '" + APP_just4cindyLONG + "'."); j4c_started = 'No'; j4c_notice = 0; noticejust4cindy(); start_myapp(); DisplayChangeApp() } break; case APP_KOK: if (kok_activation == 'No') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App is not running."); cb.sendNotice(APP_KOKLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " stopped '" + APP_KOKLONG + "'."); kok_activation = 'No'; kok_notice = 0; noticeKingOfKings(); start_myapp(); DisplayChangeApp() } break; case APP_KOD: if (kod_activation == 'No') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. App is not running."); cb.sendNotice(APP_KODLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " stopped '" + APP_KODLONG + "'."); kod_activation = 'No'; start_myapp(); DisplayChangeApp() } break; default: cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command does not exist."); cb.sendNotice("This command does not exist.\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_AUTOWHEEL + "' to stop the " + APP_AUTOWHEELLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_AUTORESET + "' to stop only the " + APP_AUTORESETLONG + ".\n Use '" + commandPrefix + CMD_STOPAPP + " " + APP_WHEEL + "' to stop only the " + APP_WHEELLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_VIPTICKETS + "' to stop the " + APP_VIPTICKETSLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_just4cindy + "' to stop the " + APP_just4cindyLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_KOK + "' to stop the " + APP_KOKLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_KOD + "' to stop the " + APP_KODLONG + ".", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder'); break; break } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command not correct."); cb.sendNotice("Usage: " + commandPrefix + CMD_STOPAPP + " <short name of the app>\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_AUTOWHEEL + "' to stop the " + APP_AUTOWHEELLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_AUTORESET + "' to stop only the " + APP_AUTORESETLONG + ".\n Use '" + commandPrefix + CMD_STOPAPP + " " + APP_WHEEL + "' to stop only the " + APP_WHEELLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_VIPTICKETS + "' to stop the " + APP_VIPTICKETSLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_just4cindy + "' to stop the " + APP_just4cindyLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_KOK + "' to stop the " + APP_KOKLONG + ".\nUse '" + commandPrefix + CMD_STOPAPP + " " + APP_KOD + "' to stop the " + APP_KODLONG + ".", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC."); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_ADDVIPTICKETS: if (app_started == APP_VIPTICKETS) { if ((((isMod) || (isFan)) && (vip_modfan_add == 'Yes')) || (isBC) || (isDev)) { if (cmdval) { if (cbjs.arrayContains(vip_holders, cmdval)) { cb.log("User " + user + " tried to add '" + cmdval + "' to the " + APP_VIPTICKETSLONG + " List. User already in the " + APP_VIPTICKETSLONG + " List."); cb.sendNotice("User '" + cmdval + "' is already in the " + APP_VIPTICKETSLONG + " List!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { vip_holders.push(cmdval); cb.limitCam_addUsers([cmdval]); cb.log("User " + user + " added '" + cmdval + "' to the " + APP_VIPTICKETSLONG + " List."); if (!isBC) { cb.sendNotice("Viewer '" + cmdval + "' added to the " + APP_VIPTICKETSLONG + " List by " + user + ".", theBC, '', COLOR_INFO) } cb.sendNotice("You were added in the " + APP_VIPTICKETSLONG + " List by " + user + ".", cmdval, '', COLOR_INFO); cb.sendNotice("User '" + cmdval + "' correctly added to the " + APP_VIPTICKETSLONG + " List.", user, '', COLOR_INFO); start_myapp() } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_ADDVIPTICKETS + " <nickname>", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { if (vip_modfan_add == 'Yes') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC, mods and fans."); cb.sendNotice(ONLY_BC_MOD_FAN, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { if ((isMod) || (isFan)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Function not activated for mods and fans."); cb.sendNotice("The Broadcaster has disabled this function for mods and fans.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC."); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } } } else { if ((((isMod) || (isFan)) && (vip_modfan_add == 'Yes')) || (isBC) || (isDev)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. " + APP_VIPTICKETSLONG + " is not running."); cb.sendNotice(APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else if ((isMod) || (isFan)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. " + APP_VIPTICKETSLONG + " is not running and function disabled for mods and fans."); cb.sendNotice(APP_VIPTICKETSLONG + " is not running and the Broadcaster has disabled this function for mods and fans.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for Broadcaster and, maybe, moda and fans."); if (vip_modfan_add == 'Yes') { cb.sendNotice(ONLY_BC_MOD_FAN + " And " + APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.sendNotice(ONLY_BC + " And " + APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } } msg['X-Spam'] = true; break; case CMD_DELVIPTICKETS: if (app_started == APP_VIPTICKETS) { if ((((isMod) || (isFan)) && (vip_modfan_add == 'Yes')) || (isBC) || (isDev)) { if (cmdval) { if (cbjs.arrayContains(vip_holders, cmdval)) { vip_holders = cbjs.arrayRemove(vip_holders, cmdval); cb.limitCam_removeUsers([cmdval]); cb.log("User " + user + " deleted '" + cmdval + "' from the " + APP_VIPTICKETSLONG + " List."); if (!isBC) { cb.sendNotice(" Viewer '" + cmdval + "' deleted from the " + APP_VIPTICKETSLONG + " List by " + user + ".", theBC, '', COLOR_INFO) } cb.sendNotice("You were deleted from the " + APP_VIPTICKETSLONG + " List by " + user + ".", cmdval, '', COLOR_INFO); cb.sendNotice("User '" + cmdval + "' correctly deleted from the " + APP_VIPTICKETSLONG + " List!", user, '', COLOR_INFO); start_myapp() } else { cb.log("User " + user + " tried to delete '" + cmdval + "' from the " + APP_VIPTICKETSLONG + " List. User is not in the " + APP_VIPTICKETSLONG + " List."); cb.sendNotice("User '" + cmdval + "' is not in the " + APP_VIPTICKETSLONG + " List!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_DELVIPTICKETS + " <nickname>", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { if (vip_modfan_add == 'Yes') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC, mods and fans."); cb.sendNotice(ONLY_BC_MOD_FAN, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { if ((isMod) || (isFan)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Function not activated for mods and fans."); cb.sendNotice("The Broadcaster has disabled this function for mods and fans.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC."); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } } } else { if ((((isMod) || (isFan)) && (vip_modfan_add == 'Yes')) || (isBC) || (isDev)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. " + APP_VIPTICKETSLONG + " is not running."); cb.sendNotice(APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else if ((isMod) || (isFan)) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. " + APP_VIPTICKETSLONG + " is not running and function disabled for mods and fans."); cb.sendNotice(APP_VIPTICKETSLONG + " is not running and the Broadcaster has disabled this function for mods and fans.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for Broadcaster and, maybe, mods and fans."); if (vip_modfan_add == 'Yes') { cb.sendNotice(ONLY_BC_MOD_FAN + " And " + APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { cb.sendNotice(ONLY_BC + " And " + APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } } msg['X-Spam'] = true; break; case CMD_CHECKVIPTICKETS: if (app_started == APP_VIPTICKETS) { if (cmdval) { if ((cb.limitCam_userHasAccess(cmdval)) && (cbjs.arrayContains(vip_holders, cmdval))) { cb.log("User " + user + " checked if '" + cmdval + "' is in the " + APP_VIPTICKETSLONG + " list. User is in the list."); cb.sendNotice("User '" + cmdval + "' is in the " + APP_VIPTICKETSLONG + " list.", user, '', COLOR_INFO) } else if (cb.limitCam_userHasAccess(cmdval)) { vip_holders.push(cmdval); cb.log("User " + user + " checked if '" + cmdval + "' is in the " + APP_VIPTICKETSLONG + " list. User is in the list."); cb.log("User '" + cmdval + "' was not in the array 'vip_holders' but in the API array. User added."); cb.sendNotice("User '" + cmdval + "' is in the " + APP_VIPTICKETSLONG + " list.", user, '', COLOR_INFO) } else if (cbjs.arrayContains(vip_holders, cmdval)) { cb.limitCam_addUsers([cmdval]); cb.log("User " + user + " checked if '" + cmdval + "' is in the " + APP_VIPTICKETSLONG + " list. User is in the list."); cb.log("User '" + cmdval + "' was not in the API array but in the array 'vip_holders'. User added."); cb.sendNotice("User '" + cmdval + "' is in the " + APP_VIPTICKETSLONG + " list.", user, '', COLOR_INFO) } else { cb.log("User " + user + " checked if '" + cmdval + "' is in the " + APP_VIPTICKETSLONG + " List. User is not in the list."); cb.sendNotice("User '" + cmdval + "' is not in the " + APP_VIPTICKETSLONG + " list.", user, '', COLOR_INFO) } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_CHECKVIPTICKETS + " <nickname>", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. " + APP_VIPTICKETSLONG + " is not running."); cb.sendNotice(APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_LISTVIPTICKETS: if (cmdval) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_LISTVIPTICKETS, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { if (vip_holders.length > 0) { var outlist = ""; outlist += vip_holders.length + (vip_holders.length > 1 ? " users" : " user") + " in the " + APP_VIPTICKETSLONG + " list\n" + HEADER_FOOTER + "\n" + cbjs.arrayJoin(vip_holders, " - "); cb.sendNotice(outlist, user, '', COLOR_INFO) } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. No user in the " + APP_VIPTICKETSLONG + " list."); cb.sendNotice("There is no user in the " + APP_VIPTICKETSLONG + " List!", user, '', COLOR_INFO) } } msg['X-Spam'] = true; break; case CMD_STARTVIPTICKETS: if ((isBC) || (isDev)) { if (app_started === APP_VIPTICKETS) { if (cmdval) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_STARTVIPTICKETS, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { if (!cb.limitCam_isRunning()) { vip_start_time = new Date(); cb.limitCam_start(APP_VIPTICKETSLONG + "\n\nHidden Show in progress! Tip at least " + vip_tip_amount + " tokens to join in on the fun!"); ChangeStatus(APP_VIPTICKETSLONG + ": Hidden Show in progress! Tip at least " + vip_tip_amount + " tokens to join in on the fun!"); cb.log("Hidden Show started by " + user); cb.sendNotice("Hidden Show in progress. Viewers: " + vip_holders.length + " - " + cbjs.arrayJoin(vip_holders, " - "), user, '', COLOR_INFO); cb.sendNotice("\nDon't forget to stop the Hidden Show with the command '" + commandPrefix + CMD_STOPVIPTICKETS + "' when the show is finished.", user, '', COLOR_INFO) } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Hidden show is already running."); cb.sendNotice("The hidden show is already in progress!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } } else { cb.log("User " + user + " tried to use '" + msg['m'] + ". " + APP_VIPTICKETSLONG + " is not running."); cb.sendNotice(APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC"); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_STOPVIPTICKETS: if ((isBC) || (isDev)) { if (app_started === APP_VIPTICKETS) { if (cmdval) { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_STOPVIPTICKETS, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { if (cb.limitCam_isRunning()) { vip_stop_time = new Date(); cb.limitCam_stop(); ChangeStatus(current_status); cb.log("Hidden Show stopped by " + user); cb.sendNotice("There is/are still users in the " + APP_VIPTICKETSLONG + " list. Use '" + commandPrefix + CMD_CLEARVIPTICKETS + "' to clear the " + APP_VIPTICKETSLONG + " list.", user, '', COLOR_INFO) } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Hidden Show is not running."); cb.sendNotice("The Hidden Show is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. " + APP_VIPTICKETSLONG + " is not running."); cb.sendNotice(APP_VIPTICKETSLONG + " is not running!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC"); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_CLEARVIPTICKETS: if ((isBC) || (isDev)) { if (!cmdval) { if (!cb.limitCam_isRunning()) { for (var i = 0; i < vip_holders.length; i++) { if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), vip_holders[0])) { cb.limitCam_removeUsers([vip_holders[0]]) } } vip_holders = []; cb.log("User " + user + " cleared the " + APP_VIPTICKETSLONG + " list."); cb.sendNotice(APP_VIPTICKETSLONG + " list is now empty.", user, '', COLOR_INFO); start_myapp() } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. List can only be cleared when Hidden Show is off."); cb.sendNotice(APP_VIPTICKETSLONG + " list can only be cleared when Hidden Show is not running.", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_CLEARVIPTICKETS, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC"); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_CHANGESTATUS: if ((isBC) || (isDev)) { if (cmdval) { ChangeStatus(cmdval); current_status = cmdval; cb.log("User " + user + " has changed the status of the room to '" + cmdval + "'."); cb.sendNotice("Status of the room correctly changed.", user, '', COLOR_INFO) } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_CHANGESTATUS + " <your text here>", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC"); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_WHEELMULTISPIN: if ((isBC) || (isDev)) { if ((app_started == APP_AUTOWHEEL) || (app_started == APP_WHEEL)) { if (cmdval) { if (cmdval == 'yes') { if (wheel_multi == 'yes') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Multi-Spin already activated."); cb.sendNotice("The multi-spin of Wheel of Fortune is already enable!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { wheel_multi = 'yes'; cb.log("User " + user + " activated the multi-spin."); cb.sendNotice("The multi-spin of Wheel of Fortune is now enable.", user, '', COLOR_INFO); DisplayChangeApp(); start_myapp() } } else if (cmdval == 'no') { if (wheel_multi == 'no') { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Multi-Spin already deactivated."); cb.sendNotice("The multi-spin of Wheel of Fortune is already disable!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } else { wheel_multi = 'no'; cb.log("User " + user + " deactivated the multi-spin."); cb.sendNotice("The multi-spin of Wheel of Fortune is now disable.", user, '', COLOR_INFO); DisplayChangeApp(); start_myapp() } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_WHEELMULTISPIN + " <yes or no>\nyes: Enable the multi-spin, no: Disable the multi-spin", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_WHEELMULTISPIN + " <yes or no>\nyes: Enable the multi-spin, no: Disable the multi-spin", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Wheel of Fortune not started."); cb.sendNotice("The Auto-Wheel of Fortune is not started!", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Only for BC."); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_TIMER: if ((isBC) || (isDev)) { if ((cmdval) && (!isNaN(cmdval)) && (cmdval > 0)) { cb.log("Timer started by user " + user + " with " + cmdval + " minutes."); start_timer(cmdval) } else { cb.log("User " + user + " tried to use '" + msg['m'] + "'. Command incorrect."); cb.sendNotice("Usage: " + commandPrefix + CMD_TIMER + " <number of minutes>", user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } } else { cb.log("User " + user + " tried to start '" + msg['m'] + "'. Only for BC"); cb.sendNotice(ONLY_BC, user, COLOR_BACKWARNING, COLOR_TEXTWARNING, 'bolder') } msg['X-Spam'] = true; break; case CMD_TIMERSTOP: start_timer(0); msg['X-Spam'] = true; break } if (!msg['X-Spam']) { if (display_tip_amount == 'Yes') { msg['m'] = message_TipAmount(msg['user'], msg['m']) } cb.log(msg['user'] + " - " + current_kok_name + " - " + current_kod_name); if (msg['user'] == current_kok_name) { cb.log("King of Kings"); msg['background'] = COLOR_KINGOFKINGS; msg['m'] = message_KingOfKings(msg['user'], msg['m']) } else if (msg['user'] == current_kod_name) { cb.log("King of the Day"); msg['background'] = COLOR_KINGOFDAY; msg['m'] = message_KingOfDay(msg['user'], msg['m']) } else { cb.log("No king") } } return msg }); function start_timer(minutes) { var outtimer = ''; timer_minutes = minutes; outtimer += HEADER_FOOTER + "\n\n"; outtimer += "Timer is running!\n\n"; if (timer_minutes === 0) { outtimer += "Time is up!\n\n"; outtimer += HEADER_FOOTER; cb.sendNotice(outtimer, '', '', COLOR_BACKWARNING) } else { outtimer += "Time left to reach the goal: " + timer_minutes + " minute(s)\n\n"; outtimer += HEADER_FOOTER; cb.sendNotice(outtimer, '', '', COLOR_INFO) } if (timer_minutes > 10) { cb.setTimeout(notice_timer, (2 * 60000)) } else if (timer_minutes > 0) { cb.setTimeout(notice_timer, (1 * 60000)) } } function notice_timer() { var outtimer = ''; if ((timer_minutes <= 10) && (timer_minutes > 0)) { timer_minutes-- } else { timer_minutes = timer_minutes - 2 } outtimer += HEADER_FOOTER + "\n\n"; outtimer += "Timer is running!\n\n"; if (timer_minutes === 0) { outtimer += "Time is up!\n\n"; outtimer += HEADER_FOOTER; cb.sendNotice(outtimer, '', '', COLOR_BACKWARNING) } else { outtimer += "Time left to reach the goal: " + timer_minutes + " minute(s)\n\n"; outtimer += HEADER_FOOTER; cb.sendNotice(outtimer, '', '', COLOR_INFO) } if (timer_minutes > 10) { cb.setTimeout(notice_timer, (2 * 60000)) } else if (timer_minutes > 0) { cb.setTimeout(notice_timer, (1 * 60000)) } } function tips_remaining() { var r = auto_tip_goal - auto_current_goal_tipped; if (r < 0) { return 0 } else { return r } } function ChangeStatus(new_subject) { if ((app_started == APP_AUTOWHEEL) || (app_started == APP_AUTORESET)) { new_subject += " [" + tips_remaining() + " tokens remaining]" } cb.changeRoomSubject(new_subject) } function DisplayChangeApp() { var outapp = ''; var running_app = ''; var text_app = ''; if (app_started == APP_AUTOWHEEL) { running_app = APP_AUTOWHEELLONG; text_app = " - Notice every " + (wheel_notice / 1000) + " sec. - Multi-spin: " + wheel_multi } else if (app_started == APP_AUTORESET) { running_app = APP_AUTORESETLONG } else if (app_started == APP_WHEEL) { running_app = APP_WHEELLONG; text_app = " - Notice every " + (wheel_notice / 1000) + " sec. - Multi-spin: " + wheel_multi } else if (app_started == APP_VIPTICKETS) { running_app = APP_VIPTICKETSLONG } else { running_app = APP_NOAPPLONG } outapp += HEADER_FOOTER; outapp += "\n\nThe Broadcaster has decided to change the running application(s)."; outapp += "\n\nRunning application(s): " + running_app + text_app; outapp += "\n" + APP_just4cindyLONG + " activation: " + j4c_started + " - Notice every " + (j4c_notice / 1000) + " sec."; outapp += "\n" + APP_KOKLONG + " activation: " + kok_activation + " - Notice every " + (kok_notice / 1000) + " sec."; outapp += "\n" + APP_KODLONG + " activation: " + kod_activation; outapp += "\n\n" + HEADER_FOOTER; cb.sendNotice(outapp, '', '', COLOR_INFO) } function getCommandList(u, isMod, isFan, isDev) { var cmdlist = HEADER_FOOTER; cmdlist += "\nAll users Commands:\n-----------------------------------"; cmdlist += "\n" + commandPrefix + CMD_HELP + " - Displays this help."; cmdlist += "\n" + commandPrefix + CMD_LB3 + " - Displays the Top 3 Leaderboard to you only."; cmdlist += "\n" + commandPrefix + CMD_LB + " - Displays the Leaderboard to you only."; if ((app_started === APP_AUTOWHEEL) || (app_started === APP_WHEEL)) { cmdlist += "\n" + commandPrefix + CMD_WHEELREWARDS + " - Displays the list of rewards of the Wheel of Fortune to you only." } if (app_started === APP_VIPTICKETS) { cmdlist += "\n" + commandPrefix + CMD_CHECKVIPTICKETS + " <nickname> - Displays if a user is in the " + APP_VIPTICKETSLONG + " list of ticket holders."; cmdlist += "\n" + commandPrefix + CMD_LISTVIPTICKETS + " - Displays all the ticket holders of the " + APP_VIPTICKETS + "." } if ((isMod) || (isFan) || (u === theBC) || (isDev)) { cmdlist += "\n\nCommands only for the broadcaster, moderators and fans:\n-----------------------------------"; cmdlist += "\n" + commandPrefix + CMD_LB3 + " all - Displays the Top 3 Leaderboard to all users."; cmdlist += "\n" + commandPrefix + CMD_LB + " all - Displays the Leaderboard to all users."; if ((app_started === APP_AUTOWHEEL) || (app_started === APP_WHEEL)) { cmdlist += "\n" + commandPrefix + CMD_WHEELREWARDS + " all - Displays the list of rewards of the Wheel of Fortune to all users." } if ((app_started === APP_VIPTICKETS) && (vip_modfan_add == 'Yes')) { cmdlist += "\n" + commandPrefix + CMD_ADDVIPTICKETS + " <nickname> - Add an user to the " + APP_VIPTICKETSLONG + " list of ticket holders."; cmdlist += "\n" + commandPrefix + CMD_DELVIPTICKETS + " <nickname> - Remove an user from the " + APP_VIPTICKETSLONG + " list of ticket holders." } } if ((u === theBC) || (isDev)) { cmdlist += "\n\nCommands only for the broadcaster:\n-----------------------------------"; cmdlist += "\n" + commandPrefix + CMD_STARTAPP + " <name of the app> - Start an app (" + APP_AUTOWHEEL + ", " + APP_AUTORESET + ", " + APP_WHEEL + ", " + APP_VIPTICKETS + ", " + APP_just4cindy + ", " + APP_KOK + ", " + APP_KOD + ")"; cmdlist += "\n" + commandPrefix + CMD_STOPAPP + " <name of the app> - Stop an app (" + APP_AUTOWHEEL + ", " + APP_AUTORESET + ", " + APP_WHEEL + ", " + APP_VIPTICKETS + ", " + APP_just4cindy + ", " + APP_KOK + ", " + APP_KOD + ")"; cmdlist += "\n" + commandPrefix + CMD_CHANGESTATUS + " <your text here> - Changes the status of the room."; if ((app_started === APP_AUTOWHEEL) || (app_started === APP_WHEEL)) { cmdlist += "\n" + commandPrefix + CMD_WHEELCHANGELIST + " - Change the Wheel of Fortune Prices List from 'dressed' to 'naked' or from 'naked' to 'dressed'."; cmdlist += "\n" + commandPrefix + CMD_WHEELMULTISPIN + " <yes or no> - Enable/disable the multi-spin for the " + APP_WHEELLONG + "." } if (app_started === APP_VIPTICKETS) { cmdlist += "\n" + commandPrefix + CMD_STARTVIPTICKETS + " - Starts the " + APP_VIPTICKETSLONG + " Hidden Show."; cmdlist += "\n" + commandPrefix + CMD_STOPVIPTICKETS + " - Stops the " + APP_VIPTICKETSLONG + " Hidden Show."; cmdlist += "\n" + commandPrefix + CMD_CLEARVIPTICKETS + " - Clears all the " + APP_VIPTICKETSLONG + " list of ticket holders." } } cmdlist += "\n" + HEADER_FOOTER; return cmdlist } function DisplayWheelRewardsList(to_user) { var outreward = ''; outreward += theBC + "'s Wheel of Fortune [by " + DEVNICK + "]. Rewards List.\n" + HEADER_FOOTER + "\n"; if (wheel_type == 'dressed') { var temp_reward = wheel_rewards_dressed } else { var temp_reward = wheel_rewards_naked } for (var i = 0; i < temp_reward.length; i++) { outreward += (i + 1) + ". " + temp_reward[i] + "\n" } outreward += HEADER_FOOTER + "\n"; if (to_user == 'all') { cb.sendNotice(outreward, '', '', COLOR_INFO, '') } else { cb.sendNotice(outreward, to_user, '', COLOR_INFO, '') } } function message_TipAmount(user, message) { var indexTipper = findTipper(user, 'none'); if (indexTipper >= 0) { message = '|' + tippersArray[indexTipper][1] + '| ' + message } return message } function displayTop3Leaderboard(to_user) { var lb3_sort = new Array; var outlb3 = ''; for (i = 0; i < tippersArray.length; i++) { lb3_sort[i] = new Array; lb3_sort[i][0] = tippersArray[i][0]; lb3_sort[i][1] = tippersArray[i][1] } if (lb3_sort.length > 0) { lb3_sort.sort(function (a, b) { return a[1] < b[1] }) } outlb3 += "Top 3 Leaderboard [by " + DEVNICK + "] - Type " + commandPrefix + CMD_LB3 + " to display the Top 3 Leaderboard\n" + HEADER_FOOTER + "\n"; if (lb3_sort.length > 3) { var i_max = 3 } else { var i_max = lb3_sort.length } var cmpt = 1; for (i = 0; i < i_max; i++) { outlb3 += cmpt + '. ' + lb3_sort[i][0] + ' (' + lb3_sort[i][1] + ' tokens)\n'; cmpt++ } for (i = cmpt; i <= 3; i++) { outlb3 += i + '. ---\n' } if (to_user == 'all') { cb.sendNotice(outlb3) } else { cb.sendNotice(outlb3, to_user) } } function displayLeaderboard(to_user) { var lb_sort = new Array; var outlb = ''; for (i = 0; i < tippersArray.length; i++) { lb_sort[i] = new Array; lb_sort[i][0] = tippersArray[i][0]; lb_sort[i][1] = tippersArray[i][1] } if (lb_sort.length > 0) { lb_sort.sort(function (a, b) { return a[1] < b[1] }) } outlb += "Leaderboard [by " + DEVNICK + "] - Type " + commandPrefix + CMD_LB + " to display the Leaderboard\n" + HEADER_FOOTER + "\n"; var cmpt = 1; for (i = 0; i < lb_sort.length; i++) { outlb += cmpt + '. ' + lb_sort[i][0] + ' (' + lb_sort[i][1] + ' tokens)\n'; cmpt++ } if (lb_sort.length < 3) { for (i = cmpt; i <= 3; i++) { outlb += i + '. ---\n' } } if (to_user == 'all') { cb.sendNotice(outlb) } else { cb.sendNotice(outlb, to_user) } } function addTipperArray(user) { var nextuser = 0; if (tippersArray.length > 0) { nextuser = tippersArray.length } tippersArray[nextuser] = new Array; tippersArray[nextuser][0] = user; tippersArray[nextuser][1] = 0; cb.log("User " + user + " added in the array. Index: " + nextuser) } function findTipper(user, fonction) { for (var i = 0; i < tippersArray.length; i++) { if (tippersArray[i][0] == user) { cb.log("User found in the tippers array with index " + i); break } } if ((i == tippersArray.length) && (fonction == 'add')) { cb.log("User not in the tippers array ==> add him"); addTipperArray(user); findTipper(user, 'none') } else if (i == tippersArray.length) { i = -1 } return i } function message_KingOfKings(user, message) { if ((kok_activation == 'Yes') && (user == current_kok_name)) { cb.log("Add KOK Crown"); message = CROWN_KOK + message } return message } function message_KingOfDay(user, message) { if ((kod_activation == 'Yes') && (user == current_kod_name)) { cb.log("Add KOD Crown"); message = CROWN_KOD + message } return message } function isKingOfKings(user, tip) { if (kok_activation == 'Yes') { if (tip > current_kok_tip) { current_kok_name = user; current_kok_tip = tip; cb.sendNotice(CROWN_KOK + ' We have a new King of Kings! Thanks to ' + user + '! ' + CROWN_KOK + '\nTip ' + (current_kok_tip + 1) + ' tokens or more to become my new King of Kings!', '', COLOR_KINGOFKINGS, '', 'bolder') } } } function isKingOfDay(user, tip) { if (kod_activation == 'Yes') { if (tip > current_kod_tip) { current_kod_name = user; current_kod_tip = tip; cb.sendNotice(CROWN_KOD + ' We have a new King of the Day! Thanks to ' + user + '! ' + CROWN_KOD + '\nTip ' + (current_kod_tip + 1) + ' tokens or more to become my new King of the Day!', '', COLOR_KINGOFDAY, '', 'bolder') } } } function spinWheel(user, nombre) { var out = ''; var randomnumber = 0; cb.log('Spin the wheel: ' + wheel_type + ' - ' + wheel_rewards_dressed.length + ' - ' + wheel_rewards_naked.length); out += HEADER_FOOTER + '\n'; out += '\n'; out += 'Spinning the Wheel of Fortune for ' + user + ' (' + nombre + ' time(s))\n'; for (var i = 0; i < nombre; i++) { if (wheel_type == 'dressed') { randomnumber = Math.floor(Math.random() * (wheel_rewards_dressed.length)); cb.log("Random: " + randomnumber); out += 'Wheel stopped on: ' + wheel_rewards_dressed[randomnumber] + '\n' } else if (wheel_type == 'naked') { randomnumber = Math.floor(Math.random() * (wheel_rewards_naked.length)); cb.log("Random: " + randomnumber); out += 'Wheel stopped on: ' + wheel_rewards_naked[randomnumber] + '\n' } } out += '\n'; out += HEADER_FOOTER + '\n'; cb.sendNotice(out, '', '', COLOR_INFO, 'bold') } function refresh() { cb.setTimeout(refresh, 20000); cb.drawPanel() } function auto_goalReached(userName) { auto_last_time_goal_reached = new Date(); var curr_times_reached = Math.floor(auto_current_goal_tipped / auto_tip_goal); for (var i = 0; i < curr_times_reached; i++) { auto_times_goal_reached++; auto_current_goal_tipped -= auto_tip_goal; if (userName != '') { cb.sendNotice("Goal was reached for the " + getNumberString(auto_times_goal_reached) + " time!"); cb.sendNotice('The user ' + userName + ' has reached the goal.', theBC, '', COLOR_INFO, "bold") } } } function getNumberString(number) { var numberString = null; var lastChar = String(number).charAt(String(number).length - 1); if ((lastChar == '1') && ((number % 100) != 11)) { numberString = number + "st" } else if ((lastChar == '2') && ((number % 100) != 12)) { numberString = number + "nd" } else if ((lastChar == '3') && ((number % 100) != 13)) { numberString = number + "rd" } else { numberString = "" + number + "th" } return (numberString) } function notice_just4cindy_tip(user) { var outj4c = ''; if (app_started != APP_NOAPP) { outj4c += "just4cindy: Thanks to " + user + "! "; if (app_started == APP_AUTOWHEEL) { outj4c += "This tip doesn't count for the " + APP_AUTOWHEELLONG + "!" } else if (app_started == APP_AUTORESET) { outj4c += "This tip doesn't count for the " + APP_AUTORESETLONG + "!" } else if (app_started == APP_WHEEL) { outj4c += "This tip doesn't count for the " + APP_WHEELLONG + "!" } else if (app_started == APP_VIPTICKETS) { outj4c += "This tip doesn't count for the " + APP_VIPTICKETSLONG + "!" } cb.sendNotice(outj4c, '', COLOR_just4cindy, '', 'bold') } } function notice_j4c_notactivated(user) { var outj4c = ''; outj4c += 'Thank you, ' + user + ', for your tip. You try to do a "just4cindy" Tip.\n'; outj4c += 'The just4cindy App is unfortunately not activated.\n'; outj4c += 'Your tip will also count for the other apps.'; cb.sendNotice(outj4c, user, COLOR_just4cindy, '', 'bolder') } function startsWith(source, str) { return source.substring(0, str.length) === str } function noticejust4cindy() { if ((j4c_started == 'Yes') && (j4c_notice > 0)) { var outj4c = ''; outj4c += 'Type: just4cindy as tip note if your tip is only for ' + theBC + '. The tip will not be counted by the running app(s). please use this function for videos or raffles aswell. example: just4cindy video15 and your email. thank you'; cb.sendNotice(outj4c, '', COLOR_just4cindy, '', 'bolder'); cb.setTimeout(noticejust4cindy, parseInt(j4c_notice)) } } function noticeKingOfKings() { if ((kok_activation == 'Yes') && (kok_notice > 0)) { var outkok = ''; outkok += CROWN_KOK + ' ' + current_kok_name + ' is the current King of Kings with a tip of ' + current_kok_tip + ' tokens. Tip ' + (current_kok_tip + 1) + ' tokens or more to become my new King of Kings!'; cb.sendNotice(outkok, '', COLOR_KINGOFKINGS, '', 'bolder'); cb.setTimeout(noticeKingOfKings, parseInt(kok_notice)) } } function noticeWheelOfFortune() { if ((wheel_activation == 'Yes') && (wheel_notice > 0)) { var outwh = ''; outwh += theBC + "'s Wheel of Fortune [by " + DEVNICK + "].\nTip " + wheel_tip_amount + " tokens or more to spin the Wheel of Fortune."; outwh += "Type '" + commandPrefix + CMD_WHEELREWARDS + "' to display the rewards. "; cb.sendNotice(outwh, '', COLOR_WHEEL, '', 'bolder'); cb.setTimeout(noticeWheelOfFortune, parseInt(wheel_notice)) } } function start_myapp() { cb.drawPanel() } function init() { if (cb.settings.AppStarted === APP_AUTOWHEELLONG) { app_started = APP_AUTOWHEEL } else if (cb.settings.AppStarted === APP_AUTORESETLONG) { app_started = APP_AUTORESET } else if (cb.settings.AppStarted === APP_WHEELLONG) { app_started = APP_WHEEL } else if (cb.settings.AppStarted === APP_VIPTICKETSLONG) { app_started = APP_VIPTICKETS } else { app_started = APP_NOAPP } if (cb.settings.just4cindyStarted === 'Yes') { j4c_started = 'Yes' } else { j4c_started = 'No' } current_status = cb.settings.current_description; display_tip_amount = cb.settings.TipAmountDisplay; kok_activation = cb.settings.KingOfKingsActivation; current_kok_name = cb.settings.KingOfKingsUser; current_kok_tip = cb.settings.KingOfKingsAmount; kok_notice_cb = cb.settings.KingOfKingsNotice * 1000; kok_notice = kok_notice_cb; kod_activation = cb.settings.KingOfDayActivation; auto_tip_goal = cb.settings.AutoResetGoal; wheel_tip_amount = cb.settings.WheelTipAmount; if ((app_started === APP_AUTOWHEEL) || (app_started === APP_WHEEL)) { wheel_activation = 'Yes' } else { wheel_activation = 'No' } wheel_notice_cb = cb.settings.WheelNotice * 1000; wheel_notice = wheel_notice_cb; if (cb.settings.WheelMultiSpin == 'Yes') { wheel_multi = 'yes' } else { wheel_multi = 'no' } vip_tip_amount = cb.settings.VIPTicketsAmount; vip_modfan_add = cb.settings.VIPIncludeModsFans; j4c_notice_cb = cb.settings.just4cindyNotice * 1000; j4c_notice = j4c_notice_cb; display_lb3 = cb.settings.Leaderboard3Display; wheel_rewards_dressed = []; wheel_rewards_naked = []; var wheel_temp_rewards_dressed = new Array(cb.settings.pos1, cb.settings.pos2, cb.settings.pos3, cb.settings.pos4, cb.settings.pos5, cb.settings.pos6, cb.settings.pos7, cb.settings.pos8, cb.settings.pos9, cb.settings.pos10, cb.settings.pos11, cb.settings.pos12, cb.settings.pos13, cb.settings.pos14, cb.settings.pos15, cb.settings.pos16, cb.settings.pos17); for (var cmpt = 0; cmpt < wheel_temp_rewards_dressed.length; cmpt++) { if (wheel_temp_rewards_dressed[cmpt] != '') { wheel_rewards_dressed.push(wheel_temp_rewards_dressed[cmpt]) } } var wheel_temp_rewards_naked = new Array(cb.settings.posn1, cb.settings.posn2, cb.settings.posn3, cb.settings.posn4, cb.settings.posn5, cb.settings.posn6, cb.settings.posn7, cb.settings.posn8, cb.settings.posn9, cb.settings.posn10, cb.settings.posn11, cb.settings.posn12, cb.settings.posn13, cb.settings.posn14, cb.settings.posn15, cb.settings.posn16, cb.settings.posn17); for (cmpt = 0; cmpt < wheel_temp_rewards_naked.length; cmpt++) { if (wheel_temp_rewards_naked[cmpt] != '') { wheel_rewards_naked.push(wheel_temp_rewards_naked[cmpt]) } } cb.log(wheel_rewards_dressed.length + ' - ' + wheel_rewards_naked.length); start_myapp(); ChangeStatus(current_status); noticejust4cindy(); noticeKingOfKings(); noticeWheelOfFortune(); cb.sendNotice(getCommandList(theBC, false, false, false), theBC, '', COLOR_INFO); if (app_started != APP_NOAPP) { cb.log("App started: " + app_started); cb.log("Current status: " + current_status); cb.log("King of Kings Activation: " + kok_activation + " - " + current_kok_name + " (" + current_kok_tip + ") - Notice each " + kok_notice + " seconds"); cb.log("King of Day Activation: " + kod_activation + " - " + current_kod_name + " (" + current_kod_tip + ")"); cb.log("Tip at the beginning of the messages: " + display_tip_amount); cb.log("Display leaderboard 3 after each tip: " + display_lb3); cb.log("just4cindy Activation: " + j4c_started + " - Notice each " + j4c_notice); if ((app_started === APP_AUTOWHEEL) || (app_started === APP_AUTORESET)) { cb.log("Auto-Reset Tip Goal: " + auto_tip_goal) } if ((app_started === APP_AUTOWHEEL) || (app_started === APP_WHEEL)) { cb.log("Wheel of Fortune Tip Amount: " + wheel_tip_amount); cb.log("Wheel of Fortune Typ: " + wheel_type) } if (app_started === APP_VIPTICKETS) { cb.log(APP_VIPTICKETSLONG + " Tip Amount: " + vip_tip_amount) } } } init(); cb.setTimeout(refresh, 20000);
© Copyright Chaturbate 2011- 2026. All Rights Reserved.