Apps Home
|
Create an App
FDBFDGE
Author:
petiteprincess0
Description
Source Code
Launch App
Current Users
Created by:
Petiteprincess0
/** Name: Dorothy's GameBot Author: chelsea2950 **/ //Classic Tip Goal by Admin + Customizable panel by Silici0 // vars var total_tipped = 0; var high_tip_username = null; var high_tip_amount = 0; var last_tip_username = null; var last_tip_amount = 0; var subject_is_set_with_0 = false; var panelConfig = cb.settings.panelConfig; var imageConfig = cb.settings.imageConfig; var imageSelec = cb.settings.imageSelec; var imageConfigTrue = cb.settings.imageConfigTrue; var row1_LabelText =cb.settings.row1_LabelText; var row1_LabelColor = cb.settings.row1_LabelColor; var row1_Color = cb.settings.row1_Color; var row1_Background = cb.settings.row1_Background; var row2_LabelText = cb.settings.row2_LabelText; var row2_LabelColor = cb.settings.row2_LabelColor; var row2_Color = cb.settings.row2_Color; var row2_Background = cb.settings.row2_Background; var row3_LabelText = cb.settings.row3_LabelText; var row3_LabelColor = cb.settings.row3_LabelColor; var row3_Color = cb.settings.row3_Color; var row3_Background = cb.settings.row3_Background; cb.settings_choices = [ {name: 'tokens', type: 'int', minValue: 1, default: 100}, {name: 'goal_description', type: 'str', minLength: 1, maxLength: 255}, { name: "hashtag", label:"Hashtags", type: "str", minLength: 1, maxLength: 255 },{ name: "panelConfig", label:"Panel configuration", type: "choice", choice1:"classic", choice2:"table", choice3:"image", defaultValue:"image" },{ name: "imageSelec", label:"Select an image ID. You can see all the images in the top of Code Source section", type: "choice", choice1:"Image ID written in next section", choice2:"cc31ba93-805a-452a-ad13-2771c249a125", choice3:"0ea82bda-1a52-482b-b8cb-2280bfb8c53c", choice4:"1a0f8783-6422-4e61-99ca-d8a9d752d3f8", choice5:"233c82fa-cbbc-4c47-abd3-9f1a65e94707", choice6:"3bc9d9a7-8590-4e23-a103-13e8ebd6bc8a", choice7:"46ab34cc-3329-422e-81b9-58cf3a8c135e", defaultValue:"Image ID written in next section", },{ name: "imageConfig", label:"Image Panel configuration, select: Image ID written... first, (useful if you copy these app to upload your own image)", type: 'str', minLength: 1, maxLength: 50, defaultValue:"3960c2c1-f59e-4351-bfc6-20c6315b7734", required: true },{ name: "row1_LabelText", label:"Row1 Label Text, default:Tip Received / Goal", type: 'str', minLength: 1, maxLength: 26, defaultValue:"Tip Received / Goal :", required: true },{ name: "row1_LabelColor", label:"Color Row1 Label, only for Table or Image Panel", type: 'str', minLength: 1, maxLength: 50, defaultValue:"black", required: true },{ name: "row1_Color", label:"Row1 Text Color, only for Table or Image Panel", type: 'str', minLength: 1, maxLength: 50, defaultValue:"black", required: true },{ name: "row1_Background", label:"Row1 Background Color, only for Table", type: 'str', minLength: 1, maxLength: 50, defaultValue:"#ADD8E6", required: true },{ name: "row2_LabelText", label:"Row2 Label Text, default: Highest Tip: ", type: 'str', minLength: 1, maxLength: 26, defaultValue:"Highest Tip:", required: true },{ name: "row2_LabelColor", label:"Row2 Label Color, only for Table or Image Panel", type: 'str', minLength: 1, maxLength: 50, defaultValue:"black", required: true },{ name: "row2_Color", label:"Row2 Tex Color, only for Table or Image Panel", type: 'str', minLength: 1, maxLength: 50, defaultValue:"black", required: true },{ name: "row2_Background", label:"Row2 Background Color, only for Table", type: 'str', minLength: 1, maxLength: 50, defaultValue:"pink", required: true },{ name: "row3_LabelText", label:"Row3 Label Text, default: Latest Tip Received: ", type: 'str', minLength: 1, maxLength: 26, defaultValue:"Latest Tip :", required: true },{ name: "row3_LabelColor", label:"Row3 Label Color, only for Table or Image Panel", type: 'str', minLength: 1, maxLength: 50, defaultValue:"black", required: true },{ name: "row3_Color", label:"Row3 Color, only for Table or Image Panel", type: 'str', minLength: 1, maxLength: 50, defaultValue:"black", required: true },{ name: "row3_Background", label:"Row3 Background Color, only for Table", type: 'str', minLength: 1, maxLength: 50, defaultValue:"#ADD8E6", required: true }, ]; // handlers if(imageSelec != "Image ID written in next section"){ imageConfigTrue = imageSelec } else { imageConfigTrue = imageConfig }; cb.onTip(function(tip) { total_tipped += tip['amount'] if (total_tipped > cb.settings.tokens) { total_tipped = cb.settings.tokens; } update_subject(); last_tip_amount = tip['amount'] last_tip_username = tip['from_user'] if (tip['amount'] > high_tip_amount) { high_tip_amount = tip['amount'] high_tip_username = tip['from_user'] } cb.drawPanel(); }); cb.onDrawPanel(function(user) { /*return { 'template': '3_rows_of_labels', //'row1_label': 'Tip Received / Goal :', 'row1_label': row1_LabelText + ':', 'row1_value': '' + total_tipped + ' / ' + cb.settings.tokens, //'row2_label': 'Highest Tip:', 'row2_label': row2_LabelText + ':', 'row2_value': " " + format_username(high_tip_username) + ' (' + high_tip_amount + ')', //'row3_label': 'Latest Tip Received:', 'row3_label': row3_LabelText + ':', 'row3_value': " " + format_username(last_tip_username) + ' (' + last_tip_amount + ')' }; }); */ if (cb.settings.panelConfig == "image"){ return { "template": "image_template", "layers": [ {'type': 'image', 'fileID': imageConfigTrue}, { 'type': 'text', 'text': row1_LabelText, 'top': 5, 'left': 10, 'font-size': 11, //'text-align': 'center', 'font-weight': 'bold', 'color': row1_LabelColor, }, { 'type': 'text', 'text': row2_LabelText, 'top': 29, 'left': 10, 'font-size': 11, //'text-align': 'center', 'font-weight': 'bold', 'color': row2_LabelColor, }, { 'type': 'text', 'text': row3_LabelText, 'top': 52, 'left': 10, 'font-size': 11, //'text-align': 'center', 'font-weight': 'bold', 'color': row3_LabelColor, },{ 'type': 'text', 'text': '' + total_tipped + ' / ' + cb.settings.tokens, 'top': 5, 'left': 147, 'font-size': 11, //'text-align': 'center', 'font-weight': 'bold', 'color': row1_Color, }, { 'type': 'text', 'text': " " + format_username(high_tip_username) + ' (' + high_tip_amount + ')', 'top': 29, 'left': 147, 'font-size': 11, //'text-align': 'center', 'font-weight': 'bold', 'color': row2_Color, }, { 'type': 'text', 'text': " " + format_username(last_tip_username) + ' (' + last_tip_amount + ')', 'top': 52, 'left': 147, 'font-size': 11, //'text-align': 'center', 'font-weight': 'bold', 'color': row3_Color, }, ], }; } if (cb.settings.panelConfig == "table"){ return { "template": "image_template", "table": { "row_1": { "background-color": row1_Background, "col_1": { "color": row1_LabelColor, "text-align": "center", "font-weight": "bold", "value": row1_LabelText }, "col_2": { "color": row1_Color, "text-align": "center", "value": ' ' + total_tipped + ' / ' + cb.settings.tokens, }, }, "row_2": { "background-color": row2_Background, "col_1": { "color": row2_LabelColor, "text-align": "center", "font-weight": "bold", "value": row2_LabelText }, "col_2": { "color": row2_Color, "text-align": "center", "value":" " + format_username(high_tip_username) + ' (' + high_tip_amount + ')' } }, "row_3": { "background-color": row3_Background, "col_1": { "color": row3_LabelColor, "text-align": "center", "font-weight": "bold", "value": row3_LabelText }, "col_2": { "color": row3_Color, "text-align": "center", "value":" " + format_username(last_tip_username) + ' (' + last_tip_amount + ')' } } } }; } else { return { 'template': '3_rows_of_labels', //'row1_label': 'Tip Received / Goal :', 'row1_label': row1_LabelText + ':', 'row1_value': '' + total_tipped + ' / ' + cb.settings.tokens, //'row2_label': 'Highest Tip:', 'row2_label': row2_LabelText + ':', 'row2_value':" " + format_username(high_tip_username) + ' (' + high_tip_amount + ')', //'row3_label': 'Latest Tip Received:', 'row3_label': row3_LabelText + ':', 'row3_value':" "+ format_username(last_tip_username) + ' (' + last_tip_amount + ')' }; } }); cb.drawPanel(); // helper functions function update_subject() { if (tips_remaining() == 0) { if (subject_is_set_with_0) { return; } subject_is_set_with_0 = true; } else { subject_is_set_with_0 = false; } var new_subject = cb.settings.goal_description + " [" + tips_remaining() + " tokens remaining] " + cb.settings.hashtag; cb.log("Changing subject to: " + new_subject); cb.changeRoomSubject(new_subject); } function tips_remaining() { var r = cb.settings.tokens - total_tipped; if (r < 0) { return 0; } else { return r; } } function format_username(val) { if (val === null) { return "--"; } else { return val.substring(0, 12); } } function init() { update_subject(); } init(); {cb.settings_choices = [ {name: 'dummyIntro', label: ' ********************* Introduction *********************** Latest Updt: 1/23/2020 (version 1.18) See Change Log *************************************************************** Welcome to Dorothy\'s Gamebot! You can choose the game features you want to turn on and off both from this initial launch page with the settings, or later when the bot is running using commands (shown in each section and on the help page). You should not need to restart the bot except to change some of the settings that are not able to be updated via command (mainly colors and time intervals). Moderators can be given significant privileges by this bot, so please make sure you assign moderators you can trust. I\'ve also setup default prizes and prices that I find to be common and some fun ones to heopfully reduce the amount of work you have to do and give you ideas, but please update these per your preference, the defaults are only suggestions! Also, you can see the full list of commands for the bot by typing "/gbhelp" in the chat (no quotes), and then also see more detailed help by game. Note that I have also created "Dorothy\'s Ultra Fembot" and "Dorothy\'s UltraApp"... the intent being that between these three apps and bots, by starting them at the beginning of each show, you can do most of the show types and features that are common to CB. Please enjoy using the gamebot and feel free to say hello if you see me around, or DM me on twitter @thechelsea2950 if you have questions. Thank you! - chelsea', type: 'choice',required: false}, // *** General Settings {name: 'general', label: ' *********************************************************** ******************* GENERAL SETUP ********************** *********************************************************** Please make a choice below for which game(s) you will start the show with. More than one game can be active at a time, but turning them all on at once can clog the chat with messaging. For each game, there is a Configuration section below where you will define the game defaults. The main benefits of this bot are having multiple games available, and having a master prize list that can be used across all of the games so you do not have to keep setting up your prizes over and over with different games.', type: 'choice',required: false}, {name: 'enableEntryMessage', label: 'Display a notification to users when they enter?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'entryMessage', label: 'Enter the message to display.', type: 'str',required: false, minLength: 1, maxLength: 1000, defaultValue: 'Welcome! Dorothys Gamebot is currently running. notices will be posted periodically in the chat to provide instructions on how to play the games.'}, {name: 'allowModsAuthority', label: 'Allow moderators to have authority to broadcaster commands across all games? It is usually ok to give moderators general authority with this setting, however they will have authority to perform actions such as starting and stopping games, changing the prices for game play, and displaying the VIP and Fan list.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'allowModsStats', label: 'Allow moderators to use the "/gbstats" command to see current show time online and tip totals', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'botModList', label: 'Bot Mods: Enter the names of any users you would like to grant moderator privileges without assigning Chaturbate moderator status. Users in this group are granted the same permissions as the red-named moderators assigned through CB. They can be entered here or added during the show with the "/addmod" command', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'VIPList', label: 'Enter the names of any VIP users you would like to grant special privileges (free/discounted wheel spins, dice rolls, etc, each defined below). Users should be separated by a comma with no spaces', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'extFanList', label: 'Enter the names of any External Fan Club members you would like to grant special privileges (free/discounted wheel spins, dice rolls, etc, each defined below). Users should be separated by a comma with no spaces. Note that External Fan Club and CB Fan Club are given the same privileges in this bot.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'bctext', label: 'Replace the general term "broadcaster" with the name of your choosing (room name, couples name, etc) wherever it appears in chat notices. Leave blank to just use "broadcaster".', type: 'str',required: false, minLength: 1, maxLength: 50}, {name: 'minMessagesForNotice', type: 'int',minValue: 0,maxValue: 1000,defaultValue: 0,label: 'Minimum number of messages required to display the next of each type of notice. This helps reduce the frequency with which certain recurring notices are posted (such as tip menu, room rules, lush menu, dice announcement, etc) if there are not a lot of messages in the chat so that the chat is not flooded only by notices. Set to 0 to not impose a minimum number of messages. Value of 10-25 are commonly used but may be set lower if the chat is really slow, or higher if the chat is busy, although if the chat is busy, the normal time interval is usually fine and will not be restricted by this setting.'}, // *** Dice Game {name: 'dummyDice', label: ' *************************************************************** ************************ Dice Game ************************** *********************************************************** This is a traditional dice roll game with two standard six sided dice, with possible rolls of 2-12, and a special rare roll of 13. Default price and prizes are only suggestions, please update with your choices. Text for all notices is black, but you can change the background highlight color for each type notice below', type: 'choice',required: false}, {name: 'diceEnable',required: false,label: 'Enable the Dice Game at the start of the show? Note you can also turn the game on and off during the show using the "/dice on" and "/dice off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'diceRollPrice',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 39,label: 'How much do you want to charge per roll of the dice?'}, {name: 'diceRollLevel',type: 'int',minValue: 1,maxValue: 4, defaultValue: 2,label: 'Which Prize Level should be used to fill the prize list? Levels 1-4 are available for this game. There must be eleven prizes configured for this level in the prize list at the bottom of the page. The first eleven prizes from the level will be used'}, {name: 'diceRollSpecialPrizeNumber',type: 'str',defaultValue: 3.1,label: 'Define the specific prize number for the special roll using the format "level.prize". For example, if you want to use prize #1 from level 3, put "3.1" here'}, {name: 'diceRollPriceFans',required: false,type: 'int',minValue: 1,maxValue: 1000,defaultValue: 26,label: 'How much do you want to charge Fan Club Members per roll of the dice? Make this the same as the normal price if you do not want to give a discount'}, {name: 'diceRollPriceVIP',required: false,type: 'int',minValue: 1,maxValue: 1000,defaultValue: 28,label: 'How much do you want to charge VIP List Members per roll of the dice? Make this the same as the normal price if you do not want to give a discount'}, {name: 'diceRollPriceMods',required: false,type: 'int',minValue: 1,maxValue: 1000,defaultValue: 27,label: 'How much do you want to charge Moderators per roll of the dice? Make this the same as the normal price if you do not want to give a discount'}, {name: 'diceFreeRollFans',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 1,label: 'Give Fan Club Members (CB or External) one or more "Free Rolls" in each session? Specify the number of free rolls they receive or set to "0" to disable the free rolls for Fan Club'}, {name: 'diceFreeRollVIP',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 1,label: 'Give VIP List Members one or more "Free Rolls" in each session? Specify the number of free rolls they receive or set to "0" to disable the free rolls for VIP'}, {name: 'diceFreeRollMods',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 0,label: 'Give Moderators one or more "Free Rolls" in each session? Specify the number of free rolls they receive or set to "0" to disable the free rolls for Moderators'}, {name: 'diceFreeRollModAuthority',required: false,type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No',label: 'Allow a moderator to use the "Free Spin" command to roll without tokens'}, {name: 'diceRemoveWinner',required: false,label: 'Remove a winning roll from available choices until all possible rolls are used? This setting is generally not used as it gives the dice roller progressively worse and worse odds to get a winning roll', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'diceMultiRolls',required: false,type: 'int',minValue: 1,maxValue: 10,label: 'Enable multiple rolls with a single tip? Set the maximum number of rolls or set to 1 to only allow rolls for the specific amount above. For example: If this is set to 3 and you charge 30 tokens per roll, a user could tip exactly 60 for 2 rolls or exactly 90 for 3 rolls. Any tip amount that is not a multiple of the single roll will be ignored.', defaultValue: '1'}, {name: 'diceMinSpecial',required: false,label: 'Minimum rolls before the special roll of 13 is allowed. Note that even after the minimum, there is only a 20% chance of rolling a 7 with the first dice and normal odds of rolling a 6 with the second dice, so the odds of hitting 13 are about 1 in 30 after the minimum is satisfied', type: 'choice', choice1: '5', choice2: '10', choice3: '15', choice4: '20',choice5: '25', choice6: '30',choice7: '40', choice8: '50',defaultValue: '15'}, {name: 'diceNoticeInterval',required: false,type: 'str',defaultValue: 3.4,label: 'Time interval for displaying the Dice Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = "One minute and 30 second" intervals.'}, {name: 'diceNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Dice Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Black'}, {name: 'diceNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'diceNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Dice Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Periwinkle'}, {name: 'diceNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'diceRollTextColor',label: 'Choose your Text color for the Dice Roll results messages',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Black'}, {name: 'diceRollCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'diceRollBgColor',label: 'Choose your Background/Highlight color for the Dice Roll results messages',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Blue'}, {name: 'diceRollCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'diceRollSpecialTextColor',label: 'Choose your Text color for the Special Dice Roll results messages (roll of 13)',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Red'}, {name: 'diceRollSpecialCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'diceRollSpecialBgColor',label: 'Choose your Background/Highlight color for the Special Dice Roll results messages (roll of 13)',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Blue'}, {name: 'diceRollSpecialCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Wheel Spin Game {name: 'dummyWheel', label: ' *************************************************************** ************************** Wheel Spin ************************* *************************************************************** This is a Wheel Spin game with 20 normal spins, and 3 special rarer spins. Default prices and prizes are only suggestions, please update with your choices. You can change the text and background/highlight color of the recurring notice and spin result messages', type: 'choice',required: false}, {name: 'wheelEnable',required: false, type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No',label: 'Enable the Wheel Spin Game at the start of the show? Note you can also turn the game on and off during the show using the "/wheel on" and "/wheel off" commands.'}, {name: 'wheelSpinPrice',required: false,type: 'int',minValue: 1,maxValue: 1000,defaultValue: 63,label: 'How much do you want to charge per spin of the wheel?'}, {name: 'wheelSpinLevel',type: 'int',minValue: 1,maxValue: 4, defaultValue: 3,label: 'Which Prize Level should be used to fill the prize list? Levels 1-4 are available for this game. There must be twenty regular prizes configured for this level in the prize list at the bottom of the page, plus three special rare prizes. The first twenty prizes from the level will be used'}, {name: 'wheelSpinSpecialPrizeNumber1',type: 'str',defaultValue: 4.1,label: 'Define the specific prize number for the special rare spin #1 using the format "level.prize". For example, if you want to use prize #1 from level 3, put "3.1" here'}, {name: 'wheelSpinSpecialPrizeNumber2',type: 'str',defaultValue: 4.2,label: 'Define the specific prize number for the special rare spin #2 using the same format of "level.prize".'}, {name: 'wheelSpinSpecialPrizeNumber3',type: 'str',defaultValue: 4.3,label: 'Define the specific prize number for the special rare spin #3 using the same format of "level.prize".'}, {name: 'wheelSpinPriceFans',required: false,type: 'int',minValue: 1,maxValue: 1000,defaultValue: 26,label: 'How much do you want to charge Fan Club Members per spin of the wheel? Make this the same as the normal price if you do not want to give a discount'}, {name: 'wheelSpinPriceVIP',required: false,type: 'int',minValue: 1,maxValue: 1000,defaultValue: 28,label: 'How much do you want to charge VIP List Members per spin of the wheel? Make this the same as the normal price if you do not want to give a discount'}, {name: 'wheelSpinPriceMods',required: false,type: 'int',minValue: 1,maxValue: 1000,defaultValue: 27,label: 'How much do you want to charge Moderators per spin of the wheel? Make this the same as the normal price if you do not want to give a discount'}, {name: 'wheelFreeSpinFans',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 1,label: 'Give Fan Club Members (CB or External) one or more "Free Spins" in each session? Specify the number of free spins they receive or set to "0" to disable the free spin for Fan Club'}, {name: 'wheelFreeSpinVIP',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 1,label: 'Give VIP List Members one or more "Free Spins" in each session? Specify the number of free spins they receive or set to "0" to disable the free spin for VIP'}, {name: 'wheelFreeSpinMods',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 0,label: 'Give Moderators one or more "Free Spins" in each session? Specify the number of free spins they receive or set to "0" to disable the free spin for Mods'}, {name: 'wheelFreeSpinModAuthority',required: false,type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No',label: 'Allow a moderator to use the "Free Spin" command to spin without tokens'}, {name: 'wheelMultiSpins',required: false,type: 'int',minValue: 1,maxValue: 10,defaultValue: '1',label: 'Enable multiple rolls with a single tip? Set the maximum number of rolls or set to 1 to only allow rolls for the specific amount above. For example: If this is set to 3 and you charge 30 tokens per roll, a user could tip exactly 60 for 2 rolls or exactly 90 for 3 rolls. Any tip amount that is not a multiple of the single roll will be ignored.'}, {name: 'wheelMinSpecial',required: false,label: 'Minimum rolls before the special wheel spin result is allowed. Set the odds of winning the special prize with the next setting below', type: 'choice', choice1: '5', choice2: '10', choice3: '15', choice4: '20',choice5: '25', choice6: '30',choice7: '40', choice8: '50',defaultValue: '15'}, {name: 'wheelPercentSpecial',required: false,label: 'Percent odds of the special wheel spin after the minimum is met', type: 'choice', choice1: '5%', choice2: '10%', choice3: '15%', choice4: '20%',choice5: '25%',defaultValue: '10%'}, {name: 'wheelNoticeInterval',required: false,type: 'str',defaultValue: 3.2,label: 'Time interval for displaying the Wheel Spin Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = "One minute and 30 second" intervals.'}, {name: 'wheelNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Wheel Spin Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Blue'}, {name: 'wheelNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'wheelNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Wheel Spin Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Cream'}, {name: 'wheelNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'wheelSpinTextColor',label: 'Choose your Text color for the Wheel Spin results messages',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Purple'}, {name: 'wheelSpinCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'wheelSpinBgColor',label: 'Choose your Background/Highlight color for the Wheel Spin results messages',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Cream'}, {name: 'wheelSpinCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'wheelSpinSpecialTextColor',label: 'Choose your Text color for the Special Wheel Spin results messages',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Teal'}, {name: 'wheelSpinSpecialCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'wheelSpinSpecialBgColor',label: 'Choose your Background/Highlight color for the Special Wheel Spin results messages',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Cream'}, {name: 'wheelSpinSpecialCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Russian Roulette {name: 'dummyRoulette', label: ' *************************************************************** ******************** Russian Roulette Game ******************* *************************************************************** This is a game of chance to try to win a single prize using the Russian Roulette method of firing a gun without knowing if a bullet is in the chamber being used. The "gun" is expanded to up to 100 "chambers" (or chances to win) and the tipper fires the gun upon tipping. Note there are two modes defined below. Most commonly this is used to have people tip for a chance at a high dollar prize such as premium snap access. ', type: 'choice',required: false}, {name: 'rouletteEnable',required: false,label: 'Enable the Russian Roulette Game at the start of the show? Note you can also turn the game on and off during the show using the "/rr on" and "/rr off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'rouletteShotPrice',type: 'int',minValue: 1,maxValue: 1000,required: false, defaultValue: 77,label: 'How much do you want to charge for viewers to fire the gun once? A starting point for the price should be roughly equal to 2x the prize value divided by the number of "chambers" you plan to use, or a little higher. For example, if you used 20 "chambers", on average, someone would win each time by approximately "chamber" 10, or halfway through the range So if the prize is valued at 500 tokens, then 500/10 = 50 tokens per fire, so maybe go slightly higher at 60. Then if they fire 10 times before winning, you make 600 tokens, which would be more than the amount of the prize value.'}, {name: 'rouletteMode',required: false,label: 'There are two modes to use: (1) Each "chamber" can be reused, which means all chambers are available for every shot (which technically means you could keep shooting and never get a winner, every shot has the same 1 in X odds), or (2) Each "chamber" is used only once, so they are used up as the gun is fired, and there will be a guaranteed winner within the defined maximum number of shots.', type: 'choice', choice1: 'Each Chamber Can Be Reused', choice2: 'Each Chamber Used Only Once', defaultValue: 'Each Chamber Used Only Once'}, {name: 'roulettePrize',type: 'str',defaultValue: 6.1,label: 'Define the specific prize number for the roulette prize using the format "level.prize". For example, if you want to use prize #1 from level 6, put "6.1" here'}, {name: 'rouletteRounds',required: false, type: 'int',minValue: 1,maxValue: 100,defaultValue: 20, label: 'Number of "chambers" to be used for firing. For the example of 20 shots, for mode "1" this means every shot has an equal 5% chance of winning. For mode "2", this means the first shot has a 5% chance, and that percentage slowly climbs to 100% by the 20th shot if no-one has won yet.'}, {name: 'rouletteCycles',required: false, type: 'int',minValue: 1,maxValue: 100,defaultValue: 3, label: 'How many times will the game be played'}, {name: 'rouletteMultiShots',required: false,type: 'int',minValue: 1,maxValue: 10,label: 'Enable multiple fires of the gun with a single tip? Set the maximum number of fires, or set to "1" to only allow firing for the specific price above. For example: If this is set to 3 and you charge 30 tokens per fire, a user could tip exactly 60 for 2 fires or exactly 90 for 3 fires. Any tip amount that is not a multiple of the single fire price will be ignored.', defaultValue: '1'}, {name: 'rouletteNoticeInterval',required: false,type: 'str',defaultValue: 4.2,label: 'Time interval for displaying the Russian Roulette Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = "One minute and 30 second" intervals.'}, {name: 'rouletteNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Roulette Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Plum'}, {name: 'rouletteNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'rouletteNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Roulette Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Plum'}, {name: 'rouletteNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'rouletteShotTextColor',label: 'Choose your Text color for the Roulette Missed Shot results messages',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Brown'}, {name: 'rouletteShotCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'rouletteShotBgColor',label: 'Choose your Background/Highlight color for the Roulette Missed Shot results messages',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Brown'}, {name: 'rouletteShotCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'rouletteWinnerTextColor',label: 'Choose your Text color for the Roulette Winning Shot results messages',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Bronze'}, {name: 'rouletteWinnerCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'rouletteWinnerBgColor',label: 'Choose your Background/Highlight color for the Roulette Winning Shot results messages',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Bronze'}, {name: 'rouletteWinnerCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Keno Game {name: 'dummyKeno', label: ' *************************************************************** ************************* Keno Game ************************* *************************************************************** This is a Keno Game where you specify the number range to be used, the prize levels you want to make available, and how many total prizes are available. Default settings are only suggestions, please update with your choices. It is recommended to either use higher prize level with a 50-75% win rate, or include lower level prizes with a 75-100% win rate.', type: 'choice',required: false}, {name: 'kenoEnable',required: false, type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No',label: 'Enable the Keno Game at the start of the show? Note you can also turn the game on and off during the show using the "/keno on" and "/keno off" commands.'}, {name: 'kenoLowNumber',required: false,type: 'int',minValue: 1,maxValue: 998,defaultValue: 1,label: 'Lowest number in the range?'}, {name: 'kenoHighNumber',required: false,type: 'int',minValue: 2,maxValue: 999,defaultValue: 75,label: 'Highest number in the range?'}, {name: 'kenoPrizesLevel1',required: false,type: 'int',minValue: 0,maxValue: 20,defaultValue: 10,label: 'Number of Prizes to use from Prize Level 1?'}, {name: 'kenoPrizesLevel2',required: false,type: 'int',minValue: 0,maxValue: 20,defaultValue: 15,label: 'Number of Prizes to use from Prize Level 2?'}, {name: 'kenoPrizesLevel3',required: false,type: 'int',minValue: 0,maxValue: 20,defaultValue: 15,label: 'Number of Prizes to use from Prize Level 3?'}, {name: 'kenoPrizesLevel4',required: false,type: 'int',minValue: 0,maxValue: 20,defaultValue: 15,label: 'Number of Prizes to use from Prize Level 4?'}, {name: 'kenoPrizesLevel5',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 8,label: 'Number of Prizes to use from Prize Level 5?'}, {name: 'kenoPrizesLevel6',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 4,label: 'Number of Prizes to use from Prize Level 6?'}, {name: 'kenoPrizesLevel7',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 4,label: 'Number of Prizes to use from Prize Level 7?'}, {name: 'kenoPrizesLevel8',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 2,label: 'Number of Prizes to use from Prize Level 8?'}, {name: 'kenoPrizesLevel9',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 2,label: 'Number of Prizes to use from Prize Level 9?'}, {name: 'kenoPrizesLevel10',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 0,label: 'Number of Prizes to use from Prize Level 10?'}, {name: 'kenoFinalGoal', label: 'Description of what happens when board is cleared', type: 'str',required: false, minLength: 1, maxLength: 200, defaultValue: 'Sex Show!'}, {name: 'kenoHighTipperPrize', label: 'Prize for High Tipper', type: 'str',required: false, minLength: 1, maxLength: 200, defaultValue: 'A Thank You!'}, {name: 'kenoFreeGuessFans',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 1,label: 'Give Fan Club Members (CB or External) one or more "Free Guesses" in each session? Specify the number of free guesses they receive or set to "0" to disable the free guesses for Fan Club'}, {name: 'kenoFreeGuessVIP',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 1,label: 'Give VIP List Members one or more "Free Guesses" in each session? Specify the number of free guesses they receive or set to "0" to disable the free guesses for VIP'}, {name: 'kenoFreeGuessMods',required: false,type: 'int',minValue: 0,maxValue: 10,defaultValue: 0,label: 'Give Moderators one or more "Free Guesses" in each session? Specify the number of free guesses they receive or set to "0" to disable the free guesses for VIP'}, {name: 'kenoMinForRandomPrize',required: false,type: 'int',minValue: 0,maxValue: 100,defaultValue: 0,label: 'Minimum number for which a prize will be rewarded. If no value is set or is set to zero, the low number of the range will be used'}, {name: 'kenoGroupTipping',type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes',label: 'Enable group tipping against the highest keno number left on the board?'}, {name: 'kenoSkipNumbers', label: 'Enter the any numbers that you would like to have Keno skip when setting up the board. These would typically be amounts that are used for oteht things like tip menu items or ticket show prices. The list of numbers should be comma separated with no spaces (such as "17,26,67,104")', type: 'str', minLength: 1, maxLength: 200, defaultValue: '', required: false}, {name: 'kenoSkipNumbersGroup',type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes',label: 'Should the above skipped numbers still count towards Group Tipping?'}, {name: 'kenoNoticeInterval',required: false,type: 'str',defaultValue: 2,label: 'Time interval for displaying the Keno Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = "One minute and 30 second" intervals.'}, {name: 'kenoNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Keno Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Fuschia'}, {name: 'kenoNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'kenoNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Keno Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Fuschia'}, {name: 'kenoNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'kenoResultTextColor',label: 'Choose your Text color for the Keno results messages',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Lime'}, {name: 'kenoResultCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'kenoResultBgColor',label: 'Choose your Background/Highlight color for the Keno results messages',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Lime'}, {name: 'kenoResultCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** War Card Game {name: 'dummyWar', label: ' *************************************************************** *********************** War Card Game ********************** *************************************************************** This is a variation of the card game War, where a viewer can challenge the brodcaster to see who draws the highest card. There are up to five prizes or prize levels that can be active at one time, and you would typically set the price for each at about half of the target price you would like for each prize, since a person should win roughly 50% of the time. For example, if you would normally charge 42 tokens for a dice roll for level 2, you might charge around 21 or a little higher to play war for a prize from level 2. You can either specify a single prize for each of the 5 settings, or set a level and a prize is assigned randomly for a winning challenge.', type: 'choice',required: false}, {name: 'warEnable',label: 'Enable the War Card Game at the start of the show? Note you can also turn the game on and off during the show using the "/war on" and "/war off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'warDealer',label: 'Automatically deal both the viewer and broadcaster cards at the same time? Or broadcaster plays by command after the viewer plays? ("command" is recommended - more interaction)', type: 'choice', choice1: 'Broadcaster dealt by command', choice2: 'Broadcaster dealt automatically', defaultValue: 'No'}, {name: 'warPrice_1',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 21,label: 'Challenge #1 Price: How much do you want to charge for someone to challenge you to a Game of War for prizes configured below? '}, {name: 'warPrizeType_1',label: 'Challenge #1: Use a specific prize number or a random prize? Depending on your selection, configure one of the two values below', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Random Prize'}, {name: 'warPrize_1',type: 'str',defaultValue: 2.5,label: 'Challenge #1: If you chose "Specific Prize" above, define the prize number from the master prize list using the format "level.prize". For example, if you want to use prize #3 from level 2, put "2.3" here'}, {name: 'warLevel_1',type: 'int',minValue: 1,maxValue: 10, defaultValue: 2,label: 'Challenge #1: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'warPrice_2',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 34,label: 'Challenge #2 Price'}, {name: 'warPrizeType_2',label: 'Challenge #2 Prize Choice?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Random Prize'}, {name: 'warPrize_2',type: 'str',defaultValue: 3.3,label: 'Challenge #2 Prize number using the format "level.prize"'}, {name: 'warLevel_2',type: 'int',minValue: 1,maxValue: 10, defaultValue: 3,label: 'Challenge #2 master prize list level'}, {name: 'warPrice_3',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 46,label: 'Challenge #3 Price'}, {name: 'warPrizeType_3',label: 'Challenge #3 Prize Choice?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Random Prize'}, {name: 'warPrize_3',type: 'str',defaultValue: 4.3,label: 'Challenge #3 Prize number using the format "level.prize"'}, {name: 'warLevel_3',type: 'int',minValue: 1,maxValue: 10, defaultValue: 4,label: 'Challenge #3 master prize list level'}, {name: 'warPrice_4',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 71,label: 'Challenge #4 Price'}, {name: 'warPrizeType_4',label: 'Challenge #4 Prize Choice?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Random Prize'}, {name: 'warPrize_4',type: 'str',defaultValue: 5.1,label: 'Challenge #4 Prize number using the format "level.prize"'}, {name: 'warLevel_4',type: 'int',minValue: 1,maxValue: 10, defaultValue: 5,label: 'Challenge #4 master prize list level'}, {name: 'warPrice_5',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 97,label: 'Challenge #5 Price'}, {name: 'warPrizeType_5',label: 'Challenge #5 Prize Choice?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Random Prize'}, {name: 'warPrize_5',type: 'str',defaultValue: 6.1,label: 'Challenge #5 Prize number using the format "level.prize"'}, {name: 'warLevel_5',type: 'int',minValue: 1,maxValue: 10, defaultValue: 6,label: 'Challenge #5 master prize list level'}, {name: 'warNoticeInterval',required: false,type: 'str',defaultValue: 2.8,label: 'Time interval for displaying the War Card Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = "One minute and 30 second" intervals.'}, {name: 'warNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the War Card Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Black'}, {name: 'warNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'warNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the War Card Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Periwinkle'}, {name: 'warNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'warResultTextColor',label: 'Choose your Text color for the War Card Game results messages',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Orange'}, {name: 'warResultCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'warResultBgColor',label: 'Choose your Background/Highlight color for the War Card Game results messages',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Orange'}, {name: 'warResultCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'warResultSpecialTextColor',label: 'Choose your Text color for the War Card Game results messages when the viewer wins or there is a tie',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Green'}, {name: 'warResultSpecialCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'warResultSpecialBgColor',label: 'Choose your Background/Highlight color for the War Card Game results messages when the viewer wins or there is a tie',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Cream'}, {name: 'warResultSpecialCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Press your luck Game {name: 'dummyPress', label: ' *************************************************************** *********************** Press Your Luck ********************** *************************************************************** This is a game of escalating prizes as the viewers continue to press their luck and draw a card. They can choose to stop if they win a round, or tip to draw again for the next round. Once they lose, they lose all progress and no prize is awarded.', type: 'choice',required: false}, {name: 'pressEnable',required: false,label: 'Enable the Press Your Luck Game at the start of the show? Note you can also turn the game on and off during the show using the "/press on" and "/press off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'pressPrice',type: 'int',minValue: 1,maxValue: 100, defaultValue: 9,label: 'How much do you want to charge for someone to challenge you to a Game of War for the below level?'}, {name: 'pressChance',label: 'Chance to win on each draw. Note that since the cards are removed from the deck each time, the odds decrease with each successive win by about 2%. The percentages noted here are only for the first draw.', type: 'choice', choice1: 'Red Card (50%)', choice2: 'Black Card (50%)', choice3: 'Hearts (25%)', choice4: 'Diamonds (25%)', choice5: 'Clubs (25%)', choice6: 'Spades (25%)', choice7: 'Number Cards 2-10 (69%)', choice8: 'Face Cards and Aces (31%)', choice9: 'Aces (8%)', choice10: 'Queen of Hearts (2%)', defaultValue: 'Red Card (50%)'}, {name: 'pressPrizeType_1',label: 'Round 1: Use a specific prize number or a random prize? Depending on your selection, configure one of the two values below', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', defaultValue: 'Random Prize'}, {name: 'pressPrize_1',type: 'str',defaultValue: 1.1,label: 'Round 1: If you chose "Specific Prize" above, define the prize number using the format "level.prize". For example, if you want to use prize #5 from level 1, put "1.5" here'}, {name: 'pressLevel_1',type: 'int',minValue: 1,maxValue: 10, defaultValue: 1,label: 'Round 1: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'pressPrizeType_2',label: 'Round 2: Use a specific prize number or a random prize?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Random Prize'}, {name: 'pressPrize_2',required: false,type: 'str',defaultValue: 2.1,label: 'Round 2: If you chose "Specific Prize" above, define the prize number using the format "level.prize".'}, {name: 'pressLevel_2',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 2,label: 'Round 2: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'pressPrizeType_3',label: 'Round 3: Use a specific prize number or a random prize?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Random Prize'}, {name: 'pressPrize_3',required: false,type: 'str',defaultValue: 3.1,label: 'Round 3: If you chose "Specific Prize" above, define the prize number using the format "level.prize".'}, {name: 'pressLevel_3',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 3,label: 'Round 3: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'pressPrizeType_4',label: 'Round 4: Use a specific prize number or a random prize?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Specific Prize'}, {name: 'pressPrize_4',required: false,type: 'str',defaultValue: 5.1,label: 'Round 4: If you chose "Specific Prize" above, define the prize number using the format "level.prize".'}, {name: 'pressLevel_4',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 5,label: 'Round 4: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'pressPrizeType_5',label: 'Round 5: Use a specific prize number or a random prize?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Specific Prize'}, {name: 'pressPrize_5',required: false,type: 'str',defaultValue: 7.1,label: 'Round 5: If you chose "Specific Prize" above, define the prize number using the format "level.prize".'}, {name: 'pressLevel_5',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 7,label: 'Round 5: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'pressPrizeType_6',label: 'Round 6: Use a specific prize number or a random prize?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Specific Prize'}, {name: 'pressPrize_6',required: false,type: 'str',defaultValue: 9.1,label: 'Round 6: If you chose "Specific Prize" above, define the prize number using the format "level.prize".'}, {name: 'pressLevel_6',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 9,label: 'Round 6: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'pressPrizeType_7',label: 'Round 7: Use a specific prize number or a random prize?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Not Used'}, {name: 'pressPrize_7',required: false,type: 'str',label: 'Round 7: If you chose "Specific Prize" above, define the prize number using the format "level.prize".'}, {name: 'pressLevel_7',required: false,type: 'int',minValue: 1,maxValue: 10, label: 'Round 7: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'pressPrizeType_8',label: 'Round 8: Use a specific prize number or a random prize?', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', choice3: 'Not Used', defaultValue: 'Not Used'}, {name: 'pressPrize_8',required: false,type: 'str',label: 'Round 8: If you chose "Specific Prize" above, define the prize number using the format "level.prize".'}, {name: 'pressLevel_8',required: false,type: 'int',minValue: 1,maxValue: 10, label: 'Round 8: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'pressNoticeInterval',required: false,type: 'str',defaultValue: 1.8,label: 'Time interval for displaying the Press Your Luck Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 2.5 = "Two minutes and 30 seconds" intervals.'}, {name: 'pressNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Dice Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Black'}, {name: 'pressNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'pressNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Dice Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',defaultValue: 'Light Periwinkle'}, {name: 'pressNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'pressResultTextColor',label: 'Choose your Text color for the Dice Roll results messages',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Black'}, {name: 'pressResultCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'pressResultBgColor',label: 'Choose your Background/Highlight color for the Dice Roll results messages',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',defaultValue: 'Light Blue'}, {name: 'pressResultCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Random Prizes {name: 'dummyRandom', label: ' ************************************************************ *********************** Random Prizes ********************** *************************************************************** This feature lets you assign prizes at different tip thresholds that will be awarded randomly when people tip. There are 3 tip threshold levels that can be defined, and you set the win percentage and prize ID/prize level for each, with the threshold value indicating the lowest value for the range. Note that not all thresholds are required. For example, if you wanted to only use one threshold and prize list for all tips, set the threshold 1 value to a minimum value (maybe "2" if you want to exclude 1 token tips) and leave the others blank or zero. You can either identify a specific prize, or a random prize from the master prize list level.', type: 'choice',required: false}, {name: 'randomEnable',label: 'Enable the Random Prize Game at the start of the show? Note you can also turn the game on and off during the show using the "/random on" and "/random off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, // {name: 'randomExclude', label: 'Enter a list of the tip amounts that should be excluded from any random prize awards (may decide to exclude 1 token tips or amounts commonly tipped for lush or tip menu items so there are not "double rewards" for those). Format should be comma separated with no spaces (such as 1,15,21 for example)', type: 'str', minLength: 1, maxLength: 250, defaultValue: '', required: false}, {name: 'randomPrice_1',type: 'int',minValue: 1,maxValue: 99999, defaultValue: 5,label: 'Tip Threshold 1 - Tips greater than this amount and less than the threshold 2 have a chance to win Prize 1 below. If threshold 2 and 3 are not used, any tip greater than threshold 1 is eligible to win Prize 1'}, {name: 'randomPercent_1',type: 'int',minValue: 1,maxValue: 100, defaultValue: 2,label: 'Threshold 1 Odds: Percent chance to win from a tip less than the Tip Threshold 1. The values are percentages, so as and example, a value of 5 means 5%, or a 1 in 20 chance to win. The selection is random, so every tip would have a 5% chance.'}, {name: 'randomPrizeType_1',label: 'Threshold 1 Prize Type: Use a specific prize number or a random prize? Depending on your selection, configure one of the two values below', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', defaultValue: 'Random Prize'}, {name: 'randomPrize_1',required: false,type: 'str',defaultValue: 2.5,label: 'Threshold 1: If you chose "Specific Prize" above, define the prize number from the master prize list using the format "level.prize". For example, if you want to use prize #3 from master prize level 2, put "2.3" here'}, {name: 'randomLevel_1',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 2,label: 'Threshold 1: If you chose "Random Prize" above, select the master prize list level that should be used for picking a random prize'}, {name: 'randomPrice_2',required: false,type: 'int',minValue: 1,maxValue: 99999, defaultValue: 20,label: '(Optional) Tip Threshold 2 - Tips greater than this amount and less than the threshold 3 have a chance to win Prize 2 below. If threshold 3 is not used, any tip greater than threshold 2 is eligible to win Prize 2'}, {name: 'randomPercent_2',required: false,type: 'int',minValue: 1,maxValue: 100, defaultValue: 2,label: 'Threshold 2 Odds: Percent chance to win'}, {name: 'randomPrizeType_2',label: 'Threshold 2 Prize Type', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', defaultValue: 'Random Prize'}, {name: 'randomPrize_2',required: false,type: 'str',defaultValue: 3.3,label: 'Threshold 2: Specific Prize number using the format "level.prize"'}, {name: 'randomLevel_2',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 3,label: 'Threshold 2: Random Prize from this master prize list level'}, {name: 'randomPrice_3',required: false,type: 'int',minValue: 1,maxValue: 99999, defaultValue: 50,label: '(Optional) Tip Threshold 3 - Tips greater than this amount have a chance to win Prize 3 below'}, {name: 'randomPercent_3',required: false,type: 'int',minValue: 1,maxValue: 100, defaultValue: 2,label: 'Threshold 3 Odds: Percent chance to win'}, {name: 'randomPrizeType_3',label: 'Threshold 3 Prize Type', type: 'choice', choice1: 'Specific Prize', choice2: 'Random Prize', defaultValue: 'Random Prize'}, {name: 'randomPrize_3',required: false,type: 'str',defaultValue: 4.3,label: 'Threshold 3: Specific Prize number using the format "level.prize"'}, {name: 'randomLevel_3',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 4,label: 'Threshold 3: Random Prize from this master prize list level'}, {name: 'randomNoticeInterval',required: false,type: 'str',defaultValue: 3.2,label: 'Time interval for displaying the Random Prize Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = "One minute and 30 second" intervals.'}, {name: 'randomNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Random Prize Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Black'}, {name: 'randomNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'randomNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Random Prize Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Periwinkle'}, {name: 'randomNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Bad Libs {name: 'dummyBad', label: ' ************************************************************* ***************** Bad Libs Game ***************** ************************************************************* In the Bad Libs game, crazy phrases are put together similar to the classic Mad Libs. When a player tips to play, they get a random result of 4 selections that are combined together in the form "Who" performs "What" "Where" and for "How Long". Would probably mainly be good for couples shows where people can do stuff to each other, similar to sex dice.', type: 'choice',required: false}, {name: 'badEnable',required: false,label: 'Enable the Bad Libs Game at the start of the show? Note you can also turn the game on and off during the show using the "/badlibs on" and "/badlibs off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'badPrice',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 69,label: 'How much do you want to charge per "draw" of the Bad Libs Cards?'}, {name: 'badWho',required: false,type: 'str',defaultValue: 'Person1,Person2',label: 'List the names of the people who are playing and will do the actions (comma separated, no spaces). Replace the defaults with the actual broadcaster (CB) names'}, {name: 'badWhat',required: false,type: 'str',defaultValue: 'licks partner,does naked squats,does naked pushups,kisses partner,goes down on partner,smacks partner,takes off top or bra,takes off pants or boxers or panties,spanks partner,plays thumb war with partner,gives partner a wet willy,does naked jumping jacks,acts like a penguin,plays with ice on nipples,talks really dirty,tries to do naked splits,does the robot naked,performs in a wet t-shirt contest,impersonates their favorite pornstar',label: 'List the eligible actions. Each one has an equal chance of being selected, so to reduce the odds of "better" prizes, make them occur less often in the list and make more of the "easier" prizes (comma separated, no spaces - do not use commas in the actual actions or they will be split). You can repeat prizes to give them a better chance of winning'}, {name: 'badWhere',required: false,type: 'str',defaultValue: 'in bed,on the floor,in the tub,on the table,upside down,in the corner,in the kitchen,with the front door open,in front of window with curtains open,on the couch',label: 'List where the action will be performed (comma separated, no spaces)'}, {name: 'badHowLong',required: false,type: 'str',defaultValue: '5 seconds,10 seconds,10 seconds,10 seconds,20 seconds,20 seconds,20 seconds,20 seconds,30 seconds,30 seconds,30 seconds,30 seconds,1 minute,1 minute,1 minute,2 minutes,3 minutes,4 minutes,5 minutes',label: 'List the possible choices for how long to do the action (comma separated, no spaces)'}, {name: 'badNoticeInterval',required: false,type: 'str',defaultValue: 2.6,label: 'Time interval for displaying the Bad Libs Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = "One minute and 30 second" intervals.'}, {name: 'badNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Bad Libs Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Black'}, {name: 'badNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'badNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Bad Libs Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Periwinkle'}, {name: 'badNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Charades / Pictionary {name: 'dummyCharades', label: ' ************************************************************* ************* Charades/Pictionary Game *************** ************************************************************* The viewers can tip to have the broadcaster(s) act out (Charades) or draw (Pictionary) a word or phrase, and then the tipper or the audience attempts to guess what they are acting out or drawing. There are three modes - Broadcaster against Broadcaster (usually for couples/multiple performer shows), and two levels of viewer against room (usually for solo shows) - single games and a goal race.', type: 'choice',required: false}, {name: 'charadesType',label: 'Are you playing Charades or Pictionary? The game behaves the same way for both, this just updates the text notices displayed during the game', type: 'choice', choice1: 'Charades', choice2: 'Pictionary', defaultValue: 'Charades'}, {name: 'charadesEnable',required: false,label: 'Enable the Charades Game at the start of the show? Note you can also turn the game on and off during the show using the "/charades on" and "/charades off" commands', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'charadesMode',required: false,label: 'What is the format of the game - "Broadcaster against Broadcaster" or "Viewer Against the Room"? For Broadcaster against Broadcaster, the broadcasters take turns, and accumulate points when the room guesses correctly on their turn. This can one round or multiple rounds until one broadcaster reaches the specified point total, up to 5 broadcasters can play. This mode can either be run with or without a tip requirement. For viewer against the room, the person who tips is trying to guess correctly before anyone else in the room to win a prize, and this goes 1 round for each tip.', type: 'choice', choice1: 'Mode 1 - Broadcaster against Broadcaster', choice2: 'Mode 2 - Viewer against Room (One Game)', choice3: 'Mode 3 - Viewer against Room (Goal Race)', defaultValue: 'Mode 2 - Viewer against Room (One Game)'}, {name: 'charadesSource',required: false,label: 'Who provides the Charades words/phrases? Use list from the Gamebot (100 provided in default list), broadcaster provides list below, or broadcaster/moderator selects during the game?', type: 'choice', choice1: 'Gamebot Default List', choice2: 'Broadcaster Defined List', choice3: 'Added During Game', defaultValue: 'Gamebot Default List'}, {name: 'charadesList',required: false,type: 'str',minLength: 1, maxLength: 2000,label: 'If selecting "Broadcaster Defined List" above, list the words and phrases you want to use below. Use a ":" to separate the words and phrases from each other, in a format such as "Superman:Airplane Pilot:Reading a book". The actual word or phrase for each game will be randomly chosen from this list. The matching to the viewer guesses is not case sensitive, so it does not matter if they are capitalized or not'}, {name: 'charadesTimerLength',label: 'If the time for guessing will be limited, set the timer length to be used. Set to "no timer" to not use a timer, or set a length from the list.',type: 'choice', choice1: 'No timer', choice2: '30 sec',choice3: '1 min', choice4: '1 min 30 sec', choice5: '2 min', choice6: '3 min', choice7: '4 min',choice8: '5 min',defaultValue: '1 min 30 sec'}, {name: 'charadesRandom',label: 'Should the next charades word or phrase be drawn at random from the list, or go in order of the entries in the list?', type: 'choice', choice1: 'Random', choice2: 'In Order', defaultValue: 'Random'}, {name: 'charadesModsKnowWord',required: false,label: 'Do the moderators have visiblity to the Charades Word or Phrase (they don\'t play the game), and are able to add words to the list?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'charadesNoticeInterval',required: false,type: 'str',defaultValue: 2.6,label: 'Time interval for displaying the recurring Charades Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, use 2.5 for Two minutes and 30 second intervals.'}, {name: 'charadesNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Charades Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Dark Plum'}, {name: 'charadesNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'charadesNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Charades Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Pink'}, {name: 'charadesNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'dummyCharades1', label: ' ****************** Charades Mode 1 Setup ****************** If using "Mode 1 - Broadcaster against Broadcaster", set up this section', type: 'choice',required: false}, {name: 'charadesBABPlayer1',type: 'str',minLength: 1, maxLength: 25,defaultValue: 'Player 1 Name',label: 'Mode 1 - Player 1 Name'}, {name: 'charadesBABPlayer2',type: 'str',minLength: 1, maxLength: 25,defaultValue: 'Player 2 Name',label: 'Mode 1 - Player 2 Name'}, {name: 'charadesBABPlayer3',required: false,type: 'str',minLength: 1, maxLength: 25,label: 'Mode 1 - Player 3 Name (leave blank if not used)'}, {name: 'charadesBABPlayer4',required: false,type: 'str',minLength: 1, maxLength: 25,label: 'Mode 1 - Player 4 Name (leave blank if not used)'}, {name: 'charadesBABPlayer5',required: false,type: 'str',minLength: 1, maxLength: 25,label: 'Mode 1 - Player 5 Name (leave blank if not used)'}, {name: 'charadesBABPrice',type: 'int',minValue: 0,maxValue: 1000, defaultValue: 0,label: 'Mode 1 - If requiring a tip for each round to start, how much do you want to charge per round? Leave this as "0" to play without tips required (broadcaster/moderator starts all games with the /chfree command). You may decide to do a round of charades at each goal, for example, so you could set up Progressive Goals or Goal Counter in Dorothy\'s UltraApp, and then start playing Charades here in the Gamebot each time the goal is hit. Could play one player, one round, or an entire game at each goal, in which case set the price here to "0" and play using the command.'}, {name: 'charadesBABGoal',type: 'int',minValue: 1,maxValue: 100, defaultValue: 5,label: 'For Mode 1 - Point Goal - Winning Broadcaster is the first one to this many correct guesses by the room'}, {name: 'charadesBABPrize',required: false,type: 'str',label: 'For Mode 1 - Prize for winning broadcaster - Any text value can be entered, such as "Winner Receives oral from Loser" or "Winner Spanks Loser"'}, {name: 'dummyCharades2', label: ' ****************** Charades Mode 2 Setup ****************** If using "Mode 2 - Viewer against Room (One Game)", set up this section. There are three types of prizes, the first one populated from the three below is used (broadcaster-enetred, specific prize from master list, winner picks from master list level)', type: 'choice',required: false}, {name: 'charadesVARPrice',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 39,label: 'Mode 2 - How much do you want to charge for a viewer to play a single game of charades against the room?'}, {name: 'charadesVARPrize',required: false,type: 'str',minLength: 1, maxLength: 50,label: 'Mode 2 - Broadcaster-entered Prize: If this value is filled it will be used, if left blank, check below for prize number'}, {name: 'charadesVARPrizeNumber',required: false,type: 'str',defaultValue: 4.2,label: 'Mode 2 - Specific Prize: If the above value is blank and this value is filled it will be used, if left blank, check below for prize level. Enter the prize number from the master prize list using the format "level.prize". For example, if you want to use prize #3 from master prize level 2, put "2.3" here'}, {name: 'charadesVARPrizeLevel',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 4,label: 'Mode 2 - Pick from Prize Level: Let the user select a prize from the master prize list level defined here, must be from 1-10'}, {name: 'dummyCharades3', label: ' ****************** Charades Mode 3 Setup ****************** If using "Mode 3 - Viewer against Room (Goal Race)", set up this section. There are three types of prizes for the person who gets to the defined point total first, the first one populated from the three below is used (broadcaster-enetred, specific prize from master list, winner picks from master list level)', type: 'choice',required: false}, {name: 'charadesVAR2Goal',type: 'int',minValue: 1,maxValue: 100, defaultValue: 8,label: 'For Mode 3 - Set the total point goal at which the winner gets the prize. Tippers who win their own game get 3 points, correct guesses from the rest of the room win 1 point.'}, {name: 'charadesVAR2Price',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 59,label: 'Mode 3 - How much do you want to charge for a viewer to play charades against the room?'}, {name: 'charadesVAR2Prize',required: false,type: 'str',minLength: 1, maxLength: 50,label: 'Mode 3 - Broadcaster-entered Prize: If this value is filled it will be used, if left blank, check below for prize number'}, {name: 'charadesVAR2PrizeNumber',required: false,type: 'str',defaultValue: 4.2,label: 'Mode 3 - Specific Prize: If the above value is blank and this value is filled it will be used, if left blank, check below for prize level. Enter the prize number from the master prize list using the format "level.prize". For example, if you want to use prize #3 from master prize level 2, put "2.3" here'}, {name: 'charadesVAR2PrizeLevel',required: false,type: 'int',minValue: 1,maxValue: 10, defaultValue: 4,label: 'Mode 3 - Pick from Prize Level: Let the user select a prize from the master prize list level defined here, must be from 1-10'}, // *** Twenty Questions {name: 'dummy20', label: ' ************************************************************* ***************** Twenty Questions Game ***************** ************************************************************* In 20 questions (which is actually configurable for the number of questions), the Broadcaster sets their word, and then people can tip to ask a "Yes" or "No" question in their tip note to try to figure out what the word is. The first viewer to guess the word correctly wins the prize. Keep in mind when setting the prize, that it should correlate to whether people are playing individually or the whole room is playing together. If individuals are playing, the prize would likely be something that an individual would win, like a video or snap access, or else everyone will just work together. If everyone is playing together, the prize may be more of something the broadcaster does for the room. Note that the word is not set below during launch, rather it is set during the game with the command "/tword xxxx".', type: 'choice',required: false}, {name: 'twentyEnable',required: false,label: 'Enable the Twenty Questions Game at the start of the show? Note you can also turn the game on and off during the show using the "/twenty on" and "/twenty off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'twentyAllowAll',label: 'All Play or Individual Play - With "All Play" the whole room works together and everyone will be able to see the Yes / No questions and answers. Note that if this is turned on, all tip notes associated with tips of the above "price to play" the game will be sent to the general chat. If it is set to individual play, each person asks their own questions. See above notes regarding prize assignment for each mode.', type: 'choice', choice1: 'All Play', choice2: 'Individual Play', defaultValue: 'All Play'}, {name: 'twentyPrice',type: 'int',minValue: 1,maxValue: 1000, defaultValue: 7,label: 'Price to Play - How much do you want to charge for a person to ask EACH question? When setting this price, consider the number of guesses you might expect someone to need to make to get to the answer (usually 15-20), how many people are likely to play, and the normal value of the prize. For example, if the prize is worth 150 tokens, one person making 15 guesses at 10 tokens each would cover the prize value. So if you expect other people will play, you can set it lower, maybe 6-8 tokens. Also, do not use a common tip amount as the price, especially when using "All Play" mode, as anyone who tips the price to play will have any tip note associate with the tip displayed to the room.'}, {name: 'twentyPrize',required: false,type: 'str',label: 'Prize for Guessing Word: Either enter any text value here, such as "Strip Tease" or "Snap Access", or leave blank and enter a prize number in the next setting below. One of the two must be entered to start the game'}, {name: 'twentyPrizeNumber',required: false,type: 'str',label: 'Prize for Guessing Word - Specific Prize from Prize List: If the above value is blank and this value is filled it will be used, if left blank, check below for prize level. Enter the prize number from the master prize list using the format "level.prize". For example, if you want to use prize #3 from master prize level 2, put "2.3" here'}, {name: 'twentyNumberOfQuestions',required: false,type: 'int',minValue: 1,maxValue: 100, defaultValue: 20,label: 'Max number of questions allowed. Defaulted to 20 since the game is "20 questions", but can be set from 1 up to 100'}, {name: 'twentyModsKnowWord',required: false,label: 'Do the moderators have visiblity to the Charades Word or Phrase (they don\'t play the game), and are able to add words to the list?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'twentyNoticeInterval',required: false,type: 'str',defaultValue: 2.2,label: 'Time interval for displaying the Twenty Questions Game notice in the chat, in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = "One minute and 30 second" intervals.'}, {name: 'twentyNoticeTextColor',label: 'Choose your Text color for the recurring chat notices related to the Twenty Questions Game',type: 'choice',choice1: 'White/No Color',choice2: 'Black',choice3: 'Dark Grey',choice4: 'Dark Red',choice5: 'Dark Orange',choice6: 'Dark Green',choice7: 'Dark Aqua',choice8: 'Dark Blue',choice9: 'Dark Purple',choice10: 'Dark Pink',choice11: 'Dark Gold',choice12: 'Dark Teal',choice13: 'Dark Brown',choice14: 'Dark Bronze',choice15: 'Dark Periwinkle',choice16: 'Dark Fuschia',choice17: 'Dark Lime',choice18: 'Dark Plum',choice19: 'Custom',defaultValue: 'Black'}, {name: 'twentyNoticeCustomTextColor', label: 'If you picked a custom Text color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'twentyNoticeBgColor',label: 'Choose your Background/Highlight color for the recurring chat notices related to the Twenty Questions Game',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Light Teal',choice12: 'Cream',choice13: 'Light Bronze',choice14: 'Light Periwinkle',choice15: 'Light Fuschia',choice16: 'Light Lime',choice17: 'Light Plum',choice18: 'Custom',defaultValue: 'Light Periwinkle'}, {name: 'twentyNoticeCustomBgColor', label: 'If you picked a custom Background/Highlight color in the previous setting, enter the hex color (6 character hex color codes including the # prefix, such as #FFFFFF):', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Master Prize List {name: 'dummyPrizes', label: ' *************************************************************** ********************** Master Prize List *********************** *************************************************************** You can define all of your potential game prizes below, with a tip amount. Some games will use the tip amount, so make sure to only use a tip amount one time. Some games it is only important which level the prize is in and that is noted within the game configuration above. You do not have to fill out every prize on the list, but you should fill out as many as are needed for each of the games that would use them. If a value is completely blanked out, the default prize will show up again, so to prevent a prize from being used, you can set the price to zero and the games will skip those prizes. The prices and prizes listed as defaults are just suggestions used for easy first time setup, please update them per your own personal prize and price preference and type of show (solo, couple, etc)', type: 'choice',required: false}, {name: 'dummyLevel1', label: '********* Level 1 Prizes (Tip Value 1-20 tokens) *******', type: 'choice',required: false}, {name: 'Prize_1_1', required: false, type: 'str', label: 'Prize 1.1', defaultValue: 'Make a Silly Face'}, {name: 'Price_1_1', required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 2}, {name: 'Prize_1_2', required: false, type: 'str', label: 'Prize 1.2', defaultValue: 'Show belly button'}, {name: 'Price_1_2', required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 3}, {name: 'Prize_1_3', required: false, type: 'str', label: 'Prize 1.3', defaultValue: 'Blow a kiss'}, {name: 'Price_1_3', required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 4}, {name: 'Prize_1_4', required: false, type: 'str', label: 'Prize 1.4', defaultValue: 'Stand up and twirl'}, {name: 'Price_1_4', required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 6}, {name: 'Prize_1_5', required: false, type: 'str', label: 'Prize 1.5', defaultValue: '3 Clothed spanks'}, {name: 'Price_1_5', required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 7}, {name: 'Prize_1_6', required: false, type: 'str', label: 'Prize 1.6', defaultValue: 'Clothed show butt'}, {name: 'Price_1_6', required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 8}, {name: 'Prize_1_7', required: false, type: 'str', label: 'Prize 1.7', defaultValue: '5 Clothed jumping jacks'}, {name: 'Price_1_7', required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 9}, {name: 'Prize_1_8', required: false, type: 'str', label: 'Prize 1.8', defaultValue: 'Sensually suck finger'}, {name: 'Price_1_8', required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 11}, {name: 'Prize_1_9', required: false, type: 'str', label: 'Prize 1.9', defaultValue: 'Kiss'}, {name: 'Price_1_9', required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 12}, {name: 'Prize_1_10',required: false, type: 'str', label: 'Prize 1.10', defaultValue: '3 Clothed spanks'}, {name: 'Price_1_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 13}, {name: 'Prize_1_11',required: false, type: 'str', label: 'Prize 1.11', defaultValue: 'Wet Willy'}, {name: 'Price_1_11',required: false, type: 'int', label: 'Price for Prize 11', minValue: 0, maxValue: 1000, defaultValue: 14}, {name: 'Prize_1_12',required: false, type: 'str', label: 'Prize 1.12', defaultValue: 'Show Feet'}, {name: 'Price_1_12',required: false, type: 'int', label: 'Price for Prize 12', minValue: 0, maxValue: 1000, defaultValue: 16}, {name: 'Prize_1_13',required: false, type: 'str', label: 'Prize 1.13', defaultValue: 'Show Bra'}, {name: 'Price_1_13',required: false, type: 'int', label: 'Price for Prize 13', minValue: 0, maxValue: 1000, defaultValue: 17}, {name: 'Prize_1_14',required: false, type: 'str', label: 'Prize 1.14', defaultValue: 'Show tattoo or piercing close-up'}, {name: 'Price_1_14',required: false, type: 'int', label: 'Price for Prize 14', minValue: 0, maxValue: 1000, defaultValue: 18}, {name: 'Prize_1_15',required: false, type: 'str', label: 'Prize 1.15', defaultValue: 'Show Panties or Boxers'}, {name: 'Price_1_15',required: false, type: 'int', label: 'Price for Prize 15', minValue: 0, maxValue: 1000, defaultValue: 19}, {name: 'Prize_1_16',required: false, type: 'str', label: 'Prize 1.16'}, {name: 'Price_1_16',required: false, type: 'int', label: 'Price for Prize 16', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_1_17',required: false, type: 'str', label: 'Prize 1.17'}, {name: 'Price_1_17',required: false, type: 'int', label: 'Price for Prize 17', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_1_18',required: false, type: 'str', label: 'Prize 1.18'}, {name: 'Price_1_18',required: false, type: 'int', label: 'Price for Prize 18', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_1_19',required: false, type: 'str', label: 'Prize 1.19'}, {name: 'Price_1_19',required: false, type: 'int', label: 'Price for Prize 19', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_1_20',required: false, type: 'str', label: 'Prize 1.20'}, {name: 'Price_1_20',required: false, type: 'int', label: 'Price for Prize 20', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'dummyLevel2', label: '********* Level 2 Prizes - Tip Value 21-50 tokens *******', type: 'choice',required: false}, {name: 'Prize_2_1',required: false, type: 'str', label: 'Prize 2.1', defaultValue: 'Sexy Makeout'}, {name: 'Price_2_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 21}, {name: 'Prize_2_2',required: false, type: 'str', label: 'Prize 2.2', defaultValue: 'Show Feet'}, {name: 'Price_2_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 22}, {name: 'Prize_2_3',required: false, type: 'str', label: 'Prize 2.3', defaultValue: 'Flex muscles'}, {name: 'Price_2_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 23}, {name: 'Prize_2_4',required: false, type: 'str', label: 'Prize 2.4', defaultValue: 'Clothed Twerking'}, {name: 'Price_2_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 24}, {name: 'Prize_2_5',required: false, type: 'str', label: 'Prize 2.5', defaultValue: '10 bra-less jumping jacks'}, {name: 'Price_2_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 26}, {name: 'Prize_2_6',required: false, type: 'str', label: 'Prize 2.6', defaultValue: 'Impersonate a famous person'}, {name: 'Price_2_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 27}, {name: 'Prize_2_7',required: false, type: 'str', label: 'Prize 2.7', defaultValue: 'Feel boobs through clothes'}, {name: 'Price_2_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 28}, {name: 'Prize_2_8',required: false, type: 'str', label: 'Prize 2.8', defaultValue: 'Song request'}, {name: 'Price_2_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 29}, {name: 'Prize_2_9',required: false, type: 'str', label: 'Prize 2.9', defaultValue: 'Show camel-toe'}, {name: 'Price_2_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 31}, {name: 'Prize_2_10',required: false, type: 'str', label: 'Prize 2.10', defaultValue: 'Boob Flash'}, {name: 'Price_2_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 32}, {name: 'Prize_2_11',required: false, type: 'str', label: 'Prize 2.11', defaultValue: 'Attempt cartwheel'}, {name: 'Price_2_11',required: false, type: 'int', label: 'Price for Prize 11', minValue: 0, maxValue: 1000, defaultValue: 34}, {name: 'Prize_2_12',required: false, type: 'str', label: 'Prize 2.12', defaultValue: 'Rub pussy or cock through clothes'}, {name: 'Price_2_12',required: false, type: 'int', label: 'Price for Prize 12', minValue: 0, maxValue: 1000, defaultValue: 37}, {name: 'Prize_2_13',required: false, type: 'str', label: 'Prize 2.13', defaultValue: 'Play "Never Have I Ever"'}, {name: 'Price_2_13',required: false, type: 'int', label: 'Price for Prize 13', minValue: 0, maxValue: 1000, defaultValue: 38}, {name: 'Prize_2_14',required: false, type: 'str', label: 'Prize 2.14', defaultValue: 'Play Charades'}, {name: 'Price_2_14',required: false, type: 'int', label: 'Price for Prize 14', minValue: 0, maxValue: 1000, defaultValue: 39}, {name: 'Prize_2_15',required: false, type: 'str', label: 'Prize 2.15', defaultValue: 'Free Dice Roll'}, {name: 'Price_2_15',required: false, type: 'int', label: 'Price for Prize 15', minValue: 0, maxValue: 1000, defaultValue: 41}, {name: 'Prize_2_16',required: false, type: 'str', label: 'Prize 2.16', defaultValue: 'Free Wheel Spin'}, {name: 'Price_2_16',required: false, type: 'int', label: 'Price for Prize 16', minValue: 0, maxValue: 1000, defaultValue: 42}, {name: 'Prize_2_17',required: false, type: 'str', label: 'Prize 2.17', defaultValue: ''}, {name: 'Price_2_17',required: false, type: 'int', label: 'Price for Prize 17', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_2_18',required: false, type: 'str', label: 'Prize 2.18', defaultValue: ''}, {name: 'Price_2_18',required: false, type: 'int', label: 'Price for Prize 18', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_2_19',required: false, type: 'str', label: 'Prize 2.19', defaultValue: ''}, {name: 'Price_2_19',required: false, type: 'int', label: 'Price for Prize 19', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_2_20',required: false, type: 'str', label: 'Prize 2.20', defaultValue: ''}, {name: 'Price_2_20',required: false, type: 'int', label: 'Price for Prize 20', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'dummyLevel3', label: '********* Level 3 Prizes - Tip Value 51-75 tokens *******', type: 'choice',required: false}, {name: 'Prize_3_1',required: false, type: 'str', label: 'Prize 3.1', defaultValue: '2 song requests'}, {name: 'Price_3_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 51}, {name: 'Prize_3_2',required: false, type: 'str', label: 'Prize 3.2', defaultValue: '3 bare ass spanks'}, {name: 'Price_3_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 52}, {name: 'Prize_3_3',required: false, type: 'str', label: 'Prize 3.3', defaultValue: 'Oil Boobs'}, {name: 'Price_3_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 53}, {name: 'Prize_3_4',required: false, type: 'str', label: 'Prize 3.4', defaultValue: 'Put on heels'}, {name: 'Price_3_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 54}, {name: 'Prize_3_5',required: false, type: 'str', label: 'Prize 3.5', defaultValue: 'Outfit request'}, {name: 'Price_3_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 56}, {name: 'Prize_3_6',required: false, type: 'str', label: 'Prize 3.6', defaultValue: 'Put on stockings or leggings'}, {name: 'Price_3_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 57}, {name: 'Prize_3_7',required: false, type: 'str', label: 'Prize 3.7', defaultValue: 'Ice on nipples'}, {name: 'Price_3_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 58}, {name: 'Prize_3_8',required: false, type: 'str', label: 'Prize 3.8', defaultValue: 'Suck on boobs'}, {name: 'Price_3_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 59}, {name: 'Prize_3_9',required: false, type: 'str', label: 'Prize 3.9', defaultValue: '2 min topless'}, {name: 'Price_3_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 61}, {name: 'Prize_3_10',required: false, type: 'str', label: 'Prize 3.10', defaultValue: 'Ass Flash'}, {name: 'Price_3_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 62}, {name: 'Prize_3_11',required: false, type: 'str', label: 'Prize 3.11', defaultValue: 'Topless jumping jacks'}, {name: 'Price_3_11',required: false, type: 'int', label: 'Price for Prize 11', minValue: 0, maxValue: 1000, defaultValue: 63}, {name: 'Prize_3_12',required: false, type: 'str', label: 'Prize 3.12', defaultValue: '5 bare ass spanks'}, {name: 'Price_3_12',required: false, type: 'int', label: 'Price for Prize 12', minValue: 0, maxValue: 1000, defaultValue: 64}, {name: 'Prize_3_13',required: false, type: 'str', label: 'Prize 3.13', defaultValue: 'Flash and Massage Boobs'}, {name: 'Price_3_13',required: false, type: 'int', label: 'Price for Prize 13', minValue: 0, maxValue: 1000, defaultValue: 65}, {name: 'Prize_3_14',required: false, type: 'str', label: 'Prize 3.14', defaultValue: 'Pussy or Cock Flash'}, {name: 'Price_3_14',required: false, type: 'int', label: 'Price for Prize 14', minValue: 0, maxValue: 1000, defaultValue: 66}, {name: 'Prize_3_15',required: false, type: 'str', label: 'Prize 3.15', defaultValue: 'Play with nipples'}, {name: 'Price_3_15',required: false, type: 'int', label: 'Price for Prize 15', minValue: 0, maxValue: 1000, defaultValue: 67}, {name: 'Prize_3_16',required: false, type: 'str', label: 'Prize 3.16', defaultValue: 'Free Picture Set'}, {name: 'Price_3_16',required: false, type: 'int', label: 'Price for Prize 16', minValue: 0, maxValue: 1000, defaultValue: 68}, {name: 'Prize_3_17',required: false, type: 'str', label: 'Prize 3.17', defaultValue: '10 spanks with spatula or cookie sheet'}, {name: 'Price_3_17',required: false, type: 'int', label: 'Price for Prize 17', minValue: 0, maxValue: 1000, defaultValue: 71}, {name: 'Prize_3_18',required: false, type: 'str', label: 'Prize 3.18'}, {name: 'Price_3_18',required: false, type: 'int', label: 'Price for Prize 18', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_3_19',required: false, type: 'str', label: 'Prize 3.19'}, {name: 'Price_3_19',required: false, type: 'int', label: 'Price for Prize 19', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_3_20',required: false, type: 'str', label: 'Prize 3.20'}, {name: 'Price_3_20',required: false, type: 'int', label: 'Price for Prize 20', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'dummyLevel4', label: '********* Level 4 Prizes - Tip Value 76-100 tokens *******', type: 'choice',required: false}, {name: 'Prize_4_1',required: false, type: 'str', label: 'Prize 4.1', defaultValue: 'Dickcopter'}, {name: 'Price_4_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 76}, {name: 'Prize_4_2',required: false, type: 'str', label: 'Prize 4.2', defaultValue: '10 Naked Jumping Jacks'}, {name: 'Price_4_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 77}, {name: 'Prize_4_3',required: false, type: 'str', label: 'Prize 4.3', defaultValue: '10 Naked Squats'}, {name: 'Price_4_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 78}, {name: 'Prize_4_4',required: false, type: 'str', label: 'Prize 4.4', defaultValue: 'Bare Ass Twerk for 1 min'}, {name: 'Price_4_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 81}, {name: 'Prize_4_5',required: false, type: 'str', label: 'Prize 4.5', defaultValue: 'Topless dancing for 1 song'}, {name: 'Price_4_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 82}, {name: 'Prize_4_6',required: false, type: 'str', label: 'Prize 4.6', defaultValue: '30 sec fingering'}, {name: 'Price_4_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 83}, {name: 'Prize_4_7',required: false, type: 'str', label: 'Prize 4.7', defaultValue: '30 sec handjob'}, {name: 'Price_4_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 84}, {name: 'Prize_4_8',required: false, type: 'str', label: 'Prize 4.8', defaultValue: '30 sec bj'}, {name: 'Price_4_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 86}, {name: 'Prize_4_9',required: false, type: 'str', label: 'Prize 4.9', defaultValue: '30 sec oral'}, {name: 'Price_4_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 87}, {name: 'Prize_4_10',required: false, type: 'str', label: 'Prize 4.10', defaultValue: '30 sec toy play'}, {name: 'Price_4_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 88}, {name: 'Prize_4_11',required: false, type: 'str', label: 'Prize 4.11', defaultValue: '20 bare ass spanks'}, {name: 'Price_4_11',required: false, type: 'int', label: 'Price for Prize 11', minValue: 0, maxValue: 1000, defaultValue: 89}, {name: 'Prize_4_12',required: false, type: 'str', label: 'Prize 4.12', defaultValue: 'Spread booty in doggy style'}, {name: 'Price_4_12',required: false, type: 'int', label: 'Price for Prize 12', minValue: 0, maxValue: 1000, defaultValue: 90}, {name: 'Prize_4_13',required: false, type: 'str', label: 'Prize 4.13', defaultValue: 'Blindfold for 2 min'}, {name: 'Price_4_13',required: false, type: 'int', label: 'Price for Prize 13', minValue: 0, maxValue: 1000, defaultValue: 91}, {name: 'Prize_4_14',required: false, type: 'str', label: 'Prize 4.14', defaultValue: 'Ice in pussy'}, {name: 'Price_4_14',required: false, type: 'int', label: 'Price for Prize 14', minValue: 0, maxValue: 1000, defaultValue: 92}, {name: 'Prize_4_15',required: false, type: 'str', label: 'Prize 4.15', defaultValue: 'Suck on dildo'}, {name: 'Price_4_15',required: false, type: 'int', label: 'Price for Prize 15', minValue: 0, maxValue: 1000, defaultValue: 93}, {name: 'Prize_4_16',required: false, type: 'str', label: 'Prize 4.16', defaultValue: 'Free Ticket to Show'}, {name: 'Price_4_16',required: false, type: 'int', label: 'Price for Prize 16', minValue: 0, maxValue: 1000, defaultValue: 94}, {name: 'Prize_4_17',required: false, type: 'str', label: 'Prize 4.17', defaultValue: '30 sec 69'}, {name: 'Price_4_17',required: false, type: 'int', label: 'Price for Prize 17', minValue: 0, maxValue: 1000, defaultValue: 95}, {name: 'Prize_4_18',required: false, type: 'str', label: 'Prize 4.18'}, {name: 'Price_4_18',required: false, type: 'int', label: 'Price for Prize 18', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_4_19',required: false, type: 'str', label: 'Prize 4.19'}, {name: 'Price_4_19',required: false, type: 'int', label: 'Price for Prize 19', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_4_20',required: false, type: 'str', label: 'Prize 4.20'}, {name: 'Price_4_20',required: false, type: 'int', label: 'Price for Prize 20', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'dummyLevel5', label: '********* Level 5 Prizes - Tip Value 101-150 tokens *******', type: 'choice',required: false}, {name: 'Prize_5_1',required: false, type: 'str', label: 'Prize 5.1', defaultValue: '2 Min toy play'}, {name: 'Price_5_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 101}, {name: 'Prize_5_2',required: false, type: 'str', label: 'Prize 5.2', defaultValue: '2 min fingering'}, {name: 'Price_5_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 109}, {name: 'Prize_5_3',required: false, type: 'str', label: 'Prize 5.3', defaultValue: '2 min handjob'}, {name: 'Price_5_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 111}, {name: 'Prize_5_4',required: false, type: 'str', label: 'Prize 5.4', defaultValue: 'Ice in the butt'}, {name: 'Price_5_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 117}, {name: 'Prize_5_5',required: false, type: 'str', label: 'Prize 5.5', defaultValue: '2 min dildo play'}, {name: 'Price_5_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 118}, {name: 'Prize_5_6',required: false, type: 'str', label: 'Prize 5.6', defaultValue: '2 Min BJ'}, {name: 'Price_5_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 119}, {name: 'Prize_5_7',required: false, type: 'str', label: 'Prize 5.7', defaultValue: 'Bare Ass Twerk for 1 song'}, {name: 'Price_5_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 123}, {name: 'Prize_5_8',required: false, type: 'str', label: 'Prize 5.8', defaultValue: '1 Video'}, {name: 'Price_5_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 128}, {name: 'Prize_5_9',required: false, type: 'str', label: 'Prize 5.9', defaultValue: '2 min 69'}, {name: 'Price_5_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 133}, {name: 'Prize_5_10',required: false, type: 'str', label: 'Prize 5.10', defaultValue: '2 Min Oral'}, {name: 'Price_5_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 149}, {name: 'dummyLevel6', label: '********* Level 6 Prizes - Tip Value 151-200 tokens *******', type: 'choice',required: false}, {name: 'Prize_6_1',required: false, type: 'str', label: 'Prize 6.1', defaultValue: '2 min watch your cam'}, {name: 'Price_6_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 151}, {name: 'Prize_6_2',required: false, type: 'str', label: 'Prize 6.2', defaultValue: '2 min footjob'}, {name: 'Price_6_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 159}, {name: 'Prize_6_3',required: false, type: 'str', label: 'Prize 6.3', defaultValue: 'Take a shot'}, {name: 'Price_6_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 161}, {name: 'Prize_6_4',required: false, type: 'str', label: 'Prize 6.4', defaultValue: '2 Min Toy Control'}, {name: 'Price_6_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 169}, {name: 'Prize_6_5',required: false, type: 'str', label: 'Prize 6.5', defaultValue: '2 min Footjob'}, {name: 'Price_6_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 171}, {name: 'Prize_6_6',required: false, type: 'str', label: 'Prize 6.6', defaultValue: 'Handcuffs/restraints for 5 min'}, {name: 'Price_6_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 179}, {name: 'Prize_6_7',required: false, type: 'str', label: 'Prize 6.7', defaultValue: 'Nipple clamps for 3 min'}, {name: 'Price_6_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 181}, {name: 'Prize_6_8',required: false, type: 'str', label: 'Prize 6.8', defaultValue: '2 Video Bundle'}, {name: 'Price_6_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 189}, {name: 'Prize_6_9',required: false, type: 'str', label: 'Prize 6.9', defaultValue: '1 min sex tease'}, {name: 'Price_6_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 191}, {name: 'Prize_6_10',required: false, type: 'str', label: 'Prize 6.10', defaultValue: 'Upside down twerking on the wall'}, {name: 'Price_6_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 198}, {name: 'dummyLevel7', label: '********* Level 7 Prizes - Tip Value 201-300 tokens *******', type: 'choice',required: false}, {name: 'Prize_7_1',required: false, type: 'str', label: 'Prize 7.1', defaultValue: '5 min Footjob'}, {name: 'Price_7_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 201}, {name: 'Prize_7_2',required: false, type: 'str', label: 'Prize 7.2', defaultValue: '5 min toy play'}, {name: 'Price_7_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 211}, {name: 'Prize_7_3',required: false, type: 'str', label: 'Prize 7.3', defaultValue: '5 min fingering'}, {name: 'Price_7_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 219}, {name: 'Prize_7_4',required: false, type: 'str', label: 'Prize 7.4', defaultValue: '5 song requests'}, {name: 'Price_7_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 222}, {name: 'Prize_7_5',required: false, type: 'str', label: 'Prize 7.5', defaultValue: '5 min handjob'}, {name: 'Price_7_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 231}, {name: 'Prize_7_6',required: false, type: 'str', label: 'Prize 7.6', defaultValue: 'Handcuffs/restraints for 10 min'}, {name: 'Price_7_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 239}, {name: 'Prize_7_7',required: false, type: 'str', label: 'Prize 7.7', defaultValue: '40 bare ass spanks'}, {name: 'Price_7_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 251}, {name: 'Prize_7_8',required: false, type: 'str', label: 'Prize 7.8', defaultValue: '2 min sex tease'}, {name: 'Price_7_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 269}, {name: 'Prize_7_9',required: false, type: 'str', label: 'Prize 7.9', defaultValue: '1 min standing 69'}, {name: 'Price_7_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 291}, {name: 'Prize_7_10',required: false, type: 'str', label: 'Prize 7.10', defaultValue: '3 Video Bundle'}, {name: 'Price_7_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 299}, {name: 'dummyLevel8', label: '********* Level 8 Prizes - Tip Value 301-500 tokens *******', type: 'choice',required: false}, {name: 'Prize_8_1',required: false, type: 'str', label: 'Prize 8.1', defaultValue: '5 min Toy Control'}, {name: 'Price_8_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 333}, {name: 'Prize_8_2',required: false, type: 'str', label: 'Prize 8.2', defaultValue: '5 min oral'}, {name: 'Price_8_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 369}, {name: 'Prize_8_3',required: false, type: 'str', label: 'Prize 8.3', defaultValue: '5 min BJ'}, {name: 'Price_8_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 401}, {name: 'Prize_8_4',required: false, type: 'str', label: 'Prize 8.4', defaultValue: '5 min fucking'}, {name: 'Price_8_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 444}, {name: 'Prize_8_5',required: false, type: 'str', label: 'Prize 8.5', defaultValue: 'Lifetime Premium Snapchat'}, {name: 'Price_8_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 469}, {name: 'Prize_8_6',required: false, type: 'str', label: 'Prize 8.6'}, {name: 'Price_8_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_8_7',required: false, type: 'str', label: 'Prize 8.7'}, {name: 'Price_8_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_8_8',required: false, type: 'str', label: 'Prize 8.8'}, {name: 'Price_8_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_8_9',required: false, type: 'str', label: 'Prize 8.9'}, {name: 'Price_8_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_8_10',required: false, type: 'str', label: 'Prize 8.10'}, {name: 'Price_8_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'dummyLevel9', label: '********* Level 9 Prizes - Tip Value 501-750 tokens *******', type: 'choice',required: false}, {name: 'Prize_9_1',required: false, type: 'str', label: 'Prize 9.1', defaultValue: '10 min Toy Control'}, {name: 'Price_9_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 501}, {name: 'Prize_9_2',required: false, type: 'str', label: 'Prize 9.2', defaultValue: '10 min fingering or dildo play'}, {name: 'Price_9_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 569}, {name: 'Prize_9_3',required: false, type: 'str', label: 'Prize 9.3', defaultValue: '10 min BJ or oral'}, {name: 'Price_9_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 601}, {name: 'Prize_9_4',required: false, type: 'str', label: 'Prize 9.4', defaultValue: '10 min fucking'}, {name: 'Price_9_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 669}, {name: 'Prize_9_5',required: false, type: 'str', label: 'Prize 9.5', defaultValue: 'Cum denial for this show'}, {name: 'Price_9_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 701}, {name: 'Prize_9_6',required: false, type: 'str', label: 'Prize 9.6'}, {name: 'Price_9_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_9_7',required: false, type: 'str', label: 'Prize 9.7'}, {name: 'Price_9_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_9_8',required: false, type: 'str', label: 'Prize 9.8'}, {name: 'Price_9_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_9_9',required: false, type: 'str', label: 'Prize 9.9'}, {name: 'Price_9_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_9_10',required: false, type: 'str', label: 'Prize 9.10'}, {name: 'Price_9_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'dummyLevel10', label: '********* Level 10 Prizes - Tip Value 751-1000 tokens *******', type: 'choice',required: false}, {name: 'Prize_10_1',required: false, type: 'str', label: 'Prize 10.1', defaultValue: 'Panties'}, {name: 'Price_10_1',required: false, type: 'int', label: 'Price for Prize 1', minValue: 0, maxValue: 1000, defaultValue: 751}, {name: 'Prize_10_2',required: false, type: 'str', label: 'Prize 10.2', defaultValue: 'Panties from this show'}, {name: 'Price_10_2',required: false, type: 'int', label: 'Price for Prize 2', minValue: 0, maxValue: 1000, defaultValue: 801}, {name: 'Prize_10_3',required: false, type: 'str', label: 'Prize 10.3', defaultValue: 'Finger or dildo and cum'}, {name: 'Price_10_3',required: false, type: 'int', label: 'Price for Prize 3', minValue: 0, maxValue: 1000, defaultValue: 869}, {name: 'Prize_10_4',required: false, type: 'str', label: 'Prize 10.4', defaultValue: 'Squirt'}, {name: 'Price_10_4',required: false, type: 'int', label: 'Price for Prize 4', minValue: 0, maxValue: 1000, defaultValue: 901}, {name: 'Prize_10_5',required: false, type: 'str', label: 'Prize 10.5', defaultValue: 'Fuck and Cumshot of your choice'}, {name: 'Price_10_5',required: false, type: 'int', label: 'Price for Prize 5', minValue: 0, maxValue: 1000, defaultValue: 969}, {name: 'Prize_10_6',required: false, type: 'str', label: 'Prize 10.6', defaultValue: 'Half priced private'}, {name: 'Price_10_6',required: false, type: 'int', label: 'Price for Prize 6', minValue: 0, maxValue: 1000, defaultValue: 989}, {name: 'Prize_10_7',required: false, type: 'str', label: 'Prize 10.7'}, {name: 'Price_10_7',required: false, type: 'int', label: 'Price for Prize 7', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_10_8',required: false, type: 'str', label: 'Prize 10.8'}, {name: 'Price_10_8',required: false, type: 'int', label: 'Price for Prize 8', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_10_9',required: false, type: 'str', label: 'Prize 10.9'}, {name: 'Price_10_9',required: false, type: 'int', label: 'Price for Prize 9', minValue: 0, maxValue: 1000, defaultValue: 0}, {name: 'Prize_10_10',required: false, type: 'str', label: 'Prize 10.10'}, {name: 'Price_10_10',required: false, type: 'int', label: 'Price for Prize 10', minValue: 0, maxValue: 1000, defaultValue: 0} ]; } // *********************************** Variables and Arrays ************************************** { var initialize = 0; var dashLine60 = new Array(60).join('-'); var dashLine70 = new Array(70).join('-'); var dashLine80 = new Array(80).join('-'); var dashLine90 = new Array(90).join('-'); var appNoticeColor = '#4dd2ff'; // blue for general chat notices var appWarningColor = '#f4d599'; // yellow for general chat warnings (invalid prizes, invalid timer, etc) var appWarningTextColor = '#ff0000'; // red for general chat warnings (invalid prizes, etc) var yellow = '#f4d599'; // Used for clock countdown var red = '#f4c1bc'; // Used for last 2 minutes of clock countdown var minMessagesForNotice = cb.settings.minMessagesForNotice; var msgCounterDice = 0; var msgCounterWheel = 0; var msgCounterTwenty = 0; var msgCounterWar = 0; var msgCounterPress = 0; var msgCounterRoulette = 0; var msgCounterBadlibs = 0; var msgCounterRandom = 0; var msgCounterKeno = 0; var msgCounterCharades = 0; // ************ Variables for Dice Game var diceToggle = 0; var diceRollPrice = cb.settings.diceRollPrice; var diceRollPriceFans = cb.settings.diceRollPriceFans; var diceRollPriceVIP = cb.settings.diceRollPriceVIP; var diceRollPriceMods = cb.settings.diceRollPriceMods; var dicePlural = (diceRollPrice > 1) ? 'tokens' : 'token'; var diceMultiRolls = cb.settings.diceMultiRolls; var diceRollCounter = 0; var diceRollCounterSpecial = 0; var diceMinSpecial = parseInt(cb.settings.diceMinSpecial); var diceGifPfx = ':gbdie'; var diceRarePct = 20; // ************ Variables for Wheel Spin var wheelToggle = 0; var wheelSpinPrice = cb.settings.wheelSpinPrice; var wheelSpinPriceFans = cb.settings.wheelSpinPriceFans; var wheelSpinPriceVIP = cb.settings.wheelSpinPriceVIP; var wheelSpinPriceMods = cb.settings.wheelSpinPriceMods; var wheelMultiSpins = cb.settings.wheelMultiSpins; var wheelSpinCounter = 0; var wheelSpinCounterSpecial = 0; var wheelMinSpecial = parseInt(cb.settings.wheelMinSpecial); var wheelGifPfx = ':wheelgifTBD'; var wheelRarePct = 5; // ************ Variables for Roulette var rouletteToggle = 0; var rouletteShotPrice = cb.settings.rouletteShotPrice; var rouletteMultiShots = cb.settings.rouletteMultiShots; var rouletteRounds = cb.settings.rouletteRounds; // ************ Variables for Keno Game var kenoToggle = 0; var kenoL1 = cb.settings.kenoPrizesLevel1; var kenoL2 = cb.settings.kenoPrizesLevel2; var kenoL3 = cb.settings.kenoPrizesLevel3; var kenoL4 = cb.settings.kenoPrizesLevel4; var kenoL5 = cb.settings.kenoPrizesLevel5; var kenoL6 = cb.settings.kenoPrizesLevel6; var kenoL7 = cb.settings.kenoPrizesLevel7; var kenoL8 = cb.settings.kenoPrizesLevel8; var kenoL9 = cb.settings.kenoPrizesLevel9; var kenoL10 = cb.settings.kenoPrizesLevel10; var kenoLowNumber = cb.settings.kenoLowNumber; var kenoHighNumber = cb.settings.kenoHighNumber; var kenoGuessCounter = 0; var kenoTotalTips = 0; var kenoTotalBoard = 0; var requiredNonWinners = 0; var nonWinners = 0; // ************ Variables for War Card Game var warToggle = 0; var currentWarPrize = ''; var currentChallengeType = ''; var currentWarPlayer = ''; var currentChallenge = ''; // ************ Variables for Press Your Luck var pressToggle = 0; var pressPrice = cb.settings.pressPrice; var pressWinnerGroup = cb.settings.pressChance; var pressWinnerGroupType = 0; var currentPressPrize = ''; var currentRoundType = ''; var currentPressPlayer = ''; var currentRound = ''; // ************ Variables for Random Prize Game var randomToggle = 0; var currentRandomPrize = ''; var randomLowTipAmount = 0; var randomWinnerCounter = 0; // ************ Variables for Bad Libs Game var badToggle = 0; var badPrice = cb.settings.badPrice; // ************ Variables for Charades Game var charadesToggle = 0; var charadesPrize = ''; var charadesVARPlayer = ''; var charadesGuessing = false; var charadesWaiting = false; var charadesEndWarning = false; var charadesActive = false; var charadesRound = 0; var charadesPrice = 0; var charadesGamesThisRound = 0; var charadesTimerLength = parseInt(cb.settings.charadesTimerLength); var charadesSource = cb.settings.charadesSource; var charadesMinsRemain = 0; var charadesSecsRemain = 0; var charadesType = cb.settings.charadesType; // ************ Variables for 20 Questions Game var twentyToggle = 0; var twentyCurrentPrize = ''; var twentyPrice = cb.settings.twentyPrice; var twentyNumberOfQuestions = cb.settings.twentyNumberOfQuestions; var twentyAllowAll = cb.settings.twentyAllowAll; var twentyModsKnowWord = cb.settings.twentyModsKnowWord; var twentyGameCount = 0; // ************ Arrays var VIPListArray = []; var extFanListArray = []; var moderatorList = {name: [], type: []}; var freeRollCount = {user: [], count: []}; var diceWinners = []; var dicePrizes = []; var freeSpinCount = {user: [], count: []}; var wheelWinners = []; var wheelPrizes = []; var rouletteShooters = []; var remainingChambers = []; //var freeShotCount = {name: [], count: []}; var kenoWinners = []; var kenoPrizes = []; var kenoNumbers = []; var kenoNumberStatus = []; var kenoTipCountArray = {name: [], amount: []}; var freeGuessCount = {name: [], count: []}; var kenoSkipNumbersArray = []; var pressPrizes = []; var pressRoundTypes = []; var pressNextplayer = []; var pressLevelPrizes = []; var pressWinners = []; var pressCurrentDeckOfCards = []; var pressEndWarning = false; var pressActive = false; var warPrizes = []; var warPrices = []; var warPrizeTypes = []; var warNextplayer = {name: [], level: []}; var warCurrentDeckOfCards = []; var warLevelPrizes = []; var warWinners = []; var warEndWarning = false; var warActive = false; var randomLevelPrizes = []; var randomWinners = []; var randomExcludeArray = []; var badWhoArray = []; var badWhatArray = []; var badWhereArray = []; var badHowLongArray = []; var badPrizes = []; var charadesList = []; var charadesWinners = []; var charadesDefaultList = ['star wars','elephant','lord of the rings','harry potter','madonna','little drummer boy','halloween','mermaid','titanic','full moon','volcano','kangaroo','lovense lush','babe ruth','goat','google','road trip','orange juice','spaghetti','Pacific Ocean', 'sex on the beach','bounce','alice in wonderland','koala','pyramid','south pole','queen','tarzan','captain america','flossy','dolphin','surfboard','farmer','tanlines','batman','superman','spiderman','jumper cables','sombrero','blue balls','bukkake','gangbang','orgy','threesome', 'butt plug','jeep','convertible','vacation','pineapple','cruise','short bus','winnie the pooh','puzzle','nutsack','mr bill','deep throat','polar bear','picasso','big ben','amazon','high school','leopard','edible panties','eiffel tower','gag reflex','dominatrix','peter pan', 'tinkerbelle','my precious','playboy bunny','jungle','gymnast','sailing','fuck buddy','telescope','saturn','thermometer','cucumber','balls deep','chef','great white shark','cello','jello','mexican jumping beans','bumblebee','rice crispies','igloo','carpet muncher','oreos', 'tarantula','iron man','jester','top gun','pac man','space invaders','asteroid','comet','black hole','dust bunny','tumbleweed','cartwheel','brown starfish','cornhole','alexa','casino','bartender','parallel','lumberjack','lawyer','scientist','chia pet','chemistry','siren', 'fireman','witch','mummy','frozen','snowman','queen of hearts','sudden death','homework','island','contract','hole in one','strip poker','nun','lucky charms','ping pong','pinball wizard','earthquake','seesaw','skateboard','snowball','pajamas','seashell','rhinoceros','saddle', 'hippopotamus','banana peel','frankenstein','cheerleader','captain','shopping cart','dentist','hair dryer','pizza','owl','gingerbread man','mouse trap','windmill','tuba','knot','quicksand','python','spider web','eraser','swordfish','flamingo','taxi','huddle','cumberbund', 'bobsled','cast','sculpture','early bird special','granola bar','prick','bbc','cavity search','mug shot','monopoly','pearl necklace','nipple ring','circle jerk','quickie','sex doll','viking']; var charadesPlayers = []; var charadesScores = [0]; var charadesLevelPrizes = []; var charadesNextPlayer = []; var charadesResults = []; var charadesVAR2Scores = {user: [], score: [0]}; var charadesBABScores = {user: [], score: [0]}; var twentyQuestionsNumber = {username: [], number: [0]}; var twentyQuestionsHistory = {username: [], number: [0], question: [], answer: []}; var totalTips = 0; var diceTotalTips = 0; var wheelTotalTips = 0; var kenoTotalTips = 0; var rouletteTotalTips = 0; var pressTotalTips = 0; var warTotalTips = 0; var badTotalTips = 0; var twentyTotalTips = 0; var deckOfCards = ['ACE_CLUBS','ACE_DIAMD','ACE_SPADE','ACE_HEART','TWO_CLUBS','TWO_DIAMD','TWO_SPADE','TWO_HEART','THR_CLUBS','THR_DIAMD','THR_SPADE','THR_HEART','FOU_CLUBS','FOU_DIAMD','FOU_SPADE','FOU_HEART','FIV_CLUBS','FIV_DIAMD','FIV_SPADE','FIV_HEART','SIX_CLUBS','SIX_DIAMD','SIX_SPADE','SIX_HEART','SEV_CLUBS','SEV_DIAMD','SEV_SPADE','SEV_HEART','EGH_CLUBS','EGH_DIAMD','EGH_SPADE','EGH_HEART','NIN_CLUBS','NIN_DIAMD','NIN_SPADE','NIN_HEART','TEN_CLUBS','TEN_DIAMD','TEN_SPADE','TEN_HEART','JAK_CLUBS','JAK_DIAMD','JAK_SPADE','JAK_HEART','QUN_CLUBS','QUN_DIAMD','QUN_SPADE','QUN_HEART','KNG_CLUBS','KNG_DIAMD','KNG_SPADE','KNG_HEART']; // ******** Playing card gifs var ACE_HEART_gif = ':playingcard-AH'; var ACE_CLUBS_gif = ':playingcard-AC'; var ACE_DIAMD_gif = ':playingcard-AD'; var ACE_SPADE_gif = ':playingcard-AS'; var TWO_HEART_gif = ':playingcard-2H'; var TWO_CLUBS_gif = ':playingcard-2C'; var TWO_DIAMD_gif = ':playingcard-2D'; var TWO_SPADE_gif = ':playingcard-2S'; var THR_HEART_gif = ':playingcard-3H'; var THR_CLUBS_gif = ':playingcard-3C'; var THR_DIAMD_gif = ':playingcard-3D'; var THR_SPADE_gif = ':playingcard-3S'; var FOU_HEART_gif = ':playingcard-4H'; var FOU_CLUBS_gif = ':playingcard-4C'; var FOU_DIAMD_gif = ':playingcard-4D'; var FOU_SPADE_gif = ':playingcard-4S'; var FIV_HEART_gif = ':playingcard-5H'; var FIV_CLUBS_gif = ':playingcard-5C'; var FIV_DIAMD_gif = ':playingcard-5D'; var FIV_SPADE_gif = ':playingcard-5S'; var SIX_HEART_gif = ':playingcard-6H'; var SIX_CLUBS_gif = ':playingcard-6C'; var SIX_DIAMD_gif = ':playingcard-6D'; var SIX_SPADE_gif = ':playingcard-6S'; var SEV_HEART_gif = ':playingcard-7H'; var SEV_CLUBS_gif = ':playingcard-7C'; var SEV_DIAMD_gif = ':playingcard-7D'; var SEV_SPADE_gif = ':playingcard-7S'; var EGH_HEART_gif = ':playingcard-8H'; var EGH_CLUBS_gif = ':playingcard-8C'; var EGH_DIAMD_gif = ':playingcard-8D'; var EGH_SPADE_gif = ':playingcard-8S'; var NIN_HEART_gif = ':playingcard-9H'; var NIN_CLUBS_gif = ':playingcard-9C'; var NIN_DIAMD_gif = ':playingcard-9D'; var NIN_SPADE_gif = ':playingcard-9S'; var TEN_HEART_gif = ':playingcard-10H'; var TEN_CLUBS_gif = ':playingcard-10C'; var TEN_DIAMD_gif = ':playingcard-10D'; var TEN_SPADE_gif = ':playingcard-10S'; var JAK_HEART_gif = ':playingcard-JH'; var JAK_CLUBS_gif = ':playingcard-JC'; var JAK_DIAMD_gif = ':playingcard-JD'; var JAK_SPADE_gif = ':playingcard-JS'; var QUN_HEART_gif = ':playingcard-QH'; var QUN_CLUBS_gif = ':playingcard-QC'; var QUN_DIAMD_gif = ':playingcard-QD'; var QUN_SPADE_gif = ':playingcard-QS'; var KNG_HEART_gif = ':playingcard-KH'; var KNG_CLUBS_gif = ':playingcard-KC'; var KNG_DIAMD_gif = ':playingcard-KD'; var KNG_SPADE_gif = ':playingcard-KS'; // Prize List var Prize_1_1 = cb.settings.Prize_1_1; var Prize_1_2 = cb.settings.Prize_1_2; var Prize_1_3 = cb.settings.Prize_1_3; var Prize_1_4 = cb.settings.Prize_1_4; var Prize_1_5 = cb.settings.Prize_1_5; var Prize_1_6 = cb.settings.Prize_1_6; var Prize_1_7 = cb.settings.Prize_1_7; var Prize_1_8 = cb.settings.Prize_1_8; var Prize_1_9 = cb.settings.Prize_1_9; var Prize_1_10 = cb.settings.Prize_1_10; var Prize_1_11 = cb.settings.Prize_1_11; var Prize_1_12 = cb.settings.Prize_1_12; var Prize_1_13 = cb.settings.Prize_1_13; var Prize_1_14 = cb.settings.Prize_1_14; var Prize_1_15 = cb.settings.Prize_1_15; var Prize_1_16 = cb.settings.Prize_1_16; var Prize_1_17 = cb.settings.Prize_1_17; var Prize_1_18 = cb.settings.Prize_1_18; var Prize_1_19 = cb.settings.Prize_1_19; var Prize_1_20 = cb.settings.Prize_1_20; var Price_1_1 = cb.settings.Price_1_1; var Price_1_2 = cb.settings.Price_1_2; var Price_1_3 = cb.settings.Price_1_3; var Price_1_4 = cb.settings.Price_1_4; var Price_1_5 = cb.settings.Price_1_5; var Price_1_6 = cb.settings.Price_1_6; var Price_1_7 = cb.settings.Price_1_7; var Price_1_8 = cb.settings.Price_1_8; var Price_1_9 = cb.settings.Price_1_9; var Price_1_10 = cb.settings.Price_1_10; var Price_1_11 = cb.settings.Price_1_11; var Price_1_12 = cb.settings.Price_1_12; var Price_1_13 = cb.settings.Price_1_13; var Price_1_14 = cb.settings.Price_1_14; var Price_1_15 = cb.settings.Price_1_15; var Price_1_16 = cb.settings.Price_1_16; var Price_1_17 = cb.settings.Price_1_17; var Price_1_18 = cb.settings.Price_1_18; var Price_1_19 = cb.settings.Price_1_19; var Price_1_20 = cb.settings.Price_1_20; var Prize_2_1 = cb.settings.Prize_2_1; var Prize_2_2 = cb.settings.Prize_2_2; var Prize_2_3 = cb.settings.Prize_2_3; var Prize_2_4 = cb.settings.Prize_2_4; var Prize_2_5 = cb.settings.Prize_2_5; var Prize_2_6 = cb.settings.Prize_2_6; var Prize_2_7 = cb.settings.Prize_2_7; var Prize_2_8 = cb.settings.Prize_2_8; var Prize_2_9 = cb.settings.Prize_2_9; var Prize_2_10 = cb.settings.Prize_2_10; var Prize_2_11 = cb.settings.Prize_2_11; var Prize_2_12 = cb.settings.Prize_2_12; var Prize_2_13 = cb.settings.Prize_2_13; var Prize_2_14 = cb.settings.Prize_2_14; var Prize_2_15 = cb.settings.Prize_2_15; var Prize_2_16 = cb.settings.Prize_2_16; var Prize_2_17 = cb.settings.Prize_2_17; var Prize_2_18 = cb.settings.Prize_2_18; var Prize_2_19 = cb.settings.Prize_2_19; var Prize_2_20 = cb.settings.Prize_2_20; var Price_2_1 = cb.settings.Price_2_1; var Price_2_2 = cb.settings.Price_2_2; var Price_2_3 = cb.settings.Price_2_3; var Price_2_4 = cb.settings.Price_2_4; var Price_2_5 = cb.settings.Price_2_5; var Price_2_6 = cb.settings.Price_2_6; var Price_2_7 = cb.settings.Price_2_7; var Price_2_8 = cb.settings.Price_2_8; var Price_2_9 = cb.settings.Price_2_9; var Price_2_10 = cb.settings.Price_2_10; var Price_2_11 = cb.settings.Price_2_11; var Price_2_12 = cb.settings.Price_2_12; var Price_2_13 = cb.settings.Price_2_13; var Price_2_14 = cb.settings.Price_2_14; var Price_2_15 = cb.settings.Price_2_15; var Price_2_16 = cb.settings.Price_2_16; var Price_2_17 = cb.settings.Price_2_17; var Price_2_18 = cb.settings.Price_2_18; var Price_2_19 = cb.settings.Price_2_19; var Price_2_20 = cb.settings.Price_2_20; var Prize_3_1 = cb.settings.Prize_3_1; var Prize_3_2 = cb.settings.Prize_3_2; var Prize_3_3 = cb.settings.Prize_3_3; var Prize_3_4 = cb.settings.Prize_3_4; var Prize_3_5 = cb.settings.Prize_3_5; var Prize_3_6 = cb.settings.Prize_3_6; var Prize_3_7 = cb.settings.Prize_3_7; var Prize_3_8 = cb.settings.Prize_3_8; var Prize_3_9 = cb.settings.Prize_3_9; var Prize_3_10 = cb.settings.Prize_3_10; var Prize_3_11 = cb.settings.Prize_3_11; var Prize_3_12 = cb.settings.Prize_3_12; var Prize_3_13 = cb.settings.Prize_3_13; var Prize_3_14 = cb.settings.Prize_3_14; var Prize_3_15 = cb.settings.Prize_3_15; var Prize_3_16 = cb.settings.Prize_3_16; var Prize_3_17 = cb.settings.Prize_3_17; var Prize_3_18 = cb.settings.Prize_3_18; var Prize_3_19 = cb.settings.Prize_3_19; var Prize_3_20 = cb.settings.Prize_3_20; var Price_3_1 = cb.settings.Price_3_1; var Price_3_2 = cb.settings.Price_3_2; var Price_3_3 = cb.settings.Price_3_3; var Price_3_4 = cb.settings.Price_3_4; var Price_3_5 = cb.settings.Price_3_5; var Price_3_6 = cb.settings.Price_3_6; var Price_3_7 = cb.settings.Price_3_7; var Price_3_8 = cb.settings.Price_3_8; var Price_3_9 = cb.settings.Price_3_9; var Price_3_10 = cb.settings.Price_3_10; var Price_3_11 = cb.settings.Price_3_11; var Price_3_12 = cb.settings.Price_3_12; var Price_3_13 = cb.settings.Price_3_13; var Price_3_14 = cb.settings.Price_3_14; var Price_3_15 = cb.settings.Price_3_15; var Price_3_16 = cb.settings.Price_3_16; var Price_3_17 = cb.settings.Price_3_17; var Price_3_18 = cb.settings.Price_3_18; var Price_3_19 = cb.settings.Price_3_19; var Price_3_20 = cb.settings.Price_3_20; var Prize_4_1 = cb.settings.Prize_4_1; var Prize_4_2 = cb.settings.Prize_4_2; var Prize_4_3 = cb.settings.Prize_4_3; var Prize_4_4 = cb.settings.Prize_4_4; var Prize_4_5 = cb.settings.Prize_4_5; var Prize_4_6 = cb.settings.Prize_4_6; var Prize_4_7 = cb.settings.Prize_4_7; var Prize_4_8 = cb.settings.Prize_4_8; var Prize_4_9 = cb.settings.Prize_4_9; var Prize_4_10 = cb.settings.Prize_4_10; var Prize_4_11 = cb.settings.Prize_4_11; var Prize_4_12 = cb.settings.Prize_4_12; var Prize_4_13 = cb.settings.Prize_4_13; var Prize_4_14 = cb.settings.Prize_4_14; var Prize_4_15 = cb.settings.Prize_4_15; var Prize_4_16 = cb.settings.Prize_4_16; var Prize_4_17 = cb.settings.Prize_4_17; var Prize_4_18 = cb.settings.Prize_4_18; var Prize_4_19 = cb.settings.Prize_4_19; var Prize_4_20 = cb.settings.Prize_4_20; var Price_4_1 = cb.settings.Price_4_1; var Price_4_2 = cb.settings.Price_4_2; var Price_4_3 = cb.settings.Price_4_3; var Price_4_4 = cb.settings.Price_4_4; var Price_4_5 = cb.settings.Price_4_5; var Price_4_6 = cb.settings.Price_4_6; var Price_4_7 = cb.settings.Price_4_7; var Price_4_8 = cb.settings.Price_4_8; var Price_4_9 = cb.settings.Price_4_9; var Price_4_10 = cb.settings.Price_4_10; var Price_4_11 = cb.settings.Price_4_11; var Price_4_12 = cb.settings.Price_4_12; var Price_4_13 = cb.settings.Price_4_13; var Price_4_14 = cb.settings.Price_4_14; var Price_4_15 = cb.settings.Price_4_15; var Price_4_16 = cb.settings.Price_4_16; var Price_4_17 = cb.settings.Price_4_17; var Price_4_18 = cb.settings.Price_4_18; var Price_4_19 = cb.settings.Price_4_19; var Price_4_20 = cb.settings.Price_4_20; var Prize_5_1 = cb.settings.Prize_5_1; var Prize_5_2 = cb.settings.Prize_5_2; var Prize_5_3 = cb.settings.Prize_5_3; var Prize_5_4 = cb.settings.Prize_5_4; var Prize_5_5 = cb.settings.Prize_5_5; var Prize_5_6 = cb.settings.Prize_5_6; var Prize_5_7 = cb.settings.Prize_5_7; var Prize_5_8 = cb.settings.Prize_5_8; var Prize_5_9 = cb.settings.Prize_5_9; var Prize_5_10 = cb.settings.Prize_5_10; var Price_5_1 = cb.settings.Price_5_1; var Price_5_2 = cb.settings.Price_5_2; var Price_5_3 = cb.settings.Price_5_3; var Price_5_4 = cb.settings.Price_5_4; var Price_5_5 = cb.settings.Price_5_5; var Price_5_6 = cb.settings.Price_5_6; var Price_5_7 = cb.settings.Price_5_7; var Price_5_8 = cb.settings.Price_5_8; var Price_5_9 = cb.settings.Price_5_9; var Price_5_10 = cb.settings.Price_5_10; var Prize_6_1 = cb.settings.Prize_6_1; var Prize_6_2 = cb.settings.Prize_6_2; var Prize_6_3 = cb.settings.Prize_6_3; var Prize_6_4 = cb.settings.Prize_6_4; var Prize_6_5 = cb.settings.Prize_6_5; var Prize_6_6 = cb.settings.Prize_6_6; var Prize_6_7 = cb.settings.Prize_6_7; var Prize_6_8 = cb.settings.Prize_6_8; var Prize_6_9 = cb.settings.Prize_6_9; var Prize_6_10 = cb.settings.Prize_6_10; var Price_6_1 = cb.settings.Price_6_1; var Price_6_2 = cb.settings.Price_6_2; var Price_6_3 = cb.settings.Price_6_3; var Price_6_4 = cb.settings.Price_6_4; var Price_6_5 = cb.settings.Price_6_5; var Price_6_6 = cb.settings.Price_6_6; var Price_6_7 = cb.settings.Price_6_7; var Price_6_8 = cb.settings.Price_6_8; var Price_6_9 = cb.settings.Price_6_9; var Price_6_10 = cb.settings.Price_6_10; var Prize_7_1 = cb.settings.Prize_7_1; var Prize_7_2 = cb.settings.Prize_7_2; var Prize_7_3 = cb.settings.Prize_7_3; var Prize_7_4 = cb.settings.Prize_7_4; var Prize_7_5 = cb.settings.Prize_7_5; var Prize_7_6 = cb.settings.Prize_7_6; var Prize_7_7 = cb.settings.Prize_7_7; var Prize_7_8 = cb.settings.Prize_7_8; var Prize_7_9 = cb.settings.Prize_7_9; var Prize_7_10 = cb.settings.Prize_7_10; var Price_7_1 = cb.settings.Price_7_1; var Price_7_2 = cb.settings.Price_7_2; var Price_7_3 = cb.settings.Price_7_3; var Price_7_4 = cb.settings.Price_7_4; var Price_7_5 = cb.settings.Price_7_5; var Price_7_6 = cb.settings.Price_7_6; var Price_7_7 = cb.settings.Price_7_7; var Price_7_8 = cb.settings.Price_7_8; var Price_7_9 = cb.settings.Price_7_9; var Price_7_10 = cb.settings.Price_7_10; var Prize_8_1 = cb.settings.Prize_8_1; var Prize_8_2 = cb.settings.Prize_8_2; var Prize_8_3 = cb.settings.Prize_8_3; var Prize_8_4 = cb.settings.Prize_8_4; var Prize_8_5 = cb.settings.Prize_8_5; var Prize_8_6 = cb.settings.Prize_8_6; var Prize_8_7 = cb.settings.Prize_8_7; var Prize_8_8 = cb.settings.Prize_8_8; var Prize_8_9 = cb.settings.Prize_8_9; var Prize_8_10 = cb.settings.Prize_8_10; var Price_8_1 = cb.settings.Price_8_1; var Price_8_2 = cb.settings.Price_8_2; var Price_8_3 = cb.settings.Price_8_3; var Price_8_4 = cb.settings.Price_8_4; var Price_8_5 = cb.settings.Price_8_5; var Price_8_6 = cb.settings.Price_8_6; var Price_8_7 = cb.settings.Price_8_7; var Price_8_8 = cb.settings.Price_8_8; var Price_8_9 = cb.settings.Price_8_9; var Price_8_10 = cb.settings.Price_8_10; var Prize_9_1 = cb.settings.Prize_9_1; var Prize_9_2 = cb.settings.Prize_9_2; var Prize_9_3 = cb.settings.Prize_9_3; var Prize_9_4 = cb.settings.Prize_9_4; var Prize_9_5 = cb.settings.Prize_9_5; var Prize_9_6 = cb.settings.Prize_9_6; var Prize_9_7 = cb.settings.Prize_9_7; var Prize_9_8 = cb.settings.Prize_9_8; var Prize_9_9 = cb.settings.Prize_9_9; var Prize_9_10 = cb.settings.Prize_9_10; var Price_9_1 = cb.settings.Price_9_1; var Price_9_2 = cb.settings.Price_9_2; var Price_9_3 = cb.settings.Price_9_3; var Price_9_4 = cb.settings.Price_9_4; var Price_9_5 = cb.settings.Price_9_5; var Price_9_6 = cb.settings.Price_9_6; var Price_9_7 = cb.settings.Price_9_7; var Price_9_8 = cb.settings.Price_9_8; var Price_9_9 = cb.settings.Price_9_9; var Price_9_10 = cb.settings.Price_9_10; var Prize_10_1 = cb.settings.Prize_10_1; var Prize_10_2 = cb.settings.Prize_10_2; var Prize_10_3 = cb.settings.Prize_10_3; var Prize_10_4 = cb.settings.Prize_10_4; var Prize_10_5 = cb.settings.Prize_10_5; var Prize_10_6 = cb.settings.Prize_10_6; var Prize_10_7 = cb.settings.Prize_10_7; var Prize_10_8 = cb.settings.Prize_10_8; var Prize_10_9 = cb.settings.Prize_10_9; var Prize_10_10 = cb.settings.Prize_10_10; var Price_10_1 = cb.settings.Price_10_1; var Price_10_2 = cb.settings.Price_10_2; var Price_10_3 = cb.settings.Price_10_3; var Price_10_4 = cb.settings.Price_10_4; var Price_10_5 = cb.settings.Price_10_5; var Price_10_6 = cb.settings.Price_10_6; var Price_10_7 = cb.settings.Price_10_7; var Price_10_8 = cb.settings.Price_10_8; var Price_10_9 = cb.settings.Price_10_9; var Price_10_10 = cb.settings.Price_10_10; } // *********************************** Functions ************************************** { // Generic functions to set the color or separator characters function checkTextColor(color) { switch (color) { case 'White/No Color': return '#FFFFFF'; case 'Black': return '#000000'; case 'Dark Blue': return '#0629AC'; case 'Dark Pink': return '#FF6680'; case 'Dark Green': return '#006600'; case 'Dark Red': return '#cc0000'; case 'Dark Purple': return '#3d003d'; case 'Dark Grey': return '#737373'; case 'Dark Orange': return '#e77400'; case 'Dark Aqua': return '#006767'; case 'Dark Gold': return '#998100'; case 'Dark Teal': return '#003f1f'; case 'Dark Brown': return '#582c00'; case 'Dark Bronze': return '#a56728'; case 'Dark Periwinkle': return '#155bd7'; case 'Dark Fuschia': return '#d6155c'; case 'Dark Lime': return '#6b790c'; case 'Dark Plum': return '#7f13bf'; default: if (/^#[0-9A-F]{6}$/i.test(color)) { return color; } else if (/^[0-9A-F]{6}$/i.test(color)) { return ('#' + color); } else { return ('default'); } } } function checkBgColor(color) { switch (color) { case 'White/No Color': return '#FFFFFF'; case 'Light Aqua': return '#adeaea'; case 'Light Pink': return '#FFE6EA'; case 'Light Green': return '#94e594'; case 'Light Red': return '#ff9a9a'; case 'Light Purple': return '#f2cdff'; case 'Light Orange': return '#ffd9b3'; case 'Light Grey': return '#e6e6e6'; case 'Light Blue': return '#d1eaee'; case 'Light Yellow': return '#ffff94'; case 'Cream': return '#f9f6ed'; case 'Light Bronze': return '#ebccad'; case 'Light Periwinkle': return '#d7e4fb'; case 'Light Teal': return '#d7fbee'; case 'Light Fuschia': return '#fbd7e4'; case 'Light Lime': return '#ecf6a7'; case 'Light Plum': return '#e3c0f9'; default: if (/^#[0-9A-F]{6}$/i.test(color)) { return color; } else if (/^[0-9A-F]{6}$/i.test(color)) { return ('#' + color); } else { return ('default'); } } } function cardNumericValue(card,acehigh) { switch (card.substring(0,3)) { case 'ACE': if (acehigh == 'yes') { return 14; } else { return 1; } case 'TWO': return 2; case 'THR': return 3; case 'FOU': return 4; case 'FIV': return 5; case 'SIX': return 6; case 'SEV': return 7; case 'EGH': return 8; case 'NIN': return 9; case 'TEN': return 10; case 'JAK': return 11; case 'QUN': return 12; case 'KNG': return 13; } } function shuffleArray(array) { var currentIndex = array.length, temporaryValue, randomIndex; while (currentIndex !== 0) { randomIndex = Math.floor(Math.random() * currentIndex) ; currentIndex -= 1; temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; } function listShowPrizes(level,sendto) { if (level == 0) { msg = '\u2297 \u2297 \u2297 \u2297 Master Prize List \u2297 \u2297 \u2297 \u2297'; for (var L = 1; L <= 10; L++) { msg += '\nLevel ' + L + ' :'; listPrizesLevel(L); } } else { msg = '\u2297 \u2297 \u2297 \u2297 Master Prize List - Level ' + level + ' \u2297 \u2297 \u2297 \u2297'; L = level; listPrizesLevel(L); } cb.sendNotice(msg, sendto, '', '', 'bold'); } function listPrizesLevel(L) { if (L <= 4) { max = 20; } else { max = 10; } for (var P = 1; P <= max; P++) { if (eval('Prize_' + L + '_' + P)) { prize = (eval('Prize_' + L + '_' + P)); } else { prize = 'Empty'; } msg += '\n' + L + '.' + P + ' : ' + prize + ' (' + (eval('Price_' + L + '_' + P)) + ')'; } } // *********************************** User List Functions * function populateModeratorArray(user,type,mode) { if (mode == 'a') { if (!cbjs.arrayContains(moderatorList.name,user)) { moderatorList.name.push(user); moderatorList.type.push(type); } else { return; } } else if (mode == 'r') { if (cbjs.arrayContains(moderatorList.name,user)) { nameIndex = moderatorList.name.indexOf(user); moderatorList.name.splice(nameIndex,1); moderatorList.type.splice(nameIndex,1); } else { return; } } else { return; } } function addRmvVIP(user, mode) { if (mode == 'a') { if (cbjs.arrayContains(VIPListArray,user)) { return; } else { VIPListArray.push(user); } } else if (mode == 'r') { if (cbjs.arrayContains(VIPListArray,user)) { cbjs.arrayRemove(VIPListArray,user); } else { return; } } } function addRmvExtFan(user, mode) { if (mode == 'a') { if (cbjs.arrayContains(extFanListArray,user)) { return; } else { extFanListArray.push(user); } } else if (mode == 'r') { if (cbjs.arrayContains(extFanListArray,user)) { cbjs.arrayRemove(extFanListArray,user); } else { return; } } } function getPrize(prizeID) { if (prizeID) { splitarray = prizeID.split('.') prizelevel = splitarray[0]; prizenumber = splitarray[1]; if (isNaN(prizelevel) || isNaN(prizenumber) || prizelevel < 1 || prizelevel > 10 || prizenumber < 1 || prizenumber > 20) { return ('invalid'); } else { return (eval('Prize_' + prizelevel + '_' + prizenumber)); } } else { return ('invalid'); } } function findTipper(user) { for (var i = 0; i < kenoTipCountArray.name.length; i++) { if (kenoTipCountArray.name[i] == user) { break; } } return i; } function timeOnline() { var timeElapsed = clockTimeCal(); var clockMS = timeElapsed % 1000; var clockSeconds = ((timeElapsed - clockMS) % 60000); var clockMinutes = ((timeElapsed - clockSeconds - clockMS) % 3600000); var clockHours = (timeElapsed - clockMinutes - clockSeconds - clockMS); clockSeconds = clockSeconds / 1000; clockMinutes = clockMinutes / 60000; clockHours = clockHours / 3600000; if (clockHours > 0) { return clockHours + ' hour' + (clockHours > 1 ? 's' : '') + ' and ' + clockMinutes + ' minute' + (clockMinutes > 1 ? 's' : ''); } else if (clockMinutes > 0 && clockSeconds === 0) { return clockMinutes + ' minute' + (clockMinutes > 1 ? 's' : ''); } else if (clockMinutes > 0) { return clockMinutes + ' minute' + (clockMinutes > 1 ? 's' : '') + ' and ' + clockSeconds + ' second' + (clockSeconds > 1 ? 's' : ''); } else { return clockSeconds + ' second' + (clockSeconds > 1 ? 's' : ''); } } function clockTimeCal() { timeNow = new Date(); return timeNow - gamebotStartTime.getTime(); } // *********************************** Dice Game Functions ************************************** function setDiceToggle(option, mod) { if (option == 'on') { if (diceToggle == 1) { cb.sendNotice('The Dice Game is already enabled.', mod, appNoticeColor); } else { diceSetPrizes(); if (validDice == true) { diceToggle = 1; setDiceColors(); diceInitNoticeTimer(); cb.sendNotice('You have enabled the Dice Game.', mod, appNoticeColor); } else { cb.sendNotice('Invalid prize settings, the Dice Game could not be started.', mod, appWarningColor, appWarningTextColor, 'bold'); } } } else if (option == 'off') { if (diceToggle == 0) { cb.sendNotice('The Dice Game is already disabled.', mod, appNoticeColor); } else { diceToggle = 0; cb.sendNotice('You have disabled the Dice Game.', mod, appNoticeColor); cb.sendNotice('The dice game has been disabled, tips will no longer roll the dice.', '', diceNoticeBgColor, diceNoticeTextColor, 'bold'); } } } function setDiceColors() { if (cb.settings.diceNoticeTextColor == 'Custom') { diceNoticeTextColor = checkTextColor(cb.settings.diceNoticeCustomTextColor); if (diceNoticeTextColor == 'default') { cb.sendNotice('Dice Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); diceNoticeTextColor = '#FFFFFF'; } } else { diceNoticeTextColor = checkTextColor(cb.settings.diceNoticeTextColor); } if (cb.settings.diceNoticeBgColor == 'Custom') { diceNoticeBgColor = checkBgColor(cb.settings.diceNoticeCustomBgColor); if (diceNoticeBgColor == 'default') { cb.sendNotice('Dice Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); diceNoticeBgColor = '#FFFFFF'; } } else { diceNoticeBgColor = checkBgColor(cb.settings.diceNoticeBgColor); } if (cb.settings.diceRollTextColor == 'Custom') { diceRollTextColor = checkTextColor(cb.settings.diceRollCustomTextColor); if (diceRollTextColor == 'default') { cb.sendNotice('Dice Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); diceRollTextColor = '#FFFFFF'; } } else { diceRollTextColor = checkTextColor(cb.settings.diceRollTextColor); } if (cb.settings.diceRollBgColor == 'Custom') { diceRollBgColor = checkBgColor(cb.settings.diceRollCustomBgColor); if (diceRollBgColor == 'default') { cb.sendNotice('Dice Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); diceRollBgColor = '#FFFFFF'; } } else { diceRollBgColor = checkBgColor(cb.settings.diceRollBgColor); } if (cb.settings.diceRollSpecialTextColor == 'Custom') { diceRollSpecialTextColor = checkTextColor(cb.settings.diceRollSpecialCustomTextColor); if (diceRollSpecialTextColor == 'default') { cb.sendNotice('Dice Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); diceRollSpecialTextColor = '#FFFFFF'; } } else { diceRollSpecialTextColor = checkTextColor(cb.settings.diceRollSpecialTextColor); } if (cb.settings.diceRollSpecialBgColor == 'Custom') { diceRollSpecialBgColor = checkBgColor(cb.settings.diceRollSpecialCustomBgColor); if (diceRollSpecialBgColor == 'default') { cb.sendNotice('Dice Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); diceRollSpecialBgColor = '#FFFFFF'; } } else { diceRollSpecialBgColor = checkBgColor(cb.settings.diceRollSpecialBgColor); } } function diceInitNoticeTimer() { if (cb.settings.diceNoticeInterval == '' || cb.settings.diceNoticeInterval == null) { cb.sendNotice('Dice Game - Chat Notice Interval is not set. Using default value of 3.1 minutes.', cb.room_slug, appWarningColor, '', 'bold'); diceInt = 3.1; } else { diceInt = parseFloat(cb.settings.diceNoticeInterval); } if (diceInt < 1) { cb.sendNotice('Dice Game - Chat Notice Interval is too short, must be at least 1 minute. Using default value of 3.1 minutes.', cb.room_slug, appWarningColor, '', 'bold'); diceInt = 3.1; } diceInt *= 60000; diceInt = parseInt(diceInt); diceNoticeTimer(); } function setDiceNoticeTimeout() { cb.setTimeout(diceNoticeTimer, diceInt); } function diceNoticeTimer() { if(diceToggle == 1) { diceShowNotice(''); setDiceNoticeTimeout(); } } function diceShowNotice(sendto) { var msg = ':diceroll1 \nDice Game is active! Tip ' + diceRollPrice + ' ' + dicePlural + ' to roll the dice! \nYou can use the command /di to see more info on the dice game'; if (diceRollPriceFans != diceRollPrice) { msg += '\nDiscount! For Fan Club Members, the Dice Roll price is ' + diceRollPriceFans + ' tokens!'; } if (diceRollPriceVIP != diceRollPrice) { msg += '\nFor VIP Members, the Dice Roll price is ' + diceRollPriceVIP + ' tokens!'; } if (diceRollPriceMods != diceRollPrice) { msg += '\nFor Moderators, the Dice Roll price is ' + diceRollPriceMods + ' tokens!'; } cb.sendNotice(msg, sendto, diceNoticeBgColor, diceNoticeTextColor, 'bold'); } function diceInfo(sendto,usertype) { if (diceMultiRolls <= 1) { var msg = 'Dice Game is active! Tip ' + diceRollPrice + ' ' + dicePlural + ' to roll the dice!'; } else if (diceMultiRolls == 2) { var msg = 'Dice Game is active! Tip ' + diceRollPrice + ' ' + dicePlural + ' to roll the dice! \nYou can tip up to 2 multiples of the dice roll price to roll multiple times (' + diceRollPrice + ' or ' + diceRollPrice*2 + ').'; } else if (diceMultiRolls == 3) { var msg = 'Dice Game is active! Tip ' + diceRollPrice + ' ' + dicePlural + ' to roll the dice! \nYou can tip up to 3 multiples of the dice roll price to roll multiple times (' + diceRollPrice + ', ' + diceRollPrice*2 + ', or ' + diceRollPrice*3 + ').'; } else if (diceMultiRolls > 3) { var msg = 'Dice Game is active! Tip ' + diceRollPrice + ' ' + dicePlural + ' to roll the dice! \nYou can tip up to ' + diceMultiRolls + ' multiples of the dice roll price to roll multiple times (' + diceRollPrice + ', ' + diceRollPrice*2 + ', ' + diceRollPrice*3 + ',...)'; } if (cb.settings.diceRemoveWinner == 'Yes') { msg += '\nEach prize that is won will be removed from the list until all prizes are won and the list resets.'; } else { msg += '\nEach prize remains on the list and can be won multiple times.'; } msg += '\nUse the command "/dp" to see the list of prizes available.'; msg += '\nUse the command "/dr" to see the history of the dice rolls and prizes that have been won.'; msg += '\nUse the command "/freeroll" if your user group has been granted a free dice roll (if allowed).'; if (usertype == 'BC') { msg += '\nYou can also use the command "/freeroll" as the broadcaster (or moderator if enabled) to do a free roll for the room.'; msg += '\nUse the command "/diceprice [xx]" as the broadcaster (or moderator if enabled) to update the dice roll price to the new value of [xx].'; msg += '\nThe dice game can be turned on or off with the command "/dice [on/off]". '; } cb.sendNotice(msg, sendto, diceNoticeBgColor, diceNoticeTextColor, 'bold'); } function diceFreeRoll(rolledby,mode) { if (mode == 'user') { cb.sendNotice(rolledby + ' has used one of their free dice rolls! ...', '', diceNoticeBgColor, diceNoticeTextColor, 'bold'); } else if (mode == 'mod') { cb.sendNotice(rolledby + ' has given a free dice roll to the room! ...', '', diceNoticeBgColor, diceNoticeTextColor, 'bold'); } else if (mode == 'bc') { cb.sendNotice('A free dice roll is being performed! ...', '', diceNoticeBgColor, diceNoticeTextColor, 'bold'); } diceRoll(rolledby); } function diceRoll(rolledby) { diceRollCounter++; diceRollCounterSpecial++; var firstDie = Math.floor(Math.random() * 6) + 1; var secondDie = Math.floor(Math.random() * 6) + 1; if (diceRollCounterSpecial > diceMinSpecial) { if (Math.random() <= (diceRarePct / 100)) { firstDie = 7; diceRollCounterSpecial = 0; } } diceTotal = firstDie + secondDie; winner = false; if (diceTotal >= 2 && diceTotal <= 13) { winner = true; prizeIndex = diceTotal - 2; prize = dicePrizes[prizeIndex]; if (cb.settings.diceRemoveWinner == 'Yes') dicePrizes.splice(prizeIndex, 1); } else { winner = false; prize = 'A Thank You!'; } if (dicePrizes.length === 1) { diceSetPrizes(); } var msg = diceGifPfx + firstDie + ' ' + diceGifPfx + secondDie + '\n'; msg += rolledby + ' rolled a ' + diceTotal + '! \n'.toUpperCase(); msg += 'Roll #' + diceRollCounter + ' | Prize: ' + prize; if (diceTotal == 13) { cb.sendNotice(msg, '', diceRollSpecialBgColor, diceRollSpecialTextColor, 'bold'); } else { cb.sendNotice(msg, '', diceRollBgColor, diceRollTextColor, 'bold'); } diceWinners.push('Roll #' + diceRollCounter + ' (' + diceTotal + '): ' + rolledby + ' - ' + prize); } function diceSetPrizes() { validDice = true; if (eval('Price_' + cb.settings.diceRollLevel + '_1') <= 0 || eval('Prize_' + cb.settings.diceRollLevel + '_1') == null) { cb.sendNotice('Dice Game Error - No prizes defined for level : ' + cb.settings.diceRollLevel, cb.room_slug, appWarningColor, '', 'bold'); validDice = false; } else { n = 0; do { for (var i = 1; i <= 20; i++) { if (n >= 11) { break; } else if (eval('Price_' + cb.settings.diceRollLevel + '_' + i) <= 0) { continue; } else { dicePrizes[n] = eval('Prize_' + cb.settings.diceRollLevel + '_' + i); n++; } } } while (n < 11); if (cb.settings.diceRollSpecialPrizeNumber) { rareprize = getPrize(cb.settings.diceRollSpecialPrizeNumber); if (rareprize == 'invalid') { cb.sendNotice('Dice Game Error - Invalid Rare Prize ID : ' + cb.settings.diceRollSpecialPrizeNumber, cb.room_slug, appWarningColor, '', 'bold'); validDice = false; } else { dicePrizes[11] = rareprize; } } else { cb.sendNotice('Dice Game Error - There is no Rare Prize ID configured', cb.room_slug, appWarningColor, '', 'bold'); validDice = false; } } } function diceShowPrizes(sendto) { if (dicePrizes.length) { var rareText = ''; var msg = '\u22A1 \u22A1 \u22A1 \u22A1 DICE GAME PRIZES \u22A1 \u22A1 \u22A1 \u22A1'; cb.sendNotice(msg, sendto, diceNoticeBgColor, diceNoticeTextColor, 'bold'); var msg = '' for (var i = 0; i <= 11; i++) { if (i == 11) { rareText = ' (RARE)'; } msg += 'Roll ' + (i+2) + ' - ' + dicePrizes[i] + rareText + '\n'; } } else { var msg = 'SORRY! There are no prizes left in the list, but thank you for the tip. :thumbsup'; } cb.sendNotice(msg, sendto, '', '', 'bold'); } function diceShowRolls(sendto,showall) { if (showall == 'all') { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 ALL DICE ROLLS \u22A1 \u22A1 \u22A1 \u22A1'; } else { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 LAST 20 DICE ROLLS \u22A1 \u22A1 \u22A1 \u22A1'; } if (diceWinners.length === 0) { msg += '\nNo one has played the Dice Game yet.'; } else { if (showall == 'all') { for (var i = 0; i < diceWinners.length; i++) { msg += '\n' + diceWinners[i]; } } else { var diceRecentWinners = diceWinners.slice(-20); for (var i = 0; i < diceRecentWinners.length; i++) { msg += '\n' + diceRecentWinners[i]; } } } cb.sendNotice(msg, sendto, '', '', 'bold'); } // *********************************** Wheel Spin Functions ************************************** function setWheelToggle(option, mod) { if (option == 'on') { if (wheelToggle == 1) { cb.sendNotice('The Wheel Spin Game is already enabled.', mod, appNoticeColor); } else { wheelRarePctCalc(); wheelSetPrizes(); if (validWheel == true) { wheelToggle = 1; setWheelColors(); wheelInitNoticeTimer(); cb.sendNotice('You have enabled the Wheel Spin Game.', mod, appNoticeColor); } else { cb.sendNotice('Invalid prize settings, the Wheel Spin could not be started.', mod, appWarningColor, appWarningTextColor, 'bold'); } } } else if (option == 'off') { if (wheelToggle == 0) { cb.sendNotice('The Wheel Spin Game is already disabled.', mod, appNoticeColor); } else { wheelToggle = 0; cb.sendNotice('You have disabled the Wheel Spin Game.', mod, appNoticeColor); cb.sendNotice('The wheel spin game has been disabled, tips will no longer spin the wheel.', '', wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); } } } function setWheelColors() { if (cb.settings.wheelNoticeTextColor == 'Custom') { wheelNoticeTextColor = checkTextColor(cb.settings.wheelNoticeCustomTextColor); if (wheelNoticeTextColor == 'default') { cb.sendNotice('Wheel Spin Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); wheelNoticeTextColor = '#FFFFFF'; } } else { wheelNoticeTextColor = checkTextColor(cb.settings.wheelNoticeTextColor); } if (cb.settings.wheelNoticeBgColor == 'Custom') { wheelNoticeBgColor = checkBgColor(cb.settings.wheelNoticeCustomBgColor); if (wheelNoticeBgColor == 'default') { cb.sendNotice('Wheel Spin Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); wheelNoticeBgColor = '#FFFFFF'; } } else { wheelNoticeBgColor = checkBgColor(cb.settings.wheelNoticeBgColor); } if (cb.settings.wheelSpinTextColor == 'Custom') { wheelSpinTextColor = checkTextColor(cb.settings.wheelSpinCustomTextColor); if (wheelSpinTextColor == 'default') { cb.sendNotice('Wheel Spin Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); wheelSpinTextColor = '#FFFFFF'; } } else { wheelSpinTextColor = checkTextColor(cb.settings.wheelSpinTextColor); } if (cb.settings.wheelSpinBgColor == 'Custom') { wheelSpinBgColor = checkBgColor(cb.settings.wheelSpinCustomBgColor); if (wheelSpinBgColor == 'default') { cb.sendNotice('Wheel Spin Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); wheelSpinBgColor = '#FFFFFF'; } } else { wheelSpinBgColor = checkBgColor(cb.settings.wheelSpinBgColor); } if (cb.settings.wheelSpinSpecialTextColor == 'Custom') { wheelSpinSpecialTextColor = checkTextColor(cb.settings.wheelSpinSpecialCustomTextColor); if (wheelSpinSpecialTextColor == 'default') { cb.sendNotice('Wheel Spin Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); wheelSpinSpecialTextColor = '#FFFFFF'; } } else { wheelSpinSpecialTextColor = checkTextColor(cb.settings.wheelSpinSpecialTextColor); } if (cb.settings.wheelSpinSpecialBgColor == 'Custom') { wheelSpinSpecialBgColor = checkBgColor(cb.settings.wheelSpinSpecialCustomBgColor); if (wheelSpinSpecialBgColor == 'default') { cb.sendNotice('Wheel Spin Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); wheelSpinSpecialBgColor = '#FFFFFF'; } } else { wheelSpinSpecialBgColor = checkBgColor(cb.settings.wheelSpinSpecialBgColor); } } function wheelRarePctCalc() { switch (cb.settings.wheelPercentSpecial) { case '5%': { wheelRarePct = 5; break; } case '10%': { wheelRarePct = 10; break; } case '15%': { wheelRarePct = 15; break; } case '20%': { wheelRarePct = 20; break; } case '25%': { wheelRarePct = 25; break; } default : { wheelRarePct = 10; break; } } } function wheelInitNoticeTimer() { if (cb.settings.wheelNoticeInterval == '' || cb.settings.wheelNoticeInterval == null) { cb.sendNotice('Wheel Spin Game - Chat Notice Interval was not set. Using default value of 2.8 minutes.', cb.room_slug, appWarningColor, '', 'bold'); wheelInt = 2.8; } else { wheelInt = parseFloat(cb.settings.wheelNoticeInterval); } if (wheelInt < 1) { cb.sendNotice('Wheel Spin Game - Chat Notice Interval setting is too short, must be at least 1 minute. Using default value of 2.8 minutes.', cb.room_slug, appWarningColor, '', 'bold'); wheelInt = 2.8; } wheelInt *= 60000; wheelInt = parseInt(wheelInt); wheelNoticeTimer(); } function setWheelNoticeTimeout() { cb.setTimeout(wheelNoticeTimer, wheelInt); } function wheelNoticeTimer() { if (wheelToggle == 1) { wheelShowNotice(''); setWheelNoticeTimeout(); } } function wheelShowNotice(sendto) { var msg = ':spinw \nWheel Spin Game is active! Tip ' + wheelSpinPrice + ' tokens to spin the wheel!\n You can use the command "/whi" to see more info on the wheel spin game.'; if (wheelSpinPriceFans != wheelSpinPrice) { msg += '\nDiscount! For Fan Club Members, the Wheel Spin price is ' + wheelSpinPriceFans + ' tokens!'; } if (wheelSpinPriceVIP != wheelSpinPrice) { msg += '\nFor VIP Members, the Wheel Spin price is ' + wheelSpinPriceVIP + ' tokens!'; } if (wheelSpinPriceMods != wheelSpinPrice) { msg += '\nFor Moderators, the Wheel Spin price is ' + wheelSpinPriceMods + ' tokens!'; } cb.sendNotice(msg, sendto, wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); } function wheelInfo(sendto,usertype) { if (wheelMultiSpins <= 1) { var msg = 'Wheel Spin Game is active! Tip ' + wheelSpinPrice + ' tokens to spin the wheel!\n You can use the command "/whp" to see the prize list.'; } else if (wheelMultiSpins == 2) { var msg = 'Wheel Spin Game is active! Tip ' + wheelSpinPrice + ' tokens to spin the wheel!\n You can use the command "/whp" to see the prize list.\nYou can tip up to 2 multiples of the wheel spin price to spin multiple times (' + wheelSpinPrice + ' or ' + wheelSpinPrice*2 + ').'; } else if (wheelMultiSpins == 3) { var msg = 'Wheel Spin Game is active! Tip ' + wheelSpinPrice + ' tokens to spin the wheel!\n You can use the command "/whp" to see the prize list.\nYou can tip up to 3 multiples of the wheel spin price to spin multiple times (' + wheelSpinPrice + ', ' + wheelSpinPrice*2 + ', or ' + wheelSpinPrice*3 + ').'; } else if (wheelMultiSpins > 3) { var msg = 'Wheel Spin Game is active! Tip ' + wheelSpinPrice + ' tokens to spin the wheel!\n You can use the command "/whp" to see the prize list.\nYou can tip up to ' + wheelMultiSpins + ' multiples of the wheel spin price to spin multiple times (' + wheelSpinPrice + ', ' + wheelSpinPrice*2 + ', ' + wheelSpinPrice*3 + ',...)'; } msg += '\nUse the command "/whp" to see the list of prizes available.'; msg += '\nUse the command "/whs" to see the history of the wheel spins and prizes that have been won.'; msg += '\nUse the command "/freespin" if your user group has been granted a free wheel spin (if allowed).'; if (usertype == 'BC') { msg += '\nYou can also use the command "/freespin" as the broadcaster (or moderator if enabled) to do a free spin for the room.'; msg += '\nUse the command "/wheelprice [xx]" as the broadcaster (or moderator if enabled) to update the wheel spin price to the new value of [xx].'; msg += '\nThe wheel spin game can be turned on or off with the command "/wheel [on/off]". '; } cb.sendNotice(msg, sendto, wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); } function wheelFreeSpin(spinby,mode) { if (mode == 'user') { cb.sendNotice(spinby + ' has used one of their free wheel spins! ...', '', wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); } else if (mode == 'mod') { cb.sendNotice(spinby + ' has given a free wheel spin to the room! ...', '', wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); } else if (mode == 'bc') { cb.sendNotice('A free wheel spin is being performed! ...', '', wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); } wheelSpin(spinby); } function wheelSpin(spinby) { cb.sendNotice(spinby + ' has tipped to spin the wheel! Wheel has started spinning...', '', wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); wheelSpinCounter++; wheelSpinCounterSpecial++; spinChoice = Math.floor(Math.random() * 20) + 1; if (wheelSpinCounterSpecial > wheelMinSpecial) { if (Math.random() <= (wheelRarePct / 100)) { spinChoice = Math.floor(Math.random() * 3) + 21; wheelSpinCounterSpecial = 0; } } wheelSpinResults(spinby); } function wheelSpinResults(spinby) { var winner = false; if (spinChoice >= 1 && spinChoice <= 23) { winner = true; prizeIndex = spinChoice - 1; wheelPrize = wheelPrizes[prizeIndex]; } else { winner = false; wheelPrize = 'A Thank You!'; } var msg = ':spinomg :spinomg2 \nWheel Spin #' + wheelSpinCounter + ' | Wheel stops in Slot #' + spinChoice + ' | Prize : ' + wheelPrize; if (spinChoice >= 21 && spinChoice <= 23) { cb.sendNotice(msg, '', wheelSpinSpecialBgColor, wheelSpinSpecialTextColor, 'bold'); } else { cb.sendNotice(msg, '', wheelSpinBgColor, wheelSpinTextColor, 'bold'); } wheelWinners.push('Spin #' + wheelSpinCounter + ' (' + spinChoice + '): ' + spinby + ' - ' + wheelPrize); } function wheelSetPrizes() { validWheel = true; if (eval('Price_' + cb.settings.wheelSpinLevel + '_1') <= 0 || eval('Prize_' + cb.settings.wheelSpinLevel + '_1') == null) { cb.sendNotice('Wheel Spin Game Error - No prizes defined for level : ' + cb.settings.wheelSpinLevel, cb.room_slug, appWarningColor, '', 'bold'); validWheel = false; } else { n = 0; do { for (var i = 1; i <= 20; i++) { if (n >= 20) { break; } else if (eval('Price_' + cb.settings.wheelSpinLevel + '_' + i) <= 0) { continue; } else { wheelPrizes[n] = eval('Prize_' + cb.settings.wheelSpinLevel + '_' + i); n++; } } } while (n < 20); if (cb.settings.wheelSpinSpecialPrizeNumber1) { rareprize = getPrize(cb.settings.wheelSpinSpecialPrizeNumber1); if (rareprize == 'invalid') { cb.sendNotice('Wheel Spin Game Error - Invalid Rare Prize #1 ID : ' + cb.settings.wheelSpinSpecialPrizeNumber1, cb.room_slug, appWarningColor, '', 'bold'); validWheel = false; } else { wheelPrizes[20] = rareprize; } } else { cb.sendNotice('Wheel Spin Game Error - There is no Rare Prize #1 ID configured', cb.room_slug, appWarningColor, '', 'bold'); validWheel = false; } if (cb.settings.wheelSpinSpecialPrizeNumber2) { rareprize = getPrize(cb.settings.wheelSpinSpecialPrizeNumber2); if (rareprize == 'invalid') { cb.sendNotice('Wheel Spin Game Error - Invalid Rare Prize #2 ID : ' + cb.settings.wheelSpinSpecialPrizeNumber2, cb.room_slug, appWarningColor, '', 'bold'); validWheel = false; } else { wheelPrizes[21] = rareprize; } } else { cb.sendNotice('Wheel Spin Game Error - There is no Rare Prize #2 ID configured', cb.room_slug, appWarningColor, '', 'bold'); validWheel = false; } if (cb.settings.wheelSpinSpecialPrizeNumber3) { rareprize = getPrize(cb.settings.wheelSpinSpecialPrizeNumber3); if (rareprize == 'invalid') { cb.sendNotice('Wheel Spin Game Error - Invalid Rare Prize #3 ID : ' + cb.settings.wheelSpinSpecialPrizeNumber3, cb.room_slug, appWarningColor, '', 'bold'); validWheel = false; } else { wheelPrizes[22] = rareprize; } } else { cb.sendNotice('Wheel Spin Game Error - There is no Rare Prize #3 ID configured', cb.room_slug, appWarningColor, '', 'bold'); validWheel = false; } } } function wheelShowPrizes(sendto) { if (wheelPrizes.length) { var rareText = ''; var msg = '\u22A1 \u22A1 \u22A1 \u22A1 WHEEL SPIN PRIZES \u22A1 \u22A1 \u22A1 \u22A1'; cb.sendNotice(msg, sendto, wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); var msg = '' for (var i = 1; i <= 23; i++) { if (i >= 21) { rareText = ' (RARE)'; } msg += 'Slot ' + i + ' - ' + wheelPrizes[i-1] + rareText + '\n'; } } cb.sendNotice(msg, sendto, '', '', 'bold'); } function wheelShowSpins(sendto,showall) { if (showall == 'all') { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 ALL WHEEL SPINS \u22A1 \u22A1 \u22A1 \u22A1'; } else { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 LAST 20 WHEEL SPINS \u22A1 \u22A1 \u22A1 \u22A1'; } if (wheelWinners.length === 0) { msg += '\nNo one has played the Wheel Spin Game yet.'; } else { if (showall == 'all') { for (var i = 0; i < wheelWinners.length; i++) { msg += '\n' + wheelWinners[i]; } } else { var wheelRecentWinners = wheelWinners.slice(-20); for (var i = 0; i < wheelRecentWinners.length; i++) { msg += '\n' + wheelRecentWinners[i]; } } } cb.sendNotice(msg, sendto, '', '', 'bold'); } // *********************************** Keno Game Functions ************************************** function setKenoToggle(option, mod) { if (option == 'on') { if (kenoToggle == 1) { cb.sendNotice('The Keno Game is already enabled.', mod, appNoticeColor); } else { kenoInit(); if (validKeno == true) { kenoToggle = 1; kenoSetColors(); kenoInitNoticeTimer(); cb.sendNotice('You have enabled the Keno Game.', mod, appNoticeColor); } else { cb.sendNotice('Invalid prize settings, the Keno Game could not be started.', mod, appWarningColor, appWarningTextColor, 'bold'); } } } else if (option == 'off') { if (kenoToggle == 0) { cb.sendNotice('The Keno Game is already disabled.', mod, appNoticeColor); } else { kenoToggle = 0; cb.sendNotice('You have disabled the Keno Game.', mod, appNoticeColor); cb.sendNotice('The keno game has been disabled, tips will no longer clear numbers from the board.', '', kenoNoticeBgColor, kenoNoticeTextColor, 'bold'); } } else if (option == 'pause') { if (kenoToggle == 0) { cb.sendNotice('The Keno Game is already disabled.', mod, appNoticeColor); } else { kenoToggle = 0; cb.sendNotice('You have paused the Keno Game.', mod, appNoticeColor); cb.sendNotice('The keno game has been paused, tips will no longer clear numbers from the board until it is resumed.', '', kenoNoticeBgColor, kenoNoticeTextColor, 'bold'); } } else if (option == 'resume') { if (kenoToggle == 1) { cb.sendNotice('The Keno Game is already enabled.', mod, appNoticeColor); } else { kenoToggle = 1; kenoInitNoticeTimer(); cb.sendNotice('You have resumed the Keno Game.', mod, appNoticeColor); } } } function kenoInit() { kenoGuessCounter = 0; kenoTotalTips = 0; kenoTotalBoard = 0; requiredNonWinners = 0; nonWinners = 0; kenoWinners.length = 0; kenoPrizes.length = 0; kenoNumbers.length = 0; kenoNumberStatus.length = 0; kenoTipCountArray.name.length = 0; kenoTipCountArray.amount.length = 0; freeGuessCount.name.length = 0; freeGuessCount.count.length = 0; kenoComplete = false; kenoLoadBoard(); } function kenoSetColors() { if (cb.settings.kenoNoticeTextColor == 'Custom') { kenoNoticeTextColor = checkTextColor(cb.settings.kenoNoticeCustomTextColor); if (kenoNoticeTextColor == 'default') { cb.sendNotice('Keno Game - Error while setting the Notices text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); kenoNoticeTextColor = '#FFFFFF'; } } else { kenoNoticeTextColor = checkTextColor(cb.settings.kenoNoticeTextColor); } if (cb.settings.kenoNoticeBgColor == 'Custom') { kenoNoticeBgColor = checkBgColor(cb.settings.kenoNoticeCustomBgColor); if (kenoNoticeBgColor == 'default') { cb.sendNotice('Keno Game - Error while setting the Notices background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); kenoNoticeBgColor = '#FFFFFF'; } } else { kenoNoticeBgColor = checkBgColor(cb.settings.kenoNoticeBgColor); } if (cb.settings.kenoResultTextColor == 'Custom') { kenoResultTextColor = checkTextColor(cb.settings.kenoResultCustomTextColor); if (kenoResultTextColor == 'default') { cb.sendNotice('Keno Game - Error while setting the Results Message text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); kenoResultTextColor = '#FFFFFF'; } } else { kenoResultTextColor = checkTextColor(cb.settings.kenoResultTextColor); } if (cb.settings.kenoResultBgColor == 'Custom') { kenoResultBgColor = checkBgColor(cb.settings.kenoResultCustomBgColor); if (kenoResultBgColor == 'default') { cb.sendNotice('Keno Game - Error while setting the Results Message background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); kenoResultBgColor = '#FFFFFF'; } } else { kenoResultBgColor = checkBgColor(cb.settings.kenoResultBgColor); } } function kenoInitNoticeTimer() { if (cb.settings.kenoNoticeInterval == '' || cb.settings.kenoNoticeInterval == null) { cb.sendNotice('Keno Game - Chat Notice Interval wass not set. Using default value of 2.1 minutes.', cb.room_slug, appWarningColor, '', 'bold'); kenoInt = 2.1; } else { kenoInt = parseFloat(cb.settings.kenoNoticeInterval); } if (kenoInt < 1) { cb.sendNotice('Keno Game - Chat Notice Interval setting is too short, must be at least 1 minute. Using default value of 2.1 minutes.', cb.room_slug, appWarningColor, '', 'bold'); kenoInt = 2.1; } kenoIntMs = kenoInt * 60000; kenoIntMs = parseInt(kenoIntMs); kenoNoticeTimer(); } function setKenoNoticeTimeout() { if (kenoComplete == false) { cb.setTimeout(kenoNoticeTimer, kenoIntMs); } } function kenoNoticeTimer() { if (kenoToggle == 1 && kenoComplete == false) { kenoShowNotice(''); setKenoNoticeTimeout(); } } function kenoShowNotice(sendto) { msg = ' :kenoapp \nKeno Game is active! Tip any amount on the board to make a guess and see if you win a prize!'; msg += '\nUse the command "/ki" to see info and commands for the Keno game.'; if (cb.settings.kenoFreeGuessFans > 0) { msg += '\nFan Club Members get ' + cb.settings.kenoFreeGuessFans + ' free ' + (cb.settings.kenoFreeGuessFans == 1 ? 'guess!' : 'guesses!'); } if (cb.settings.kenoFreeGuessVIP > 0) { msg += '\nVIP list Members get ' + cb.settings.kenoFreeGuessVIP + ' free ' + (cb.settings.kenoFreeGuessVIP == 1 ? 'guess!' : 'guesses!'); } if (cb.settings.kenoFreeGuessMods > 0) { msg += '\nModerators get ' + cb.settings.kenoFreeGuessMods + ' free ' + (cb.settings.kenoFreeGuessMods == 1 ? 'guess!' : 'guesses!'); } cb.sendNotice(msg, sendto, kenoNoticeBgColor, kenoNoticeTextColor, 'bold'); kenoDisplayBoard(sendto); } function kenoInfo(sendto,usertype) { msg = 'The Keno game is active. Tip any amount on the board to make a guess and see if you win a prize!'; msg += '\nUse the command "/kp" to see the keno prize list - both the remaining prizes and prizes won.'; msg += '\nUse the command "/kpw" to see the list of keno prizes that has already been won. You can also specify the number of recent prizes to display, such as "/kpw 10" to display the last 10 prizes won.'; msg += '\nUse the command "/kb" to see the keno board.'; msg += '\nUse the command "/freekeno xx" if your user group has been granted a free keno guess, where xx is the number you would like to choose.'; if (usertype == 'BC') { msg += '\nThe command "/kpa" functions like /kp but will display the full prize list of remaining prizes and prizes won to the whole chat.'; msg += '\nThe command "/kpwa" functions like /kpw but will display the list of recent winners to the whole chat. A number of recent prizes to display can be entered as a parameter.'; msg += '\nYou can also use the command "/freekeno xx" as the broadcaster (or moderator if enabled) to do a free guess for the room.'; msg += '\nBroadcasters can use a variation of the prizelist command, "/kpbc" to see the prize list and which number each one is behind, and the prizes won in sequential order.'; msg += '\nThe keno game can be turned on or off with the command "/keno [on/off]". '; } cb.sendNotice(msg, sendto, kenoNoticeBgColor, kenoNoticeTextColor, 'bold'); if (totalNumbersLeft > 0) { msg += '\nThere are ' + totalNumbersLeft + (totalNumbersLeft == 1 ? ' number' : ' numbers') + ' left on the board, and ' + totalPrizesLeft + (totalPrizesLeft == 1 ? ' prize' : ' prizes') + ' available to win (' + Math.floor(totalPrizesLeft/totalNumbersLeft*100) + '% chance to win)'; } else { msg += '\nThe keno board is completely cleared!!!'; } if (kenoTotalTips <= kenoTotalBoard) { msg += '\nTotal amount tipped for Keno : ' + kenoTotalTips + ' tokens --- Total amount on Board : ' + kenoTotalBoard + ' (' + Math.floor(kenoTotalTips/kenoTotalBoard*100) + '% complete)'; if (cb.settings.kenoGroupTipping == 'Yes') { msg += '\nGroup Tipping is enabled - all tips that do not match an available number will be applied against the highest remaining number on the board (' + groupTipNumber + ').'; } else { msg += '\nGroup Tipping is disabled - tip the exact amount of an available number on the board.'; } } else { msg += '\nTotal amount tipped for Keno : ' + kenoTotalTips + ' tokens --- Total amount on Board : ' + kenoTotalBoard + ' (100% complete)'; } cb.sendNotice(msg, sendto, kenoNoticeBgColor, kenoNoticeTextColor, 'bold'); } function kenoTip(tipAmount,user,mode) { prizeindex = kenoNumbers.indexOf(tipAmount); if (kenoNumberStatus[prizeindex] == 'Available') { kenoPrizeMessage(tipAmount,user,mode); if (tipAmount == groupTipNumber && cb.settings.kenoGroupTipping == 'Yes') { kenoGetNewGroupTipNumber(); } } else { if (cb.settings.kenoGroupTipping == 'Yes') { kenoGroupTip(tipAmount,user); } } } function kenoGetNewGroupTipNumber() { groupTipNumber = 0; groupTipNumberRem = 0; for (var i = groupTipNumberIndex; i >= 0; i--) { if (kenoNumberStatus[i] != 'Won') { groupTipNumber = kenoNumbers[i]; groupTipNumberRem = groupTipNumber; groupTipNumberIndex = i; break; } } } function kenoGroupTip(tipAmount,user) { doGroupTip = true; if (cb.settings.kenoSkipNumbersGroup == 'No') { tipAmountInt = parseInt(tipAmount); if (cbjs.arrayContains(kenoSkipNumbersArray,tipAmountInt)) { doGroupTip = false; } } if (doGroupTip) { if (tipAmount < groupTipNumberRem) { groupTipNumberRem -= tipAmount; prizeindex = kenoNumbers.indexOf(groupTipNumber); kenoNumberStatus[prizeindex] = 'Group'; cb.sendNotice('Group tip sent for number ' + groupTipNumber + '. There are ' + groupTipNumberRem + ' tokens remaining for this number.', '', kenoResultBgColor, kenoResultTextColor, 'bold'); } else if (tipAmount == groupTipNumberRem) { kenoPrizeMessage(groupTipNumber,user,'group'); kenoGetNewGroupTipNumber(); } else if (tipAmount > groupTipNumberRem && groupTipNumber > 0) { kenoPrizeMessage(groupTipNumber,user,'group'); remAmount = tipAmount - groupTipNumberRem; kenoGetNewGroupTipNumber(); if (remAmount == groupTipNumber) { kenoTip(groupTipNumber,user,'tip'); } else { kenoGroupTip(remAmount,user); } } } } function kenoPrizeMessage(tipAmount,user,mode) { prizeindex = kenoNumbers.indexOf(tipAmount); prize = kenoPrizes[prizeindex]; kenoNumberStatus[prizeindex] = 'Won'; kenoWinners.push(kenoPrizes[prizeindex]); totalNumbersLeft--; if (prize != 'Sorry - no prize won') { totalPrizesLeft--; } if (mode == 'group') { cb.sendNotice('Group tipping for number ' + tipAmount + ' completed. :smallpresent Prize is : ' + prize + ' :smallpresent ', '', kenoResultBgColor, kenoResultTextColor, 'bold'); } else if (mode == 'free') { cb.sendNotice(user + ' has used one of their free keno guesses for board number ' + tipAmount + '! :smallpresent Prize is : ' + prize + ' :smallpresent ', '', kenoResultBgColor, kenoResultTextColor, 'bold'); } else if (mode == 'bc') { cb.sendNotice(bctext + ' completed board number ' + tipAmount + '! :smallpresent Prize is : ' + prize + ' :smallpresent ', '', kenoResultBgColor, kenoResultTextColor, 'bold'); } else { cb.sendNotice(user + ' has tipped for number ' + tipAmount + ' off the board! :smallpresent Prize is : ' + prize + ' :smallpresent ', '', kenoResultBgColor, kenoResultTextColor, 'bold'); } if (kenoCheckBoardComplete() == 'Y') { kenoBoardComplete(); } } function kenoCheckBoardComplete() { for (var i = 0; i <= (totalNumbers-1); i++) { if (kenoNumberStatus[i] != 'Won') { return 'N'; } } return 'Y'; } function kenoBoardComplete() { kenoComplete = true; cb.sendNotice(':siren1 :siren1 :siren1 The Keno Board is Completely Cleared!!! :siren1 :siren1 :siren1 \n Keno Game Completion Prize: ' + cb.settings.kenoFinalGoal, '', kenoNoticeBgColor, kenoNoticeTextColor, 'bold'); if (cb.settings.kenoHighTipperPrize) { cb.sendNotice(':siren1 The High Tipper was ' + kenoGetTopTipper() + ', and they have won ' + cb.settings.kenoHighTipperPrize + '! :siren1', '', kenoNoticeBgColor, kenoNoticeTextColor, 'bold'); } } function kenoGetTopTipper() { var swapped, temp1, temp2; do { swapped = false; for (var i = 0; i < kenoTipCountArray.amount.length ; i++) { if (kenoTipCountArray.amount[i] < kenoTipCountArray.amount[i + 1]) { temp1 = kenoTipCountArray.amount[i]; temp2 = kenoTipCountArray.name[i]; kenoTipCountArray.amount[i] = kenoTipCountArray.amount[i + 1]; kenoTipCountArray.amount[i + 1] = temp1; kenoTipCountArray.name[i] = kenoTipCountArray.name[i + 1]; kenoTipCountArray.name[i + 1] = temp2; swapped = true; } } } while (swapped); return kenoTipCountArray.name[0]; } function kenoDisplayBoard(sendto) { boardText = ' :slam69-kenoprize1 :slam69-kenoprize2 \n \u2776 \u2777 \u2778 \u2779 \u277A Keno Board \u2776 \u2777 \u2778 \u2779 \u277A \n'; linecount = 0; lineDisplay = '\u25FE '; for (var i = 1; i <= totalNumbers; i++) { if (kenoNumberStatus[i-1] == 'Won') { lineDisplay += '\u2327 \u25FE '; linecount++; } else if (kenoNumberStatus[i-1] == 'Group') { lineDisplay += 'GT \u25FE '; linecount++; } else { if (kenoNumbers[i-1] < 10) { lineDisplay += '0' + kenoNumbers[i-1] + ' \u25FE '; } else if (kenoNumbers[i-1] < 100) { lineDisplay += kenoNumbers[i-1] + ' \u25FE '; } else { lineDisplay += kenoNumbers[i-1] + ' \u25FE '; } linecount ++; } if (linecount >= 10) { boardText += lineDisplay + '\n'; linecount = 0; lineDisplay = '\u25FE '; } } if (linecount > 0) { boardText += lineDisplay; } cb.sendNotice(boardText, sendto); } function kenoLoadBoard() { validKeno = true; if (kenoLowNumber > kenoHighNumber) { cb.sendNotice('Keno Error - Low Number is greater than High Number. Please restart the bot and set the values appropriately.', cb.room_slug, appWarningColor, '', 'bold'); validKeno = false; return; } else { totalSkipsInRange = 0; for (var i = 0; i <= kenoSkipNumbersArray.length; i++) { if (kenoSkipNumbersArray[i] >= kenoLowNumber && kenoSkipNumbersArray[i] <= kenoHighNumber) { totalSkipsInRange++; } } totalNumbers = (kenoHighNumber - kenoLowNumber + 1) - totalSkipsInRange; totalNumbersLeft = totalNumbers; } totalPrizes = kenoL1 + kenoL2 + kenoL3 + kenoL4 + kenoL5 + kenoL6 + kenoL7 + kenoL8 + kenoL9 + kenoL10; totalPrizesLeft = totalPrizes; if (totalPrizes > totalNumbers) { cb.sendNotice('Keno Error - More prizes are defined (' + totalPrizes + ') than the numbers in the range (' + totalNumbers + ').', cb.room_slug, appWarningColor, '', 'bold'); validKeno = false; return; } prizeindex = 0; if (cb.settings.kenoMinForRandomPrize >= kenoHighNumber) { cb.sendNotice('Keno Error - Minimum prize setting (' + cb.settings.kenoMinForRandomPrize + ') is equal to or higher than the highest number configured for board (' + kenoHighNumber + ').', cb.room_slug, appWarningColor, '', 'bold'); validKeno = false; return; } if (cb.settings.kenoMinForRandomPrize > kenoLowNumber) { requiredNonWinners = cb.settings.kenoMinForRandomPrize - kenoLowNumber; if ((totalNumbers - totalPrizes) < requiredNonWinners) { cb.sendNotice('Keno Error - Minimum prize setting (' + cb.settings.kenoMinForRandomPrize + ') requires more non-winning numbers (' + (cb.settings.kenoMinForRandomPrize - kenoLowNumber) + ') than available with current prize total (' + (totalNumbers - totalPrizes) + ').', cb.room_slug, appWarningColor, '', 'bold'); validKeno = false; return; } else { for (var i = 1; i <= requiredNonWinners; i++) { kenoPrizes[prizeindex] = 'Sorry - no prize won'; prizeindex++; } } } for (var L = 1; L <= 10; L++) { numForLevel = eval('kenoL' + L); if (numForLevel > 0) { if (eval('Price_' + L + '_1') <= 0 || eval('Prize_' + L + '_1') == null || eval('Prize_' + L + '_1') == '') { cb.sendNotice('Keno Error - Requested prizes, but no prizes defined in Prize 1 position for level : ' + L, cb.room_slug, appNoticeColor, '', 'bold'); validKeno = false; return; } else { if (L <= 4) { max = 20; } else { max = 10; } levelcount = 0; do { for (var i = 1; i <= max; i++) { if (levelcount >= numForLevel) { break; } else if (eval('Price_' + L + '_' + i) <= 0) { continue; } else { kenoPrizes[prizeindex] = eval('Prize_' + L + '_' + i); prizeindex++; levelcount++; } } } while (levelcount < numForLevel); } } } nonWinners = totalNumbers - prizeindex; for (var i = 1; i <= nonWinners; i++) { kenoPrizes.push('Sorry - no prize won'); } prizesAdded = kenoPrizes.length; if (prizesAdded != totalNumbers) { cb.sendNotice('Keno Error - Prizes added including non-winners (' + prizesAdded + ') not equal to total numbers in range (' + totalNumbers + ').', cb.room_slug, appNoticeColor, '', 'bold'); validKeno = false; return; } kenoPrizes = shuffleBoard(kenoPrizes); for (var i = parseInt(kenoLowNumber); i <= parseInt(kenoHighNumber); i++) { if (!cbjs.arrayContains(kenoSkipNumbersArray,i)) { kenoNumbers.push(i); kenoNumberStatus.push('Available'); kenoTotalBoard += i; } } groupTipNumber = kenoNumbers[kenoNumbers.length-1]; groupTipNumberRem = groupTipNumber; groupTipNumberIndex = kenoNumbers.length-1; } function shuffleBoard(array) { var currentIndex = array.length, temporaryValue, randomIndex; while (currentIndex > requiredNonWinners) { randomIndex = (Math.floor(Math.random() * (currentIndex - requiredNonWinners))) + requiredNonWinners; currentIndex -= 1; temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; } function kenoShowPrizes(sendto,displaymode,displaynumber) { var msg = ''; if (displaymode == 'a') { msg += '\u22A1 \u22A1 \u22A1 \u22A1 REMAINING PRIZES (in random order) \u22A1 \u22A1 \u22A1 \u22A1 \n'; kenoRemPrizes = []; for (var i = 1; i <= kenoPrizes.length; i++) { if (kenoPrizes[i-1] != 'Sorry - no prize won') { if (kenoNumberStatus[i-1] != 'Won') { kenoRemPrizes.push(kenoPrizes[i-1]); } } } if (kenoRemPrizes.length > 0) { kenoRemPrizes = shuffleArray(kenoRemPrizes); msg += cbjs.arrayJoin(kenoRemPrizes, '\n') msg += '\n\n'; } else { msg += 'There are no prizes left in the list, all prizes have been won! \n\n'; } } if (kenoWinners.length) { if (displaynumber && (kenoWinners.length - displaynumber) >= 0) { startposn = kenoWinners.length - displaynumber; msg += '\u22A1 \u22A1 \u22A1 \u22A1 LAST ' + displaynumber + ' PRIZE' + (displaynumber == 1 ? '' : 'S') + ' WON (in order) \u22A1 \u22A1 \u22A1 \u22A1 \n'; } else { startposn = 0; msg += '\u22A1 \u22A1 \u22A1 \u22A1 PRIZES WON (in order) \u22A1 \u22A1 \u22A1 \u22A1 \n'; } for (var windex = startposn; windex < kenoWinners.length; windex++) { msg += (windex+1) + '. ' + kenoWinners[windex] + '\n'; } } else { msg += 'There are no prizes won yet, tip to guess a number from the board!'; } cb.sendNotice(msg, sendto, '', '', 'bold'); } function kenoShowPrizesBC() { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 Broadcaster Board & Prize List \u22A1 \u22A1 \u22A1 \u22A1 \n'; for (var i = 1; i <= totalNumbers; i++) { msg += '(' + kenoNumbers[i-1] + ') ' + kenoPrizes[i-1] + ' : ' + kenoNumberStatus[i-1] + '\n'; } cb.sendNotice(msg, cb.room_slug, '', '', 'bold'); } // *********************************** Press Your Luck Functions ************************************** function setPressToggle(option, mod) { if (option == 'on') { if (pressToggle == 1) { cb.sendNotice('The Press Your Luck Game is already enabled.', mod, appNoticeColor); } else { pressPrizes.length = 0; pressCheckPrizes(); pressSetGroup(); if (validPress == true) { pressToggle = 1; setPressColors(); pressInitNoticeTimer(); pressReminderCounter = 0; pressWaitingOnWinner = false; pressRemInt = 90000; pressReminderTimer(); pressGameCounter = 0; pressNewGame(); cb.sendNotice('You have enabled the Press Your Luck Game.', mod, appNoticeColor); } else { cb.sendNotice('Invalid prize settings, the Press Your Luck Game could not be started.', mod, appWarningColor, appWarningTextColor, 'bold'); } } } else if (option == 'off') { if (pressToggle == 0) { cb.sendNotice('The Press Your Luck Game is already disabled.', mod, appNoticeColor); } else { pressToggle = 0; cb.sendNotice('You have disabled the Press Your Luck Game.', mod, appNoticeColor); cb.sendNotice('The Press Your Luck game has been disabled, tips will no longer draw a card.', '', pressNoticeBgColor, pressNoticeTextColor, 'bold'); } } } function pressSetGroup() { pressCardTypeArr = pressWinnerGroup.split(' ('); pressCardType = pressCardTypeArr[0]; if (pressWinnerGroup == 'Red Card (50%)') { pressWinnerGroupType = 1; } else if (pressWinnerGroup == 'Black Card (50%)') { pressWinnerGroupType = 2; } else if (pressWinnerGroup == 'Hearts (25%)') { pressWinnerGroupType = 3; } else if (pressWinnerGroup == 'Diamonds (25%)') { pressWinnerGroupType = 4; } else if (pressWinnerGroup == 'Clubs (25%)') { pressWinnerGroupType = 5; } else if (pressWinnerGroup == 'Spades (25%)') { pressWinnerGroupType = 6; } else if (pressWinnerGroup == 'Number Cards 2-10 (69%)') { pressWinnerGroupType = 7; } else if (pressWinnerGroup == 'Face Cards and Aces (31%)') { pressWinnerGroupType = 8; } else if (pressWinnerGroup == 'Aces (8%)') { pressWinnerGroupType = 9; } else if (pressWinnerGroup == 'Queen of Hearts (2%)') { pressWinnerGroupType = 10; } } function pressCheckPrizes() { validPress = true; n = 0; for (var i = 1; i <= 8; i++) { roundtype = eval('cb.settings.pressPrizeType_' + i); if (roundtype != 'Not Used') { pressRoundTypes[n] = roundtype; n++; if (roundtype == 'Specific Prize') { prizeID = eval('cb.settings.pressPrize_' + i); if (prizeID == '' || prizeID == null) { cb.sendNotice('Press Your Luck Game Error - Round ' + i + ' : "Specific Prize" type defined, but no prize ID configured.', cb.room_slug, appWarningColor, '', 'bold'); validPress = false; return; } else { levelprize = getPrize(prizeID); if (levelprize == 'invalid') { cb.sendNotice('Press Your Luck Game Error - Round ' + i + ' : "Specific Prize" type defined, but invalid Prize ID format (' + eval('cb.settings.pressPrize_' + i) + ').', cb.room_slug, appWarningColor, '', 'bold'); validPress = false; return; } else { pressPrizes[n-1] = levelprize; } } } else if (roundtype == 'Random Prize') { pressPrizes[n-1] = eval('cb.settings.pressLevel_' + i); } } } pressMaxLevels = pressPrizes.length; } function setPressColors() { if (cb.settings.pressNoticeTextColor == 'Custom') { pressNoticeTextColor = checkTextColor(cb.settings.pressNoticeCustomTextColor); if (pressNoticeTextColor == 'default') { cb.sendNotice('Press Your Luck Game - Error while setting the Notices text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); pressNoticeTextColor = '#FFFFFF'; } } else { pressNoticeTextColor = checkTextColor(cb.settings.pressNoticeTextColor); } if (cb.settings.pressNoticeBgColor == 'Custom') { pressNoticeBgColor = checkBgColor(cb.settings.pressNoticeCustomBgColor); if (pressNoticeBgColor == 'default') { cb.sendNotice('Press Your Luck Game - Error while setting the Notices background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); pressNoticeBgColor = '#FFFFFF'; } } else { pressNoticeBgColor = checkBgColor(cb.settings.pressNoticeBgColor); } if (cb.settings.pressResultTextColor == 'Custom') { pressResultTextColor = checkTextColor(cb.settings.pressRollCustomTextColor); if (pressResultTextColor == 'default') { cb.sendNotice('Press Your Luck Game - Error while setting the Results Message text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); pressResultTextColor = '#FFFFFF'; } } else { pressResultTextColor = checkTextColor(cb.settings.pressResultTextColor); } if (cb.settings.pressResultBgColor == 'Custom') { pressResultBgColor = checkBgColor(cb.settings.pressRollCustomBgColor); if (pressResultBgColor == 'default') { cb.sendNotice('Press Your Luck Game - Error while setting the Results Message background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); pressResultBgColor = '#FFFFFF'; } } else { pressResultBgColor = checkBgColor(cb.settings.pressResultBgColor); } } function pressInitNoticeTimer() { if (cb.settings.pressNoticeInterval == '' || cb.settings.pressNoticeInterval == null) { cb.sendNotice('Press Your Luck Game - Chat Notice Interval was not set. Using default value of 2.5 minutes.', cb.room_slug, appWarningColor, '', 'bold'); pressInt = 2.5; } else { pressInt = parseFloat(cb.settings.pressNoticeInterval); } if (pressInt < 1) { cb.sendNotice('Press Your Luck Game - Chat Notice Interval setting is too short, must be at least 1 minute. Using default value of 2.5 minutes.', cb.room_slug, appWarningColor, '', 'bold'); pressInt = 2.5; } pressInt *= 60000; pressInt = parseInt(pressInt); pressNoticeTimer(); } function setPressNoticeTimeout() { cb.setTimeout(pressNoticeTimer, pressInt); } function pressNoticeTimer() { if (pressToggle == 1) { pressShowNotice(''); setPressNoticeTimeout(); } } function pressShowNotice(sendto) { msg = ' :clover66 :potofgold2 The "Press Your Luck" game is active! :potofgold2 :clover66 '; msg += '\nTip ' + pressPrice + ' tokens to draw a card and start a game.'; msg += '\nUse the command "/pi" to see the instructions, commands, and prizes for the Press Your Luck game (no quotes).'; cb.sendNotice(msg, sendto, pressNoticeBgColor, pressNoticeTextColor, 'bold'); } function pressReminderTimer() { if (pressToggle == 1 && pressWaitingOnWinner == true) { pressReminderCounter++; if (pressReminderCounter >= 3) { cb.sendNotice('Auto-ending "Press Your Luck" for player ' + currentPressPlayer + ' after 2 reminders...', '', pressNoticeBgColor, pressNoticeTextColor, 'bold'); stopPressing(currentPressPlayer,'the Gamebot'); } else { cb.sendNotice('Reminder: there is a "Press Your Luck" game active, waiting on ' + currentPressPlayer + ' to /stoppress or tip to play the next round.', '', pressNoticeBgColor, pressNoticeTextColor, 'bold'); } } setPressReminderTimeout(); } function setPressReminderTimeout() { cb.setTimeout(pressReminderTimer, pressRemInt); } function pressInstructions(sendto) { msg = '"Press Your Luck" Instructions: '; msg += '\nYou can tip ' + pressPrice + ' tokens to draw a card and start a game.'; msg += '\nThe current winning card type is a ' + pressCardType + '.'; msg += '\nIf you draw a ' + pressCardType + ', you win the round and can either keep that prize or give up that prize and press your luck in the next round.'; msg += '\nTo Press Your Luck in the next round, you can keep tipping ' + pressPrice + ' tokens, or you can use the command "/stoppress" to end your game and claim the last prize you won.'; msg += '\nThere are ' + pressMaxLevels + ' rounds to get to the end of the game.'; msg += '\nIf you lose a round, you lose any prize you won in the previous round.'; msg += '\nOne person can play at a time and a new deck of cards is used for each new player game.'; msg += '\nYou can tip to play at any time and it will save your place in line if someone else is already playing.'; msg += '\nIf there is a queue, you can use the command "/pq" to see the list of players waiting to play (no quotes).'; msg += '\nUse the command "/pp" to see the available Press Your Luck prizes (no quotes).'; msg += '\nUse the command "/pw" to see a listing of the last 20 players to play and their results.'; cb.sendNotice(msg, sendto, pressNoticeBgColor, pressNoticeTextColor, 'bold'); } function pressInstructionsBC(sendto) { msg = '"Press Your Luck" Instructions: '; msg += '\nYou can tip ' + pressPrice + ' tokens to draw a card and start a game.'; msg += '\nThe current winning card type is a ' + pressCardType + '.'; msg += '\nIf you draw a ' + pressCardType + ', you win the round and can either keep that prize or give up that prize and press your luck in the next round.'; msg += '\nTo Press Your Luck in the next round, you can keep tipping ' + pressPrice + ' tokens, or you can use the command "/stoppress" to end your game and claim the last prize you won.'; msg += '\nThe Broadcaster can also use the command "/stoppress" to end a game if the user stopped responding or left.'; msg += '\nThere are ' + pressMaxLevels + ' rounds to get to the end of the game.'; msg += '\nIf you lose a round, you lose any prize you won in the previous round.'; msg += '\nOne person can play at a time and a new deck of cards is used for each new player game.'; msg += '\nYou can tip to play at any time and it will save your place in line if someone else is already playing.'; msg += '\nIf there is a queue, you can use the command "/pq" to see the list of players waiting to play (no quotes).'; msg += '\nUse the command "/pp" to see the available Press Your Luck prizes (no quotes).'; msg += '\nUse the command "/pw" to see a listing of the last 20 players to play and their results.'; msg += '\nUse the command "/pf" to do a free drawing as if a user had tipped (no quotes).'; msg += '\nUse the command "/press [on/off]" to turn the game on or off, in the format of "/press on" (no quotes).'; cb.sendNotice(msg, sendto, pressNoticeBgColor, pressNoticeTextColor, 'bold'); } function pressNewGame() { pressCurrentDeckOfCards = deckOfCards.slice(); currentRound = 0; currentPressPlayer = ''; pressWaitingOnWinner = false; if (pressNextplayer.length > 0) { nextPlayer = pressNextplayer[0]; pressNextplayer.splice(0, 1); cb.sendNotice(nextPlayer + ' is next in line and is about to start Round 1. \n You can use the command "/pq" to see the list of players waiting to play. \n Shuffling the cards...', '', pressResultBgColor, pressResultTextColor, 'bold'); cb.setTimeout(pressNextGame, 5000); } else { pressActive = false; } } function pressNextGame() { cb.sendNotice('Ready to draw...', '', pressResultBgColor, pressResultTextColor, 'bold'); pressTip(nextPlayer,'next'); } function pressTip(user,pressfrom) { if (pressActive == true && currentPressPlayer == user && (pressfrom != 'next') && pressWaitingOnWinner == true) { currentRound++; pressWaitingOnWinner = false; cb.sendNotice('Game #' + pressGameCounter + ' (round ' + currentRound + '): ' + user + ' has chosen to keep pressing their Luck! Drawing a card for Round ' + currentRound + '...', '', pressResultBgColor, pressResultTextColor, 'bold'); cb.setTimeout(pressDrawCard, 3000); } else if (pressActive == true && pressfrom != 'next') { pressNextplayer.push(user); cb.sendNotice(user + ' has tipped to play Press Your Luck and been added to the player queue since someone else is already playing. Their game will start once it reaches their place in line (current number of players in line : ' + pressNextplayer.length + '). \n You can use the command "/pq" to see the list of players waiting to play.', '', pressResultBgColor, pressResultTextColor, 'bold'); } else if (pressActive == false || (pressActive == true && pressfrom == 'next')) { pressActive = true; pressGameCounter++; currentPressPlayer = user; currentRound = 1; cb.sendNotice('Game #' + pressGameCounter + ' (round ' + currentRound + '): ' + user + ' has tipped to play Press Your Luck! Drawing a card for Round 1...', '', pressResultBgColor, pressResultTextColor, 'bold'); cb.setTimeout(pressDrawCard, 3000); } } function pressDrawCard() { pressCurrentDeckOfCards = shuffleArray(pressCurrentDeckOfCards); cardsleft = pressCurrentDeckOfCards.length; cardchoiceindex = Math.floor(Math.random() * cardsleft); pressCardDrawn = pressCurrentDeckOfCards[cardchoiceindex]; pressCurrentDeckOfCards.splice(cardchoiceindex, 1); cb.sendNotice(currentPressPlayer + ' has drawn the ' + (eval(pressCardDrawn + '_gif')), '', pressResultBgColor, pressResultTextColor, 'bold'); winRound = pressCheckWinner(pressCardDrawn); pressReminderCounter = 0; if (winRound == 'Yes') { if (currentRound == pressMaxLevels) { pressAssignPrize(); pressWinners.push('Game #' + pressGameCounter + ' (round ' + currentRound + '): ' + currentPressPlayer + ' - Won ' + currentPressPrize); cb.sendNotice('Congratulations ' + currentPressPlayer + ', you\'ve won the final round of "Press Your Luck"! \n :fireworks4 The prize is : ' + currentPressPrize + ' :fireworks4 ', '', pressResultBgColor, pressResultTextColor, 'bold'); pressNewGame(); } else { pressAssignPrize(); pressWaitingOnWinner = true; pressWinners.push('Game #' + pressGameCounter + ' (round ' + currentRound + '): ' + currentPressPlayer + ' - Temporarily Won ' + currentPressPrize); cb.sendNotice('Congratulations ' + currentPressPlayer + ', you win Round ' + currentRound + '! \n :smallpresent The prize is : ' + currentPressPrize + ' :smallpresent \n You can now either Press Your Luck for a better prize in the next round by tipping ' + pressPrice + ' tokens again, or you can use the command "/stoppress" to keep this prize. \n If you Press Your Luck, you turn in the current prize and take your chances in the next round. \n You can use the command "/pp" to see the available prizes for each round.', '', pressResultBgColor, pressResultTextColor, 'bold'); } } else { cb.sendNotice('Sorry ' + currentPressPlayer + ', that card is not a ' + pressCardType + ', your luck ran out! You can play again starting at Round 1 by tipping ' + pressPrice + ' tokens again.', '', pressResultBgColor, pressResultTextColor, 'bold'); pressWinners.push('Game #' + pressGameCounter + ' (round ' + currentRound + '): ' + currentPressPlayer + ' - Lost'); pressNewGame(); } } function pressCheckWinner(pressCardDrawn) { if (pressWinnerGroupType == 1 && (pressCardDrawn.substring(4) == 'HEART' || pressCardDrawn.substring(4) == 'DIAMD')) { return ('Yes'); } else if (pressWinnerGroupType == 2 && (pressCardDrawn.substring(4) == 'CLUBS' || pressCardDrawn.substring(4) == 'SPADE')) { return ('Yes'); } else if (pressWinnerGroupType == 3 && pressCardDrawn.substring(4) == 'HEART') { return ('Yes'); } else if (pressWinnerGroupType == 4 && pressCardDrawn.substring(4) == 'DIAMD') { return ('Yes'); } else if (pressWinnerGroupType == 5 && pressCardDrawn.substring(4) == 'CLUBS') { return ('Yes'); } else if (pressWinnerGroupType == 6 && pressCardDrawn.substring(4) == 'SPADE') { return ('Yes'); } else if (pressWinnerGroupType == 7 && (pressCardDrawn.substring(0,3) == 'TWO' || pressCardDrawn.substring(0,3) == 'THR' || pressCardDrawn.substring(0,3) == 'FOU' || pressCardDrawn.substring(0,3) == 'FIV' || pressCardDrawn.substring(0,3) == 'SIX' || pressCardDrawn.substring(0,3) == 'SEV' || pressCardDrawn.substring(0,3) == 'EGH' || pressCardDrawn.substring(0,3) == 'NIN' || pressCardDrawn.substring(0,3) == 'TEN')) { return ('Yes'); } else if (pressWinnerGroupType == 8 && (pressCardDrawn.substring(0,3) == 'JAK' || pressCardDrawn.substring(0,3) == 'QUN' || pressCardDrawn.substring(0,3) == 'KNG' || pressCardDrawn.substring(0,3) == 'ACE')) { return ('Yes'); } else if (pressWinnerGroupType == 9 && pressCardDrawn.substring(0,3) == 'ACE') { return ('Yes'); } else if (pressWinnerGroupType == 10 && pressCardDrawn == 'QUN_HEART') { return ('Yes'); } else { return ('No'); } } function pressAssignPrize() { currentRoundType = pressRoundTypes[currentRound-1]; currentPressPrize = 'Error on Prize Lookup : ' + currentRoundType + ' ' + pressPrizes[currentRound-1]; if (currentRoundType == 'Specific Prize') { currentPressPrize = pressPrizes[currentRound-1]; } else if (currentRoundType == 'Random Prize') { L = pressPrizes[currentRound-1]; if (L <= 4) { max = 20; } else { max = 10; } pressLevelPrizes.length = 0; for (var i = 1; i <= max; i++) { if (eval('Price_' + L + '_' + i) <= 0 || eval('Prize_' + L + '_' + i) == '' || eval('Prize_' + L + '_' + i) == null) { continue; } else { pressLevelPrizes.push(eval('Prize_' + L + '_' + i)); } } prizesavailable = pressLevelPrizes.length; if (prizesavailable == 1) { currentPressPrize = pressLevelPrizes[0]; } else if (prizesavailable > 1) { prizenumberindex = Math.floor(Math.random() * prizesavailable); currentPressPrize = pressLevelPrizes[prizenumberindex]; } } } function stopPressing(user,stoppedby) { if (stoppedby == user) { cb.sendNotice(user + ' has chosen to keep their prize :smallpresent ' + currentPressPrize + ' :smallpresent', '', pressResultBgColor, pressResultTextColor, 'bold'); pressWinners.push('Game #' + pressGameCounter + ' (round ' + currentRound + '): ' + currentPressPlayer + ' - Stopped pressing their luck and kept their prize'); } else { cb.sendNotice(user + '\'s game has been ended by ' + stoppedby + ', they will keep the prize of :smallpresent ' + currentPressPrize + ' :smallpresent', '', pressResultBgColor, pressResultTextColor, 'bold'); pressWinners.push('Game #' + pressGameCounter + ' (round ' + currentRound + '): ' + currentPressPlayer + ' - Ended by ' + stoppedby); } pressNewGame(); } function pressShowPrizes(sendto) { msg = '\u2297 \u2297 \u2297 \u2297 Press Your Luck - Prizes \u2297 \u2297 \u2297 \u2297'; for (var i = 0; i < pressRoundTypes.length; i++) { if (pressRoundTypes[i] == 'Specific Prize') { msg += '\nRound ' + (i+1) + ': Specific prize of ' + pressPrizes[i]; } else { R = i + 1; if (R <= 4) { max = 20; } else { max = 10; } pressLevelPrizes.length = 0; for (var j = 1; j <= max; j++) { if (eval('Price_' + R + '_' + j) <= 0) { continue; } else { pressLevelPrizes.push(eval('Prize_' + R + '_' + j)); } } msg += '\nRound ' + (i+1) + ': Random Prize from Prize Level ' + pressPrizes[i]; msg += '\n -- Level ' + pressPrizes[i] + ' includes ' + cbjs.arrayJoin(pressLevelPrizes, ', '); } } cb.sendNotice(msg, sendto, '', '', 'bold'); } function pressShowWinners(sendto,showall) { if (showall == 'all') { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 ALL GAMES OF PRESS YOUR LUCK \u22A1 \u22A1 \u22A1 \u22A1'; } else { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 LAST 20 GAMES OF PRESS YOUR LUCK \u22A1 \u22A1 \u22A1 \u22A1'; } if (pressWinners.length === 0) { msg += '\nNo one has played Press Your Luck yet.'; } else { if (showall == 'all') { for (var i = 0; i < pressWinners.length; i++) { msg += '\n' + pressWinners[i]; } } else { var pressRecentWinners = pressWinners.slice(-20); for (var i = 0; i < pressRecentWinners.length; i++) { msg += '\n' + pressRecentWinners[i]; } } } cb.sendNotice(msg, sendto, '', '', 'bold'); } // *********************************** War Card Game Functions ************************************** function setWarToggle(option, mod) { if (option == 'on') { if (warToggle == 1) { cb.sendNotice('The War Card Game is already enabled.', mod, appNoticeColor); } else { warPrizes.length = 0; warCheckPrizes(); if (validWar == true) { warToggle = 1; warSetColors(); warInitNoticeTimer(); warReminderCounter = 0; warWaiting = false; warRemInt = 90000; warReminderTimer(); warGameCounter = 0; warNewGame(); cb.sendNotice('You have enabled the War Card Game.', mod, appNoticeColor); } else { cb.sendNotice('Invalid prize settings, the War Card Game could not be started.', mod, appWarningColor, appWarningTextColor, 'bold'); } } } else if (option == 'off') { if (warToggle == 0) { cb.sendNotice('The War Card Game is already disabled.', mod, appNoticeColor); } else { warToggle = 0; cb.sendNotice('You have disabled the War Card Game.', mod, appNoticeColor); cb.sendNotice('The War! game has been disabled, tips will no longer draw a card.', '', warNoticeBgColor, warNoticeTextColor, 'bold'); } } } function warCheckPrizes() { validWar = true; n = 0; for (var i = 1; i <= 5; i++) { prizesetting = eval('cb.settings.warPrizeType_' + i); warPrices[n] = eval('cb.settings.warPrice_' + i); if (prizesetting != 'Not Used' && warPrices[n] > 0) { warPrizeTypes[n] = prizesetting; n++; if (prizesetting == 'Specific Prize') { prizeID = eval('cb.settings.warPrize_' + i); if (prizeID == '' || prizeID == null) { cb.sendNotice('War Card Game Error - Round ' + i + ' : "Specific Prize" type defined, but no prize ID configured.', cb.room_slug, appWarningColor, '', 'bold'); validWar = false; return; } else { levelprize = getPrize(prizeID); if (levelprize == 'invalid') { cb.sendNotice('War Card Game Error - Round ' + i + ' : "Specific Prize" type defined, but invalid Prize ID format (' + eval('cb.settings.warPrize_' + i) + ').', cb.room_slug, appWarningColor, '', 'bold'); validWar = false; return; } else { warPrizes[n-1] = levelprize; } } } else if (prizesetting == 'Random Prize') { warPrizes[n-1] = eval('cb.settings.warLevel_' + i); } } } } function warSetColors() { if (cb.settings.warNoticeTextColor == 'Custom') { warNoticeTextColor = checkTextColor(cb.settings.warNoticeCustomTextColor); if (warNoticeTextColor == 'default') { cb.sendNotice('War Card Game - Error while setting the Notices text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); warNoticeTextColor = '#FFFFFF'; } } else { warNoticeTextColor = checkTextColor(cb.settings.warNoticeTextColor); } if (cb.settings.warNoticeBgColor == 'Custom') { warNoticeBgColor = checkBgColor(cb.settings.warNoticeCustomBgColor); if (warNoticeBgColor == 'default') { cb.sendNotice('War Card Game - Error while setting the Notices background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); warNoticeBgColor = '#FFFFFF'; } } else { warNoticeBgColor = checkBgColor(cb.settings.warNoticeBgColor); } if (cb.settings.warResultTextColor == 'Custom') { warResultTextColor = checkTextColor(cb.settings.warResultCustomTextColor); if (warResultTextColor == 'default') { cb.sendNotice('War Card Game - Error while setting the Results Message text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); warResultTextColor = '#FFFFFF'; } } else { warResultTextColor = checkTextColor(cb.settings.warResultTextColor); } if (cb.settings.warResultBgColor == 'Custom') { warResultBgColor = checkBgColor(cb.settings.warResultCustomBgColor); if (warResultBgColor == 'default') { cb.sendNotice('War Card Game - Error while setting the Results Message background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); warResultBgColor = '#FFFFFF'; } } else { warResultBgColor = checkBgColor(cb.settings.warResultBgColor); } if (cb.settings.warResultSpecialTextColor == 'Custom') { warResultSpecialTextColor = checkTextColor(cb.settings.warResultSpecialCustomTextColor); if (warResultSpecialTextColor == 'default') { cb.sendNotice('War Card Game - Error while setting the Results Message text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); warResultSpecialTextColor = '#FFFFFF'; } } else { warResultSpecialTextColor = checkTextColor(cb.settings.warResultSpecialTextColor); } if (cb.settings.warResultSpecialBgColor == 'Custom') { warResultSpecialBgColor = checkBgColor(cb.settings.warResultSpecialCustomBgColor); if (warResultSpecialBgColor == 'default') { cb.sendNotice('War Card Game - Error while setting the Results Message background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); warResultSpecialBgColor = '#FFFFFF'; } } else { warResultSpecialBgColor = checkBgColor(cb.settings.warResultSpecialBgColor); } } function warInitNoticeTimer() { if (cb.settings.warNoticeInterval == '' || cb.settings.warNoticeInterval == null) { cb.sendNotice('War! Card Game - Chat Notice Interval is not set. Using default value of 2.2 minutes.', cb.room_slug, appNoticeColor); warInt = 2.2; } else { warInt = parseFloat(cb.settings.warNoticeInterval); } if (warInt < 1) { cb.sendNotice('War! Card Game Game - Chat Notice Interval is too short, must be at least 1 minute. Using default value of 2.2 minutes.', cb.room_slug, appNoticeColor); warInt = 2.2; } warInt *= 60000; warInt = parseInt(warInt); warNoticeTimer(); } function setWarNoticeTimeout() { cb.setTimeout(warNoticeTimer, warInt); } function warNoticeTimer() { if (warToggle == 1) { warShowNotice(''); setWarNoticeTimeout(); } } function warShowNotice(sendto) { msg = ' :cardsuits The "War" card game is active! :cardsuits '; msg += '\nTip to start a game against ' + bctext + ' using the amounts below.\n'; for (var i = 0; i < warPrizeTypes.length; i++) { if (warPrizeTypes[i] == 'Specific Prize') { msg += '(' + warPrices[i] + ') ' + warPrizes[i] + (i < (warPrizeTypes.length-1) ? ' :acehearts_small ' : ''); } else { msg += '(' + warPrices[i] + ') Level ' + warPrizes[i] + (i < (warPrizeTypes.length-1) ? ' :acehearts_small ' : ''); } } msg += '\nUse the command "/wp" to see the full prize list, or "/wi" to see the instructions and commands for playing War!'; cb.sendNotice(msg, sendto, warNoticeBgColor, warNoticeTextColor, 'bold'); } function warReminderTimer() { if (warToggle == 1 && warWaiting == true) { warReminderCounter++; if (warReminderCounter >= 3) { cb.sendNotice('Auto-drawing for dealer after 2 reminders...', '', warNoticeBgColor, warNoticeTextColor, 'bold'); warDealerDraw(); } else { cb.sendNotice('Reminder: there is a War! game active, waiting on ' + bctext + ' to use /wd to draw their card.', '', warNoticeBgColor, warNoticeTextColor, 'bold'); } } setWarReminderTimeout(); } function setWarReminderTimeout() { cb.setTimeout(warReminderTimer, warRemInt); } function warInstructions(sendto) { msg = ' "War" card game instructions: '; msg += '\nTip for one of the prize levels to draw a card and start a game against ' + bctext + '.'; msg += '\nWhoever draws the higher card wins! Note that Aces are high in this game!'; msg += '\nOne person can play at a time and a new deck of cards is used for each new player game.'; msg += '\nYou can tip to play at any time and it will save your place in line if someone else is already playing.'; msg += '\nYou can use the command "/wl" to see the list of players waiting to play (no quotes).'; msg += '\nIf there is a tie, the viewer can use the command "/war" to War again with new cards. '; msg += '\nUse the command "/wp" to see the full list of available War Prizes for each price level (no quotes).'; msg += '\nUse the command "/ww" to see a listing of the last 20 players to play and their results (no quotes).'; cb.sendNotice(msg, sendto, warNoticeBgColor, warNoticeTextColor, 'bold'); } function warInstructionsBC(sendto) { msg = ' "War" card game instructions: '; msg += '\nTip for one of the prize levels to draw a card and start a game against ' + bctext + '.'; msg += '\nAfter the player draws, ' + bctext + ' uses the command "/wd" to war and draw their card (if not set to automatic draw).'; msg += '\nWhoever draws the higher card wins! Note that Aces are high in this game!'; msg += '\nOne person can play at a time and a new deck of cards is used for each new player game.'; msg += '\nYou can tip to play at any time and it will save your place in line if someone else is already playing.'; msg += '\nYou can use the command "/wl" to see the list of players waiting to play (no quotes).'; msg += '\nIf there is a tie, the viewer can use the command "/war" to War again with new cards. '; msg += '\nUse the command "/wp" to see the full list of available War Prizes for each price level (no quotes).'; msg += '\nUse the command "/ww" to see a listing of the last 20 players to play and their results (no quotes).'; msg += '\nUse the command "/wf [1-5]" to do a free drawing at the specified level, in the format of "/wf 3" (no quotes).'; msg += '\nUse the command "/wargame [on/off]" to turn the game on or off, in the format of "/wargame on" (no quotes).'; cb.sendNotice(msg, sendto, warNoticeBgColor, warNoticeTextColor, 'bold'); } function warNewGame() { warActive = false; warCurrentDeckOfCards = deckOfCards.slice(); currentChallenge = 0; currentWarPlayer = ''; if (warNextplayer.name.length > 0 && warActive == false) { warActive = true; nextwarplayer = warNextplayer.name[0]; nextchallengelevel = warNextplayer.level[0]; warNextplayer.name.splice(0, 1); warNextplayer.level.splice(0, 1); cb.sendNotice(nextwarplayer + ' is next in line and is about to Play War at Challenge Level #' + nextchallengelevel + '. \n You can use the command "/wl" to see the list of players waiting to play. \n Shuffling the cards...', '', warNoticeBgColor, warNoticeTextColor, 'bold'); cb.setTimeout(warNextTimeout, 5000); } } function warNextTimeout() { cb.sendNotice('Ready to draw...', '', warNoticeBgColor, warNoticeTextColor, 'bold'); fromnext = true; warTip(nextwarplayer,nextchallengelevel,fromnext); } function warTip(user,challengelevel,fromnext) { if (warActive == true && fromnext != true) { warNextplayer.name.push(user); warNextplayer.level.push(challengelevel); cb.sendNotice(user + ' has tipped to play War and been added to the player queue since a game is already being played. Their game will start once it reaches their place in line (current number of players in line : ' + warNextplayer.name.length + '). \n You can use the command "/wl" to see the list of players waiting to play.', '', warNoticeBgColor, warNoticeTextColor, 'bold'); } else { warActive = true; warWaitingTie = false; warGameCounter++; currentWarPlayer = user; currentChallenge = challengelevel; cb.sendNotice('Game #' + warGameCounter + ' : ' + user + ' has tipped to play War at level ' + currentChallenge + '! Drawing card...', '', warNoticeBgColor, warNoticeTextColor, 'bold'); cb.setTimeout(warDrawCard, 3000); } } function warDealerDraw() { warWaiting = false; warCurrentDeckOfCards = shuffleArray(warCurrentDeckOfCards); cardsleft = warCurrentDeckOfCards.length; cardchoiceindex = Math.floor(Math.random() * cardsleft); warBCDraw = warCurrentDeckOfCards[cardchoiceindex]; warCurrentDeckOfCards.splice(cardchoiceindex, 1); cb.sendNotice(bctext + ' has drawn the ' + (eval(warBCDraw + '_gif')), '', warResultBgColor, warResultTextColor, 'bold'); BCCardValue = cardNumericValue(warBCDraw,'yes'); if (playerCardValue > BCCardValue) { warAssignPrize(); warWinners.push('Game #' + warGameCounter + ' (level ' + currentChallenge + '): ' + currentWarPlayer + ' - Won ' + currentWarPrize); cb.sendNotice('Congratulations ' + currentWarPlayer + ', you have beaten ' + bctext + '! \n :smallpresent The prize is: ' + currentWarPrize + ' :smallpresent \n You can continue tipping for additional War Challenges!', '', warResultSpecialBgColor, warResultSpecialTextColor, 'bold'); warNewGame(); } else if (playerCardValue == BCCardValue) { cb.sendNotice('It\'s a tie! We War Again! Please use the "/war" command to draw a new card!', '', warResultSpecialBgColor, warResultSpecialTextColor, 'bold'); warWaitingTie = true; } else { cb.sendNotice('Sorry ' + currentWarPlayer + ', ' + bctext + ' won this round of War! \n You can play again by tipping for one of the War challenge prices.', '', warResultBgColor, warResultTextColor, 'bold'); warWinners.push('Game #' + warGameCounter + ' (level ' + currentChallenge + '): ' + currentWarPlayer + ' - Lost'); warNewGame(); } } function warDrawCard() { warCurrentDeckOfCards = shuffleArray(warCurrentDeckOfCards); cardsleft = warCurrentDeckOfCards.length; cardchoiceindex = Math.floor(Math.random() * cardsleft); warCardDrawn = warCurrentDeckOfCards[cardchoiceindex]; warCurrentDeckOfCards.splice(cardchoiceindex, 1); cb.sendNotice('Challenge Level ' + currentChallenge + ' : ' + currentWarPlayer + ' has drawn the ' + (eval(warCardDrawn + '_gif')), '', warResultBgColor, warResultTextColor, 'bold'); warWaiting = true; warReminderCounter = 0; playerCardValue = cardNumericValue(warCardDrawn,'yes'); if (cb.settings.warDealer == 'Broadcaster dealt automatically') { warDealerDraw(); } else { cb.sendNotice('Waiting on the dealer to draw their card...', '', warNoticeBgColor, warNoticeTextColor, 'bold') } } function warAssignPrize() { currentChallengeType = warPrizeTypes[currentChallenge-1]; currentWarPrize = 'Error on Prize Lookup : ' + currentChallengeType + ' ' + warPrizes[currentChallenge-1]; if (currentChallengeType == 'Specific Prize') { currentWarPrize = warPrizes[currentChallenge-1]; } else if (currentChallengeType == 'Random Prize') { L = warPrizes[currentChallenge-1]; if (L <= 4) { max = 20; } else { max = 10; } warLevelPrizes.length = 0; for (var i = 1; i <= max; i++) { if (eval('Price_' + L + '_' + i) > 0 && eval('Prize_' + L + '_' + i)) { warLevelPrizes.push(eval('Prize_' + L + '_' + i)); } } prizesavailable = warLevelPrizes.length; if (prizesavailable == 1) { currentWarPrize = warLevelPrizes[0]; } else if (prizesavailable > 1) { prizenumberindex = Math.floor(Math.random() * prizesavailable); currentWarPrize = warLevelPrizes[prizenumberindex]; } } } function stopWar(user) { cb.sendNotice('The current game of war with player ' + currentWarPlayer + ' has been ended by ' + bctext + ' or moderator.', '', warNoticeBgColor, warNoticeTextColor, 'bold'); warWinners.push('Game #' + warGameCounter + ' (level ' + currentChallenge + '): ' + currentWarPlayer + ' - Ended by Broadcaster or Moderator'); warNewGame(); } function warShowPrizes(sendto) { msg = '\u2297 \u2297 \u2297 \u2297 War Card Game - Prizes \u2297 \u2297 \u2297 \u2297'; for (var i = 0; i < warPrizeTypes.length; i++) { if (warPrizeTypes[i] == 'Specific Prize') { msg += '\nChallenge #' + (i+1) + ': Specific prize of ' + warPrizes[i]; } else { R = warPrizes[i]; if (R <= 4) { max = 20; } else { max = 10; } warLevelPrizes.length = 0; for (var j = 1; j <= max; j++) { if (eval('Price_' + R + '_' + j) > 0 && eval('Prize_' + R + '_' + j)) { warLevelPrizes.push(eval('Prize_' + R + '_' + j)); } } msg += '\nChallenge #' + (i+1) + ': Random Prize from Master Prize List Level ' + warPrizes[i]; msg += '\n -- Prize Level ' + warPrizes[i] + ' includes: ' + cbjs.arrayJoin(warLevelPrizes, ', '); } } cb.sendNotice(msg, sendto, '', '', 'bold'); } function warShowWinners(sendto) { if (showall == 'all') { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 RESULTS FOR ALL GAMES OF WAR \u22A1 \u22A1 \u22A1 \u22A1'; } else { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 RESULTS FOR LAST 20 GAMES OF WAR \u22A1 \u22A1 \u22A1 \u22A1'; } if (warWinners.length === 0) { msg += '\nNo one has played War! yet.'; } else { if (showall == 'all') { for (var i = 0; i < warWinners.length; i++) { msg += '\n' + warWinners[i]; } } else { var warRecentWinners = warWinners.slice(-20); for (var i = 0; i < warRecentWinners.length; i++) { msg += '\n' + warRecentWinners[i]; } } } cb.sendNotice(msg, sendto, '', '', 'bold'); } // *********************************** Roulette Functions ************************************** function rouletteSetToggle(option, mod) { if (option == 'on') { if (rouletteToggle == 1) { cb.sendNotice('The Russian Roulette Game is already enabled.', mod, appNoticeColor); } else { rouletteInit(); if (validRoulette == true) { rouletteToggle = 1; rouletteInitNoticeTimer(); rouletteLoadGun(); cb.sendNotice('You have enabled the Russian Roulette Game.', mod, appNoticeColor); } else { cb.sendNotice('Invalid prize setting, the Russian Roulette Game could not be started.', mod, appWarningColor, appWarningTextColor, 'bold'); } } } else if (option == 'off') { if (rouletteToggle == 0) { cb.sendNotice('The Russian Roulette Game is already disabled.', mod, appNoticeColor); } else { rouletteToggle = 0; cb.sendNotice('You have disabled the Russian Roulette Game.', mod, appNoticeColor); } } } function rouletteInit() { shotsFired = 0; currentRouletteCycle = 0; rouletteShooters.length = 0; rouletteSetColors(); rouletteLoadPrize(); } function rouletteLoadGun() { shotsFired = 0; currentRouletteCycle++; bulletChamber = Math.floor(Math.random() * rouletteRounds) + 1; cb.sendNotice('Russian Roulette: The bullet has been loaded into one of the ' + rouletteRounds + ' chambers, firing can begin!', '', rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); remainingChambers.length = 0; if (cb.settings.rouletteMode == 'Each Chamber Used Only Once') { for (var i = 1; i <= rouletteRounds; i++) { remainingChambers.push(i); } } } function rouletteLoadPrize() { validRoulette = true; prizeID = cb.settings.roulettePrize; if (prizeID == '' || prizeID == null) { cb.sendNotice('Russian Roulette Game Error - no prize ID configured.', cb.room_slug, appWarningColor, '', 'bold'); validRoulette = false; return; } else { specificprize = getPrize(prizeID); if (specificprize == 'invalid') { cb.sendNotice('Russian Roulette Game Error - invalid Prize ID format (' + prizeID + ').', cb.room_slug, appWarningColor, '', 'bold'); validRoulette = false; return; } else { roulettePrize = specificprize; } } } function rouletteSetColors() { if (cb.settings.rouletteNoticeTextColor == 'Custom') { rouletteNoticeTextColor = checkTextColor(cb.settings.rouletteNoticeCustomTextColor); if (rouletteNoticeTextColor == 'default') { cb.sendNotice('Roulette Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); rouletteNoticeTextColor = '#FFFFFF'; } } else { rouletteNoticeTextColor = checkTextColor(cb.settings.rouletteNoticeTextColor); } if (cb.settings.rouletteNoticeBgColor == 'Custom') { rouletteNoticeBgColor = checkBgColor(cb.settings.rouletteNoticeCustomBgColor); if (rouletteNoticeBgColor == 'default') { cb.sendNotice('Roulette Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); rouletteNoticeBgColor = '#FFFFFF'; } } else { rouletteNoticeBgColor = checkBgColor(cb.settings.rouletteNoticeBgColor); } if (cb.settings.rouletteShotTextColor == 'Custom') { rouletteShotTextColor = checkTextColor(cb.settings.rouletteShotCustomTextColor); if (rouletteShotTextColor == 'default') { cb.sendNotice('Roulette Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); rouletteShotTextColor = '#FFFFFF'; } } else { rouletteShotTextColor = checkTextColor(cb.settings.rouletteShotTextColor); } if (cb.settings.rouletteShotBgColor == 'Custom') { rouletteShotBgColor = checkBgColor(cb.settings.rouletteShotCustomBgColor); if (rouletteShotBgColor == 'default') { cb.sendNotice('Roulette Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); rouletteShotBgColor = '#FFFFFF'; } } else { rouletteShotBgColor = checkBgColor(cb.settings.rouletteShotBgColor); } if (cb.settings.rouletteWinnerTextColor == 'Custom') { rouletteShotTextColor = checkTextColor(cb.settings.rouletteWinnerCustomTextColor); if (rouletteWinnerTextColor == 'default') { cb.sendNotice('Roulette Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); rouletteWinnerTextColor = '#FFFFFF'; } } else { rouletteWinnerTextColor = checkTextColor(cb.settings.rouletteWinnerTextColor); } if (cb.settings.rouletteWinnerBgColor == 'Custom') { rouletteWinnerBgColor = checkBgColor(cb.settings.rouletteWinnerCustomBgColor); if (rouletteWinnerBgColor == 'default') { cb.sendNotice('Roulette Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); rouletteWinnerBgColor = '#FFFFFF'; } } else { rouletteWinnerBgColor = checkBgColor(cb.settings.rouletteWinnerBgColor); } } function rouletteInitNoticeTimer() { if (cb.settings.rouletteNoticeInterval == '' || cb.settings.rouletteNoticeInterval == null) { cb.sendNotice('Russian Roulette Game - Chat Notice Interval is not set. Using default value of 3.4 minutes.', cb.room_slug, appWarningColor, '', 'bold'); rouletteInt = 3.4; } else { rouletteInt = parseFloat(cb.settings.rouletteNoticeInterval); } if (rouletteInt < 1) { cb.sendNotice('Russian Roulette Game - Chat Notice Interval is too short, must be at least 1 minute. Using default value of 3.4 minutes.', cb.room_slug, appWarningColor, '', 'bold'); rouletteInt = 3.4; } rouletteInt *= 60000; rouletteInt = parseInt(rouletteInt); rouletteNoticeTimer(); } function rouletteSetNoticeTimeout() { cb.setTimeout(rouletteNoticeTimer, rouletteInt); } function rouletteNoticeTimer() { if (rouletteToggle == 1) { rouletteShowNotice(''); rouletteSetNoticeTimeout(); } } function rouletteShowNotice(sendto) { var msg = ' :RussianRoulette \nThe Russian Roulette Game is active!'; msg += '\nTip ' + rouletteShotPrice + ' tokens to fire the gun, with a chance to win "' + roulettePrize + '"!'; if (cb.settings.rouletteMode == 'Each Chamber Can Be Reused') { msg += '\n You have a 1 in ' + rouletteRounds + ' chance of winning the prize with every shot!' } else { msg += '\n There are ' + rouletteRounds + ' chambers, and ' + shotsFired + (shotsFired == 1 ? ' shot has ' : ' shots have ') + ' been fired, you have a 1 in ' + (rouletteRounds - shotsFired) + ' chance of winning the prize!' } msg += '\nUse the command "/rri" to see more info on the Russian Roulette game'; cb.sendNotice(msg, sendto, rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); } function rouletteInfo(sendto,usertype) { if (rouletteMultiShots <= 1) { var msg = 'The Russian Roulette Game is active! Tip ' + rouletteShotPrice + ' tokens to fire the gun, with a chance to win "' + roulettePrize + '"!'; } else if (rouletteMultiShots == 2) { var msg = 'The Russian Roulette Game is active! Tip ' + rouletteShotPrice + ' tokens to fire the gun, with a chance to win "' + roulettePrize + '"!\nYou can tip up to 2 multiples of the shot price at once to take 2 shots (' + rouletteShotPrice + ' or ' + rouletteShotPrice*2 + ').'; } else if (rouletteMultiShots == 3) { var msg = 'The Russian Roulette Game is active! Tip ' + rouletteShotPrice + ' tokens to fire the gun, with a chance to win "' + roulettePrize + '"!\nYou can tip up to 3 multiples of the shot price at once to take 3 shots (' + rouletteShotPrice + ', ' + rouletteShotPrice*2 + ', or ' + rouletteShotPrice*3 + ').'; } else if (rouletteMultiShots > 3) { var msg = 'The Russian Roulette Game is active! Tip ' + rouletteShotPrice + ' tokens to fire the gun, with a chance to win "' + roulettePrize + '"!\nYou can tip up to ' +rouletteMultiShots + ' multiples of the shot price to take that many shots (' + rouletteShotPrice + ', ' + rouletteShotPrice*2 + ', ' + rouletteShotPrice*3 + ',...)'; } if (cb.settings.rouletteMode == 'Each Chamber Can Be Reused') { msg += '\n Game is configured to use the same odds with each shot, so you have a 1 in ' + rouletteRounds + ' chance of winning the prize with every shot!' } else { msg += '\n Game is configured to use up chambers as you fire, so your chances improve as the game goes. ' + shotsFired + (shotsFired == 1 ? ' shot has ' : ' shots have ') + ' been fired so far, so you have a 1 in ' + (rouletteRounds - shotsFired) + ' chance of winning the prize!' } msg += '\nUse the command "/rrs" to see the history of the roulette shots and prizes that have been won.'; if (usertype == 'BC') { msg += '\nUse the command "/rrp [xx]" as the broadcaster (or moderator if enabled) to update the Russian Roulette shot price to the new value of [xx].'; msg += '\nThe Russian Roulette game can be turned on or off with the command "/rr [on/off]". '; msg += '\nBroadcasters can use the command "/chambers" to display the remaining chambers and the location of the bullet (if chambers used only once, otherwise every shot has an equal chance).'; } cb.sendNotice(msg, sendto, rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); } function rouletteShot(firedby) { if (rouletteToggle == 1) { rouletteShooters.push(firedby); cb.sendNotice(firedby + ' has tipped to play Russian Roulette! Spinning chamber and firing...', '', rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); shotsFired++; if (cb.settings.rouletteMode == 'Each Chamber Can Be Reused') { chamberFired = Math.floor(Math.random() * rouletteRounds) + 1; if (chamberFired == bulletChamber) { rouletteWinner(firedby); } else { cb.sendNotice(' :rremoji Sorry, that shot did not win the prize, please try again!', '', rouletteShotBgColor, rouletteShotTextColor, 'bold'); } } else { chamberFired = Math.floor(Math.random() * (remainingChambers.length)) + 1; bulletIndex = remainingChambers.indexOf(bulletChamber); if (chamberFired == (bulletIndex+1)) { rouletteWinner(firedby); } else { remainingChambers.splice((chamberFired-1), 1); cb.sendNotice(' :rremoji Sorry, that shot did not win the prize, please try again!', '', rouletteShotBgColor, rouletteShotTextColor, 'bold'); } } } } function rouletteWinner(firedby) { cb.sendNotice(' :rremoji Congratulations ' + firedby + '! You\'ve won the Russian Roulette prize of :smallpresent ' + roulettePrize + ' :smallpresent !', '', rouletteWinnerBgColor, rouletteWinnerTextColor, 'bold'); if (currentRouletteCycle < cb.settings.rouletteCycles) { cb.sendNotice('Loading a new game...','', rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); rouletteLoadGun(); } else { cb.sendNotice('That was the last game of Russian Roulette, game is now being disabled. No more shots will be counted.', '', rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); rouletteSetToggle('off',cb.room_slug); } } function rouletteShowShooters(sendto) { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 RUSSIAN ROULETTE SHOOTERS \u22A1 \u22A1 \u22A1 \u22A1'; if (rouletteShooters.length === 0) { cb.sendNotice('\nNo shots have been taken in the current game.', sendto, '', '', 'bold'); } else { for (var i = 0; i < rouletteShooters.length; i++) { msg += "\n" + (i+1) + '. ' + rouletteShooters[i]; } } cb.sendNotice(msg, sendto, rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); } function rouletteShowChambers(sendto) { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 REMAINING CHAMBERS \u22A1 \u22A1 \u22A1 \u22A1'; if (remainingChambers.length === 0) { cb.sendNotice('\nError - The gun is empty', sendto, '', '', 'bold'); } else { for (var i = 0; i < remainingChambers.length; i++) { if (remainingChambers[i] == bulletChamber) { msg += '\n Chamber : ' + remainingChambers[i] + ' (Loaded)'; } else { msg += '\n Chamber : ' + remainingChambers[i]; } } } cb.sendNotice(msg, sendto, rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); } // *********************************** Random Prize Game Functions ************************************** function randomSetToggle(option, mod) { if (option == 'on') { if (randomToggle == 1) { cb.sendNotice('The Random Prize Game is already enabled.', mod, appNoticeColor); } else { randomInit(); if (validRandom == true) { randomToggle = 1; randomSetColors(); randomInitNoticeTimer(); cb.sendNotice('You have enabled the Random Prize Game.', mod, appNoticeColor); } else { cb.sendNotice('Invalid prize settings, the Random Prize could not be started.', mod, appWarningColor, appWarningTextColor, 'bold'); } } } else if (option == 'off') { if (randomToggle == 0) { cb.sendNotice('The Random Prize Game is already disabled.', mod, appNoticeColor); } else { randomToggle = 0; cb.sendNotice('You have disabled the Random Prize Game.', mod, appNoticeColor); cb.sendNotice('The Random Prize game has been disabled.', '', randomNoticeBgColor, randomNoticeTextColor, 'bold'); } } } function randomInit() { validRandom = true; randomWinnerCounter = 0; randomLowTipAmount = cb.settings.randomPrice_1; // if (cb.settings.randomExclude != ' ' && cb.settings.randomExclude != '' && cb.settings.randomExclude != null) { // var n = cb.settings.randomExclude; // randomExcludeArray = n.split(','); // } } function randomSetColors() { if (cb.settings.randomNoticeTextColor == 'Custom') { randomNoticeTextColor = checkTextColor(cb.settings.randomNoticeCustomTextColor); if (randomNoticeTextColor == 'default') { cb.sendNotice('Random Prize Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); randomNoticeTextColor = '#FFFFFF'; } } else { randomNoticeTextColor = checkTextColor(cb.settings.randomNoticeTextColor); } if (cb.settings.randomNoticeBgColor == 'Custom') { randomNoticeBgColor = checkBgColor(cb.settings.randomNoticeCustomBgColor); if (randomNoticeBgColor == 'default') { cb.sendNotice('Random Prize Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); randomNoticeBgColor = '#FFFFFF'; } } else { randomNoticeBgColor = checkBgColor(cb.settings.randomNoticeBgColor); } } function randomInitNoticeTimer() { if (cb.settings.randomNoticeInterval == '' || cb.settings.randomNoticeInterval == null) { cb.sendNotice('Random Prize Game - Chat Notice Interval was not set. Using default value of 3 minutes.', cb.room_slug, appWarningColor, '', 'bold'); randomInt = 3; } else { randomInt = parseFloat(cb.settings.randomNoticeInterval); } if (randomInt < 1) { cb.sendNotice('Random Prize Game - Chat Notice Interval setting is too short, must be at least 1 minute. Using default value of 3 minutes.', cb.room_slug, appWarningColor, '', 'bold'); randomInt = 3; } randomInt *= 60000; randomInt = parseInt(randomInt); randomNoticeTimer(); } function setRandomNoticeTimeout() { cb.setTimeout(randomNoticeTimer, randomInt); } function randomNoticeTimer() { if (randomToggle == 1) { randomShowNotice(''); setRandomNoticeTimeout(); } } function randomShowNotice(sendto) { var msg = 'The Random Prize Game is active! All tips greater than ' + randomLowTipAmount + ' tokens are eligible to be awarded a prize at random!\n You can use the command "/ri" to see more info on the random prize game.'; cb.sendNotice(msg, sendto, randomNoticeBgColor, randomNoticeTextColor, 'bold'); } function randomInfo(sendto,usertype) { var msg = 'The Random Prize Game is active! All tips greater than ' + randomLowTipAmount + ' tokens are eligible to be awarded a prize at random!'; msg += '\nEach tip is given an equal chance to win according to the percentages that have been defined.'; // msg += '\nUse the command "/rp" to see the list of prizes available.'; msg += '\nUse the command "/rw" to see the history of the random prize winners.'; if (usertype == 'BC') { msg += '\nThe random prize game can be turned on or off with the command "/random [on/off]". '; msg += '\nYou can also use the command "/randomfree [1-10]" as the broadcaster (or moderator if enabled) to do a free random prize for the room at the specified master prize list level.'; } cb.sendNotice(msg, sendto, randomNoticeBgColor, randomNoticeTextColor, 'bold'); } function checkRandom(tipby,tipAmount) { if (cb.settings.randomPrice_3 > 0 && tipAmount >= cb.settings.randomPrice_3) { randomPercent = cb.settings.randomPercent_3; randomPrize = cb.settings.randomPrize_3; randomLevel = cb.settings.randomLevel_3; randomPrizeType = cb.settings.randomPrizeType_3; } else if (cb.settings.randomPrice_2 > 0 && tipAmount >= cb.settings.randomPrice_2) { randomPercent = cb.settings.randomPercent_2; randomPrize = cb.settings.randomPrize_2; randomLevel = cb.settings.randomLevel_2; randomPrizeType = cb.settings.randomPrizeType_2; } else if (cb.settings.randomPrice_1 > 0 && tipAmount >= cb.settings.randomPrice_1) { randomPercent = cb.settings.randomPercent_1; randomPrize = cb.settings.randomPrize_1; randomLevel = cb.settings.randomLevel_1; randomPrizeType = cb.settings.randomPrizeType_1; } else { randomPercent = 0; } if (randomPercent > 0 && randomPercent <= 100) { oneInX = Math.floor(100/randomPercent); randomCheck = Math.floor(Math.random() * oneInX) + 1; randomChance = Math.floor(Math.random() * oneInX) + 1; if (randomCheck == randomChance) { randomWinner(tipby,randomPrizeType,randomLevel,randomPrize); } } } function randomWinner(tipby,type,level,prizeID) { var winner = false; if (type == 'Specific Prize') { currentRandomPrize = getPrize(prizeID); if (currentRandomPrize != 'invalid') { winner = true; } } else if (type == 'Random Prize') { L = level; if (L <= 4) { max = 20; } else { max = 10; } randomLevelPrizes.length = 0; for (var i = 1; i <= max; i++) { if (eval('Price_' + L + '_' + i) > 0 && eval('Prize_' + L + '_' + i)) { randomLevelPrizes.push(eval('Prize_' + L + '_' + i)); } } prizesavailable = randomLevelPrizes.length; if (prizesavailable == 1) { currentRandomPrize = randomLevelPrizes[0]; winner = true; } else if (prizesavailable > 1) { prizenumberindex = Math.floor(Math.random() * prizesavailable); currentRandomPrize = randomLevelPrizes[prizenumberindex]; winner = true; } } if (winner == true) { randomWinnerCounter++; cb.sendNotice(' :smallpresent Random Prize Winner! Congratulations ' + tipby + ', your prize: ' + currentRandomPrize, '', randomNoticeBgColor, randomNoticeTextColor, 'bold'); randomWinners.push('Winner #' + randomWinnerCounter + ': ' + tipby + ' - ' + currentRandomPrize); } else { cb.sendNotice('Error on Prize Lookup : ' + type + ' L' + level + ' P' + prize, cb.room_slug, appNoticeColor); } } function randomShowWinners(sendto,showall) { if (showall == 'all') { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 ALL RANDOM PRIZE WINNERS \u22A1 \u22A1 \u22A1 \u22A1'; } else { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 LAST 20 RANDOM PRIZE WINNERS \u22A1 \u22A1 \u22A1 \u22A1'; } if (randomWinners.length === 0) { msg += '\nNo Random Prize Winners yet.'; } else { if (showall == 'all') { for (var i = 0; i < randomWinners.length; i++) { msg += '\n' + randomWinners[i]; } } else { var randomRecentWinners = randomWinners.slice(-20); for (var i = 0; i < randomRecentWinners.length; i++) { msg += '\n' + randomRecentWinners[i]; } } } cb.sendNotice(msg, sendto, '', '', 'bold'); } // *********************************** Bad Libs Functions ************************************** function setBadLibsToggle(mode, sendto) { if (mode == 'on') { if (badToggle == 1) { cb.sendNotice('The Bad Libs Game is already enabled.', sendto, appNoticeColor); } else { badInit(); if (validBad == true) { badToggle = 1; badInitNoticeTimer(); } else { cb.sendNotice('Invalid prize setting, the Bad Libs Game could not be started.', sendto, appWarningColor, appWarningTextColor, 'bold'); } } } else if (mode == 'off') { if (badToggle == 0) { cb.sendNotice('The Bad Libs Game is already disabled.', sendto, appNoticeColor); } else { badToggle = 0; cb.sendNotice('The Bad Libs game has been disabled, tips will no longer trigger the game play.', '', badNoticeBgColor, badNoticeTextColor, 'bold'); } } } function badInit() { badPlays = 0; badSetColors(); badLoadPrizes(); } function badLoadPrizes() { validBad = true; var n = cb.settings.badWho; badWhoArray = n.split(','); if (badWhoArray.length == 0 || badWhoArray[0] == ' ' || badWhoArray[0] == '' || badWhoArray[0] == null) { validBad = false; cb.sendNotice('Bad Libs Game Setup Error - No names entered.', cb.room_slug, appWarningColor, '', 'bold'); return; } var n = cb.settings.badWhat; badWhatArray = n.split(','); if (badWhatArray.length == 0 || badWhatArray[0] == ' ' || badWhatArray[0] == '' || badWhatArray[0] == null) { validBad = false; cb.sendNotice('Bad Libs Game Setup Error - No actions entered.', cb.room_slug, appWarningColor, '', 'bold'); return; } var n = cb.settings.badWhere; badWhereArray = n.split(','); if (badWhereArray.length == 0 || badWhereArray[0] == ' ' || badWhereArray[0] == '' || badWhereArray[0] == null) { validBad = false; cb.sendNotice('Bad Libs Game Setup Error - No locations entered.', cb.room_slug, appWarningColor, '', 'bold'); return; } var n = cb.settings.badHowLong; badHowLongArray = n.split(','); if (badHowLongArray.length == 0 || badHowLongArray[0] == ' ' || badHowLongArray[0] == '' || badHowLongArray[0] == null) { validBad = false; cb.sendNotice('Bad Libs Game Setup Error - No durations entered.', cb.room_slug, appWarningColor, '', 'bold'); return; } } function badSetColors() { if (cb.settings.badNoticeTextColor == 'Custom') { badNoticeTextColor = checkTextColor(cb.settings.badNoticeCustomTextColor); if (badNoticeTextColor == 'default') { cb.sendNotice('Bad Libs Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); badNoticeTextColor = '#FFFFFF'; } } else { badNoticeTextColor = checkTextColor(cb.settings.badNoticeTextColor); } if (cb.settings.badNoticeBgColor == 'Custom') { badNoticeBgColor = checkBgColor(cb.settings.badNoticeCustomBgColor); if (badNoticeBgColor == 'default') { cb.sendNotice('Bad Libs Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); badNoticeBgColor = '#FFFFFF'; } } else { badNoticeBgColor = checkBgColor(cb.settings.badNoticeBgColor); } } function badInitNoticeTimer() { if (cb.settings.badNoticeInterval == '' || cb.settings.badNoticeInterval == null) { cb.sendNotice('Bad Libs Game - Chat Notice Interval was not set. Using default value of 2.6 minutes.', cb.room_slug, appWarningColor, '', 'bold'); badInt = 2.6; } else { badInt = parseFloat(cb.settings.badNoticeInterval); } if (badInt < 1) { cb.sendNotice('Bad Libs Game Warning - Chat Notice Interval setting is too short, must be at least 1 minute. Using default value of 2.6 minutes.', cb.room_slug, appWarningColor, '', 'bold'); badInt = 2.6; } badInt *= 60000; badInt = parseInt(badInt); badNoticeTimer(); } function badSetNoticeTimeout() { cb.setTimeout(badNoticeTimer, badInt); } function badNoticeTimer() { if (badToggle == 1) { badShowNotice(''); badSetNoticeTimeout(); } } function badShowNotice(sendto) { var msg = ' :badlibs The "Bad Libs" Game is active! Tip ' + badPrice + ' tokens to play.'; msg += '\nEach tip for the Bad Libs game will select random actions for ' + bctext + ' to perform.'; msg += '\nUse the command "/bli" to see more info on the commands and possible prizes in the game'; cb.sendNotice(msg, sendto, badNoticeBgColor, badNoticeTextColor, 'bold'); } function badInfo(sendto,usertype) { var msg = ':badlibs The "Bad Libs" Game is made in the spirit of the classic Mad Libs where random words and phrases are put together to make a crazy prize.'; msg += '\nTip ' + badPrice + ' tokens to play the game and construct a "Bad Libs" phrase to be performed based on random selection of the available choices for Who, What, Where, and How Long'; msg += '\nUse the command "/blc" to see the possible choices for Bad Libs.'; msg += '\nUse the command "/blw" to see the history/winners of the Bad Libs games that have been tipped for.'; if (usertype == 'BC') { msg += '\nUse the command "/badprice [xx]" as the broadcaster (or moderator if enabled) to update the price for playing Bad Libs to the new value of [xx].'; msg += '\nThe Bad Libs game can be turned on or off with the command "/badlibs on" or "/badlibs off". '; msg += '\nUse the command /badfree to do a free Bad Libs game as if someone had tipped for it.'; msg += '\nYou can add a person to the "Who" list with the command "/addwho [name]", where [name] is the person being added.'; msg += '\nYou can add an action to the "What" list with the command "/addwhat [action]", where [action] is the description of the action to be performed.'; msg += '\nYou can add a location to the "Where" list with the command "/addwhere [location]", where [location] is where the action will be performed.'; msg += '\nYou can add a duration to the "How Long" list with the command "/addhowlong [how long]", where [how long] is the description of how long they will do the action.'; } cb.sendNotice(msg, sendto, badNoticeBgColor, badNoticeTextColor, 'bold'); } function badTip(tippedby) { if (badToggle == 1) { cb.sendNotice(' :badlibs ' + tippedby + ' has tipped to play the Bad Libs Game! Selecting Random choices...', '', badNoticeBgColor, badNoticeTextColor, 'bold'); badPlays++; numberWho = badWhoArray.length; indexWho = Math.floor(Math.random() * numberWho); selectedWho = badWhoArray[indexWho]; numberWhat = badWhatArray.length; indexWhat = Math.floor(Math.random() * numberWhat); selectedWhat = badWhatArray[indexWhat]; numberWhere = badWhereArray.length; indexWhere = Math.floor(Math.random() * numberWhere); selectedWhere = badWhereArray[indexWhere]; numberHowLong = badHowLongArray.length; indexHowLong = Math.floor(Math.random() * numberHowLong); selectedHowLong = badHowLongArray[indexHowLong]; selectedPrize = tippedby + ' - ' + selectedWho + ' ' + selectedWhat + ' ' + selectedWhere + ' for ' + selectedHowLong + '!'; badPrizes.push(selectedPrize); cb.sendNotice(' :smallpresent Selection for ' + selectedPrize, '', badNoticeBgColor, badNoticeTextColor, 'bold'); } } function badShowDraws(sendto,showall) { if (showall == 'all') { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 Bad Libs Prizes \u22A1 \u22A1 \u22A1 \u22A1'; } else { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 Last 20 Bad Libs Prizes \u22A1 \u22A1 \u22A1 \u22A1'; } if (badPrizes.length === 0) { cb.sendNotice('\nNo Selections have been made.', sendto, '', '', 'bold'); } else { if (showall == 'all') { for (var i = 0; i < badPrizes.length; i++) { msg += '\n' + (i+1) + '. ' + badPrizes[i]; } } else { var badRecentWinners = badPrizes.slice(-20); for (var i = 0; i < badRecentWinners.length; i++) { msg += '\n' + badRecentWinners[i]; } } } cb.sendNotice(msg, sendto, badNoticeBgColor, badNoticeTextColor, 'bold'); } function badShowChoices(sendto) { var msg = 'CHOICES - Who?:'; if (badWhoArray.length > 0) { msg += '\n' + cbjs.arrayJoin(badWhoArray, ', '); } msg += '\nCHOICES - What?:'; if (badWhatArray.length > 0) { msg += '\n' + cbjs.arrayJoin(badWhatArray, ', '); } msg += '\nCHOICES - Where?:'; if (badWhereArray.length > 0) { msg += '\n' + cbjs.arrayJoin(badWhereArray, ', '); } msg += '\nCHOICES - How Long?:'; if (badHowLongArray.length > 0) { msg += '\n' + cbjs.arrayJoin(badHowLongArray, ', '); } cb.sendNotice(msg, sendto, badNoticeBgColor, badNoticeTextColor, 'bold'); } // *********************************** Charades Functions ************************************** function charadesSetToggle(option, mod) { if (option == 'on') { if (charadesToggle == 1) { cb.sendNotice('The ' + charadesType + ' Game is already enabled.', mod, appNoticeColor); } else { charadesInit(); if (validCharades == true) { charadesToggle = 1; charadesInitNoticeTimer(); cb.sendNotice('You have enabled the ' + charadesType + ' Game.', mod, appNoticeColor); } else { cb.sendNotice('Invalid setting, the ' + charadesType + ' Game could not be started.', mod, appWarningColor, appWarningTextColor, 'bold'); } } } else if (option == 'off') { if (charadesToggle == 0) { cb.sendNotice('The ' + charadesType + ' Game is already disabled.', mod, appNoticeColor); } else { charadesToggle = 0; cb.sendNotice('You have disabled the ' + charadesType + ' Game.', mod, appNoticeColor); cb.sendNotice('The ' + charadesType + ' game has been disabled, tips will no longer start a ' + charadesType + ' game.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } } } function charadesInit() { charadesSetColors(); charadesNumberofPlayers = 1; charadesActive = false; validCharades = true; charadesWordSelected = false; charadesSetTimerLength(); charadesLoadList(); if (validCharades = true) { if (charadesMode == 'M1') { charadesLoadBABPlayers(); } else { charadesTipper = ''; } } if (validCharades = true) { charadesLoadPrizes(); } charadesRound = 1; charadesGamesThisRound = 0; charadesGamesPerRound = charadesNumberofPlayers; charadesCurrentPlayerIndex = 0; charadesCurrentPlayer = charadesPlayers[charadesCurrentPlayerIndex]; charadesGamesGoalRace = 0; charadesWaiting = false; setCharadesWaitingTimer(); } function charadesSetColors() { if (cb.settings.charadesNoticeTextColor == 'Custom') { charadesNoticeTextColor = checkTextColor(cb.settings.charadesNoticeCustomTextColor); if (charadesNoticeTextColor == 'default') { cb.sendNotice(charadesType + ' Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); charadesNoticeTextColor = '#FFFFFF'; } } else { charadesNoticeTextColor = checkTextColor(cb.settings.charadesNoticeTextColor); } if (cb.settings.charadesNoticeBgColor == 'Custom') { charadesNoticeBgColor = checkBgColor(cb.settings.charadesNoticeCustomBgColor); if (charadesNoticeBgColor == 'default') { cb.sendNotice(charadesType + ' Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); charadesNoticeBgColor = '#FFFFFF'; } } else { charadesNoticeBgColor = checkBgColor(cb.settings.charadesNoticeBgColor); } } function charadesLoadList() { if (charadesList.length > 0) { cb.sendNotice(charadesType + ' Game Setup Notice - Existing word list kept on restart. \nYou can use the command /chclearlist to clear the existing wordlist.', cb.room_slug, appWarningColor, '', 'bold'); } else { if (charadesSource == 'Gamebot Default List') { charadesList = charadesDefaultList; if (charadesList.length == 0 || charadesList[0] == ' ' || charadesList[0] == '' || charadesList[0] == null) { validCharades = false; cb.sendNotice(charadesType + ' Game Setup Error - ' + charadesType + ' Default Word/Phrase list not populated.', cb.room_slug, appWarningColor, '', 'bold'); return; } } else if (charadesSource == 'Broadcaster Defined List') { var n = cb.settings.charadesList; charadesList = n.split(':'); if (charadesList.length == 0 || charadesList[0] == ' ' || charadesList[0] == '' || charadesList[0] == null) { validCharades = false; charadesList.length = 0; cb.sendNotice(charadesType + ' Game Setup Notice - Word/Phrase list configured for "Broadcaster Defined List" but no list entered on launch page. \nPlease use the command "/chword xxxxx" to add words and phrases to the word list for the game, where "xxxxx" is the word or phrase you would like to add. \nWords must be spelled exactly the same for a match, but are not case sensitive.', cb.room_slug, appNoticeColor, '', 'bold'); return; } } } } function charadesSetTimerLength() { switch (cb.settings.charadesTimerLength) { case 'No timer': charadesTimerLength = 0; return; case '30 sec': charadesTimerLength = 0.5; return; case '1 min': charadesTimerLength = 1; return; case '1 min 30 sec': charadesTimerLength = 1.5; return; case '2 min': charadesTimerLength = 2; return; case '3 min': charadesTimerLength = 3; return; case '4 min': charadesTimerLength = 4; return; case '5 min': charadesTimerLength = 5; return; default: charadesTimerLength = 2; return; } } function charadesLoadBABPlayers() { if (cb.settings.charadesBABPlayer1) { charadesPlayers[0] = cb.settings.charadesBABPlayer1; charadesScores[0] = 0; } else { validCharades = false; cb.sendNotice(charadesType + ' Game Setup Error - Configured for "Mode 1 - Broadcaster against Broadcaster" but Player 1 is not defined.', cb.room_slug, appWarningColor, '', 'bold'); return; } if (cb.settings.charadesBABPlayer2) { charadesPlayers[1] = cb.settings.charadesBABPlayer2; charadesScores[1] = 0; } else { validCharades = false; cb.sendNotice(charadesType + ' Game Setup Error - Configured for "Mode 1 - Broadcaster against Broadcaster" but Player 2 is not defined.', cb.room_slug, appWarningColor, '', 'bold'); return; } if (cb.settings.charadesBABPlayer3) { charadesPlayers[2] = cb.settings.charadesBABPlayer3; charadesScores[2] = 0; } if (cb.settings.charadesBABPlayer4) { charadesPlayers[3] = cb.settings.charadesBABPlayer4; charadesScores[3] = 0; } if (cb.settings.charadesBABPlayer5) { charadesPlayers[4] = cb.settings.charadesBABPlayer5; charadesScores[4] = 0; } charadesNumberofPlayers = charadesPlayers.length; } function charadesLoadPrizes() { if (charadesMode == 'M1') { charadesPrize = cb.settings.charadesBABPrize; cb.sendNotice(charadesType + ' Game Setup Notice - Mode 1, Broadcaster defined prize : ' + charadesPrize, cb.room_slug, appNoticeColor) } else if (charadesMode == 'M2') { if (cb.settings.charadesVARPrize) { charadesPrizeType = 'prize'; charadesPrize = cb.settings.charadesVARPrize; cb.sendNotice(charadesType + ' Game Setup Notice - Mode 2, Broadcaster defined prize : ' + charadesPrize, cb.room_slug, appNoticeColor) } else if (cb.settings.charadesVARPrizeNumber) { VARprize = getPrize(cb.settings.charadesVARPrizeNumber); if (VARprize == 'invalid') { cb.sendNotice(charadesType + ' Game Setup Error - "Specific Prize" type defined for "Viewer Against Room (one game)", but invalid Prize ID format (' + cb.settings.charadesVARPrize + ').', cb.room_slug, appWarningColor, '', 'bold'); validCharades = false; return; } else { charadesPrizeType = 'prize number'; charadesPrize = VARprize; cb.sendNotice(charadesType + ' Game Setup Notice - Mode 2, Prize selected from prize list : ' + charadesPrize, cb.room_slug, appNoticeColor) } } else if (cb.settings.charadesVARPrizeLevel) { if (cb.settings.charadesVARPrizeLevel < 1 || cb.settings.charadesVARPrizeLevel > 10) { cb.sendNotice(charadesType + ' Game Setup Error - "Prize Level" type defined for "Viewer Against Room (one game)", but prize level setting is not from 1 to 10.', cb.room_slug, appWarningColor, '', 'bold'); validCharades = false; return; } else { charadesPrizeType = 'prize level'; charadesPrize = cb.settings.charadesVARPrizeLevel; cb.sendNotice(charadesType + ' Game Setup Notice - Mode 2, Prize Level configured : Level ' + charadesPrize, cb.room_slug, appNoticeColor) } } } else if (charadesMode == 'M3') { if (cb.settings.charadesVAR2Prize) { charadesPrizeType = 'prize'; charadesPrize = cb.settings.charadesVAR2Prize; cb.sendNotice(charadesType + ' Game Setup Notice - Mode 3, Broadcaster defined prize : ' + charadesPrize, cb.room_slug, appNoticeColor) } else if (cb.settings.charadesVAR2PrizeNumber) { VAR2prize = getPrize(cb.settings.charadesVAR2PrizeNumber); if (VAR2prize == 'invalid') { cb.sendNotice(charadesType + ' Game Setup Error - "Specific Prize" type defined for "Viewer Against Room (goal race)", but invalid Prize ID format (' + cb.settings.charadesVAR2Prize + ').', cb.room_slug, appWarningColor, '', 'bold'); validCharades = false; return; } else { charadesPrizeType = 'prize number'; charadesPrize = VAR2prize; cb.sendNotice(charadesType + ' Game Setup Notice - Mode 3, Prize selected from prize list : ' + charadesPrize, cb.room_slug, appNoticeColor) } } else if (cb.settings.charadesVAR2PrizeLevel) { if (cb.settings.charadesVAR2PrizeLevel < 1 || cb.settings.charadesVAR2PrizeLevel > 10) { cb.sendNotice(charadesType + ' Game Setup Error - "Prize Level" type defined for "Viewer Against Room (goal race)", but prize level setting is not from 1 to 10.', cb.room_slug, appWarningColor, '', 'bold'); validCharades = false; return; } else { charadesPrizeType = 'prize level'; charadesPrize = cb.settings.charadesVAR2PrizeLevel; cb.sendNotice(charadesType + ' Game Setup Notice - Mode 3, Prize Level configured : Level ' + charadesPrize, cb.room_slug, appNoticeColor) } } } } function charadesInitNoticeTimer() { if (cb.settings.charadesNoticeInterval == '' || cb.settings.charadesNoticeInterval == null) { cb.sendNotice(charadesType + ' Game Warning - Chat Notice Interval was not set. Using default value of 2.6 minutes.', cb.room_slug, appWarningColor, '', 'bold'); charadesInt = 2.6; } else { charadesInt = parseFloat(cb.settings.charadesNoticeInterval); } if (charadesInt < 1) { cb.sendNotice(charadesType + ' Game Warning - Chat Notice Interval setting is too short, must be at least 1 minute. Using default value of 2.6 minutes.', cb.room_slug, appWarningColor, '', 'bold'); charadesInt = 2.6; } charadesInt *= 60000; charadesInt = parseInt(charadesInt); charadesNoticeTimer(); } function charadesSetNoticeTimeout() { cb.setTimeout(charadesNoticeTimer, charadesInt); } function charadesNoticeTimer() { if (charadesToggle == 1) { charadesShowNotice(''); charadesSetNoticeTimeout(); } } function charadesShowNotice(sendto) { var msg = 'The "' + charadesType + '" Game is active and set to ' + cb.settings.charadesMode + '. '; if (charadesMode == 'M1') { if (charadesPrice > 0) { msg += '\nTip ' + charadesPrice + ' tokens to play to next game/round.'; } else { msg += '\nNo tips required, guess the ' + charadesType + ' word/phrase to win ' + bctext + ' a point'; } msg += '\nFirst performer to the goal score of ' + cb.settings.charadesBABGoal + ' points wins the prize: ' + charadesPrize + '.'; } else if (charadesMode == 'M2') { msg += '\nTip ' + charadesPrice + ' tokens to play and try to guess the ' + charadesType + ' word/phrase before anyone else in the room to win!'; if (charadesPrizeType == 'prize' || charadesPrizeType == 'prizenumber') { msg += '\nThe single game prize is: ' + charadesPrize + '.'; } else if (charadesPrizeType == 'prizelevel') { msg += '\nThe single game prize is the viewer\'s choice from prize level: ' + charadesPrize + '.'; } } else if (charadesMode == 'M3') { msg += '\nTip ' + charadesPrice + ' tokens to play and try to guess the ' + charadesType + ' word/phrase before anyone else in the room to score points!'; msg += '\nFirst viewer to the score of ' + cb.settings.charadesVAR2Goal + ' points wins the grand prize.'; if (charadesPrizeType == 'prize' || charadesPrizeType == 'prizenumber') { msg += '\nThe grand prize for this game is: ' + charadesPrize + '.'; } else if (charadesPrizeType == 'prizelevel') { msg += '\nThe grand prize for this game is the viewer\'s choice from prize level: ' + charadesPrize + '.'; } } msg += '\nUse the command "/chi" to see more info on the game modes, game format, commands and possible prizes.'; cb.sendNotice(msg, sendto, charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } function charadesInfo(sendto,usertype) { var msg = 'The "' + charadesType + '" Game is active and set to ' + cb.settings.charadesMode + '. '; if (charadesMode == 'M1') { if (charadesPrice > 0) { msg += '\nYou can tip ' + charadesPrice + ' tokens to have ' + bctext + ' play the next game/round.'; } else { msg += '\nNo tips are required, ' + bctext + ' will start each round.'; } msg += '\nOnce started, guess the ' + charadesType + ' word/phrase to win the current performer a point'; msg += '\nFirst performer to the score of ' + cb.settings.charadesBABGoal + ' points wins the prize: ' + charadesPrize + '.'; } else if (charadesMode == 'M2') { msg += '\nTip ' + charadesPrice + ' tokens to play and try to guess the ' + charadesType + ' word/phrase before anyone else in the room to win!'; if (charadesPrizeType == 'prize' || charadesPrizeType == 'prizenumber') { msg += '\nThe single game prize is: ' + charadesPrize + '.'; } else if (charadesPrizeType == 'prizelevel') { msg += '\nThe single game prize is the viewer\'s choice from prize level: ' + charadesPrize + '.'; } } else if (charadesMode == 'M3') { msg += '\nTip ' + charadesPrice + ' tokens to play and try to guess the ' + charadesType + ' word/phrase before anyone else in the room to score points!'; msg += '\nFirst viewer to the score of ' + cb.settings.charadesVAR2Goal + ' points wins the grand prize.'; if (charadesPrizeType == 'prize' || charadesPrizeType == 'prizenumber') { msg += '\nThe grand prize for this game is: ' + charadesPrize + '.'; } else if (charadesPrizeType == 'prizelevel') { msg += '\nThe grand prize for this game is the viewer\'s choice from prize level: ' + charadesPrize + '.'; } } msg += '\nWhen tipping to start a game, if a game is already started, your name will go into the queue.'; msg += '\nAs each game is finished, the next player in the queue automatically starts the next game.'; msg += '\nOnce ' + bctext + ' starts a game, all viewers in the room can attempt to guess the word/phrase.'; msg += '\nThe bot will monitor for the correct answer and announce the winner and stop the timer when a correct guess is made.'; msg += '\nNote that the answer must be spelled correctly, but case does not matter.'; if (charadesTimerLength > 0) { msg += '\nIf the timer is used, everyone will have ' + charadesTimerLength + ' minute' + (charadesMinsRemain > 1 ? 's' : '') + ' to guess the correct word/phrase.'; } msg += '\nUse the command "/chh" to see the history of the ' + charadesType + ' games that have been played so far this session.'; msg += '\nUse the command "/chq" to see the list of people who have tipped to play ' + charadesType + ' and are currently in line waiting to play.'; msg += '\nUse the command "/chsb" to display the ' + charadesType + ' scoreboard for modes 1 and 3.'; msg += '\nYou can find some ideas on signals you can do to tell the audience what kind of word or phrase you are doing here: http://www.outsetmedia.com/charadessignals '; if (usertype == 'BC') { msg += '\nFor Broadcasters (and moderators with authority):'; msg += '\nThe ' + charadesType + ' game can be turned on or off with the command "/charades on" or "/charades off". '; msg += '\nUse the command "/chprice xx" to update the price for playing ' + charadesType + ' to the new value of xx.'; msg += '\nUse the command "/chwin username" to manually assign a correct guess to someone who may have come close but misspelled the word. The game will behave as if they had guessed correctly'; msg += '\nUse the command "/chfree" to initiate a free game to play the next turn or round, or to override the tip requirement and play a round for free as if someone had tipped'; msg += '\nUse the command "/chplay" once a word is selected to show the word to ' + bctext + ' and start the timer.'; msg += '\nUse the command "/chword xxxxx" to add words and phrases to the word list used for the game, where "xxxxx" is the word or phrase to be added. You can add multiple words separated by a colon ":".'; msg += '\nUse the command "/chrmv xxxxx" to remove words or phrases from the word list used for the game, where "xxxxx" is the word or phrase to be removed (must exactly match spelling and case).'; msg += '\nThis can be done in any play mode at any time, and will only add to the existing list.'; msg += '\nIf the word list source is configured as "Added During Game", the list will be empty to start and must be added before a game can be played.'; msg += '\nOtherwise, it will be populated from the default list or the broadcaster defined list on the launch page (and you can still add to the list in either case).'; msg += '\nNOTE: Try not to use words that are hard to spell or long phrases, the spelling must match exactly (but is not case sensitive)'; msg += '\nUse the command "/chsave" to display the current remaining word list in a form that can be copied and pasted into the Broadcaster Managed word list upon restart of the Gamebot to save your remaining words.'; msg += '\nUse the command "/chskip" to skip a word/phrase if you do not know what it is. Skipping a word will reset the timer, and you must use /chplay to start again after word selection.'; msg += '\nUse the command "/chend" to end the current game if you decide not to finish it. Does not end the ' + charadesType + ' feature, just the current game/word being guessed, and will be ready for the next game. If a game has been tipped for in the queue it will be started.'; msg += '\nUse the command "/chstoptimer" to stop the countdown timer. Viewers will still be allowed to guess, but the game will not end from the timer.'; msg += '\nUse the command "/chclearlist" to clear the wordlist. The wordlist is kept intact if the game is ended and restarted without restarting the Gamebot.'; msg += '\nUse the command "/chlength" to update the length of the timer for each game. Valid values are .5, 1, 1.5, 2, 3, 4, 5.'; } cb.sendNotice(msg, sendto, charadesNoticeBgColor, charadesNoticeTextColor); } function charadesNewGame() { charadesActive = false; if (charadesNextPlayer.length > 0 && charadesActive == false) { charadesActive = true; nextCharadesPlayer = charadesNextPlayer[0]; charadesNextPlayer.splice(0, 1); cb.sendNotice(nextCharadesPlayer + ' is next in line and is about to Play ' + charadesType + '. Ready to play...', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesPlay('tip',nextCharadesPlayer,true); } } function charadesPlay(mode,tippedby,charadesfromnext) { charadesTipper = tippedby; if (tippedby == cb.room_slug) { tippedby = bctext; } if (charadesActive == true && charadesfromnext != true) { charadesNextPlayer.push(tippedby); cb.sendNotice(tippedby + ' has tipped to play ' + charadesType + ' and been added to the player queue since a game is already being played. Their game will start once it reaches their place in line (current number of players in line : ' + charadesNextPlayer.length + '). \n You can use the command "/chq" to see the queue of players waiting to play.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } else { charadesActive = true; playmessage = ''; if (charadesMode == 'M1') { playmessage += 'Current Player: \n \u21D2 ' + charadesCurrentPlayer + ' \u21D0 \n'; } if (mode == 'tip') { if (charadesfromnext == false) { playmessage += tippedby + ' has tipped to play the ' + charadesType + ' Game! Selecting word or phrase...'; } else { playmessage += 'Selecting word or phrase...'; } } else if (mode == 'bc') { playmessage += bctext + ' is starting the next game of ' + charadesType + '! Selecting word or phrase...'; } else if (mode == 'free') { playmessage += 'A free game of ' + charadesType + ' has been started by ' + tippedby + '! Selecting word or phrase...'; } cb.sendNotice(playmessage, '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); selectWord(); } } function selectWord() { charadesWaiting = true; charadesWordSelected = false; if (charadesList.length == 0) { cb.sendNotice('WORD LIST IS EMPTY! Waiting on word or phrase to be added using the command "/chword xxxxx", where "xxxxx" is the word or phrase that should be added to the list and used next.', cb.room_slug, appNoticeColor); if (cb.settings.charadesModsKnowWord == 'Yes') { cb.sendNotice('WORD LIST IS EMPTY! Waiting on word or phrase to be added using the command "/chword xxxxx", where "xxxxx" is the word or phrase that should be added to the list and used next.', '', appNoticeColor, '', '', 'red'); } } else { if (charadesList.length == 1 || cb.settings.charadesRandom == 'In Order') { charadesWord = charadesList[0].toLowerCase(); charadesList.splice(0,1); } else { numberOfEntries = charadesList.length; indexOfEntry = Math.floor(Math.random() * numberOfEntries); charadesWord = charadesList[indexOfEntry].toLowerCase(); charadesList.splice(indexOfEntry,1); } charadesWordSelected = true; cb.sendNotice('Word selected, ready to start. \nYou can start the game with the /chplay command.', cb.room_slug, appNoticeColor, '', ''); if (cb.settings.charadesModsKnowWord == 'Yes') { cb.sendNotice('Word selected, ready to start. \nModerators can start the game with the /chplay command.', '', appNoticeColor, '', '', 'red'); } cb.sendNotice('Word is selected, ' + charadesType + ' will start on command.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } } function setCharadesWaitingTimer() { cb.setTimeout(charadesWaitingNotice, 60000); } function charadesWaitingNotice() { if (charadesWaiting == true) { cb.sendNotice('Word selected, ready to start. \nYou can start the game with the /chplay command.', cb.room_slug, appNoticeColor, '', ''); if (cb.settings.charadesModsKnowWord == 'Yes') { cb.sendNotice('Word selected, ready to start. \nModerators can start the game with the /chplay command.', '', appNoticeColor, '', '', 'red'); } } } function charadesStartPlay() { cb.sendNotice('The word/phrase for this game is: \n \u21D2 ' + charadesWord + ' \u21D0 \nA word can be skipped with the /chskip command.', cb.room_slug, appNoticeColor, '', ''); if (cb.settings.charadesModsKnowWord == 'Yes') { cb.sendNotice('The word/phrase for this game is: \n \u21D2 ' + charadesWord + ' \u21D0 \nA word can be skipped with the /chskip command.', '', appNoticeColor, '', '', 'red'); } charadesWaiting = false; charadesGuessing = true; if (charadesTimerLength > 0) { charadesStartTime = new Date(); charadesStopTime = new Date(charadesStartTime.getTime() + charadesTimerLength * 60000); charadesMinsRemain = Math.floor(charadesTimerLength); charadesStopping = false; if (charadesTimerLength == 0.5 || charadesTimerLength == 1.5) { charadesSecsRemain = 30; if (charadesTimerLength == 0.5) { cb.sendNotice(charadesType + ' has started a timer for 30 seconds.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } else if (charadesTimerLength == 1.5) { cb.sendNotice(charadesType + ' has started a timer for 1 minute and 30 seconds.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } if (charadesMinsRemain > 0) { charadesDisplaySeconds = false; } else { charadesDisplaySeconds = true; } charadesTimerSec(); } else { cb.sendNotice(charadesType + ' has started a timer for ' + charadesMinsRemain + ' minute' + (charadesMinsRemain > 1 ? 's' : ''), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesTimerMin(); } } else { cb.sendNotice('A timer is not used for this game of ' + charadesType + ', the game will be ended manually by ' + bctext + ' or moderators.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); cb.sendNotice('Since no timer is used, you can use the command /chend when you are ready to end the current game.', cb.room_slug, charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); if (cb.settings.allowModsAuthority == 'Yes') { cb.sendNotice('Since no timer is used, you can use the command /chend when the broadcaster is ready to end the current game.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold', 'red'); } } } function charadesTimerMin() { if (!charadesStopping) { switch (charadesMinsRemain) { case 10: case 9: case 8: case 7: case 6: case 5: case 4: case 3: case 2: cb.sendNotice('\u23f1 \u23f1 \u23f1 There are ' + charadesMinsRemain + ' minutes left on the ' + charadesType + ' timer \u23f1 \u23f1 \u23f1', '', yellow, '', 'bold'); break; case 1: cb.sendNotice('\u23f1 \u23f1 \u23f1 There is 1 minute left on the ' + charadesType + ' timer !! \u23f1 \u23f1 \u23f1', '', red, '', 'bold'); break; } charadesMinsRemain--; if (charadesMinsRemain > 0) { charadesDisplaySeconds = false; } else { charadesDisplaySeconds = true; } charadesSecsRemain = 60; charadesTimerSec(); } } function charadesTimerSec() { if (!charadesStopping) { if (charadesDisplaySeconds) { switch (charadesSecsRemain) { case 30: case 10: case 5: case 4: case 3: case 2: cb.sendNotice('\u23f1 \u23f1 \u23f1 There are ' + charadesSecsRemain + ' seconds left on the ' + charadesType + ' timer \u23f1 \u23f1 \u23f1', '', red, '', 'bold'); break; case 1: cb.sendNotice('\u23f1 \u23f1 \u23f1 There is 1 second left on the ' + charadesType + ' timer \u23f1 \u23f1 \u23f1', '', red, '', 'bold'); break; } } if (charadesSecsRemain < 1) { if (charadesMinsRemain >= 1) { charadesTimerMin(); } else { cb.sendNotice('\u23f0 \u23f0 \u23f0 Time is up! There were no correct guesses \u23f0 \u23f0 \u23f0 \n *** The correct word or phrase was "' + charadesWord + '".', '', yellow, '', 'bold'); charadesGuessing = false; charadesGameComplete('none',false); charadesNewGame(); } } else { charadesSecsRemain--; cb.setTimeout(charadesTimerSec, 1000); } } } function charadesStopTimer(mod) { charadesStopTime = new Date(); charadesStopping = true; charadesMinsRemain = 0; charadesSecsRemain = 0; if(mod != null) { cb.sendNotice(mod + ' has stopped the game timer.','',yellow,'', 'bold'); } } function charadesCorrectAnswer(guessedby) { cb.sendNotice(guessedby + ' guessed the correct answer of "' + charadesWord + '"!', '', red, '', 'bold'); charadesGuessing = false; if (charadesMinsRemain > 0 || charadesSecsRemain > 0) { charadesStopTimer(charadesType); } if (charadesMode == 'M1') { cb.sendNotice('Congratulations ' + guessedby + ' on the correct guess! ' + charadesCurrentPlayer + ' wins a point!', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(guessedby + ' has guessed correctly, ' + charadesCurrentPlayer + ' wins a point!'); charadesScores[charadesCurrentPlayerIndex] ++; if (!cbjs.arrayContains(charadesBABScores.user,guessedby)) { charadesBABScores.user.push(guessedby); userIndex = charadesBABScores.user.indexOf(guessedby); charadesBABScores.score[userIndex] = 0; charadesBABScores.score[userIndex] += 1; } else { userIndex = charadesBABScores.user.indexOf(guessedby); charadesBABScores.score[userIndex] += 1; } } else if (charadesMode == 'M2') { if (guessedby == charadesTipper || charadesTipper == cb.room_slug) { if (charadesPrizeType == 'prize level') { L = cb.settings.charadesVARPrizeLevel; if (L <= 4) { max = 20; } else { max = 10; } charadesLevelPrizes.length = 0; for (var i = 1; i <= max; i++) { if (eval('Price_' + L + '_' + i) <= 0 || eval('Prize_' + L + '_' + i) == '' || eval('Prize_' + L + '_' + i) == null) { continue; } else { charadesLevelPrizes.push(eval('Prize_' + L + '_' + i)); } } charadesPrize = cbjs.arrayJoin(charadesLevelPrizes, ', '); cb.sendNotice(' :smallpresent Congratulations ' + guessedby + ', you win! You can choose any prize from the following list: ' + charadesPrize, '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(guessedby + ' has guessed correctly and has won a prize from level ' + L); } else { cb.sendNotice('Congratulations ' + guessedby + ', you win! :smallpresent Prize is: ' + charadesPrize + ' :smallpresent ', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(guessedby + ' has guessed correctly and has won the prize of : ' + charadesPrize); } } else { cb.sendNotice('Sorry ' + charadesTipper + ', ' + guessedby + ' guessed the correct answer first!', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(charadesTipper + ' did not win, ' + guessedby + ' guessed the correct answer first'); } } else if (charadesMode == 'M3') { var winPoints = 0; if (guessedby == charadesTipper) { cb.sendNotice('Congratulations ' + guessedby + ' on the correct guess! You win 3 points for guessing correctly in the game you tipped for!', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(guessedby + ' guessed correctly, and wins 3 points!'); winPoints = 3; } else { cb.sendNotice('Congratulations ' + guessedby + ' on the correct guess! You win 1 point!', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(guessedby + ' guessed correctly, and wins 1 point!'); winPoints = 1; } if (!cbjs.arrayContains(charadesVAR2Scores.user,guessedby)) { charadesVAR2Scores.user.push(guessedby); userIndex = charadesVAR2Scores.user.indexOf(guessedby); charadesVAR2Scores.score[userIndex] = 0; charadesVAR2Scores.score[userIndex] += winPoints; } else { userIndex = charadesVAR2Scores.user.indexOf(guessedby); charadesVAR2Scores.score[userIndex] += winPoints; } } charadesGameComplete(guessedby,false); charadesNewGame(); } function charadesGameComplete(guessedby,fixscore) { if (charadesMode == 'M1') { if (!fixscore) { charadesGamesThisRound++; } highScore = 0; secondScore = 0; for (var i = 0; i < charadesPlayers.length; i++) { if (charadesScores[i] > highScore) { secondScore = highScore; highScore = charadesScores[i]; } else if (charadesScores[i] > secondScore) { secondScore = charadesScores[i]; } } if (highScore >= cb.settings.charadesBABGoal) { if (charadesGamesThisRound >= charadesNumberofPlayers || charadesGamesThisRound == 0 || (highScore - secondScore) > 1) { winnercount = 0; for (var i = 0; i < charadesPlayers.length; i++) { if (charadesScores[i] == highScore) { winnercount++; winningindex = i; } } if (winnercount > 1) { charadesNextRound(); cb.sendNotice('There is a tie, we\'ll play another round of ' + charadesType + ' until there is a winner! \n' + charadesCurrentPlayer + ' will play next. \nCurrent Broadcaster Score - ' + charadesBABScore() + '\nCurrent Viewer Score - ' + charadesMode1Score(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } else { cb.sendNotice('Final Broadcaster Score - ' + charadesBABScore() + '\nFinal Viewer Score ' + charadesMode1Score(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); cb.sendNotice(charadesPlayers[winningindex] + ' has won ' + charadesType + '! :smallpresent The prize is ' + charadesPrize + '! :smallpresent ', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(charadesPlayers[winningindex] + ' has won ' + charadesType + '! The prize is ' + charadesPrize); charadesRestart(); cb.sendNotice('' + charadesType + ' Game has been reset.', cb.room_slug, appNoticeColor); } } else if (!fixscore) { if (charadesGamesThisRound >= charadesNumberofPlayers) { charadesNextRound(); cb.sendNotice((charadesRound-1) + ' round' + ((charadesRound-1) == 1 ? '' : 's') + ' played. \n' + charadesCurrentPlayer + ' will play next. \nCurrent Score - ' + charadesBABScore(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } else { charadesCurrentPlayerIndex ++; charadesCurrentPlayer = charadesPlayers[charadesCurrentPlayerIndex]; cb.sendNotice(charadesCurrentPlayer + ' will perform the next word/phrase. \nCurrent Broadcaster Score - ' + charadesBABScore() + '\nCurrent Viewer Score - ' + charadesMode1Score(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } } } else if (!fixscore) { if (charadesGamesThisRound >= charadesNumberofPlayers) { charadesNextRound(); cb.sendNotice((charadesRound-1) + ' round' + ((charadesRound-1) == 1 ? '' : 's') + ' played. \n' + charadesCurrentPlayer + ' will play next. \nCurrent Broadcaster Score - ' + charadesBABScore() + '\nCurrent Viewer Score - ' + charadesMode1Score(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } else { charadesCurrentPlayerIndex ++; charadesCurrentPlayer = charadesPlayers[charadesCurrentPlayerIndex]; cb.sendNotice(charadesCurrentPlayer + ' will perform the next word/phrase. \nCurrent Broadcaster Score - ' + charadesBABScore() + '\nCurrent Viewer Score - ' + charadesMode1Score(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } } } else if (charadesMode == 'M2') { if (guessedby == 'none') { if (charadesTipper == cb.room_slug) { cb.sendNotice('The free play started by ' + bctext + ' ended without a correct guess.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push('Free Play game started by ' + bctext + ' ended with no winner, time ran out.'); } else { cb.sendNotice('Sorry ' + charadesTipper + ', time ran out so you did not win a prize - Please play again!', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push('The ' + charadesType + ' game started by ' + charadesTipper + ' ended with no winner, time ran out.'); } } else { cb.sendNotice('The current ' + charadesType + ' game started by ' + charadesTipper + ' has been completed.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } } else if (charadesMode == 'M3') { if (!fixscore) { charadesGamesGoalRace++; } highScore = 0; for (var i = 0; i < charadesVAR2Scores.user.length; i++) { if (charadesVAR2Scores.score[i] > highScore) { highScore = charadesVAR2Scores.score[i]; winningindex = i; } } if (highScore > 0 && highScore >= cb.settings.charadesVAR2Goal) { if (charadesPrizeType == 'prize level') { L = cb.settings.charadesVAR2PrizeLevel; if (L <= 4) { max = 20; } else { max = 10; } charadesLevelPrizes.length = 0; for (var i = 1; i <= max; i++) { if (eval('Price_' + L + '_' + i) <= 0 || eval('Prize_' + L + '_' + i) == '' || eval('Prize_' + L + '_' + i) == null) { continue; } else { charadesLevelPrizes.push(eval('Prize_' + L + '_' + i)); } } charadesPrize = cbjs.arrayJoin(charadesLevelPrizes, ', '); cb.sendNotice(' :smallpresent Congratulations ' + guessedby + ', you win the goal race! You can choose any prize from the following list: ' + charadesPrize, '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(guessedby + ' has won the ' + charadesType + ' Goal race and selects a prize from level ' + L); } else { cb.sendNotice(charadesVAR2Scores.user[winningindex] + ' has won the ' + charadesType + ' Goal Race! :smallpresent The prize is ' + charadesPrize + '! :smallpresent ', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push(charadesVAR2Scores.user[winningindex] + ' has won ' + charadesType + '! The prize is ' + charadesPrize); } cb.sendNotice('Resetting the ' + charadesType + ' game and scores... Let\'s play again!', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesRestart(); cb.sendNotice(charadesType + ' Game has been reset.', cb.room_slug, appNoticeColor); } else if (!fixscore) { cb.sendNotice(charadesGamesGoalRace + ' game' + (charadesGamesGoalRace == 1 ? '' : 's') + ' played in the goal race. \nCurrent Scoreboard - ' + charadesMode3Score(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesNextRound(); } } } function charadesRestart() { charadesActive = false; charadesWordSelected = false; charadesRound = 1; charadesGamesThisRound = 0; charadesCurrentPlayerIndex = 0; charadesCurrentPlayer = charadesPlayers[charadesCurrentPlayerIndex]; charadesGamesGoalRace = 0; if (charadesMode == 'M1') { charadesLoadBABPlayers(); } else if (charadesMode == 'M3') { charadesVAR2Scores.user = []; charadesVAR2Scores.score = [0]; } charadesResults.push(charadesType + ' game has been restarted.'); } function sortMode3Scores() { var swapped, temp1, temp2; do { swapped = false; for (var i = 0; i < charadesVAR2Scores.user.length ; i++) { if (charadesVAR2Scores.score[i] < charadesVAR2Scores.score[i + 1]) { temp1 = charadesVAR2Scores.score[i]; temp2 = charadesVAR2Scores.user[i]; charadesVAR2Scores.score[i] = charadesVAR2Scores.score[i + 1]; charadesVAR2Scores.score[i + 1] = temp1; charadesVAR2Scores.user[i] = charadesVAR2Scores.user[i + 1]; charadesVAR2Scores.user[i + 1] = temp2; swapped = true; } } } while (swapped); } function sortMode1Scores() { var swapped, temp1, temp2; do { swapped = false; for (var i = 0; i < charadesBABScores.user.length ; i++) { if (charadesBABScores.score[i] < charadesBABScores.score[i + 1]) { temp1 = charadesBABScores.score[i]; temp2 = charadesBABScores.user[i]; charadesBABScores.score[i] = charadesBABScores.score[i + 1]; charadesBABScores.score[i + 1] = temp1; charadesBABScores.user[i] = charadesBABScores.user[i + 1]; charadesBABScores.user[i + 1] = temp2; swapped = true; } } } while (swapped); } function charadesBABScore() { charadesScoreList = '\n'; for (var i = 0; i < charadesPlayers.length; i++) { charadesScoreList += (i > 0 ? ' / ' : '') + charadesPlayers[i] + ': ' + charadesScores[i]; } return charadesScoreList; } function charadesMode3Score() { if (charadesVAR2Scores.user.length > 0) { sortMode3Scores(); charadesScoreboard = ''; for (var i = 0; i < charadesVAR2Scores.user.length; i++) { charadesScoreboard += '\n' + (i+1) + '. ' + charadesVAR2Scores.user[i] + ' (' + charadesVAR2Scores.score[i] + ')'; } } else { charadesScoreboard = '\nNo Scores Yet'; } return charadesScoreboard; } function charadesMode1Score() { if (charadesBABScores.user.length > 0) { sortMode1Scores(); charadesScoreboard = ''; for (var i = 0; i < charadesBABScores.user.length; i++) { charadesScoreboard += '\n' + (i+1) + '. ' + charadesBABScores.user[i] + ' (' + charadesBABScores.score[i] + ')'; } } else { charadesScoreboard = '\nNo Scores Yet'; } return charadesScoreboard; } function charadesNextRound() { charadesRound++; charadesCurrentPlayerIndex = 0; charadesCurrentPlayer = charadesPlayers[charadesCurrentPlayerIndex]; charadesGamesThisRound = 0; } function charadesEndGame(endedby) { charadesGuessing = false; charadesWaiting = false; charadesActive = false; charadesStopTimer(endedby); if (charadesMode == 'M1') { cb.sendNotice('The current ' + charadesType + ' game started by ' + charadesTipper + ' has been ended by ' + endedby + ', but the overall point race is still active.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push('The ' + charadesType + ' game was ended by ' + endedby); charadesGameComplete('none',false); charadesNewGame(); } else if (charadesMode == 'M2') { cb.sendNotice('The current ' + charadesType + ' game started by ' + charadesTipper + ' has been ended by ' + endedby, '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push('The current ' + charadesType + ' game started by ' + charadesTipper + ' was ended by ' + endedby); charadesNewGame(); } else if (charadesMode == 'M3') { cb.sendNotice('The current ' + charadesType + ' game started by ' + charadesTipper + ' has been ended by ' + endedby, ', but the overall point race is still active.', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesResults.push('The current ' + charadesType + ' game started by ' + charadesTipper + ' was ended by ' + endedby); charadesNewGame(); } } function charadesPlayerQueue(sendto) { if (charadesNextPlayer.length === 0) { cb.sendNotice('No players waiting.', sendto, charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } else { var msg = 'Players waiting to play ' + charadesType + ':'; for (var i = 0; i < charadesNextPlayer.length; i++) { msg += '\n' + (i+1) + '. ' + charadesNextPlayer[i]; } cb.sendNotice(msg, sendto, charadesNoticeBgColor, charadesNoticeTextColor); } } function charadesShowResults(sendto,showall) { if (showall == 'all') { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 ' + charadesType + ' Results \u22A1 \u22A1 \u22A1 \u22A1'; } else { var msg = '\u22A1 \u22A1 \u22A1 \u22A1 Last 20 ' + charadesType + ' Results \u22A1 \u22A1 \u22A1 \u22A1'; } if (charadesResults.length === 0) { cb.sendNotice('\nNo Selections have been made.', sendto, charadesNoticeBgColor, charadesNoticeTextColor); } else { if (showall == 'all') { for (var i = 0; i < charadesResults.length; i++) { msg += '\n' + (i+1) + '. ' + charadesResults[i]; } } else { var charadesRecentResults = charadesResults.slice(-20); for (var i = 0; i < charadesRecentResults.length; i++) { msg += '\n' + charadesRecentResults[i]; } } } cb.sendNotice(msg, sendto, charadesNoticeBgColor, charadesNoticeTextColor); } // *********************************** Twenty Questions Functions ************************************** function twentySetToggle(mode, sendto) { if (mode == 'on') { if (twentyToggle == 1) { cb.sendNotice('The Twenty Questions Game is already enabled.', sendto, appNoticeColor); } else { twentyNoticeWaiting = false; validTwenty = true; twentySetColors(); twentyLoadPrize(); if (validTwenty == true) { twentyToggle = 1; twentyChgWarned = false; twentyEndWarned = false; twentyChgPWarned = false; twentyActive = false; twentyInitNoticeTimer(); cb.sendNotice('The Twenty Questions Game is now enabled. You can enter the word or phrase to be guessed using the command /tword to begin the actual game.', sendto, appNoticeColor); } else { cb.sendNotice('Invalid prize setting, the Twenty Questions Game could not be started.', sendto, appWarningColor, appWarningTextColor, 'bold'); } if (twentyAllowAll == 'All Play') { if (twentyPrice == 1 || twentyPrice == 5 || twentyPrice == 10 || twentyPrice == 20 || twentyPrice == 25 || twentyPrice == 50 || twentyPrice == 100) { cb.sendNotice('WARNING! It is not advisable to use a common tip amount as the Twenty Questions price, especially when using "All Play" mode, as anyone who tips the price to play will have any tip note associate with the tip displayed to the room.', cb.room_slug, appWarningColor, appWarningTextColor, 'bold'); } } } } else if (mode == 'off') { if (twentyToggle == 0) { cb.sendNotice('The Twenty Questions Game is already disabled.', sendto, appNoticeColor); } else { twentyToggle = 0; cb.sendNotice('The Twenty Questions game has been disabled, tips will no longer trigger the game play.', '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } } } function twentyInitRound() { twentyQuestionsNumber.username = []; twentyQuestionsNumber.number = []; twentyQuestionsNumber.number[0] = 0; twentyQuestionsHistory.username = []; twentyQuestionsHistory.number = []; twentyQuestionsHistory.question = []; twentyQuestionsHistory.answer = []; twentyGameCount++; } function twentyLoadPrize() { if (cb.settings.twentyPrize != '' && cb.settings.twentyPrize != ' ' && cb.settings.twentyPrize != null) { twentyCurrentPrize = cb.settings.twentyPrize; cb.sendNotice('Twenty Questions - Current Game Prize defined from settings: ' + twentyCurrentPrize, cb.room_slug, appNoticeColor); } else { if (cb.settings.twentyPrizeNumber == '' || cb.settings.twentyPrizeNumber == null || cb.settings.twentyPrizeNumber == ' ') { cb.sendNotice('Twenty Questions Game Error - no prize name or prize ID configured.', cb.room_slug, appWarningColor, '', 'bold'); validTwenty = false; return; } else { specificprize = getPrize(cb.settings.twentyPrizeNumber); if (specificprize == 'invalid') { cb.sendNotice('Twenty Questions Game Error - invalid Prize ID format (' + cb.settings.twentyPrizeNumber + ').', cb.room_slug, appWarningColor, '', 'bold'); validTwenty = false; return; } else { twentyCurrentPrize = specificprize; cb.sendNotice('Twenty Questions - Current Game Prize successfully retrieved from Master Prize List: ' + twentyCurrentPrize, cb.room_slug, appNoticeColor); } } } } function twentySetColors() { if (cb.settings.twentyNoticeTextColor == 'Custom') { twentyNoticeTextColor = checkTextColor(cb.settings.twentyNoticeCustomTextColor); if (twentyNoticeTextColor == 'default') { cb.sendNotice('Twenty Questions Game - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); twentyNoticeTextColor = '#FFFFFF'; } } else { twentyNoticeTextColor = checkTextColor(cb.settings.twentyNoticeTextColor); } if (cb.settings.twentyNoticeBgColor == 'Custom') { twentyNoticeBgColor = checkBgColor(cb.settings.twentyNoticeCustomBgColor); if (twentyNoticeBgColor == 'default') { cb.sendNotice('Twenty Questions Game - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appWarningColor, '', 'bold'); twentyNoticeBgColor = '#FFFFFF'; } } else { twentyNoticeBgColor = checkBgColor(cb.settings.twentyNoticeBgColor); } } function twentyInitNoticeTimer() { if (cb.settings.twentyNoticeInterval == '' || cb.settings.twentyNoticeInterval == null) { cb.sendNotice('Twenty Questions Game - Chat Notice Interval is not set. Using default value of 2.6 minutes.', cb.room_slug, appWarningColor, '', 'bold'); twentyInt = 2.6; } else { twentyInt = parseFloat(cb.settings.twentyNoticeInterval); } if (twentyInt < 1) { cb.sendNotice('Twenty Questions Game - Chat Notice Interval is too short, must be at least 1 minute. Using default value of 2.6 minutes.', cb.room_slug, appWarningColor, '', 'bold'); twentyInt = 2.6; } twentyInt *= 60000; twentyInt = parseInt(twentyInt); } function twentyNoticeTimer() { twentyNoticeWaiting = false; if (twentyToggle == 1 && twentyActive) { if (minMessagesForNotice > 0 && msgCounterTwenty < minMessagesForNotice) { twentyNoticeWaiting = true; cb.setTimeout(twentyNoticeTimer, 30000); } else { msgCounterTwenty = 0; twentyShowNotice(''); twentySetNoticeTimeout(); } } } function twentySetNoticeTimeout() { twentyNoticeWaiting = true; cb.setTimeout(twentyNoticeTimer, twentyInt); } function twentyShowNotice(sendto) { var msg = ':gbtq2 The "Twenty Questions" Game is active with a prize of "' + twentyCurrentPrize + '"! :gbtq2 '; msg += '\nTo play Twenty Questions, you can tip ' + twentyPrice + ' tokens to ask your "Yes/No" question in the tip note. Questions asked outside of a tip note will be ignored.'; msg += '\nYou can also try to guess the word/phrase in your tipnote, but it will count as one of your questions.'; if (twentyAllowAll == 'All Play') { msg += '\nThe game is configured so that the whole room can play, so any tip notes that are sent along with a tip of ' + twentyPrice + ' tokens will be displayed to the whole room.'; } else { msg += '\nThe game is configured so each viewer asks their own questions and their number of guesses is tracked, so the room will not see your tip note questions, so do not share them or else you are helping your fellow viewers win.'; } msg += '\nUse the command "/tqi" to see more info on the commands used in the game'; cb.sendNotice(msg, sendto, twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } function twentyInfo(sendto,usertype) { var msg = ':gbtq1 Game Info and Commands:'; msg += '\nThe goal of the game is to guess the word or phrase that the ' + bctext + ' has selected by asking up to ' + twentyNumberOfQuestions + ' "Yes/No" questions to narrow down to the point you can guess the hidden word.'; msg += '\nYou can tip ' + twentyPrice + ' tokens to play, and put your "Yes/No" question for the broadcaster in the tip note.'; msg += '\nYou can also try to guess the word in your tipnote, but it will count as one of your questions.'; if (twentyAllowAll == 'All Play') { msg += '\nThe game is configured so that the whole room can play, so any tip notes that are sent along with a tip of ' + twentyPrice + ' tokens will be displayed to the whole room.'; msg += '\nIf any one person gets to the correct answer before the room asks ' + twentyNumberOfQuestions + ' questions, the room wins the prize of "' + twentyCurrentPrize + '"!'; msg += '\nUse the command "/tqh" to see the questions that have already been asked by the room (with answers if they were recorded).'; } else { msg += '\nThe game is configured so each viewer asks their own questions and their number of guesses is tracked, so the room will not see your tip note questions. Therefore, do not share them or else you are helping your fellow viewers win.'; msg += '\nWhoever gets to the right answer first without individually going over ' + twentyNumberOfQuestions + ' questions wins the prize of "' + twentyCurrentPrize + '"!'; } if (usertype == 'BC') { msg += '\nAdditional Info and Commands for Mods and Broadcasters:'; msg += '\nUse the command "/tword" with a parameter of the word or phrase that you would like to use to begin a game of Twenty Questions. You can use this to initiate the first game, and after each game is completed to start a new one.'; msg += '\nUse the command "/tqa" with parameters of the question number and answer value ("yes or "no") to record an answer for the question, only valid in "All Play" mode. For all play, this is important to do so that new people joining the room can see the answers to previously asked questions. For individual play, each person should already know the answer to their question.'; msg += '\nUse the command "/twentyend" to indicate the end of the game after all questions are asked if there was no correct answer. The game does not end automatically after the last question in case a user guessed correctly but misspelled their answer.'; msg += '\nUse the command "/twentywin" with a parameter of the winning username to indicate that someone correctly guessed the answer, but misspelled it or was close enough to the answer, but it was not recognized by the answer check.'; msg += '\nUse the command "/twentyprice" with a parameter of the new price to update the price for asking each question.'; msg += '\nUse the command "/twentymode" with a parameter of "all" or "single" to update the mode for playing Twenty Questions to be everyone playing together or everyone for themselves'; msg += '\n - For "all" mode, tipnotes are displayed to everyone in the room, and there is one tracker for the room for number of questions asked.'; msg += '\n - For "single" mode, tipnotes are not displayed to everyone, and there is a tracker for each person who plays for number of questions asked.'; msg += '\nThe Twenty Questions game can be turned on or off with the command "/twenty on" or "/twenty off". '; } cb.sendNotice(msg, sendto, twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } function twentyPlay(tippedby,tipnote) { if (twentyActive) { twentyvalidguess = true; if (twentyAllowAll == 'All Play') { if (twentyQuestionsNumber.number[0] >= twentyNumberOfQuestions) { cb.sendNotice('Sorry, the room has exceeded the number of allowed questions and the game is over.', '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); twentyvalidguess = false; } else { twentyQuestionsNumber.username[0] = 'All play'; twentyQuestionsNumber.number[0]++; twentycurrentnumber = twentyQuestionsNumber.number[0]; } } else { if (cbjs.arrayContains(twentyQuestionsNumber.username,tippedby)) { nameNumIndex = twentyQuestionsNumber.username.indexOf(tippedby); if (twentyQuestionsNumber.number[nameNumIndex] >= twentyNumberOfQuestions) { cb.sendNotice('Sorry, you have already exceeded your number of guesses, the broadcaster will not answer the question.', tippedby, twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); cb.sendNotice(tippedby + ' has exceeded their number of guesses, you should not answer their question.', cb.room_slug, red, '', 'bold'); cb.sendNotice(tippedby + ' has exceeded their number of guesses, a message has been sent to the broadcaster that they should not answer the question.', '', red, '', 'bold', 'red'); twentyvalidguess = false; } else { twentyQuestionsNumber.number[nameNumIndex]++; twentycurrentnumber = twentyQuestionsNumber.number[nameNumIndex]; } } else { twentyQuestionsNumber.username.push(tippedby); twentyQuestionsNumber.number.push(1); twentycurrentnumber = 1; } } if (twentyvalidguess) { if (cbjs.arrayContains(twentyQuestionsHistory.username,tippedby)) { lastguessindex = twentyQuestionsHistory.username.lastIndexOf(tippedby); currentuserguess = twentyQuestionsHistory.number[lastguessindex]; currentuserguess++; } else { currentuserguess = 1; } twentyQuestionsHistory.username.push(tippedby); twentyQuestionsHistory.number.push(currentuserguess); twentyQuestionsHistory.question.push(tipnote); twentyQuestionsHistory.answer.push('No answer yet'); tipnoteCompare = tipnote.toLowerCase().trim(); tipnoteCompare = tipnoteCompare.replace(/[^a-z0-9]/g, ''); twentyWordCompare = twentyWord.replace(/[^a-z0-9]/g, ''); if (tipnoteCompare.includes(twentyWordCompare)) { twentyGameWon(tippedby); } else if (twentycurrentnumber >= twentyNumberOfQuestions) { if (twentyAllowAll == 'All Play') { cb.sendNotice('Twenty Questions Game #' + twentyGameCount + ': \nAll guesses have been used! The word was "' + twentyWord + '". \nNo more tips for guesses will be accepted.','', appWarningColor, appWarningTextColor, 'bold'); cb.sendNotice('The current round of Twenty Questions is completed. If there was a correct guess on the last question that was not recognized (mis-spelling, etc.), you can manually give credit for winning the game with the command "/twentywin ' + tippedby + '". If there was no correct guess and this round is over, you can end the game with the "/twentyend" command.', cb.room_slug, appNoticeColor); if (cb.settings.allowModsAuthority == 'Yes') { cb.sendNotice('The current round of Twenty Questions is completed. If there was a correct guess on the last question that was not recognized (mis-spelling, etc.), moderators can manually give credit for winning the game with the command "/twentywin ' + tippedby + '". If there was no correct guess and this round is over, moderators can end the game with the "/twentyend" command.', '', appNoticeColor, '', '', 'red'); } } else { cb.sendNotice('You have used all of your guesses! You will not be able to keep playing this round of Twenty Questions.', tippedby, appWarningColor, appWarningTextColor, 'bold'); cb.sendNotice(tippedby + ' has used their last question/guess. If they made a correct guess on the last question that was not recognized (mis-spelling, etc.), you can manually give them credit for winning the game with the command "/twentywin ' + tippedby + '".', cb.room_slug, appNoticeColor); if (cb.settings.allowModsAuthority == 'Yes') { cb.sendNotice(tippedby + ' has used their last question/guess. If they made a correct guess on the last question that was not recognized (mis-spelling, etc.), Moderators can manually give them credit for winning the game with the command "/twentywin ' + tippedby + '".', '', appNoticeColor, '', '', 'red'); } } } else { if (twentyAllowAll == 'All Play') { quesnotice = 'Twenty Questions: ' + tippedby + ' has tipped to play and asked Question # ' + twentycurrentnumber + ': \n' + tipnote + '\nThe broadcaster will respond to the room with "Yes" or "No". '; if ((twentyNumberOfQuestions-twentycurrentnumber) > 1) { quesnotice += 'There are ' + (twentyNumberOfQuestions-twentycurrentnumber) + ' questions/guesses remaining until end of game.'; } else { quesnotice += 'There is 1 question/guess remaining! Make it count!'; } cb.sendNotice(quesnotice, '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } else { cb.sendNotice('Thank you for playing! This is Question # ' + twentycurrentnumber + ' for you. ' + bctext + ' will answer your question shortly. \nYou have ' + (twentyNumberOfQuestions-twentycurrentnumber) + ' remaining until you have used up all your questions and guesses, and will not be allowed to guess anymore.', tippedby, twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); cb.sendNotice('Twenty Questions: ' + tippedby + ' has tipped to play and asked Question # ' + twentycurrentnumber + ' for them: \n' + tipnote + '\nYou can verbally respond directly to them with "Yes" or "No".', cb.room_slug, twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } } } } else { cb.sendNotice('Thank you for tipping - note that a Twenty Questions game has not yet been started.', '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } } function twentyGameWon(winninguser) { twentyActive = false; cb.sendNotice('Twenty Questions Game #' + twentyGameCount + ': \nCongratulations ' + winninguser + ' on guessing the correct word!\nThe word/phrase was "' + twentyWord + '".','', appWarningColor, appWarningTextColor, 'bold'); if (twentyAllowAll == 'All Play') { cb.sendNotice(':smallpresent The Prize for the rooom is "' + twentyCurrentPrize + '"! :smallpresent', '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } else { cb.sendNotice(':smallpresent You have won the prize of "' + twentyCurrentPrize + '"! :smallpresent', winninguser, twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } cb.sendNotice('The current round of Twenty Questions is completed. You can start a new round by entering a new word with the /tword command.', cb.room_slug, appNoticeColor); } function twentyQuestionsAsked(tqhsendto,tqhreqby) { if (tqhsendto == '') { sendtoname = 'ALL'; } else { sendtoname = 'YOU'; } if (twentyAllowAll == 'All Play') { msg = '\u22A1 \u22A1 \u22A1 \u22A1 History of Questions Asked by the Room (sent to ' + sendtoname + ') \u22A1 \u22A1 \u22A1 \u22A1'; if (twentyQuestionsHistory.username.length <= 0) { msg += '\nNo Questions have been asked in the current game.'; } else { for (var askindex = 0; askindex < twentyQuestionsHistory.username.length; askindex++) { msg += '\n' + twentyQuestionsHistory.username[askindex] + ': Question ' + (askindex+1) + ' : ' + twentyQuestionsHistory.question[askindex] + ' --- Answer : ' + twentyQuestionsHistory.answer[askindex]; } } } else { if (tqhreqby == 'BC') { msg = '\u22A1 \u22A1 \u22A1 \u22A1 Question History for All Players (sent to ' + sendtoname + ') \u22A1 \u22A1 \u22A1 \u22A1'; if (twentyQuestionsHistory.username.length <= 0) { msg += '\nNo Questions have been asked in the current game.'; } else { for (var askindex = 0; askindex < twentyQuestionsHistory.username.length; askindex++) { msg += '\n Question #' + twentyQuestionsHistory.number[askindex] + ' for user ' + twentyQuestionsHistory.username[askindex] + ' - ' + twentyQuestionsHistory.question[askindex]; } } } else { msg = '\u22A1 \u22A1 \u22A1 \u22A1 Your Question History \u22A1 \u22A1 \u22A1 \u22A1'; numfound = 0; for (var askindex = 0; askindex < twentyQuestionsHistory.username.length; askindex++) { if (twentyQuestionsHistory.username[askindex] == tqhreqby) { numfound++; msg += '\n Question ' + twentyQuestionsHistory.number[askindex] + ' - ' + twentyQuestionsHistory.question[askindex]; } } if (numfound <= 0) { msg += '\nYou have not asked any questions in the current game.'; } } } cb.sendNotice(msg, tqhsendto, twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } // *********************************** Help Function ************************************** function helpCommon(from) { cb.sendNotice('Dorothys Gamebot Help Menu', from, appNoticeColor); cb.sendNotice('',from,appNoticeColor); cb.sendNotice('There is a listing of commands and instructions for each game:' + '\n/di for Dice' + '\n/whi for Wheel Spin' + '\n/ki for Keno' + '\n/rri for Russian Roulette' + '\n/pi for Press Your Luck' + '\n/bli for Bad Libs' + '\n/ri for Random Prizes' + '\n/chi for Charades' + '\n/tqi for Twenty Questions' + '\n/wi for War!' ,from); cb.sendNotice('',from,appNoticeColor); } function helpModBC(from) { cb.sendNotice('Dorothys Gamebot Help Menu - Mods and Broadcasters', from, appNoticeColor); cb.sendNotice('',from,appNoticeColor); cb.sendNotice('There is a listing of commands and instructions for each game:' + '\n/di for Dice' + '\n/whi for Wheel Spin' + '\n/ki for Keno' + '\n/rri for Russian Roulette' + '\n/pi for Press Your Luck' + '\n/wi for War!' + '\n/bli for Bad Libs' + '\n/ri for Random Prizes' + '\n/chi for ' + charadesType + '\n/tqi for Twenty Questions' + '\nThe following general commands are also available for broadcasters (and moderators if enabled):' + '\n/addfan [user]</font></b>: (bc only) Adds a user to the External Fan Club list where [user] is the person you want to add. ' + '\n/rmvfan [user]</font></b>: (bc only) Removes a user from the External Fan Club List where [user] is the person you want to remove.' + '\n/fanlist</font></b>: (mods/bc only) Displays the list of users currently in the External Fan Club list.' + '\n/addvip [user]</font></b>: (bc only) Adds a user to the VIP list where [user] is the person you want to add. ' + '\n/rmvvip [user]</font></b>: (bc only) Removes a user from the VIP List where [user] is the person you want to remove.' + '\n/viplist</font></b>: (mods/bc only) Displays the list of users currently in the VIP list.' + '\n/addmod [user]</font></b>: (bc only) Adds a user to the "BotMod" Moderator list where [user] is the person you want to add. BotMods are given the same authority as CB assigned moderators but not given a red name in the chat.' + '\n/rmvmod [user]</font></b>: (bc only) Removes a user from the "BotMod" Moderator List where [user] is the person you want to remove.' + '\n/modlist</font></b>: (mods/bc only) Displays the list of users currently in the Moderator list.' + '\n/mpl (or /masterprizelist)</font></b>: (mods/bc only) Displays the master list of all prizes by level. If the parameter is entered for a level, only display that level, otherwise if level is 0 or not entered, will display all levels. The list is only sent to the person requesting, this command is not available to the general room, only mods (if granted authority) and broadcaster' + '\n/ap (or /addprize) [level.prize] [price] [description]</font></b>: (mods/bc only) Add or change a prize on the master prize list. Note that all parameters must be entered when using the "add", and if a prize already exists in the position specified, it will be overwritten. The "level.prize" indicates the level and prize number that are to be added/changed, [price] indicates the price (a value of "0" disables the prize), and is followed by the text description of the prize.' + '\n/cpp (or /chgprizeprice) [level.prize] [price]</font></b>: (mods/bc only) Change a prize\'s price on the master prize list. The "level.prize" indicates the level and prize number for which the price will be changed, and is followed by the new price of the prize (a value of "0" disables the prize).' + '\n/cpd (or /chgprizedesc) [level.prize] [description]</font></b>: (mods/bc only) Change a prize\'s description on the master prize list. The "level.prize" indicates the level and prize number for which the description will be changed, and is followed by the new text description of the prize.' + '\n/gbstats </font></b>: (mods/bc only) Display a listing of the Gamebot\'s time online, total tips toward games, and tips broken down by game.' ,from); cb.sendNotice('',from,appNoticeColor); } } // ******************************* Upon user entry of a Message ************************************** { cb.onMessage(function (msg) { var message = msg['m'].split(' '); var cmd = 0; var listRegExp = /[,\s]+/; var m = msg.m; var u = msg.user; var isMod = msg.is_mod; var isFan = msg.in_fanclub; var isBC = (u === cb.room_slug); var isExtFan = cbjs.arrayContains(extFanListArray,u); var isVIP = cbjs.arrayContains(VIPListArray,u); var BC = cb.room_slug; if (msg['X-Spam'] != true && minMessagesForNotice > 0) { msgCounterDice++; msgCounterWheel++; msgCounterTwenty++; msgCounterWar++; msgCounterPress++; msgCounterRoulette++; msgCounterBadlibs++; msgCounterRandom++; msgCounterKeno++; msgCounterCharades++; } isBotMod = false; if (isMod) { populateModeratorArray(u,'cbmod','a'); } else { if (cbjs.arrayContains(moderatorList.name,u)) { nameIndex = moderatorList.name.indexOf(u); if (moderatorList.type[nameIndex] == 'botmod') { isBotMod = true; isMod = true; } } } var command = message[0] var commandVar1 = parseInt(message[1]); var commandVar2 = parseInt(message[2]); if (message[0].charAt(0) != '/') { if (charadesToggle == 1 && charadesGuessing == true) { charadesguess = msg['m'].toLowerCase().trim(); charadesguess = charadesguess.replace(/[^a-z0-9]/g, ''); charadeswordtoguess = charadesWord.replace(/[^a-z0-9]/g, ''); if (charadesguess == charadeswordtoguess) { if (isMod && cb.settings.charadesModsKnowWord == 'Yes') { cb.sendNotice('Gamebot: Moderators are not allowed to guess when they know the word.', u, appNoticeColor); msg['X-Spam'] = true; } else if (isBC) { cb.sendNotice('Gamebot: Broadcasters are not allowed to guess.\n If you need to force a win for someone who guessed close enough, you can use the command "/chwin username" before time runs out and it will give them credit for the answer.\n After time runs out, you can correct the score if necessary with the "/chfixscore X username" command, where X is the new score for the given user.', u, appNoticeColor); msg['X-Spam'] = true; } else { charadesCorrectAnswer(u); } } } } if (message[0].charAt(0) == '/') { msg['X-Spam'] = true; var ntc = null; for (var i = 1; i < message.length; i++) { if (i == 1) ntc = message[i]; else ntc += " " + message[i]; } var cmdval = null; for (var i = 1; i < message.length; i++) { if (i == 1) cmdval = message[i]; else cmdval += " " + message[i]; } switch(command) { //********* General Gamebot commands case "/masterprizelist": case "/mpl": { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { numlevel = 0; if (message[1]) { numlevel = parseInt(message[1]); } if(isNaN(numlevel)) { cb.sendNotice('Gamebot: The value entered for the level is not numeric, please try again.', u, appNoticeColor); } else if(numlevel < 0 || numlevel > 10) { cb.sendNotice('Gamebot: The value entered for the level is outside allowable values for level ID from 1 to 10, please try again.', u, appNoticeColor); } else { listShowPrizes(numlevel,u); } } else { cb.sendNotice('Gamebot: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/addprize': case '/ap': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { validcmd = true; if (!message[1]) { cb.sendNotice('Gamebot: The first parameter is the prize ID and must be used. Please try again using a prize ID parameter. Prize ID must be in the format "level.prize", such as "3.9". Example command format is "/ap 3.9 57 Flash Boobs" to add a prize of "Flash Boobs" at level 3 prize 9 with a price of 57 tokens.', u, appNoticeColor); validcmd = false; break; } else { prizeID = message[1]; splitarray = prizeID.split('.') prizelevel = splitarray[0]; prizenumber = splitarray[1]; if (isNaN(prizelevel) || isNaN(prizenumber)) { cb.sendNotice('Gamebot: The prize ID format is invalid, the prize or level is not numeric. Prize ID must be in the format "level.prize", such as "3.9".', u, appNoticeColor); validcmd = false; break; } if (prizelevel < 1 || prizelevel > 10 ) { cb.sendNotice('Gamebot: The prize level portion of the prize ID is invalid, it should be from level 1 to level 10.', u, appNoticeColor); validcmd = false; break; } if (prizelevel < 5 && prizenumber > 20) { cb.sendNotice('Gamebot: The prize number portion of the prize ID is invalid. For levels 1-4, there are 20 available prize slots.', u, appNoticeColor); validcmd = false; break; } if (prizelevel > 4 && prizenumber > 10) { cb.sendNotice('Gamebot: The prize number portion of the prize ID is invalid. For levels 5-10, there are 10 available prize slots.', u, appNoticeColor); validcmd = false; break; } } if (!message[2]) { cb.sendNotice('Gamebot: The second parameter is the price for this prize and must be used. Please try again using a price parameter. Example command format is "/ap 3.9 57 Flash Boobs" to add a prize of "Flash Boobs" at level 3 prize 9 with a price of 57 tokens.', u, appNoticeColor); validcmd = false; break; } else { pricenum = parseInt(message[2]); if (isNaN(pricenum) || pricenum < 1 || pricenum > 10000) { cb.sendNotice('Gamebot: The price value is outside the allowable range from 1 to 10000.', u, appNoticeColor); validcmd = false; break; } } var ntc3 = null; for (var i = 3; i < message.length; i++) { if (i == 3) ntc3 = message[i]; else ntc3 += ' ' + message[i]; } prizedesc = ntc3; if (prizedesc == '') { cb.sendNotice('Gamebot: The last parameter is the description of the prize and must be used. Please try again using a prize description parameter. Example command format is "/ap 3.9 57 Flash Boobs" to add a prize of "Flash Boobs" at level 3 prize 9 with a price of 57 tokens.', u, appNoticeColor); validcmd = false; break; } if (validcmd == true) { this['Prize_' + prizelevel + '_' + prizenumber] = prizedesc; this['Price_' + prizelevel + '_' + prizenumber] = pricenum; cb.sendNotice('Master Prize List ID #' + prizeID + ' was added/updated with a price of ' + pricenum + ' and a description of "' + prizedesc + '".', u, appNoticeColor); if (isMod) { cb.sendNotice(u + ' added/updated Master Prize List ID #' + prizeID + ' with a price of ' + pricenum + ' and a description of "' + prizedesc + '".', cb.room_slug, appNoticeColor); } } } else { cb.sendNotice('Gamebot: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chgprizeprice': case '/cpp': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { validcmd = true; if (!message[1]) { cb.sendNotice('Gamebot: The first parameter is the prize ID and must be used. Please try again using a prize ID parameter. Prize ID must be in the format "level.prize", such as "3.9". Example command format is "/ap 3.9 57 Flash Boobs" to add a prize of "Flash Boobs" at level 3 prize 9 with a price of 57 tokens.', u, appNoticeColor); validcmd = false; break; } else { prizeID = message[1]; splitarray = prizeID.split('.') prizelevel = splitarray[0]; prizenumber = splitarray[1]; if (isNaN(prizelevel) || isNaN(prizenumber)) { cb.sendNotice('Gamebot: The prize ID format is invalid, the prize or level is not numeric. Prize ID must be in the format "level.prize", such as "3.9".', u, appNoticeColor); validcmd = false; break; } if (prizelevel < 1 || prizelevel > 10 ) { cb.sendNotice('Gamebot: The prize level portion of the prize ID is invalid, it should be from level 1 to level 10.', u, appNoticeColor); validcmd = false; break; } if (prizelevel < 5 && prizenumber > 20) { cb.sendNotice('Gamebot: The prize number portion of the prize ID is invalid. For levels 1-4, there are 20 available prize slots.', u, appNoticeColor); validcmd = false; break; } if (prizelevel > 4 && prizenumber > 10) { cb.sendNotice('Gamebot: The prize number portion of the prize ID is invalid. For levels 5-10, there are 10 available prize slots.', u, appNoticeColor); validcmd = false; break; } } if (!message[2]) { cb.sendNotice('Gamebot: The second parameter is the price for this prize and must be used. Please try again using a price parameter. Example command format is "/ap 3.9 57 Flash Boobs" to add a prize of "Flash Boobs" at level 3 prize 9 with a price of 57 tokens.', u, appNoticeColor); validcmd = false; break; } else { pricenum = parseInt(message[2]); if (isNaN(pricenum) || pricenum < 0 || pricenum > 10000) { cb.sendNotice('Gamebot: The price value is outside the allowable range from 1 to 10000.', u, appNoticeColor); validcmd = false; break; } } if (validcmd == true) { this['Price_' + prizelevel + '_' + prizenumber] = pricenum; cb.sendNotice('Master Prize List ID #' + prizeID + ' was added/updated with a price of ' + pricenum + ' tokens.', u, appNoticeColor); if (isMod) { cb.sendNotice(u + ' added/updated Master Prize List ID #' + prizeID + ' with a price of ' + pricenum + ' tokens.', cb.room_slug, appNoticeColor); } } } else { cb.sendNotice('Gamebot: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chgprizedesc': case '/cpd': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { validcmd = true; if (!message[1]) { cb.sendNotice('Gamebot: The first parameter is the prize ID and must be used. Please try again using a prize ID parameter. Prize ID must be in the format "level.prize", such as "3.9". Example command format is "/ap 3.9 57 Flash Boobs" to add a prize of "Flash Boobs" at level 3 prize 9 with a price of 57 tokens.', u, appNoticeColor); validcmd = false; break; } else { prizeID = message[1]; splitarray = prizeID.split('.') prizelevel = splitarray[0]; prizenumber = splitarray[1]; if (isNaN(prizelevel) || isNaN(prizenumber)) { cb.sendNotice('Gamebot: The prize ID format is invalid, the prize or level is not numeric. Prize ID must be in the format "level.prize", such as "3.9".', u, appNoticeColor); validcmd = false; break; } if (prizelevel < 1 || prizelevel > 10 ) { cb.sendNotice('Gamebot: The prize level portion of the prize ID is invalid, it should be from level 1 to level 10.', u, appNoticeColor); validcmd = false; break; } if (prizelevel < 5 && prizenumber > 20) { cb.sendNotice('Gamebot: The prize number portion of the prize ID is invalid. For levels 1-4, there are 20 available prize slots.', u, appNoticeColor); validcmd = false; break; } if (prizelevel > 4 && prizenumber > 10) { cb.sendNotice('Gamebot: The prize number portion of the prize ID is invalid. For levels 5-10, there are 10 available prize slots.', u, appNoticeColor); validcmd = false; break; } } var ntc2 = null; for (var i = 2; i < message.length; i++) { if (i == 2) ntc2 = message[i]; else ntc2 += ' ' + message[i]; } prizedesc = ntc2; if (prizedesc == '') { cb.sendNotice('Gamebot: The second parameter is the description of the prize and must be used. Please try again using a prize description parameter. Example command format is "/ap 3.9 57 Flash Boobs" to add a prize of "Flash Boobs" at level 3 prize 9 with a price of 57 tokens.', u, appNoticeColor); validcmd = false; break; } if (validcmd == true) { this['Prize_' + prizelevel + '_' + prizenumber] = prizedesc; cb.sendNotice('Master Prize List ID #' + prizeID + ' was added/updated with a description of "' + prizedesc + '".', u, appNoticeColor); if (isMod) { cb.sendNotice(u + ' added/updated Master Prize List ID #' + prizeID + ' with a description of "' + prizedesc + '".', cb.room_slug, appNoticeColor); } } } else { cb.sendNotice('Gamebot: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/gbstats': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsStats == 'Yes')) { cb.sendNotice('Current Gamebot Session Stats: \n \u21D2 Gamebot Time Online......... ' + timeOnline() + '\n \u21D2 Total Gamebot Tips............ ' + totalTips + ' tokens ($' + Number(totalTips*.05).toFixed(2) + ' @ 5 cents per token)\n \u21D2 \u21D2 \u21D2 Dice Game Total..................... ' + diceTotalTips + ' tokens\n \u21D2 \u21D2 \u21D2 Wheel Spin Total................... ' + wheelTotalTips + ' tokens\n \u21D2 \u21D2 \u21D2 Keno Total ........................... ' + kenoTotalTips + ' tokens\n \u21D2 \u21D2 \u21D2 Roulette Total ..................... ' + rouletteTotalTips + ' tokens\n \u21D2 \u21D2 \u21D2 Press Your Luck Total ........... ' + pressTotalTips + ' tokens\n \u21D2 \u21D2 \u21D2 War Total ............................. ' + warTotalTips + ' tokens', u, appNoticeColor, '', 'bold'); } else { cb.sendNotice('Gamebot: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/minmsg': { cmd = 1; if (isMod || isBC) { nummsg = parseInt(message[1]); if (isNaN(nummsg)) { cb.sendNotice('The parameter entered for the /minmsg command is not numeric, please try again. Setting the value to 0 will disabled the minimum message count check. A value of 25 is commonly used but may be set lower if the chat is slow, or higher if the chat is busy.', u, appNoticeColor); } else { minMessagesForNotice = nummsg; cb.sendNotice('The minimum number of chat messages required before a recurring notice is displayed has been updated to ' + nummsg + '.', u, appNoticeColor); if (u != BC) { cb.sendNotice('The minimum number of chat messages required before a recurring notice is displayed has been updated to ' + nummsg + ' by ' + u + '.', BC, appNoticeColor); } } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, appNoticeColor); } break; } //********* Dice Game commands case '/dice': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { setDiceToggle(message[1], u); } else { cb.sendNotice('Gamebot: No parameter was specified for the "/dice" command. An "on" or "off" parameter is required.', u, appNoticeColor); } } else { cb.sendNotice('Gamebot: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/di': { cmd = 1; if (diceToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { diceInfo(u,'BC'); } else { diceInfo(u,'common'); } } else { cb.sendNotice('Gamebot: The dice game is not enabled.', u, appNoticeColor); } break; } case '/dp': case '/diceprizes': { cmd = 1; if (diceToggle == 1) { if (isMod || isBC) { sendto = ""; } else { sendto = u; } diceShowPrizes(sendto); } else { cb.sendNotice('Gamebot: The dice game is not enabled.', u, appNoticeColor); } break; } case '/dr': case '/dicerolls': { cmd = 1; showall = ''; if (message[1] == 'all' || message[1] == '') { showall = message[1]; } else { cb.sendNotice('Gamebot: Invalid parameter for the "/dr" command, valid values are "all" and blanks (blanks defaults to last 20 winners).', u, appNoticeColor); } if (isMod) { diceShowRolls(cb.room_slug,showall); } diceShowRolls(u,showall); break; } case '/diceprice': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (diceToggle == 1) { numprice = parseInt(message[1]); if(isNaN(numprice)) { cb.sendNotice('Gamebot: The value entered for the new Dice Roll price is not numeric, please try again.', u, appNoticeColor); } else if(numprice < 1 || numprice > 1000) { cb.sendNotice('Gamebot: The value entered for the new Dice Roll price is outside allowable values from 1 to 1000, please try again.', u, appNoticeColor); } else { diceRollPrice = numprice; cb.sendNotice(u + ' has updated the Dice Roll Price.', u, appNoticeColor); cb.sendNotice('Gamebot: The Dice Roll Price has been updated to ' + numprice + ' tokens.', '', diceNoticeBgColor, diceNoticeTextColor, 'bold'); } } else { cb.sendNotice('Gamebot: The Dice Game has not been turned on, you can use the command "/dice on" to enable it.', u, appNoticeColor); } } else { cb.sendNotice('Gamebot: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/freeroll': { cmd = 1; if (diceToggle == 1) { if (isBC) { diceFreeRoll(u,'bc'); } else if (isMod && cb.settings.diceFreeRollModAuthority == 'Yes') { diceFreeRoll(u,'mod'); } else { numFreeRolls = 0; if (isFan || isExtFan) { numFreeRolls = cb.settings.diceFreeRollFans; } else if (isVIP) { numFreeRolls = cb.settings.diceFreeRollVIP; } else if (isMod) { numFreeRolls = cb.settings.diceFreeRollMods; } if (numFreeRolls > 0) { if (!cbjs.arrayContains(freeRollCount.user,u)) { diceFreeRoll(u,'user'); freeRollCount.user.push(u); freeRollCount.count.push(1); } else { userIndex = freeRollCount.user.indexOf(u); if (freeRollCount.count[userIndex] < numFreeRolls) { diceFreeRoll(u,'user'); freeRollCount.count[userIndex]++; } else { cb.sendNotice('Gamebot: Sorry, you have used up all your free dice rolls.', u, appNoticeColor); } } } else { cb.sendNotice('Gamebot: Sorry, your user group has not been granted any free dice rolls.', u, appNoticeColor); } } } else { cb.sendNotice('Gamebot: The dice game is not enabled.', u, appNoticeColor); } break; } //********* Wheel Spin commands case '/wheel': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { setWheelToggle(message[1], u); } else { cb.sendNotice('Gamebot: No parameter was specified for the "/wheel" command. An "on" or "off" parameter is required.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/whp': case '/wheelprizes': { cmd = 1; if (wheelToggle == 1) { if (isMod || isBC) { sendto = ""; } else { sendto = u; } wheelShowPrizes(sendto); } else { cb.sendNotice('The Wheel Spin game is not enabled.', u, appNoticeColor); } break; } case '/whi': { cmd = 1; if (wheelToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { wheelInfo(u,'BC'); } else { wheelInfo(u,'common'); } } else { cb.sendNotice('The Wheel Spin game is not enabled.', u, appNoticeColor); } break; } case '/whs': case '/wheelspins': { cmd = 1; showall = ''; if (message[1] == 'all' || message[1] == '') { showall = message[1]; } else { cb.sendNotice('Invalid parameter for the "/whs" command, valid values are "all" and blanks (blanks defaults to last 20 winners).', u, appNoticeColor); } if (isMod) { wheelShowSpins(cb.room_slug,showall); } wheelShowSpins(u,showall); break; } case '/wheelprice': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (wheelToggle == 1) { numprice = parseInt(message[1]); if(isNaN(numprice)) { cb.sendNotice('The value entered for the new Wheel Spin price is not numeric, please try again.', u, appNoticeColor); } else if(numprice < 1 || numprice > 1000) { cb.sendNotice('The value entered for the new Wheel Spin price is outside allowable values from 1 to 1000, please try again.', u, appNoticeColor); } else { wheelSpinPrice = numprice; cb.sendNotice(u + ' has updated the Wheel Spin Price.', u, appNoticeColor); cb.sendNotice('The Wheel Spin Price has been updated to ' + numprice + ' tokens.', '', wheelNoticeBgColor, wheelNoticeTextColor, 'bold'); } } else { cb.sendNotice('The Wheel Spin Game has not been turned on, you can use the command "/wheel on" to enable it.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/freespin': { cmd = 1; if (wheelToggle == 1) { if (isBC) { wheelFreeSpin(u,'bc'); } else if (isMod && cb.settings.wheelFreeSpinModAuthority == 'Yes') { wheelFreeSpin(u,'mod'); } else { numFreeSpins = 0; if (isFan || isExtFan) { numFreeSpins = cb.settings.wheelFreeSpinFans; } else if (isVIP) { numFreeSpins = cb.settings.wheelFreeSpinVIP; } else if (isMod) { numFreeSpins = cb.settings.wheelFreeSpinMods; } if (numFreeSpins > 0) { if (!cbjs.arrayContains(freeSpinCount.user,u)) { wheelFreeSpin(u,'user'); freeSpinCount.user.push(u); freeSpinCount.count.push(1); } else { userIndex = freeSpinCount.user.indexOf(u); if (freeSpinCount.count[userIndex] < numFreeSpins) { wheelFreeSpin(u,'user'); freeSpinCount.count[userIndex]++; } else { cb.sendNotice('Sorry, you have used up all your free wheel spins.', u, appNoticeColor); } } } else { cb.sendNotice('Sorry, your user group has not been granted any free wheel spins.', u, appNoticeColor); } } } else { cb.sendNotice('The wheel spin game is not enabled.', u, appNoticeColor); } break; } //********* Russian Roulette Game commands case '/rr': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { rouletteSetToggle(message[1], u); } else { cb.sendNotice('Gamebot: No parameter was specified for the "/rr" command. An "on" or "off" parameter is required.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/rri': { cmd = 1; if (rouletteToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { rouletteInfo(u,'BC'); } else { rouletteInfo(u,'common'); } } else { cb.sendNotice('The Russian Roulette Game is not enabled.', u, appNoticeColor); } break; } case '/rrs': case '/shooters': { cmd = 1; if (rouletteToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { rouletteShowShooters(u); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Russian Roulette Game is not enabled.', u, appNoticeColor); } break; } case '/chambers': { cmd = 1; if (rouletteToggle == 1) { if (isBC) { if (cb.settings.rouletteMode == 'Each Chamber Used Only Once') { rouletteShowChambers(u); } else { cb.sendNotice('Not valid for this mode, gun is loaded the same for every shot.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Russian Roulette Game is not enabled.', u, appNoticeColor); } break; } case '/rrp': case '/rrprice': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (rouletteToggle == 1) { numprice = parseInt(message[1]); if(isNaN(numprice)) { cb.sendNotice('The value entered for the new Russian Roulette shot price is not numeric, please try again.', u, appNoticeColor); } else if(numprice < 1 || numprice > 1000) { cb.sendNotice('The value entered for the new Russian Roulette shot price is outside allowable values from 1 to 1000, please try again.', u, appNoticeColor); } else { rouletteShotPrice = numprice; cb.sendNotice(u + ' has updated the Russian Roulette shot price.', u, appNoticeColor); cb.sendNotice('The Russian Roulette shot price has been updated to ' + numprice + ' tokens.', '', rouletteNoticeBgColor, rouletteNoticeTextColor, 'bold'); } } else { cb.sendNotice('The Russian Roulette Game is not enabled, you can use the command "/rr on" to enable it.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } //********* Keno Game commands case '/keno': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { setKenoToggle(message[1], u); } else { cb.sendNotice('Gamebot: No parameter was specified for the "/keno" command. An "on" or "off" parameter is required.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/ki': { cmd = 1; if (kenoToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { kenoInfo(u,'BC'); } else { kenoInfo(u,'common'); } } else { cb.sendNotice('The keno game is not enabled.', u, appNoticeColor); } break; } case '/kp': { cmd = 1; if (kenoToggle == 1) { kenoShowPrizes(u,'a',0); } else { cb.sendNotice('The keno game is not enabled.', u, appNoticeColor); } break; } case '/kpa': { cmd = 1; if (kenoToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { kenoShowPrizes('','a',0); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The keno game is not enabled.', u, appNoticeColor); } break; } case '/kpw': { cmd = 1; if (kenoToggle == 1) { displaynumber = 0; if (message[1]) { displaynumber = parseInt(message[1]); if (isNaN(displaynumber) || displaynumber < 0) { cb.sendNotice('If entered, the first parameter is the last X number of recent winners to display, and must be 0 or a positive number. With no parameter or a parameter of 0, all winners are displayed.', u, appNoticeColor); displaynumber = 0; } } kenoShowPrizes(u,'w',displaynumber); } else { cb.sendNotice('The keno game is not enabled.', u, appNoticeColor); } break; } case '/kpwa': { cmd = 1; if (kenoToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { displaynumber = 0; if (message[1]) { displaynumber = parseInt(message[1]); if (isNaN(displaynumber) || displaynumber < 0) { cb.sendNotice('If entered, the first parameter is the last X number of recent winners to display, and must be 0 or a positive number. With no parameter or a parameter of 0, all winners are displayed.', u, appNoticeColor); displaynumber = 0; } } kenoShowPrizes('','w',displaynumber); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The keno game is not enabled.', u, appNoticeColor); } break; } case '/kpbc': { cmd = 1; if (kenoToggle == 1) { if (isBC) { kenoShowPrizesBC(); } else { cb.sendNotice('This command is only allowed for broadcasters.', u, appNoticeColor); } } else { cb.sendNotice('The keno game is not enabled.', u, appNoticeColor); } break; } case '/kenoboard': case '/kb': { cmd = 1; kenoDisplayBoard(u); break; } case '/freeguess': case '/kenoguess': case '/freekeno': { cmd = 1; if (kenoToggle == 1) { guessnum = parseInt(message[1]); if(isNaN(guessnum)) { cb.sendNotice('The value entered for the keno number to select is not numeric, please try again.', u, appNoticeColor); } else if(guessnum < kenoLowNumber || guessnum > kenoHighNumber) { cb.sendNotice('The value entered for the keno number to select is outside the range of values on the board, please try again.', u, appNoticeColor); } else { if (isBC) { kenoTip(guessnum,u,'bc'); } else { numFreeGuess = 0; if (isFan || isExtFan) { numFreeGuess = cb.settings.kenoFreeGuessFans; } else if (isVIP) { numFreeGuess = cb.settings.kenoFreeGuessVIP; } else if (isMod) { numFreeGuess = cb.settings.kenoFreeGuessMods; } if (numFreeGuess > 0) { if (!cbjs.arrayContains(freeGuessCount.name,u)) { kenoTip(guessnum,u,'free'); freeGuessCount.name.push(u); freeGuessCount.count.push(1); } else { userIndex = freeGuessCount.name.indexOf(u); if (freeGuessCount.count[userIndex] < numFreeGuess) { kenoTip(guessnum,u,'free'); freeGuessCount.count[userIndex]++; } else { cb.sendNotice('Sorry, you have used up all your free keno guesses.', u, appNoticeColor); } } } else { cb.sendNotice('Sorry, your user group has not been granted any free keno guesses.', u, appNoticeColor); } } } } else { cb.sendNotice('The keno game is not enabled.', u, appNoticeColor); } break; } //********* Press Your Luck commands case '/press': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1] == 'on' || message[1] == 'off') { if (message[1] == 'off' && pressEndWarning == false && pressActive == true) { cb.sendNotice('Warning! You are disabling the Press Your Luck game while there is still an active game waiting. You can use the "/press off" command again to disable it anyways.', u, appNoticeColor); pressEndWarning = true; } else { setPressToggle(message[1], u); pressEndWarning = false; } } else { cb.sendNotice('Invalid parameter for the "/press" command, valid values are "on" and "off".', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/pressprizes': case '/pp': { cmd = 1; if (pressToggle == 1) { if (isMod || isBC) { sendto = ''; } else { sendto = u; } pressShowPrizes(sendto); } else { cb.sendNotice('The Press Your Luck game is not enabled.', u, appNoticeColor); } break; } case '/pw': case '/presswinners': { cmd = 1; showall = ''; if (message[1] == 'all' || message[1] == '' || message[1] == null) { showall = message[1]; } else { cb.sendNotice('Invalid parameter for the "/pw" command, valid values are "all" and blanks (blanks defaults to last 20 winners).', u, appNoticeColor); } if (isMod) { pressShowWinners(cb.room_slug,showall); } pressShowWinners(u,showall); break; } case '/pressqueue': case '/pressq': case '/pq': { cmd = 1; if (pressToggle == 1) { cb.sendNotice('Current Waiting List for playing the Press Your Luck game (in order): \n ' + cbjs.arrayJoin(pressNextplayer, ', ') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('The Press Your Luck game is not enabled.', u, appNoticeColor); } break; } case '/stoppress': { cmd = 1; if (pressToggle == 1) { if (pressActive == true && (currentPressPlayer == u || isBC || (isMod && cb.settings.allowModsAuthority == 'Yes'))) { stoppedby = u; stopPressing(currentPressPlayer,stoppedby); } else { cb.sendNotice('You do not have an active Press Your Luck game to stop.', u, appNoticeColor); } } else { cb.sendNotice('The Press Your Luck game is not enabled.', u, appNoticeColor); } break; } case '/pi': { cmd = 1; if (pressToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { pressInstructionsBC(u); } else { pressInstructions(u); } } else { cb.sendNotice('The Press Your Luck game is not enabled.', u, appNoticeColor); } break; } case '/presstype': case '/pt': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (pressToggle == 1) { typenum = parseInt(message[1]); if(isNaN(typenum)) { cb.sendNotice('The value entered for the new Press Your Luck card type is not numeric, please try again. Valid values are: \n1=Red Card\n2=Black Card\n3=Hearts\n4=Diamonds\n5=Clubs\n6=Spades\n7=Number Cards\n8=Face Cards and Aces\n9=Aces\n10=Queen of Hearts', u, appNoticeColor); } else if(typenum < 1 || typenum > 10) { cb.sendNotice('The value entered for the new Press Your Luck card type is outside the range of 1-10, please try again. Valid values are: \n1=Red Card\n2=Black Card\n3=Hearts\n4=Diamonds\n5=Clubs\n6=Spades\n7=Number Cards\n8=Face Cards and Aces\n9=Aces\n10=Queen of Hearts', u, appNoticeColor); } else { pressWinnerGroupType = typenum; if (pressWinnerGroupType == 1) { pressCardType = 'Red Card'; } else if (pressWinnerGroupType == 2) { pressCardType = 'Black Card'; } else if (pressWinnerGroupType == 3) { pressCardType = 'Heart'; } else if (pressWinnerGroupType == 4) { pressCardType = 'Diamond'; } else if (pressWinnerGroupType == 5) { pressCardType = 'Club'; } else if (pressWinnerGroupType == 6) { pressCardType = 'Spade'; } else if (pressWinnerGroupType == 7) { pressCardType = 'Number Card'; } else if (pressWinnerGroupType == 8) { pressCardType = 'Face Card or Ace'; } else if (pressWinnerGroupType == 9) { pressCardType = 'Ace'; } else if (pressWinnerGroupType == 10) { pressCardType = 'Queen of Hearts'; } else { pressCardType = 'Error'; } cb.sendNotice('You have updated the Press Your Luck winning card type to "' + pressWinnerGroupType + '" (' + pressCardType + ').', u, appNoticeColor); } } else { cb.sendNotice('The Press Your Luck Game has not been turned on, you can use the command "/press on" to enable it.', u, appNoticeColor); } } break; } case '/pressfree': case '/pf': { cmd = 1; if (pressToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { pressTip(u,'free'); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Press Your Luck Game has not been enabled.', u, appNoticeColor); } break; } case '/pressprice': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (pressToggle == 1) { numprice = parseInt(message[1]); if(isNaN(numprice)) { cb.sendNotice('The value entered for the new Press Your Luck price is not numeric, please try again.', u, appNoticeColor); } else if(numprice < 1 || numprice > 100) { cb.sendNotice('The value entered for the new Press Your Luck price is outside allowable values from 1 to 100, please try again.', u, appNoticeColor); } else { pressPrice = numprice; cb.sendNotice(u + ' has updated the Press Your Luck Price.', u, appNoticeColor); cb.sendNotice('The Press Your Luck Price has been updated to ' + numprice + ' tokens.', '', pressNoticeBgColor, pressNoticeTextColor, 'bold'); } } else { cb.sendNotice('The Press Your Luck Game has not been turned on, you can use the command "/press on" to enable it.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } //********* War Card Game commands case '/wargame': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1] == 'on' || message[1] == 'off') { if (message[1] == 'off' && warEndWarning == false && warActive == true) { cb.sendNotice('Warning! You are disabling the War! game while there is still an active game waiting. You can draw your card with the /wd command to finish this game, or use the "/wargame off" command again to disable it anyways.', u, appNoticeColor); warEndWarning = true; } else { setWarToggle(message[1], u); warEndWarning = false; } } else { cb.sendNotice('Invalid parameter for the "/wargame" command, valid values are "on" and "off".', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/wi': { cmd = 1; if (warToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { warInstructionsBC(u); } else { warInstructions(u); } } else { cb.sendNotice('The War! Game has not been enabled.', u, appNoticeColor); } break; } case '/warfree': case '/wf': { cmd = 1; if (warToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1] == '1' || message[1] == '2' || message[1] == '3' || message[1] == '4' || message[1] == '5') { fromnext = false; if (u == BC) { startedby = bctext; } else { startedby = u; } warTip(startedby,message[1],fromnext); } else { cb.sendNotice('Invalid parameter for the "/wf" command, valid values are 1-5, such as in the format "/wf 3" to do a free play at level 3.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The War! Game has not been enabled.', u, appNoticeColor); } break; } case '/warprizes': case '/wp': { cmd = 1; if (warToggle == 1) { if (isMod || isBC) { sendto = ''; } else { sendto = u; } warShowPrizes(sendto); } else { cb.sendNotice('The War Card Game is not enabled.', u, appNoticeColor); } break; } case '/warlist': case '/wl': { cmd = 1; if (warToggle == 1) { cb.sendNotice('Current Waiting List for playing the War Card Game (in order): \n ' + cbjs.arrayJoin(warNextplayer.name, ', ') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('The War Card Game is not enabled.', u, appNoticeColor); } break; } case '/stopwar': { cmd = 1; if (warToggle == 1) { if (warActive == true && (currentWarPlayer == u || isBC || (isMod && cb.settings.allowModsAuthority == 'Yes'))) { stopWar(currentWarPlayer); } else { cb.sendNotice('You do not have an active War Card Game to stop.', u, appNoticeColor); } } else { cb.sendNotice('The War Card Game is not enabled.', u, appNoticeColor); } break; } case '/ww': case '/warwinners': { cmd = 1; showall = ''; if (message[1] == 'all' || message[1] == '' || message[1] == null) { showall = message[1]; } else { cb.sendNotice('Invalid parameter for the "/ww" command, valid values are "all" and blanks (blanks defaults to last 20 winners).', u, appNoticeColor); } if (isMod) { warShowWinners(cb.room_slug,showall); } warShowWinners(u,showall); break; } case '/war': { cmd = 1; if (warToggle == 1) { if (warActive == true && (currentWarPlayer == u || isBC || (isMod && cb.settings.allowModsAuthority == 'Yes'))) { if (warWaitingTie == true) { warWaitingTie = false; warDrawCard(); } else { cb.sendNotice('It is not your turn, the "/war" command is only used for the viewer to draw a new card after a tie.', u, appNoticeColor); } } else { cb.sendNotice('You do not have an active War Card Game to continue.', u, appNoticeColor); } } else { cb.sendNotice('The War Card Game is not enabled.', u, appNoticeColor); } break; } case '/wardraw': case '/wd': { cmd = 1; if (warToggle == 1) { if (isBC) { if (warActive == true) { if (warWaiting == true) { warDealerDraw(); } else { cb.sendNotice('It is not your turn yet, a card is being dealt to the player.', u, appNoticeColor); } } else { cb.sendNotice('There is not currently an active War! Card Game.', u, appNoticeColor); } } else { cb.sendNotice('This command is only available for broadcasters.', u, appNoticeColor); } } else { cb.sendNotice('The War Card Game is not enabled.', u, appNoticeColor); } break; } //********* Random Prize Game commands case '/random': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { randomSetToggle(message[1], u); } else { cb.sendNotice('Gamebot: No parameter was specified for the "/random" command. An "on" or "off" parameter is required.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/ri': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { randomInfo(u,'BC'); } else { randomInfo(u,'common'); } break; } case '/rw': { cmd = 1; showall = ''; if (message[1] == 'all' || message[1] == '' || message[1] == null) { showall = message[1]; } else { cb.sendNotice('Invalid parameter for the "/rw" command, valid values are "all" and blanks (blanks defaults to last 20 winners).', u, appNoticeColor); } if (isMod) { randomShowWinners(cb.room_slug,showall); } randomShowWinners(u,showall); break; } case '/randomfree': { cmd = 1; if (randomToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1] >= 1 && message[1] <= 10) { randomWinner(u,'Random Prize',message[1],''); } else { cb.sendNotice('Invalid parameter for the "/randomfree" command, valid values are 1-10 and correspond to the level that a random prize should be drawn from, such as in the format "/randomfree 3" to do a free play from master prize list level 3.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Random Prize Game has not been enabled.', u, appNoticeColor); } break; } //********* Bad Libs Game commands case '/badlibs': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { setBadLibsToggle(message[1], u); } else { cb.sendNotice('Gamebot: No parameter was specified for the "/badlibs" command. An "on" or "off" parameter is required.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/bli': { cmd = 1; if (badToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { badInfo(u,'BC'); } else { badInfo(u,'common'); } } else { cb.sendNotice('The Bad Libs Game is not enabled.', u, appNoticeColor); } break; } case '/blw': { cmd = 1; showall = ''; if (message[1] == 'all' || message[1] == '' || message[1] == null) { showall = message[1]; } else { cb.sendNotice('Invalid parameter for the "/blw" command, valid values are "all" and blanks (blanks defaults to last 20 winners).', u, appNoticeColor); } if (isMod) { badShowDraws(cb.room_slug,showall); } badShowDraws(u,showall); break; } case '/blc': { cmd = 1; if (badToggle == 1) { badShowChoices(u); } else { cb.sendNotice('The Bad Libs Game is not enabled.', u, appNoticeColor); } break; } case '/badprice': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (badToggle == 1) { numprice = parseInt(message[1]); if(isNaN(numprice)) { cb.sendNotice('The value entered for the new Bad Libs price is not numeric, please try again.', u, appNoticeColor); } else if(numprice < 1 || numprice > 1000) { cb.sendNotice('The value entered for the new Bad Libs price is outside allowable values from 1 to 1000, please try again.', u, appNoticeColor); } else { badPrice = numprice; cb.sendNotice(u + ' has updated the Bad Libs price.', u, appNoticeColor); cb.sendNotice('The Bad Libs price has been updated to ' + badPrice + ' tokens.', '', badNoticeBgColor, badNoticeTextColor, 'bold'); } } else { cb.sendNotice('The Bad Libs Game is not enabled, you can use the command "/badlibs on" to enable it.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/badfree': { cmd = 1; if (badToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { badTip(u); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Bad Libs Game has not been enabled.', u, appNoticeColor); } break; } case '/addwho': { cmd = 1; if (badToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newvalue = msg['m'].substring(8).trim(); badWhoArray.push(newvalue) cb.sendNotice('"' + newvalue + '" added to the name list.', u, appNoticeColor); } else { cb.sendNotice('No parameter specified to add to the name list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Bad Libs Game is not enabled.', u, appNoticeColor); } break; } case '/addwhat': { cmd = 1; if (badToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newvalue = msg['m'].substring(9).trim(); badWhatArray.push(newvalue) cb.sendNotice('"' + newvalue + '" added to the action list.', u, appNoticeColor); } else { cb.sendNotice('No parameter specified to add to the action list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Bad Libs Game is not enabled.', u, appNoticeColor); } break; } case '/addwhere': { cmd = 1; if (badToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newvalue = msg['m'].substring(10).trim(); badWhereArray.push(newvalue) cb.sendNotice('"' + newvalue + '" added to the location list.', u, appNoticeColor); } else { cb.sendNotice('No parameter specified to add to the location list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Bad Libs Game is not enabled.', u, appNoticeColor); } break; } case '/addhowlong': { cmd = 1; if (badToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newvalue = msg['m'].substring(12).trim(); badHowLongArray.push(newvalue) cb.sendNotice('"' + newvalue + '" added to the duration list.', u, appNoticeColor); } else { cb.sendNotice('No parameter specified to add to the duration list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Bad Libs Game is not enabled.', u, appNoticeColor); } break; } //********* Charades commands case '/charades': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1] == 'on' || message[1] == 'off') { if (message[1] == 'off' && charadesEndWarning == false && charadesActive == true) { cb.sendNotice('Warning! You are disabling the ' + charadesType + ' game while there is still an active game waiting. You can play the current game with the /chplay command, or use the "/charades off" command again to disable it anyways.', u, appNoticeColor); charadesEndWarning = true; } else { charadesSetToggle(message[1], u); charadesEndWarning = false; } } else { cb.sendNotice('Invalid parameter for the "/charades" command, valid values are "on" and "off".', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chi': { cmd = 1; if (charadesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { charadesInfo(u,'BC'); } else { charadesInfo(u,'common'); } } else { cb.sendNotice('The ' + charadesType + ' Game is not enabled.', u, appNoticeColor); } break; } case '/chlist': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { cb.sendNotice(charadesType + ' Word List (' + charadesList.length + (charadesList.length == 1 ? ' entry' : ' entries') + '): \n' + (charadesList.length > 0 ? cbjs.arrayJoin(charadesList, ', ') : 'No entries.') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chq': { cmd = 1; if (charadesToggle == 1) { charadesPlayerQueue(u); } else { cb.sendNotice('The ' + charadesType + ' Game is not enabled.', u, appNoticeColor); } break; } case '/chh': { cmd = 1; showall = ''; if (message[1] == 'all' || message[1] == '' || message[1] == null) { showall = message[1]; } else { cb.sendNotice('Invalid parameter for the "/chh" command, valid values are "all" and blanks (blanks defaults to last 20 plays).', u, appNoticeColor); } if (isMod) { charadesShowResults(cb.room_slug,showall); } charadesShowResults(u,showall); break; } case '/chplay': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (charadesToggle) { if (charadesWaiting == true) { if (charadesMinsRemain >= 1 || charadesSecsRemain >= 1) { cb.sendNotice('A ' + charadesType + ' timer is already running, likely from the previous game, please stop the current timer using the command /chstoptimer if it is no longer needed.', u, appNoticeColor); } else { if (charadesWordSelected == true) { charadesStartPlay(); } else { cb.sendNotice('A word has not yet been selected for the current game, please add a word to the wordlist using the /chword command.', u, appNoticeColor); } } } else { cb.sendNotice('The ' + charadesType + ' Game is not awaiting a start (word may not be selected, or already started and taking guesses).', u, appNoticeColor); } } else { cb.sendNotice('The ' + charadesType + ' Game is not enabled.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chword': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (isBC || (isMod && cb.settings.charadesModsKnowWord == 'Yes')) { if (cmdval != null) { var addlistarray = cmdval.split(':'); if (addlistarray.length > 1) { addnotice = ''; for (var i = 0; i < addlistarray.length; i++) { if (addlistarray[i] != '') { newCharadesWord = addlistarray[i].toLowerCase().trim(); if (!cbjs.arrayContains(charadesList, newCharadesWord)) { charadesList.push(newCharadesWord); addnotice += '\nAdded "' + newCharadesWord + '" to the ' + charadesType + ' Word List.' } else { addnotice += '\n' + newCharadesWord + ' is already on the ' + charadesType + ' Word List. Skipping.'; } } } addnotice += '\nAll words and phrases were added.'; cb.sendNotice(addnotice, u, appNoticeColor); } else { newCharadesWord = msg['m'].substring(8).trim(); if (cbjs.arrayContains(charadesList,newCharadesWord)) { cb.sendNotice('Gamebot: ' + newCharadesWord + ' is already in the ' + charadesType + ' Word list.', u, appNoticeColor); } else { charadesList.push(newCharadesWord); cb.sendNotice('You have added "' + newCharadesWord + '" to the ' + charadesType + ' Word List.', u, appNoticeColor); } } if (charadesWaiting == true && charadesWordSelected == false) { selectWord(); } } else { cb.sendNotice('A parameter is required for the /chword command and should be the word or phrase you would like to add. Multiple words and phrases can be added to the list if they are separated with a colon ":".', u, appNoticeColor); } } else { cb.sendNotice('A moderator can only add words if they are configured to know the word list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chsave': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (isBC || (isMod && cb.settings.charadesModsKnowWord == 'Yes')) { if (charadesList.length > 0) { cb.sendNotice('Unused charades words listed below. \nYou can paste this list into the Broadcaster Managed word list when next starting the Gamebot so you don\'t reuse words from the current session: \n' + cbjs.arrayJoin(charadesList,':'), u, appNoticeColor); } else { cb.sendNotice('There are no words or phrases left in the current word list.', u, appNoticeColor); } } else { cb.sendNotice('A moderator can only use this command if they are configured to know the word list.', u, appNoticeColor); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/chrmv': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { wordtormv = msg['m'].substring(7).trim(); if (wordtormv != null && wordtormv != '' && wordtormv != ' ') { if (cbjs.arrayContains(charadesList,wordtormv)) { cbjs.arrayRemove(charadesList,wordtormv); cb.sendNotice('You have removed "' + wordtormv + '" from the ' + charadesType + ' Word List.', u, appNoticeColor); } else { cb.sendNotice('The word/phrase "' + wordtormv + '" is not in the ' + charadesType + ' Word List. Please check your spelling to ensure it is an exact match with what you are trying to remove, including upper and lower case. You can use the command /chlist to view the list, and then copy and paste the word or phrase from the list.', u, appNoticeColor); } } else { cb.sendNotice('A parameter is required for the /chrmv command and should be an exact match for the word or phrase you would like to remove.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chlength': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (charadesToggle == 1) { numlength = parseFloat(message[1]); if(isNaN(numlength)) { cb.sendNotice('The value entered for the new ' + charadesType + ' timer length is not numeric, please try again.', u, appNoticeColor); } else if (numlength != .5 && numlength != 1 && numlength != 1.5 && numlength != 2 && numlength != 3 && numlength != 4 && numlength != 5) { cb.sendNotice('The value entered for the new ' + charadesType + ' timer length is not one of the allowable values of .5, 1, 1.5, 2, 3, 4, or 5 (min), please try again.', u, appNoticeColor); } else { charadesTimerLength = numlength; cb.sendNotice(u + ' has updated the ' + charadesType + ' timer length to ' + charadesTimerLength + (charadesTimerLength == 1 ? ' minute.' : ' minutes.'), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } } else { cb.sendNotice('The ' + charadesType + ' Game is not enabled, you can use the command "/charades on" to enable it.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chprice': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (charadesToggle == 1) { numprice = parseInt(message[1]); if(isNaN(numprice)) { cb.sendNotice('The value entered for the new ' + charadesType + ' price is not numeric, please try again.', u, appNoticeColor); } else if(numprice < 1 || numprice > 1000) { cb.sendNotice('The value entered for the new ' + charadesType + ' price is outside allowable values from 1 to 1000, please try again.', u, appNoticeColor); } else { charadesPrice = numprice; cb.sendNotice(u + ' has updated the ' + charadesType + ' price to ' + charadesPrice + ' tokens.', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } } else { cb.sendNotice('The ' + charadesType + ' Game is not enabled, you can use the command "/charades on" to enable it.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chfree': { cmd = 1; if (charadesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (charadesActive == false) { charadesPlay('free',u,false); } else { cb.sendNotice('A ' + charadesType + ' game has already started. Once the current game is finished, a new one can be started.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The ' + charadesType + ' Game has not been enabled.', u, appNoticeColor); } break; } case '/chstoptimer': { cmd = 1; if (charadesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (charadesMinsRemain >= 1 || charadesSecsRemain >= 1) { if (charadesGuessing) { cb.sendNotice('The timer has been ended, but guessing can continue. To end the game, use the /chend command.', u, appNoticeColor); } charadesStopTimer(); } else { cb.sendNotice('A ' + charadesType + ' timer is not currently running.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The ' + charadesType + ' Game has not been enabled.', u, appNoticeColor); } break; } case '/chend': { cmd = 1; if (charadesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (charadesActive) { charadesEndGame(u); } else { cb.sendNotice('A ' + charadesType + ' game has not been started.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The ' + charadesType + ' Game has not been enabled.', u, appNoticeColor); } break; } case '/chwin': { cmd = 1; if (charadesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (charadesGuessing) { if (message[1]) { charadesCorrectAnswer(message[1]); } else { cb.sendNotice('A user ID is required as a parameter for this command to identify the winner. Command should be used in the format "/chwin username".', u, appNoticeColor); } } else { cb.sendNotice('A ' + charadesType + ' game has not been started.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The ' + charadesType + ' Game has not been enabled.', u, appNoticeColor); } break; } case '/chskip': { cmd = 1; if (charadesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (charadesGuessing) { cb.sendNotice('Current word is being skipped, ' + charadesType + ' will start again on broadcaster\'s command', '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesStopTimer(u); selectWord(); } else { cb.sendNotice('The /chskip command can only be used once the game starts after the word has been shown.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The ' + charadesType + ' Game has not been enabled.', u, appNoticeColor); } break; } case '/chclearlist': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { charadesList = []; cb.sendNotice('The ' + charadesType + ' Word List has been cleared. You can add words to the list with the /chword command.', u, appNoticeColor); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chsb': case '/chscoreboard': { cmd = 1; if (charadesToggle == 1) { if (isMod || isBC) { sendto = ''; } else { sendto = u; } if (charadesMode == 'M1') { cb.sendNotice((sendto == '' ? '(Sent to ALL)' : '(Sent to You)') + '\n' + charadesType + ' Current Broadcaster Score - ' + charadesBABScore() + '\n' + charadesType + ' Current Viewer Score - ' + charadesMode1Score(), sendto, charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } else if (charadesMode == 'M3') { cb.sendNotice((sendto == '' ? '(Sent to ALL)' : '(Sent to You)') + '\n' + charadesType + ' Current Score ' + + charadesMode3Score(), sendto, charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); } else { cb.sendNotice('The /chsb (or /chscoreboard) command is only valid for ' + charadesType + ' Modes 1 and 3.', u, appNoticeColor); } } else { cb.sendNotice('The ' + charadesType + ' Game has not been enabled.', u, appNoticeColor); } break; } case '/chfixscore': { cmd = 1; if (charadesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { newscore = parseInt(message[1]); updateuser = message[2]; if (isNaN(newscore)) { cb.sendNotice('The value entered for the new user score is not numeric, please try again.\n The format of the command should be "/chfixscore X username" to update username\'s score to a new value X.', u, appNoticeColor); } else if (!message[2]) { cb.sendNotice('A value was not entered for the username of the score to update, please try again.\n The format of the command should be "/chfixscore X username" to update username\'s score to a new value X.', u, appNoticeColor); } else { if (charadesMode == 'M1') { if (cbjs.arrayContains(charadesPlayers,updateuser)) { index = charadesPlayers.indexOf(updateuser); charadesScores[index] = newscore; cb.sendNotice('You have updated ' + updateuser + '\'s score to ' + newscore + '.', u, appNoticeColor); if (u != BC) { cb.sendNotice(u + ' has updated ' + updateuser + '\'s score to ' + newscore + '.', BC, appNoticeColor); } cb.sendNotice(charadesType + ' Current Broadcaster Score - ' + charadesBABScore() + '\n' + charadesType + ' Current Viewer Score - ' + charadesMode1Score(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesGameComplete(updateuser,true); charadesResults.push(u + ' has updated ' + updateuser + '\'s score to ' + newscore); } else { cb.sendNotice('The value entered for the username of the score to update does not match any of the current players, please try again.\n The format of the command should be "/chfixscore X username" to update username\'s score to a new value X.\n The entry is case sensitive, current player list: ' + cbjs.arrayJoin(charadesPlayers, ', '), u, appNoticeColor); } } else if (charadesMode == 'M3') { if (cbjs.arrayContains(charadesVAR2Scores.user,updateuser)) { index = charadesVAR2Scores.user.indexOf(updateuser); charadesVAR2Scores.score[index] = newscore; cb.sendNotice('You have updated ' + updateuser + '\'s score to ' + newscore + '.', u, appNoticeColor); if (u != BC) { cb.sendNotice(u + ' has updated ' + updateuser + '\'s score to ' + newscore + '.', BC, appNoticeColor); } } else { cb.sendNotice('The value entered for the username of the score to update does not match any of the current players, an entry is being added for ' + updateuser, u, appNoticeColor); if (u != BC) { cb.sendNotice(u + ' has added ' + updateuser + ' to the scoreboard with a score of ' + newscore + '.', BC, appNoticeColor); } charadesVAR2Scores.user.push(updateuser); userIndex = charadesVAR2Scores.user.indexOf(updateuser); charadesVAR2Scores.score[userIndex] = newscore; } cb.sendNotice(charadesType + ' Current Score - ' + charadesMode3Score(), '', charadesNoticeBgColor, charadesNoticeTextColor, 'bold'); charadesGameComplete(updateuser,true); charadesResults.push(u + ' has updated ' + updateuser + '\'s score to ' + newscore); } else { cb.sendNotice('The /chfixscore command is only valid for ' + charadesType + ' Modes 1 and 3.', u, appNoticeColor); } } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The ' + charadesType + ' Game has not been enabled.', u, appNoticeColor); } break; } //********* Twenty Questions Game commands case '/tq': case '/twenty': case '/twentyquestions': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { cmdparm = message[1].toLowerCase(); if (cmdparm != 'on' && cmdparm != 'off') { cb.sendNotice('Gamebot: Invalid parameter was specified for the "/twenty" command. The parameter value must be "on" or "off".', u, appNoticeColor); } else { twentySetToggle(cmdparm, u); } } else { cb.sendNotice('Gamebot: No parameter was specified for the "/twenty" command. An "on" or "off" parameter is required.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/tqi': { cmd = 1; if (twentyToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { twentyInfo(u,'BC'); } else { twentyInfo(u,'common'); } } else { cb.sendNotice('The Twenty Questions Game is not enabled.', u, appNoticeColor); } break; } case '/tqh': { cmd = 1; tqhsendto = u; if (message[1]) { if (message[1] == 'all') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (twentyAllowAll == 'All Play') { tqhsendto = ''; } else { cb.sendNotice('The "all" parameter cannot be used when playing individual games. History will only be sent to you.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are allowed to send to "all".', u, appNoticeColor); } } else { cb.sendNotice('Invalid parameter for the "/tqh" command, a value of "all" can be used to send the list of questions to everyone, otherwise leave blank.', u, appNoticeColor); } } if (isMod || isBC) { twentyQuestionsAsked(tqhsendto,'BC'); } else { twentyQuestionsAsked(tqhsendto,u); } break; } case '/tqa': { cmd = 1; if (twentyToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (twentyActive) { if (twentyAllowAll == 'All Play') { if (message[1]) { numanswer = parseInt(message[1]); if (message[2]) { answervalue = message[2].toLowerCase(); if (twentyQuestionsNumber.number[0] <= 0) { cb.sendNotice('No questions have been asked yet.', u, appNoticeColor); } else if (isNaN(numanswer) || numanswer < 1) { cb.sendNotice('The value entered for number of the question to answer is either not a number or less than 1. The last question asked was #' + twentyQuestionsNumber.number[0] + '.', u, appNoticeColor); } else if (numanswer > twentyNumberOfQuestions) { cb.sendNotice('The value entered for number of the question to answer is greater than the number of questions set for the game (' + twentyNumberOfQuestions + '). The last question asked was #' + twentyQuestionsNumber.number[0] + '.', u, appNoticeColor); } else if (numanswer > twentyQuestionsNumber.number[0]) { cb.sendNotice('The value entered for number of the question to answer is greater than the number of questions asked so far. The last question asked was #' + twentyQuestionsNumber.number[0] + '.', u, appNoticeColor); } else if (answervalue != 'yes' && answervalue != 'no') { cb.sendNotice('The value entered for the answer must be "yes" or "no". Maybe is not allowed :)', u, appNoticeColor); } else { answerindex = numanswer - 1; twentyQuestionsHistory.answer[answerindex] = answervalue; cb.sendNotice(u + ' has updated the answer for All Play question #' + numanswer + ' to "' + answervalue + '".', '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } } else { cb.sendNotice('No value was entered for the answer to the question. The command format is "/tqa X [yes/no]" where X is the number of the question being answered, followed by "yes" or "no". Maybe is not allowed :)', u, appNoticeColor); } } else { cb.sendNotice('No value was entered for the question number. The command format is "/tqa X [yes/no]" where X is the number of the question being answered, followed by "yes" or "no". Maybe is not allowed :)', u, appNoticeColor); } } else { cb.sendNotice('Answers can only be recorded for "All Play" mode.', u, appNoticeColor); } } else { cb.sendNotice('A Twenty Questions game has not yet been started, the broadcaster (or allowed moderator) should start the game by selecting a word with the /tword command.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Twenty Questions Game is not enabled.', u, appNoticeColor); } break; } case '/twentymode': { cmd = 1; if (twentyToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { modevalue = message[1].toLowerCase(); if (twentyActive && twentyQuestionsHistory.username.length > 0 && !twentyChgWarned) { cb.sendNotice('WARNING: You are attempting to update the game mode for Twenty Questions when a game has already started and users have tipped to guess. You can enter the same command again to override the warning and start a new game with a new word.', u, appNoticeColor); twentyChgWarned = true; } else if (modevalue == '' && modevalue == null) { cb.sendNotice('No value was entered for the new mode. The command format is "/twentymode all" for "All Play" where everyone is playing and can see the guesses that are made, or "/twentymode single" if you want each person to make their own guesses.', u, appNoticeColor); } else if (modevalue != 'all' && modevalue != 'single') { cb.sendNotice('The value that was entered for the new mode is invalid. The command format is "/twentymode all" for "All Play" where everyone is playing and can see the guesses that are made, or "/twentymode single" if you want each person to make their own guesses.', u, appNoticeColor); } else if (modevalue == 'all' && twentyAllowAll == 'All Play') { cb.sendNotice('The mode is already set to "All Play".', u, appNoticeColor); } else if (modevalue != 'single' && modevalue == 'Individual Play') { cb.sendNotice('The mode is already set to "Individual Play".', u, appNoticeColor); } else { if (modevalue = 'all') { twentyAllowAll = 'All Play'; } else { twentyAllowAll = 'Individual Play'; } twentyChgWarned = false; twentyInitRound(); if (u != BC) { cb.sendNotice('The Twenty Questions game mode has been set to "' + twentyAllowAll + '" by ' + u + '.', BC, appNoticeColor); cb.sendNotice(u + ' has updated the Twenty Questions game mode to "' + twentyAllowAll + '".', '', appNoticeColor, '', '', 'red'); } else { cb.sendNotice('You have updated the Twenty Questions game mode to "' + twentyAllowAll + '". You can now start the next game by entering a new word or phrase with the "/tword" command.', u, appNoticeColor); } } } else { cb.sendNotice('No value was specified for the new game mode.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Twenty Questions Game is not enabled.', u, appNoticeColor); } break; } case '/twentyend': { cmd = 1; if (twentyToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (twentyAllowAll == 'All Play') { if (twentyActive && twentyQuestionsNumber.number[0] < twentyNumberOfQuestions && !twentyEndWarned) { cb.sendNotice('WARNING: You are attempting to update the game mode for Twenty Questions when a game has already started and users have tipped to guess. You can enter the same command again to override the warning and start a new game with a new word.', u, appNoticeColor); twentyEndWarned = true; } else if (twentyActive) { twentyActive = false; if (u != BC) { cb.sendNotice('The current Twenty Questions game has been ended by ' + u + '. You can start a new game by setting the next word or phrase using the "/tword" command.', BC, appNoticeColor); cb.sendNotice('The current Twenty Questions game has been ended by ' + u + '. A new game can be started by setting the next word or phrase using the "/tword" command.', '', appNoticeColor, '', '', 'red'); } else { cb.sendNotice('You have ended the current Twenty Questions game. You can start a new game by setting the next word or phrase using the "/tword" command.', u, appNoticeColor); } } else { cb.sendNotice('There is currently not a Twenty Questions game active that can be ended.', u, appNoticeColor); } } else { cb.sendNotice('This command is only valid for "All Play" mode and should be used after all questions have been used up.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Twenty Questions Game is not enabled.', u, appNoticeColor); } break; } case '/twentywin': { cmd = 1; if (twentyToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (twentyActive) { if (message[1]) { uservalue = message[1].toLowerCase(); if (uservalue == '' && uservalue == null) { cb.sendNotice('No value was entered for the winning username. The command format is "/twentywin username".', u, appNoticeColor); } else { twentyGameWon(uservalue); if (u != BC) { cb.sendNotice(u + ' has indicated a winner in the current Twenty Questions game.', BC, appNoticeColor); cb.sendNotice(u + ' has indicated a winner in the current Twenty Questions game. A new game can be started by entering a word or phrase using the "/tword" command.', '', appNoticeColor, '', '', 'red'); } else { cb.sendNotice('You can start the next game by entering a word or phrase using the "/tword" command.', BC, appNoticeColor); } } } } else { cb.sendNotice('There is currently not a Twenty Questions game active.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Twenty Questions Game is not enabled.', u, appNoticeColor); } break; } case '/twentyprice': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (twentyToggle == 1) { numprice = parseInt(message[1]); if (isNaN(numprice)) { cb.sendNotice('The value entered for the new Twenty Questions price is not numeric, please try again.', u, appNoticeColor); } else if (numprice < 1 || numprice > 1000) { cb.sendNotice('The value entered for the new Twenty Questions price is outside allowable values from 1 to 1000, please try again.', u, appNoticeColor); } else { twentyPrice = numprice; cb.sendNotice(u + ' has updated the Twenty Questions price.', u, appNoticeColor); cb.sendNotice('The Twenty Questions price has been updated to ' + twentyPrice + ' tokens.', '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } } else { cb.sendNotice('The Twenty Questions Game is not enabled, you can use the command "/twenty on" to enable it.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/tprize': { cmd = 1; if (twentyToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { if (twentyActive && twentyQuestionsHistory.username.length > 0 && !twentyChgPWarned) { cb.sendNotice('WARNING: You are attempting to update the current prize for 20 questions when a game has already started and users have tipped to guess. You can enter the same command again to override this warning and update the prize.', u, appNoticeColor); twentyChgPWarned = true; } else { twentyChgPWarned = false; twentyCurrentPrize = msg['m'].substring(8).trim(); if (u != BC) { cb.sendNotice('The new Twenty Questions Prize was updated by ' + u + '.', BC, appNoticeColor); } cb.sendNotice('The Twenty Questions Prize has been updated to "' + twentyCurrentPrize + '".', '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } } else { cb.sendNotice('No value was specified for the Twenty Questions Prize.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Twenty Questions Game is not enabled.', u, appNoticeColor); } break; } case '/tword': { cmd = 1; if (twentyToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (twentyModsKnowWord) { if (message[1]) { if (twentyActive && twentyQuestionsHistory.username.length > 0 && !twentyChgWarned) { cb.sendNotice('WARNING: You are attempting to update the current word for 20 questions when a game has already started and users have tipped to guess. You can enter the same command again to override the warning and start a new game with a new word.', u, appNoticeColor); twentyChgWarned = true; } else { twentyWord = msg['m'].substring(7).trim(); twentyChgWarned = false; twentyActive = true; twentyInitRound(); if (!twentyNoticeWaiting) { twentyNoticeTimer(); } if (u != BC) { cb.sendNotice('The new Twenty Questions word has been set to "' + twentyWord + '" by ' + u + '.', BC, appNoticeColor); cb.sendNotice(u + ' has entered a new Twenty Questions word: "' + twentyWord + '".', '', appNoticeColor, '', '', 'red'); } else { cb.sendNotice('You have set the new Twenty Questions word to "' + twentyWord + '" and the new game has started.', u, appNoticeColor); } cb.sendNotice('Twenty Questions Game #' + twentyGameCount + ' has been started and a word has been selected.', '', twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } } else if (twentyActive) { cb.sendNotice('Sent to you only: The current word/phrase for Twenty Questions is "' + twentyWord + '".', u, appNoticeColor); } else { cb.sendNotice('No value was specified for the Twenty Questions Word.', u, appNoticeColor); } } else { cb.sendNotice('Moderators are not allowed to enter or see the current Twenty Questions word.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The Twenty Questions Game is not enabled.', u, appNoticeColor); } break; } //******** VIP Commands *********** case '/addvip': { cmd = 1; if (isBC) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { addnotice = 'Adding multiple users to the Gamebot VIP list.'; addnotice += '\nNote this is only applied during this session, permanent VIP list changes must be made to the list defined when starting the Gamebot. This list should also be saved to a separate document.'; for (var i = 0; i < cmdvalsplit.length; i++) { if (cmdvalsplit[i] != '') { nametoadd = cmdvalsplit[i].toLowerCase(); if (!cbjs.arrayContains(VIPListArray, nametoadd)) { addRmvVIP(nametoadd,'a'); addnotice += '\nAdded ' + nametoadd + ' to the Gamebot VIP list.'; cb.sendNotice(u + ' has added you to the Gamebot VIP list.', nametoadd, appNoticeColor); } else { addnotice += '\n' + nametoadd + ' is already on the Gamebot VIP list. Skipping.'; } } } addnotice += '\nAll users were added and notified.'; cb.sendNotice(addnotice, u, appNoticeColor); cb.sendNotice(u + ' has added multiple users to the Gamebot VIP list.\n' + 'Users added: ' + cbjs.arrayJoin(cmdvalsplit, ', '), '', appNoticeColor, '', 'normal', 'red'); } else { nametoadd = message[1].toLowerCase(); if (cbjs.arrayContains(VIPListArray,nametoadd)) { cb.sendNotice('Gamebot: ' + nametoadd + ' is already on the VIP list.', u, appNoticeColor); } else { addRmvVIP(nametoadd,'a'); cb.sendNotice('Gamebot: You have added ' + nametoadd + ' to the VIP list.\nNote this is only applied during this session, permanent VIP list changes must be made to the list defined when starting the Gamebot. This list should also be saved to a separate document.', u, appNoticeColor); cb.sendNotice('Gamebot: Congratulations! You have been added to the VIP list!', nametoadd, appNoticeColor); } } } else { cb.sendNotice('You did not specify what username you want to add to the Gamebot VIP list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/rmvvip': { cmd = 1; if(isBC) { if (message[1]) { nametormv = message[1].toLowerCase(); if (cbjs.arrayContains(VIPListArray,nametormv)) { addRmvVIP(nametormv,'r'); cb.sendNotice('Gamebot: You have removed ' + nametormv + ' from the VIP list.\nNote this is only applied during this session, permanent VIP list changes must be made to the list defined when starting the Gamebot. This list should also be saved to a separate document.', u, appNoticeColor); } else { cb.sendNotice('Gamebot: ' + nametormv + ' is not on the VIP list.', u, appNoticeColor); } } else { cb.sendNotice('Gamebot: You did not specify the username you want to remove from the VIP list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/viplist': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { cb.sendNotice('Users currently on the Gamebot VIP List: ' + VIPListArray.length + '\n' + (VIPListArray.length > 0 == true ? cbjs.arrayJoin(VIPListArray, ', ') : 'No users.') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } //******** External Fan Club Commands *********** case '/addfan': { cmd = 1; if (isBC) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { addnotice = 'Adding multiple users to the Gamebot External Fan Club list.'; addnotice += '\nNote this is only applied during this session, permanent External Fan Club list changes must be made to the list defined when starting the Gamebot. This list should also be saved to a separate document.'; for (var i = 0; i < cmdvalsplit.length; i++) { if (cmdvalsplit[i] != '') { nametoadd = cmdvalsplit[i].toLowerCase(); if (!cbjs.arrayContains(extFanListArray, nametoadd)) { addRmvExtFan(nametoadd,'a'); addnotice += '\nAdded ' + nametoadd + ' to the Gamebot External Fan Club list.'; cb.sendNotice(u + ' has added you to the Gamebot External Fan Club list.', nametoadd, appNoticeColor); } else { addnotice += '\n' + nametoadd + ' is already on the Gamebot External Fan Club list. Skipping.'; } } } addnotice += '\nAll users were added and notified.'; cb.sendNotice(addnotice, u, appNoticeColor); cb.sendNotice(u + ' has added multiple users to the Gamebot External Fan Club list.\n' + 'Users added: ' + cbjs.arrayJoin(cmdvalsplit, ', '), '', appNoticeColor, '', 'normal', 'red'); } else { nametoadd = message[1].toLowerCase(); if (cbjs.arrayContains(extFanListArray,nametoadd)) { cb.sendNotice('Gamebot: ' + nametoadd + ' is already on the External Fan Club list.', u, appNoticeColor); } else { addRmvExtFan(nametoadd,'a'); cb.sendNotice('Gamebot: You have added ' + nametoadd + ' to the External Fan Club list.\nNote this is only applied during this session, permanent VIP list changes must be made to the list defined when starting the Gamebot. This list should also be saved to a separate document.', u, appNoticeColor); cb.sendNotice('Gamebot: Congratulations! You have been added to the External Fan Club list!', nametoadd, appNoticeColor); } } } else { cb.sendNotice('You did not specify the username you want to add to the Gamebot External Fan Club list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/rmvfan': { cmd = 1; if (isBC) { nametormv = message[1].toLowerCase(); if (cbjs.arrayContains(extFanListArray,nametormv)) { addRmvExtFan(nametormv,'r'); cb.sendNotice('Gamebot: You have removed ' + nametormv + ' from the External Fan Club list.\nNote this is only applied during this session, permanent VIP list changes must be made to the list defined when starting the Gamebot. This list should also be saved to a separate document.', u, appNoticeColor); } else { cb.sendNotice('Gamebot: ' + nametormv + ' is not on the External Fan Club list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/fanlist': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { cb.sendNotice('Users currently in the Gamebot External Fan Club List: ' + extFanListArray.length + '\n' + (extFanListArray.length > 0 == true ? cbjs.arrayJoin(extFanListArray, ', ') : 'No users.') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } //******** Moderator List Commands *********** case '/addmod': { cmd = 1; if (isBC) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { addnotice = 'Adding multiple users to the Gamebot Moderator list.'; addnotice += '\nNote this is only applied during this session, permanent Moderator list changes must be made to the list defined when starting the Gamebot. This list should also be saved to a separate document.'; for (var i = 0; i < cmdvalsplit.length; i++) { if (cmdvalsplit[i] != '') { nametoadd = cmdvalsplit[i].toLowerCase(); if (!cbjs.arrayContains(moderatorList.name, nametoadd)) { populateModeratorArray(nametoadd,'botmod','a'); addnotice += '\nAdded ' + nametoadd + ' to the Gamebot Moderator list.'; cb.sendNotice(u + ' has added you to the Gamebot Moderator list. You now have all moderator privileges, you can view the full command list with the "/uahelp" command.', nametoadd, appNoticeColor); } else { addnotice += '\n' + nametoadd + ' is already on the Gamebot Moderator list. Skipping.'; } } } addnotice += '\nAll users were added and notified.'; cb.sendNotice(addnotice, u, appNoticeColor); cb.sendNotice(u + ' has added multiple users to the Gamebot Moderator list.\n' + 'Users added: ' + cbjs.arrayJoin(cmdvalsplit, ', '), '', appNoticeColor, '', 'normal', 'red'); } else { nametoadd = message[1].toLowerCase(); if (!cbjs.arrayContains(moderatorList.name,nametoadd)) { populateModeratorArray(nametoadd,'botmod','a'); cb.sendNotice('You have added ' + nametoadd + ' to the Gamebot moderator list.', u, appNoticeColor); cb.sendNotice('Note this is only applied during this session, permanent VIP list changes must be made to the list defined when starting the Gamebot. This list should also be saved to a separate document.', u, appNoticeColor); cb.sendNotice(u + ' has added you to the Gamebot moderator list. You now have all moderator privileges, you can view the full command list with the "/gbhelp" command.', nametoadd, appNoticeColor); } else { cb.sendNotice(nametoadd + ' is already on the Gamebot moderator list.', u, appNoticeColor); } } } else { cb.sendNotice('You did not specify the username you want to add to the Gamebot moderator list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/rmvmod': { cmd = 1; if (isBC) { if (message[1]) { nametormv = message[1].toLowerCase(); if (cbjs.arrayContains(moderatorList.name,nametormv)) { populateModeratorArray(nametormv,'botmod','r'); cb.sendNotice('You have removed ' + nametormv + ' from the Gamebot Moderator list.', u, appNoticeColor); } else { cb.sendNotice(nametormv + ' is not in the Gamebot Moderator list.', u, appNoticeColor); } } else { cb.sendNotice('Gamebot: A parameter is required for this command to specify the user to remove from the Gamebot Moderator list, such as "/rmvmod username".', u, appNoticeColor); } } else { cb.sendNotice('Gamebot: Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/modlist': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { message = ''; message += 'Users currently on the Gamebot Moderator List: '; if (moderatorList.name.length > 0) { for (var i = 0; i < moderatorList.name.length; i++) { message += '\n' + (i+1) + '. ' + moderatorList.name[i] + ' (' + moderatorList.type[i] + ')'; } } else { message += '\nNo moderators currently assigned.'; } message += '\nEnd of List'; cb.sendNotice(message, u, appNoticeColor); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } //********* Help Menu case '/gbhelp': { cmd = 1; if (isMod || isBC) { helpModBC(u); } else { helpCommon(u); } break; } //********* End of Expected commands } } return msg; }); } // *********************************** Actions on user entering ************************************** { cb.onEnter(function(user) { // Variables var onEnterUser = user.user; var onEnterIsMod = user.is_mod; var onEnterIsBC = (onEnterUser === cb.room_slug); var onEnterIsFan = user.in_fanclub; var onEnterIsExtFan = cbjs.arrayContains(extFanListArray,onEnterUser); var onEnterIsVIP = cbjs.arrayContains(VIPListArray,onEnterUser); onEnterIsBotMod = false; if (onEnterIsMod) { populateModeratorArray(onEnterUser,'cbmod','a'); } else { if (cbjs.arrayContains(moderatorList.name,onEnterUser)) { nameIndex = moderatorList.name.indexOf(onEnterUser); if (moderatorList.type[nameIndex] == 'botmod') { onEnterIsBotMod = true; onEnterIsMod = true; } } } // **** Dice Game Message if(diceToggle == 1) { diceShowNotice(onEnterUser); } // **** Wheel Spin Message if(wheelToggle == 1) { wheelShowNotice(onEnterUser); } // **** Keno Message if(kenoToggle == 1) { kenoShowNotice(onEnterUser); } // **** War Message if(warToggle == 1) { warShowNotice(onEnterUser); } // **** Press Your Luck Message if(pressToggle == 1) { pressShowNotice(onEnterUser); } // **** Random Prize Message if(randomToggle == 1) { randomShowNotice(onEnterUser); } // **** Bad Libs Message if(badToggle == 1) { badShowNotice(onEnterUser); } // **** Charades Message if(charadesToggle == 1) { charadesShowNotice(onEnterUser); } // **** Twenty Questions Message if(twentyToggle == 1) { twentyShowNotice(onEnterUser); } }); } // *********************************** Actions upon leaving ************************************** { cb.onLeave(function(user) { var onLeaveUser = user.user; }); } // *********************************** Actions upon tipping ************************************** { cb.onTip(function (tip) { var tipAmount = Number.parseInt(tip.amount, 10); var onTipUser = tip.from_user var onTipIsFan = tip.from_user_in_fanclub; var onTipIsExtFan = cbjs.arrayContains(extFanListArray,onTipUser); var onTipIsVIP = cbjs.arrayContains(VIPListArray,onTipUser); var tipNote = tip.message; var tipForGame = false; var onTipIsMod = tip.from_user_is_mod; onTipIsBotMod = false; if (onTipIsMod) { populateModeratorArray(onTipUser,'cbmod','a'); } else { if (cbjs.arrayContains(moderatorList.name,onTipUser)) { nameIndex = moderatorList.name.indexOf(onTipUser); if (moderatorList.type[nameIndex] == 'botmod') { onTipIsBotMod = true; onTipIsMod = true; } } } // ***** Perform Dice Roll Function if (diceToggle == 1) { if (diceRollPriceFans > 0 && (onTipIsFan || onTipIsExtFan)) { if (tipAmount >= diceRollPriceFans && (tipAmount / diceRollPriceFans <= diceMultiRolls) && (tipAmount % diceRollPriceFans == 0)) { var numberOfRolls = Math.floor(parseInt(tipAmount) / diceRollPriceFans); for (var i = 0; i < numberOfRolls; i++) { diceRoll(onTipUser); tipForGame = true; diceTotalTips += tipAmount; } } } else if (diceRollPriceVIP > 0 && onTipIsVIP) { if (tipAmount >= diceRollPriceVIP && (tipAmount / diceRollPriceVIP <= diceMultiRolls) && (tipAmount % diceRollPriceVIP == 0)) { var numberOfRolls = Math.floor(parseInt(tipAmount) / diceRollPriceVIP); for (var i = 0; i < numberOfRolls; i++) { diceRoll(onTipUser); tipForGame = true; diceTotalTips += tipAmount; } } } else if (diceRollPriceMods > 0 && onTipIsMod) { if (tipAmount >= diceRollPriceMods && (tipAmount / diceRollPriceMods <= diceMultiRolls) && (tipAmount % diceRollPriceMods == 0)) { var numberOfRolls = Math.floor(parseInt(tipAmount) / diceRollPriceMods); for (var i = 0; i < numberOfRolls; i++) { diceRoll(onTipUser); tipForGame = true; diceTotalTips += tipAmount; } } } else if (tipAmount >= diceRollPrice && (tipAmount / diceRollPrice <= diceMultiRolls) && (tipAmount % diceRollPrice == 0)) { var numberOfRolls = Math.floor(parseInt(tipAmount) / diceRollPrice); for (var i = 0; i < numberOfRolls; i++) { diceRoll(onTipUser); tipForGame = true; diceTotalTips += tipAmount; } } } // ***** Perform Wheel Spin Function if (wheelToggle == 1) { if (wheelSpinPriceFans > 0 && (onTipIsFan || onTipIsExtFan)) { if (tipAmount >= wheelSpinPriceFans && (tipAmount / wheelSpinPriceFans <= wheelMultiSpins) && (tipAmount % wheelSpinPriceFans == 0)) { var numberOfSpins = Math.floor(parseInt(tipAmount) / wheelSpinPriceFans); for (var i = 0; i < numberOfSpins; i++) { wheelSpin(onTipUser); tipForGame = true; wheelTotalTips += tipAmount; } } } else if (wheelSpinPriceVIP > 0 && onTipIsVIP) { if (tipAmount >= wheelSpinPriceVIP && (tipAmount / wheelSpinPriceVIP <= wheelMultiSpins) && (tipAmount % wheelSpinPriceVIP == 0)) { var numberOfSpins = Math.floor(parseInt(tipAmount) / wheelSpinPriceVIP); for (var i = 0; i < numberOfSpins; i++) { wheelSpin(onTipUser); tipForGame = true; wheelTotalTips += tipAmount; } } } else if (wheelSpinPriceMods > 0 && onTipIsMod) { if (tipAmount >= wheelSpinPriceMods && (tipAmount / wheelSpinPriceMods <= wheelMultiSpins) && (tipAmount % wheelSpinPriceMods == 0)) { var numberOfSpins = Math.floor(parseInt(tipAmount) / wheelSpinPriceMods); for (var i = 0; i < numberOfSpins; i++) { wheelSpin(onTipUser); tipForGame = true; wheelTotalTips += tipAmount; } } } else if (tipAmount >= wheelSpinPrice && (tipAmount / wheelSpinPrice <= wheelMultiSpins) && (tipAmount % wheelSpinPrice == 0)) { var numberOfSpins = Math.floor(parseInt(tipAmount) / wheelSpinPrice); for (var i = 0; i < numberOfSpins; i++) { wheelSpin(onTipUser); tipForGame = true; wheelTotalTips += tipAmount; } } } // ***** Perform Roulette Tip Function if (rouletteToggle == 1) { if (tipAmount >= rouletteShotPrice && (tipAmount / rouletteShotPrice <= rouletteMultiShots) && (tipAmount % rouletteShotPrice == 0)) { var numberOfShots = Math.floor(parseInt(tipAmount) / rouletteShotPrice); checkcycle = currentRouletteCycle; i = 0; do { rouletteShot(onTipUser); tipForGame = true; rouletteTotalTips += tipAmount; i++; } while (currentRouletteCycle == checkcycle && i < numberOfShots); } } // ***** Perform Keno Tip Function if (kenoToggle == 1) { if (!cbjs.arrayContains(kenoTipCountArray.name,onTipUser)) { kenoTipCountArray.name.push(onTipUser); kenoTipCountArray.amount.push(tipAmount); } else { kenoTipCountArray.amount[findTipper(onTipUser)] += tipAmount; } if (cbjs.arrayContains(kenoNumbers,tipAmount)) { kenoTip(tipAmount,onTipUser,'tip'); tipForGame = true; kenoTotalTips += tipAmount; } else if (cb.settings.kenoGroupTipping == 'Yes') { kenoGroupTip(tipAmount,onTipUser); tipForGame = true; kenoTotalTips += tipAmount; } } // ***** Press Your Luck Tip Function if (pressToggle == 1) { if (tipAmount == pressPrice) { pressTip(onTipUser,'tip'); tipForGame = true; pressTotalTips += tipAmount; } } // ***** War Game Tip Function if (warToggle == 1) { fromnext = false; if (tipAmount == warPrices[0]) { warTip(onTipUser,1,fromnext); tipForGame = true; warTotalTips += tipAmount; } else if (tipAmount == warPrices[1]) { warTip(onTipUser,2,fromnext); tipForGame = true; warTotalTips += tipAmount; } else if (tipAmount == warPrices[2]) { warTip(onTipUser,3,fromnext); tipForGame = true; warTotalTips += tipAmount; } else if (tipAmount == warPrices[3]) { warTip(onTipUser,4,fromnext); tipForGame = true; warTotalTips += tipAmount; } else if (tipAmount == warPrices[4]) { warTip(onTipUser,5,fromnext); tipForGame = true; warTotalTips += tipAmount; } } // ***** Random Prize Tip Function if (randomToggle == 1) { // if (!cbjs.arrayContains(randomExcludeArray,tipAmount) && tipAmount >= randomLowTipAmount) { if (tipAmount >= randomLowTipAmount) { checkRandom(onTipUser,tipAmount); } } // ***** Bad Libs Game Tip Function if (badToggle == 1 && tipAmount == badPrice) { badTip(onTipUser); tipForGame = true; } // ***** Charades Game Tip Function if (charadesToggle == 1) { if (tipAmount == charadesPrice) { charadesPlay('tip',onTipUser,false); tipForGame = true; } } // ***** Twenty Questions Tip Function if (twentyToggle == 1 && tipAmount == twentyPrice) { if (tipNote != '' && tipNote != null) { twentyPlay(onTipUser,tipNote); tipForGame = true; } else { cb.sendNotice('Thank you for tipping. You tipped the right amount to play Twenty Questions but did not include a question in your tip note.', onTipUser, twentyNoticeBgColor, twentyNoticeTextColor, 'bold'); } } // ***** Total Gamebot Tips Function if (tipForGame == true) { totalTips += tipAmount; } }); } // *********************************** Initialize ************************************** { if (initialize == 0) { cb.sendNotice(' :DorothysGamebot v1.18'); cb.sendNotice('** Version 1.18 was released on 1/23/2020. Please see the change log at the bottom of the bot description page for a list of added features in the current release.\nThe Twenty Questions game has been added in this Release!', cb.room_slug, appNoticeColor); // *** Init Features using toggle functions if (cb.settings.bctext != '' && cb.settings.bctext != null) { bctext = cb.settings.bctext; } else { bctext = 'The Broadcaster'; } if (cb.settings.diceEnable == 'Yes') { setDiceToggle('on',cb.room_slug); } if (cb.settings.wheelEnable == 'Yes') { setWheelToggle('on',cb.room_slug); } if (cb.settings.kenoSkipNumbers != '' && cb.settings.kenoSkipNumbers != null) { var n = cb.settings.kenoSkipNumbers; kenoSkipNumbersArray = n.split(','); for (var i = 0; i < kenoSkipNumbersArray.length; i++) { kenoSkipNumbersArray[i] = parseInt(kenoSkipNumbersArray[i]); if (isNaN(kenoSkipNumbersArray[i])) { kenoSkipNumbersArray.splice(i,1); } } } if (cb.settings.kenoEnable == 'Yes') { setKenoToggle('on',cb.room_slug); } if (cb.settings.warEnable == 'Yes') { setWarToggle('on',cb.room_slug); } if (cb.settings.pressEnable == 'Yes') { setPressToggle('on',cb.room_slug); } if (cb.settings.rouletteEnable == 'Yes') { rouletteSetToggle('on',cb.room_slug); } if (cb.settings.randomEnable == 'Yes') { randomSetToggle('on',cb.room_slug); } if (cb.settings.badEnable == 'Yes') { setBadLibsToggle('on',cb.room_slug); } if (cb.settings.charadesMode == 'Mode 1 - Broadcaster against Broadcaster') { charadesMode = 'M1'; charadesPrice = cb.settings.charadesBABPrice; } else if (cb.settings.charadesMode == 'Mode 2 - Viewer against Room (One Game)') { charadesMode = 'M2'; charadesPrice = cb.settings.charadesVARPrice; } else if (cb.settings.charadesMode == 'Mode 3 - Viewer against Room (Goal Race)') { charadesMode = 'M3'; charadesPrice = cb.settings.charadesVAR2Price; } if (cb.settings.charadesEnable == 'Yes') { charadesSetToggle('on',cb.room_slug); } if (cb.settings.twentyEnable == 'Yes') { twentySetToggle('on',cb.room_slug); } // *** Fill Arrays from provided Lists if (cb.settings.extFanList != '' && cb.settings.extFanList != null) { var n = cb.settings.extFanList.toLowerCase(); extFanListArray = n.split(','); } if (cb.settings.VIPList != '' && cb.settings.VIPList != null) { var n = cb.settings.VIPList.toLowerCase(); VIPListArray = n.split(','); } if (cb.settings.botModList != '' && cb.settings.botModList != null) { var n = cb.settings.botModList.toLowerCase(); botModListArray = n.split(','); for (var i = 0; i < botModListArray.length; i++) { populateModeratorArray(botModListArray[i],'botmod','a'); } } populateModeratorArray(cb.room_slug,'broadcaster','a'); gamebotStartTime = new Date(); initialize = 1; } }
© Copyright Sisiva.Com 2011- 2024. All Rights Reserved.