Apps Home
|
Create an App
Meu Teste
Author:
master_show
Description
Source Code
Launch App
Current Users
Created by:
Master_Show
/** Name: Dorothy's UltraApp Author: chelsea2950 Created 01/27/2019 This app is intended to provide cammers with many of the most common features from Apps in one place, specifically goals and ticket shows. It does not, however, include things that I would expect to be managed by Dorothy's Ultra Fembot or other UltraBot, such as chat control and tracking tip leaders, etc. This app is also intended to be transparent and not automatically add people to your modlist and ticket show lists and give other special rights without permission. The source for this app will always remain open and unobfuscated. **/ // prototype functions { String.prototype.capitalize = function() { return this.charAt(0).toUpperCase() + this.slice(1); } } { var appVersion = 'Show1'; //var appVersion = 'Show2'; var dummycounter = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46' ]; var backgroundArray = { menu: ['Cube Wave', 'Hearts', 'Blue Floral', 'Aquarium', 'Snakeskin', 'Pastels', 'Clouds', 'Lava Lamp', 'Light Blue', 'Moon', 'personalized - CumCreamery', 'personalized - Liv n Drew', 'Blue Bars', 'Valentines Pink Bars', 'Valentines 2 Hearts', 'Green and Blue Bars', 'Pink and Blue Bars', 'Green and Green Bars', 'Green and Yellow Bars', 'Purple and Pink Bars', 'Aqua and Pink Bars', 'Pink and Pink Bars', 'Yellow and Yellow Bars', 'Christmas - Silver snowflakes', 'personalized - SweetHornyDreams', 'Christmas Lights', 'Christmas - Green background', 'Christmas - Blue and Silver', 'Pink Smoke', 'Halloween - spooky pumpkins', 'Halloween - bouncing pumpkin', 'Halloween - Red sky lightning', 'Halloween - orange sky bats', 'Halloween - blue sky bats', 'Halloween - graveyard', 'Halloween - blue with ghosts', 'Halloween - red paper with webs', 'Christmas - BW Snowflakes', 'Christmas - Blue Snowflakes', 'Christmas - Snowflake border', 'Christmas - Red with snow', 'Christmas - Red Santa and snowman', 'Christmas - Wrapping Paper', 'Christmas - Classic', 'Pastel Aqua Stars', 'Black Leather Texture', 'personalized - Batmansuperhero' ], command: ['cubewave', 'hearts', 'bluefloral', 'aquarium', 'snakeskin', 'pastels', 'clouds', 'lavalamp', 'lightblue', 'moon', 'cumcreamery', 'livanddrew', 'bluegradient', 'valentines1', 'valentines2', 'greenblue', 'pinkblue', 'greengreen', 'greenyellow', 'purplepink', 'aquapink', 'pinkpink', 'yellowyellow', 'christmas1silversnowflakes', 'sweethornydreams', 'christmas2lights', 'christmas3green', 'christmas4blue', 'pinksmoke', 'halloween1', 'halloween2', 'halloween3', 'halloween4', 'halloween5', 'halloween6', 'halloween7', 'halloween8', 'christmas4bw', 'christmas5bluesnowflakes', 'christmas6snowflakesborder', 'christmas7red1', 'christmas8red2', 'christmas9wrap', 'christmas10classic', 'pastelaqua', 'blackleather', 'batmansuperhero' ], devfile: ['17606e52-2215-403d-b052-46a936ca9f92','add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', '3f73f647-504a-4f9a-8e64-86cc89890955', 'add', 'add', 'add', 'add', 'add', 'add', 'ca7b4f10-9623-4db8-8f84-70153dc60f61', 'add', 'add', 'add', 'add', 'add', 'add', 'f2f943be-e7a6-4149-b20c-647b934f2404', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add', 'add' ], livefile: ['9478eff1-b042-4d33-ad91-f8427b98cad8','18994a59-8a72-44c4-ba3b-ab9e835460b8', 'f9eaf1a2-9530-428e-8c58-1b00bf9e9357', 'e2632788-9b57-48b3-8b63-1880c39efa0d', '80a94656-e4b5-4217-adf3-5a7386dc4023', '8c0b2b81-cb3e-4fb7-9ae3-4f2656c90e4d', 'b3dcdf85-a351-4f50-a686-5a553657981f', '8da93470-9c6a-47c4-83e6-858907d4f84d', '2311527c-85cb-44a0-87d9-adc3097b53d8', '1b53854d-dd02-4e7e-a9cb-fd0e38255cf1', '87983935-461f-418b-a140-36b790fb1bcf', '51864982-fa61-466f-9de6-367461031eb9', 'a0ad9443-e8df-4286-9f95-ea5f51931b9f', 'f228e2e6-8d58-49f4-b9a4-4662de7290c0', '2a63550e-d6f8-4182-bf35-3a61b24067e5', '1a3e852f-8c39-4c0c-8365-ae7ad8c8ac29', '30182874-b8c9-4004-a145-7ed60f6bfedd', '8e5604f6-5552-4447-a43b-54b97b15f05d', '9817f86f-e3c1-4a1e-b4d7-c06da8fc5639', 'a4e5a8e1-4756-419b-8459-fa971558ebab', 'b12c143a-2ea8-488c-9345-854a36cdd8a3', 'cf4dd491-0f33-4c07-8d22-adec552bc1c9', 'f82bd0a1-5923-401a-bece-6becf546053e', 'a9734d8e-c14d-42ad-a050-a8707dd8b228', 'a23544a6-e5a7-486b-8a59-298ece086987', 'a103491f-8017-4b85-b35c-4f746f13f5d4', 'b9253bf7-d70d-449e-8215-d515d239c42d', '893574c9-64f8-4e26-9747-ff9876f6d266', 'acc9b554-c110-44f8-91f7-1ad0a52466cf', '17361a63-0d94-417a-8337-bdfd2f2f6fee', 'a5110b60-f189-419a-beb9-f4d2a92ac0a1', '70bdd188-e3e4-4571-81f2-8c90eb63b126', '0b2d410c-2e20-41a4-bf39-3af8ac50221b', 'd7b0b19b-e5dc-4eac-8456-b3b1d96a2148', '69b4126f-0455-4a62-b1c4-4e579fbdf52f', '2b10c454-e41e-4718-a80c-2322e9868919', 'a7499e58-3e85-4592-96a6-853f9cccf926', '69888621-3e88-47ac-aa16-2036ec450ee9', '1a008fef-95d1-4ed1-90a7-e440576b73b6', '77b6cd5b-19fe-4dc7-bf3e-4d1d95b205ff', '3d3cd33d-07cb-4535-aca0-a614821c67c2', '47c285d5-e67c-475e-98e6-11570d2aa45c', '355c31d9-6da6-4823-bc68-d08ad20fc656', '2d8b360d-2d6b-47f4-af5a-c52b63576623', '116a887f-5ff6-4620-898e-6e87c268579a', '46c37397-4a07-4d17-b783-dbb6ec53b4ac', '357665d8-b76a-4fa0-a49c-ac85c33982ad' ], livefile2: ['958ee720-4d90-48dc-b436-a3af31e139f4','4756f264-2e25-4a62-be6b-067cc20db7e2', '0b0ddbe5-ba0d-492f-96fa-c46cea3512ee', '5420ef5d-f232-4c2b-b8bf-0aade352d924', '3eef9d45-be81-4ed4-92bc-32ac896be906', 'cbae9a73-11c1-4780-939c-438e921640de', '0589d760-9797-4d8b-b649-f57cfef9cb62', 'f04f2c01-7e00-48e7-b45a-bc4e21b4659d', 'fa347bfa-1da1-4c6c-b047-ef1026513ca1', 'd4832372-2b4c-4a17-9ca4-7832e2c4572e', 'a89a2849-ee3f-4027-8ed8-1e87d17778bc', '3dfe588d-6b3b-4059-96b2-c5b1da9ecb9b', '1849c10d-8ffc-4058-87d8-b6236e659804', 'b3ec41d2-4d7d-470b-ac85-aa1a5a4d0468', '4411987e-2547-4d0b-8e3d-0633944b6735', '5c123d54-fe96-4734-9ff6-5bf01ba705f2', 'ba4a2483-0850-4d74-a04b-9a1416cf92c9', 'fb4dfb9d-6153-4c39-ac43-480b3c0ecfa2', '2971a31c-b27f-49d3-8903-e11b27303131', '3d702f1c-f111-463b-89a9-38034c74ee50', '9b97c7ee-8193-48d6-b7e9-476813c87ccd', 'b245ae63-593a-4ab8-b66a-095a8ffb26a8', 'd6a33adf-033c-47d8-bb08-8200db361f7c', 'd837bc37-0365-4052-8c0c-d24e2a3e1ba9', '56cb4eb3-da12-43f6-b24e-48b4dcc7b893', 'e5f491d2-9048-40d9-86b5-0b805dc623a2', '9ed6ab77-fd05-41d2-b54b-2f81462d8591', '50ae4d02-3cf0-4e43-ae41-06bc9d973480', 'c4b304d3-04e4-4fcc-ac70-dd493586bd83', '491fe3b8-64b0-4655-814a-862e941d23db', 'd93fee75-9e90-4378-9b46-d5f2311e61ae', '104f314b-690f-4ff8-a5fd-4a01b82ddb0d', '18c841c1-2aba-48a5-8b48-28e6007542e8', '13da365c-6f14-4ea2-a676-0c598065468f', 'ff58b9d0-957c-46d6-969e-0e4f9a563ab8', '0c3b0b2c-854e-4ff0-88ea-ffb9a3e9cead', '403e2ead-4804-4430-8653-39e4a217fa43', '1e5c8f99-2bec-4b1e-abcf-4ad49e3d1f50', 'b4c879ef-0b33-4491-9d9e-c54fe06e3c54', 'd1eee134-5e13-409d-b600-1feef2e8196d', '56409438-827b-46cf-ae9a-c987789074b5', '76e9adfc-8b62-4de9-ac2c-77dc58b37b3a', '369659f9-93fa-40c5-a92d-f2b1bc1b1b0d', 'e6371053-6fef-41b5-80d0-8482107a2755', '51feda0b-0968-469d-9b22-0dbf1a98a7fe', '7696cce8-a2d2-495e-b91f-abc19b71417d', 'bfdb4283-7b9f-4046-ab29-1191b5190e08' ] }; var customPanel = false; } {cb.settings_choices = [ {name: 'intro', label: '******************* INTRODUCTION ********************* Latest Updt: 1/4/2020 (version 2.14) See Change Log ********************************************************* Welcome to Dorothy\'s Ultra App, if this is your first time using the App, the main thing you are choosing is which feature to start with, and then setting up the defaults for that section. Since Apps control the draw panel below the video window, only one app feature can be active at a time. Other features can be set up in future shows or turned on during the show by you or your moderator. Moderators are given significant privileges by this App, so please make sure you assign moderators you can trust. I have defined default settings using prices that I find to be common, but please update these per your preference, the defaults are only suggestions! Also, you can see the full list of commands for the App by typing "/uahelp" in the chat (no quotes), and then also see more detailed help by section. It is expected that you would be using an Ultrabot such as Dorothy\'s Ultra Fembot alongside this for features such as Chat Control and Tipper Count/Leader features. Please enjoy using the Ultra App 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: '---------------------------------------------------------------------------------- PART 1: GENERAL SETUP ---------------------------------------------------------------------------------- Please make a choice below for which App feature you will start the show with. For each feature, there is a Config section below where you will define the App startup defaults, and some settings can be changed on the fly during the show. Also, certain features do well in certain scenarios based on the number of people in the room, quick or slow nights, etc - there is more info in my bio on show strategy based on what I\'ve seen work well (chaturbate.com/chelsea2950). Note that if planning a ticket show, it is very common and advisable to start the show with goals, and switch to the ticket show once the room has enough people to make ticket sales successful (usually at least 1000-1500 viewers)', type: 'choice',required: false}, {name: 'whichApp', label: '1A. Which Goal Type / Show Type would you like to begin the show with? See App description page for more details on each goal type', type: 'choice', choice1: 'Single/Progressive Goals', choice2: 'Goal Counter', choice3: 'Asc/Desc Tip Sequence Goals', choice4: 'Tip Jar', choice5: 'UltraApp Ticket Show', choice6: 'Goal Race', choice7: 'Spank-a-thon', choice8: 'Peep Show', choice9: 'Auto-Reset Goal', choice10: 'None', defaultValue: 'Single/Progressive Goals'}, {name: 'enableEntryMessage', label: '1B. Announcement? -- Display a notification to users when they enter?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'entryMessage', label: '1C. Announcement Text -- Enter the message to display. A note regarding the current App Feature running will be appended to this message so you do not need to restate that', type: 'str',required: false, minLength: 1, maxLength: 1000, defaultValue: 'Welcome! Dorothys Ultra App is running.'}, {name: 'allowModsAuthority', label: '1D. Mod Command Authority -- Allow moderators to have authority to broadcaster commands across all App Features? Note there are separate controls later for ticket show additions and price changes. It is usually ok to give moderators general authority with this setting, however they will have authority to perform actions such as manually adding tips to goals, start and ending ticket shows, and changing goal thresholds', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'allowModsStats', label: '1E. Mod Stats Authority -- Allow moderators to use the "/stats" command to see current show time online and tip totals', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'extFanList', label: '1F1. External FanClub 1 List -- Enter the names of any External Fan Club 1 members you would like to grant special privileges, such as free or reduced prices to ticket shows. User names should be separated by a comma with no spaces', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'EFCname', label: '1F2. External FanClub 1 Name -- Enter the name of the External Fan Club 1 if you have a personalized one. Default is "External Fan Club" if you do not enter one.', type: 'str', minLength: 1, maxLength: 50, required: false}, {name: 'extFanList2', label: '1G1. External FanClub 2 List -- Enter the names of any External Fan Club 2 members you would like to grant special privileges, such as free or reduced prices to ticket shows. User names should be separated by a comma with no spaces', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'EFCname2', label: '1G2. External FanClub 2 Name -- Enter the name of the External Fan Club 2 if you have a personalized one. Default is "External Fan Club 2" if you do not enter one.', type: 'str', minLength: 1, maxLength: 50, required: false}, {name: 'VIPList', label: '1H. VIP List -- Enter the names of any VIP List users you would like to grant special privileges, such as free or reduced prices to ticket shows. User names should be separated by a comma with no spaces', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'VIPname', label: '1J. VIP List Name -- Enter the name of the VIP List if you have a personalized one. Default is "VIP List" if you do not enter one.', type: 'str', minLength: 1, maxLength: 50, required: false}, {name: 'botModList', label: '1K. App 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: 'bctext', label: '1L. Display Name -- Replace the general term "broadcaster" and in some cases the room name with the name of your choosing (the name you would like to be called, couples name, etc) wherever it appears in chat notices. Leave blank to just use "The Broadcaster".', type: 'str',required: false, minLength: 1, maxLength: 50}, {name: 'showTotals', label: '1M. Total Tips -- Show the total tips so far for the current app in the draw panel?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'fembotRunning', label: '1N. Command Error App or Bot -- Are you using Dorothy\'s Fembot alongside the Ultra App? If not, you should be! :) This setting is used to suppress error messages from the UltraApp for invalid commands as it is expected the Fembot will handle errors (so you don\'t get the same error twice)', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'genericRoomSubjectSfx', label: '1P. General Room Title Text -- Enter any show description text or hashtags you would like appended to the goal or ticket show specific descriptions from each section below. This part of the room title will be used across all show types below and follow the goal specific ones. Keep in mind you haev a total of 200 characters between the hardcoded text for each show type, the show specific text, and the general text defined here.', type: 'str',required: false, minLength: 1, maxLength: 125}, {name: 'genericRoomSubjectPosn', label: '1Q. Title Text Position -- Show the General Room Title Text at the beginning or end of the room title. Default value is "End" and room title format is: [Hardcoded App/Goal Text] + [App/Goal Specific Configurable Text] + [General Room Title Text]. If this value is changed to "Beginning", the format will be: [General Room Title Text] + [Hardcoded App/Goal Text] + [App/Goal Specific Configurable Text] ', type: 'choice', choice1: 'Beginning', choice2: 'End', defaultValue: 'End'}, {name: 'panelBackground', label: '1R. Background Panel Graphic -- Which background panel type would you like to display? Note you cannot use the personalized background unless they are for your room, it will use the default if they are selected', type: 'choice', choice1: 'default - no image', choice2: backgroundArray.menu[0], choice3: backgroundArray.menu[1], choice4: backgroundArray.menu[2], choice5: backgroundArray.menu[3], choice6: backgroundArray.menu[4], choice7: backgroundArray.menu[5], choice8: backgroundArray.menu[6], choice9: backgroundArray.menu[7], choice10: backgroundArray.menu[8], choice11: backgroundArray.menu[9], choice12: backgroundArray.menu[10], choice13: backgroundArray.menu[11], choice14: backgroundArray.menu[12], choice15: backgroundArray.menu[13], choice16: backgroundArray.menu[14], choice17: backgroundArray.menu[15], choice18: backgroundArray.menu[16], choice19: backgroundArray.menu[17], choice20: backgroundArray.menu[18], choice21: backgroundArray.menu[19], choice22: backgroundArray.menu[20], choice23: backgroundArray.menu[21], choice24: backgroundArray.menu[22], choice25: backgroundArray.menu[23], choice26: backgroundArray.menu[24], choice27: backgroundArray.menu[25], choice28: backgroundArray.menu[26], choice29: backgroundArray.menu[27], choice30: backgroundArray.menu[28], choice31: backgroundArray.menu[29], choice32: backgroundArray.menu[30], choice33: backgroundArray.menu[31], choice34: backgroundArray.menu[32], choice35: backgroundArray.menu[33], choice36: backgroundArray.menu[34], choice37: backgroundArray.menu[35], choice38: backgroundArray.menu[36], choice39: backgroundArray.menu[37], choice40: backgroundArray.menu[38], choice41: backgroundArray.menu[39], choice42: backgroundArray.menu[40], choice43: backgroundArray.menu[41], choice44: backgroundArray.menu[42], choice45: backgroundArray.menu[43], choice46: backgroundArray.menu[44], choice47: backgroundArray.menu[45], choice48: backgroundArray.menu[46], defaultValue: backgroundArray.menu[0]}, {name: 'panelTextColor', label: '1S. Panel Text Color -- Text color for the panel text',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: 'panelCustomTextColor', label: '1T. Panel Text Custom Color -- 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: 'noAppRunningDisplay', label: '1U. No App Running Display -- If the configured App Feature could not be started due to invalid settings, should the panel show the "No App Running" message, or the highest and last tipper stats?', type: 'choice', choice1: 'No App Running', choice2: 'Tipper Stats', defaultValue: 'No App Running'}, // *** Single or Progressive Goals {name: 'progressivegoals', label: '---------------------------------------------------------------------------------- PART 2: SINGLE OR PROGRESSIVE GOALS ---------------------------------------------------------------------------------- You can set up a Single goal or multiple goals. Each goal amount is specific to that goal, it is not the cumulative total. Please clear out the descriptions and amounts for the goals that are not being used. If doing a single goal, you can recycle the goal multiple times using the "/restartgoal" command', type: 'choice',required: false}, {name: 'progressiveRoomSubjectSfx', label: '2A. Title? -- Enter any show description text or hashtags you would like appended to the individual goal descriptions shown in the room title', type: 'str',required: false, minLength: 1, maxLength: 125, defaultValue: 'Sex Show at Final Goal #couple #goals'}, {name: 'progressiveAutoNext', label: '2B. Auto-start next goal? -- Once the current goal is reached, automatically start next goal, or require manual start of a goal with the "/next" command? Note that with manual start, tips that exceed the current goal are not counted toward the next goal. With auto-start, the excess amount is rolled over to the next goal.', type: 'choice', choice1: 'Auto-start next', choice2: 'Manually start next', defaultValue: 'Auto-start next'}, {name: 'progressiveUpDown', label: '2C. Count Up or Count Down -- Choose if you want to count up from zero to each goal, or count down from the goal amount to zero', type: 'choice', choice1: 'Count Up To Goal', choice2: 'Count Down To Zero', defaultValue: 'Count Up To Goal'}, {name: 'progressiveGoalDescription1', label: 'Goal #1 Description', type: 'str',required: false, minLength: 1, maxLength: 100, defaultValue: 'Goal #1 Name'}, {name: 'progressiveGoalAmount1', label: 'Goal #1 amount', type: 'int',required: false, minValue: 1, maxValue: 100000, defaultValue: 500}, {name: 'progressiveGoalDescription2', label: 'Goal #2 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount2', label: 'Goal #2 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription3', label: 'Goal #3 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount3', label: 'Goal #3 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription4', label: 'Goal #4 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount4', label: 'Goal #4 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription5', label: 'Goal #5 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount5', label: 'Goal #5 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription6', label: 'Goal #6 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount6', label: 'Goal #6 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription7', label: 'Goal #7 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount7', label: 'Goal #7 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription8', label: 'Goal #8 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount8', label: 'Goal #8 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription9', label: 'Goal #9 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount9', label: 'Goal #9 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription10', label: 'Goal #10 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount10', label: 'Goal #10 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription11', label: 'Goal #11 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount11', label: 'Goal #11 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription12', label: 'Goal #12 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount12', label: 'Goal #12 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription13', label: 'Goal #13 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount13', label: 'Goal #13 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription14', label: 'Goal #14 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount14', label: 'Goal #14 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription15', label: 'Goal #15 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount15', label: 'Goal #15 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription16', label: 'Goal #16 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount16', label: 'Goal #16 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription17', label: 'Goal #17 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount17', label: 'Goal #17 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription18', label: 'Goal #18 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount18', label: 'Goal #18 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription19', label: 'Goal #19 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount19', label: 'Goal #19 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalDescription20', label: 'Goal #20 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'progressiveGoalAmount20', label: 'Goal #20 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'progressiveGoalNoticeInterval', label: '2D. Notice Interval -- Time interval for displaying the Remaining Goals recurring 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. Set to 0 to not use the notice.',required: false,type: 'str',defaultValue: 0}, {name: 'progressiveGoalTextColor', label: '2E. Notice Text Color -- Text color for chat notices related to the Progressive Goal App',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: 'progressiveGoalCustomTextColor', label: '2F. Notice Custom Text Color -- 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: 'progressiveGoalBgColor', label: '2G. Notice Background Color -- Background/Highlight color for chat notices related to the Progressive Goal App', 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 Green'}, {name: 'progressiveGoalCustomBgColor', label: '2H. Notice Custom Background Color -- 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}, // *** Goal Counter {name: 'goalcounter', label: '---------------------------------------------------------------------------------- PART 3: GOAL COUNTER ---------------------------------------------------------------------------------- With this Feature, smaller goals are set, and prizes are performed at each number of goals met, such as top off at 5 goals, bottoms off at 10 goals, etc. Only fill in the label and goal threshold for the prizes you would like to use and leave the rest blank. Note that the prize thresholds are the total number of goals, and not the incremental number of goals.', type: 'choice',required: false}, {name: 'goalcounterRoomSubjectSfx', label: '3A. Title? -- Enter any show description text or hashtags you would like appended to the list of individual goal thresholds that shown by default in the room title', type: 'str',required: false, minLength: 1, maxLength: 125, defaultValue: 'Sex Show at Final Goal #couple #goals'}, {name: 'goalcounterPerGoalAmount', label: '3B. Individual goal amount', type: 'int',required: false, minValue: 1, maxValue: 10000, defaultValue: 99}, {name: 'goalcounterGoalDescription1', label: 'Prize Description #1', type: 'str',required: false, minLength: 1, maxLength: 100, defaultValue: 'Prize #1 Name'}, {name: 'goalcounterGoalAmount1', label: 'Prize Threshold #1 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000, defaultValue: 5}, {name: 'goalcounterGoalDescription2', label: 'Prize Description #2', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount2', label: 'Prize Threshold #2 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription3', label: 'Prize Description #3', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount3', label: 'Prize Threshold #3 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription4', label: 'Prize Description #4', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount4', label: 'Prize Threshold #4 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription5', label: 'Prize Description #5', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount5', label: 'Prize Threshold #5 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription6', label: 'Prize Description #6', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount6', label: 'Prize Threshold #6 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription7', label: 'Prize Description #7', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount7', label: 'Prize Threshold #7 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription8', label: 'Prize Description #8', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount8', label: 'Prize Threshold #8 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription9', label: 'Prize Description #9', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount9', label: 'Prize Threshold #9 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription10', label: 'Prize Description #10', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount10', label: 'Prize Threshold #10 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription11', label: 'Prize Description #11', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount11', label: 'Prize Threshold #11 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription12', label: 'Prize Description #12', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount12', label: 'Prize Threshold #12 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription13', label: 'Prize Description #13', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount13', label: 'Prize Threshold #13 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription14', label: 'Prize Description #14', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount14', label: 'Prize Threshold #14 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterGoalDescription15', label: 'Prize Description #15', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'goalcounterGoalAmount15', label: 'Prize Threshold #15 - Cumulative Total Number of Goals', type: 'int',required: false, minValue: 1, maxValue: 1000}, {name: 'goalcounterNoticeInterval', label: '3C. Notice Interval -- Time interval for displaying the Ticket Show Price Notice and tip menu 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.',required: false,type: 'str',defaultValue: 0}, {name: 'goalcounterTextColor', label: '3D. Notice Text Color -- Text color for chat notices related to the Goal Counter App',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: 'goalcounterCustomTextColor', label: '3E. Notice Custom Text Color -- 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: 'goalcounterBgColor', label: '3F. Notice Background Color -- Background/Highlight color for chat notices related to the Goal Counter App', 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: 'goalcounterCustomBgColor', label: '3G. Notice Custom Background Color -- 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}, // *** Ascending/Descending Tip Sequence Goals {name: 'tipsequence', label: '---------------------------------------------------------------------------------- PART 4: TIP SEQUENCE GOALS ---------------------------------------------------------------------------------- With this Feature, users tip the next amount in a sequence that counts up or down through your configured range, toward a Final Prize at the end of the range. Intermediate prizes can be performed at intervals, such as (if counting up) top off at 20, bottoms off at 30, etc., or you can just have a single goal at the end. The room title will automatically show the thresholds you configure for prizes. For reference, here are the total number of tips for several common sequence ranges: from 1-10=55, 1-20=210, 1-30=465, 1-40=820, 1-50=1275, 1-60=1830, 1-70=2485, 1-80=3240, 1-90=4095, 1-100=5050', type: 'choice',required: false}, {name: 'tipsequenceRoomSubjectSfx', label: '4A. Title? -- Description of the show or end goal to appear as part of the room title (optional). Enter any text or hashtags you would like appended to the list of individual sequence thresholds that will be shown in the room title. The end goal can either be stated here or in a sequence goal entry below for the last sequence to be used', type: 'str',required: false, minLength: 1, maxLength: 125, defaultValue: 'Help us hit the goal! #couple #goals'}, {name: 'tipsequenceDirection', label: '4B. Use Ascending sequence (count up) or Descending sequence (count down). Typically counting down makes the tipping go faster near the end', type: 'choice', choice1: 'Ascending', choice2: 'Descending', defaultValue: 'Ascending'}, {name: 'tipsequenceLowNumber', label: '4C. Set the value used for the low end of your sequence range, which will be the start of the count when counting up, or end when counting down (this is typically 1 for ascending sequence)', type: 'int',required: false, minValue: 1, maxValue: 200, defaultValue: 1}, {name: 'tipsequenceHighNumber', label: '4D. Set the value used for the high end of your sequence range, which will be the end of the count when counting up, or start when counting down (this is typically a value that makes the total equate to what you want to make by the final goal - see reference table above)', type: 'int',required: false, minValue: 1, maxValue: 200, defaultValue: 50}, {name: 'tipsequenceGroupTips', label: '4E. Allow Group Tipping of the next number, where any tip counts toward the next value (faster), or only count tips of at least the next sequence number amount toward the goal (slower)', type: 'choice', choice1: 'Group Tipping', choice2: 'Exact Amount or Greater', defaultValue: 'Group Tipping'}, {name: 'tipsequenceChatMsg', label: '4F. Show a message in the chat each time a sequence number is tipped or surpassed?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'tipsequenceShowTotal', label: '4G. Show the total goal for the sequence range in the draw panel?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'tipsequenceGoalDescription1', label: 'Prize #1 - Description', type: 'str',required: false, minLength: 1, maxLength: 100, defaultValue: 'Prize #1 Name'}, {name: 'tipsequenceGoalAmount1', label: 'Prize #1 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200, defaultValue: 20}, {name: 'tipsequenceGoalDescription2', label: 'Prize #2 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount2', label: 'Prize #2 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceGoalDescription3', label: 'Prize #3 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount3', label: 'Prize #3 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceGoalDescription4', label: 'Prize #4 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount4', label: 'Prize #4 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceGoalDescription5', label: 'Prize #5 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount5', label: 'Prize #5 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceGoalDescription6', label: 'Prize #6 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount6', label: 'Prize #6 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceGoalDescription7', label: 'Prize #7 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount7', label: 'Prize #7 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceGoalDescription8', label: 'Prize #8 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount8', label: 'Prize #8 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceGoalDescription9', label: 'Prize #9 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount9', label: 'Prize #9 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceGoalDescription10', label: 'Prize #10 - Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipsequenceGoalAmount10', label: 'Prize #10 at Tip Sequence of', type: 'int',required: false, minValue: 1, maxValue: 200}, {name: 'tipsequenceTextColor', label: '4H. Text color for chat notices related to the Tip Sequence App',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 Pink'}, {name: 'tipsequenceCustomTextColor', label: '4J. 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: 'tipsequenceBgColor', label: '4K. Background/Highlight color for chat notices related to the Tip Sequence App', 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: 'tipsequenceCustomBgColor', label: '4L. 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}, // *** Tip Jar {name: 'tipjar', label: '---------------------------------------------------------------------------------- PART 5: TIP JAR ---------------------------------------------------------------------------------- The Tip Jar is used to perform a particular action once goal is reached, and keep doing it until the tip jar empties, so be sure to use it for prizes that you are willing to do for that long, and make sense to use as an ongoing goal (stay naked, oral, sex, etc). Set the goal(s) and drain rate, tokens do not start to drain until the goal is hit. Can be operated with a single goal or multiple goals similar to Progressive Goal show. Set the Recycle Count to "0" to only use each goal once, or set it to the number of times you will continue to do that prize if the jar is refilled again. Only the goals that are filled in will be used, blank out the goals and amounts you do not wish to use.', type: 'choice',required: false}, {name: 'tipjarRoomSubjectSfx', label: '5A. Title? -- Description of the show to appear as part of the room title (optional). You can include hashtags for keywords you want to be searchable. The actual goal prize descriptions are defined below at each level', type: 'str',required: false, minLength: 1, maxLength: 125, defaultValue: 'Welcome to our tip jar show! #tipjar #couples #sex.'}, {name: 'tipjarWhenEmpty', label: '5B. When Empty? - Once the tip jar is empty, should the app allow users to continue tipping to fill it up again, or end the current goal and start the next goal/recycle of the current goal? If allowing continued tipping, use the /skip command when ready to advance', type: 'choice', choice1: 'Tip to continue current goal', choice2: 'Advance to Next Goal/Cycle', defaultValue: 'Tip to continue current goal'}, {name: 'tipjarStartDrainRate', label: '5C. Drain Rate for how fast tokens are removed from the jar. Default is 1 token/sec but initial setting can be changed here, and can also be changed during the show using the "/faster" and "/slower" commands', type: 'choice', choice1: '5 tokens per second (fastest)', choice2: '4 tokens per second', choice3: '3 tokens per second', choice4: '2 tokens per second', choice5: '1 token per second', choice6: '1 token every 2 seconds', choice7: '1 token every 3 seconds', choice8: '1 token every 4 seconds', choice9: '1 token every 5 seconds', choice10: '1 token every 10 seconds (slowest)', defaultValue: '1 token per second'}, {name: 'tipjarDescription1', label: 'Goal #1 Description', type: 'str',required: false, minLength: 1, maxLength: 100, defaultValue: 'Goal #1 Name.'}, {name: 'tipjarAmount1', label: 'Goal #1 amount', type: 'int',required: false, minValue: 1, maxValue: 100000, defaultValue: 500}, {name: 'tipjarRecycle1', label: 'Goal #1 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription2', label: 'Goal #2 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount2', label: 'Goal #2 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle2', label: 'Goal #2 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription3', label: 'Goal #3 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount3', label: 'Goal #3 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle3', label: 'Goal #3 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription4', label: 'Goal #4 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount4', label: 'Goal #4 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle4', label: 'Goal #4 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription5', label: 'Goal #5 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount5', label: 'Goal #5 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle5', label: 'Goal #5 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription6', label: 'Goal #6 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount6', label: 'Goal #6 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle6', label: 'Goal #6 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription7', label: 'Goal #7 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount7', label: 'Goal #7 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle7', label: 'Goal #7 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription8', label: 'Goal #8 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount8', label: 'Goal #8 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle8', label: 'Goal #8 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription9', label: 'Goal #9 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount9', label: 'Goal #9 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle9', label: 'Goal #9 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarDescription10', label: 'Goal #10 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'tipjarAmount10', label: 'Goal #10 amount', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'tipjarRecycle10', label: 'Goal #10 Recycle Count', type: 'int',required: false, minValue: 0, maxValue: 10, defaultValue: 0}, {name: 'tipjarTextColor', label: '5D. Text color for chat notices related to the Tip Jar App',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: 'tipjarCustomTextColor', label: '5E. 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: 'tipjarBgColor', label: '5F. Background/Highlight color for chat notices related to the Tip Jar App', 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 Purple'}, {name: 'tipjarCustomBgColor', label: '5G. 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}, // *** Hidden Ticket Show {name: 'ticketshow', label: '---------------------------------------------------------------------------------- PART 6: TICKET SHOWS ---------------------------------------------------------------------------------- When using this Ultra App in combination with Dorothy\'s Ultra Fembot, be sure to set the ticket show type in the Fembot to "Dorothy\'s UltraApp". Ticket show Pre-sales should also be performed here in the UltraApp, but the backup ticket list as well as all of the automated features around menus, polls, adding users from leaderboard, etc. can be performed or maintained in the Fembot.', type: 'choice',required: false}, {name: 'ticketRoomSubjectSfx', label: '6A. Title? -- Description of the show to appear as part of the room title (optional). You can include hashtags for keywords you want to be searchable', type:'str', minLength: 1,maxLength: 200, required: false, defaultValue: 'Hidden Sex Show! Token Poll for cumshot!'}, {name: 'ticketShowPrice', label: '6B. Ticket Show Price? -- The Hidden Show feature cannot be enabled without a price defined. Discounted price for Fan Club is defined later below', type: 'int',minValue: 1,maxValue: 99999,defaultValue: 69,required: false}, {name: 'ticketShowStartPrice', label: '6C. New Price at Start of Hidden Show? -- You can choose to have the price increase once at the time the show starts from the original price above to a higher price. Notice that if this is done, the backup ticket list in an external bot such as Dorothy\'s Ultra Fembot will no longer be able to track tickets sold at the updated price. Only used if configured to a value greater than the ticket price above.', type: 'int',minValue: 0,maxValue: 99999,defaultValue: 0,required: false}, {name: 'ticketShowCumulative', label: '6D. Accumulate tips? -- Once ticket sales have started (including Pre-sales if used), accumulate tips toward ticket price? -- Recommend set to "Yes" to avoid need for many manual adds. If set to "No", user can only tip the ticket amount or higher to be added. Note that cumulative tips to buy a ticket will not add a user to the backup ticket list in the Fembot', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowStartMode', label: '6E. Start Mode? -- Which mode is used for determining when to start the show? This setting works in combination with the next setting below to define what will trigger the start of show, and whether it starts automatically', type: 'choice', choice1: 'Start Show Anytime', choice2: 'Start Show after Timer', choice3: 'Start Show after Ticket Goal', choice4: 'Start Show after Token Goal', defaultValue: 'Start Show Anytime'}, {name: 'ticketShowStartAuto', label: '6F. AutoStart? -- If using a timer or goal to determine start of show, does the Broadcaster (or moderator) start the show manually with the /startshow command, or does the show start automatically when timer runs out or goal is reached?', type: 'choice', choice1: 'Start from Command', choice2: 'Automated Start', defaultValue: 'Start from Command'}, {name: 'ticketShowGoal', label: '6G. Goal Amount? -- If using a goal for the total sales before starting the show, set goal amount here (in terms of tickets or tokens based on type of show start goal defined above). When using a timed start, this setting is not used', type: 'int',minValue: 1,maxValue: 5000,defaultValue: 1000,required: false}, {name: 'ticketShowStartTimer', label: '6H. Default Timer -- If the start mode is set for using an automatic timer, define the number of minutes for the countdown to show start here. Timer will start immediately upon starting the broadcast, or when the Hidden Ticket Show feature is turned on later. For manual timer control, start the show in "Start Show Anytime" mode, turn off "Autostart", and use "/ticketstarttimer" to do a countdown', type: 'int',minValue: 1,maxValue: 120,defaultValue: 15,required: false}, {name: 'ticketShowFanAppreciation', label: '6J. Fan Appreciation Mode? When turned on, a special ticket show is used where only the members defined below for free shows are able to access. There will be no ticket sales available.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'ticketShowFreeFC', label: '6K. Give a free ticket to CB Fanclub members?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowFreeMods', label: '6L. Give a free ticket to moderators?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowFreeEFC', label: '6M1. Give a free ticket to External Fanclub 1 members? Even if the External FanClub 1 list has been setup in the Fembot, it must also be duplicated here (see General Setup section above) to provide ticket show privileges', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowFreeEFC2', label: '6M2. Give a free ticket to External Fanclub 2 members? Even if the External FanClub 2 list has been setup in the Fembot, it must also be duplicated here (see General Setup section above) to provide ticket show privileges', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowFreeVIP', label: '6N. Give a free ticket to VIP List members? Even if the VIP list has been setup in the Fembot, it must also be duplicated here (see General Setup section above) to provide ticket show privileges', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowPriceFC', label: '6P. Discounted Price for a ticket to the show for CB Fan Club members if not set for a free ticket above. If no price is set, the Fanc Club ticket price is the same as regular viewers. This value is not used if the above setting grants them a free ticket.', type: 'int',minValue: 1,maxValue: 300,defaultValue: 35,required: false}, {name: 'ticketShowPriceEFC', label: '6Q1. Discounted Price for a ticket to the show for External Fan Club 1 members. If no price is set, the External Fan Club 1 ticket price is the same as regular viewers. This value is not used if the above setting grants them a free ticket.', type: 'int',minValue: 0,maxValue: 300,required: false}, {name: 'ticketShowPriceEFC2', label: '6Q2. Discounted Price for a ticket to the show for External Fan Club 2 members. If no price is set, the External Fan Club 2 ticket price is the same as regular viewers. This value is not used if the above setting grants them a free ticket.', type: 'int',minValue: 0,maxValue: 300,required: false}, {name: 'ticketShowPriceVIP', label: '6R. Discounted Price for a ticket to the show for VIP List members. If no price is set, the VIP List ticket price is the same as regular viewers. This value is not used if the above setting grants them a free ticket.', type: 'int',minValue: 0,maxValue: 300,required: false}, {name: 'ticketShowModsAdd', label: '6S. Allow moderators to use the "add" and "remove" commands? Note that enabling this will allow them to add themselves to a show even if the above setting for giving them a free ticket is set to "No". This setting overrides the general setting for mod authority specifically for the ticket show "/add" functions.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowModsChgPrice', label: '6T. Allow moderators to change the price of a ticket? This setting overrides the general setting for mod authority specifically for the ticket show price functions', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowAfterNotice', label: '6U. Message to display in the Room Subject and Notice after the show has ended', type:'str',minLength: 1,maxLength: 100,required: false,defaultValue: 'After show hangout, please follow us on twitter @yourusername.'}, {name: 'ticketShowReducePriceWarn', label: '6V. Late addition Ticket Show Sale? -- Reduce Ticket Price by this amount when the /showwarn command is used to indicate the show is nearly over. Set to 0 to not use this feature. Note this is the price reduction, not the actual new price', type: 'int',minValue: 0,maxValue: 300,defaultValue: 0,required: false}, {name: 'ticketShowEnableOT', label: '6W. Use OT List? -- Enable Outstanding Ticket feature so users can save their ticket for use in a later show. Note that the broadcaster must still record the user names and enter them in the OTS list below. Can also be used for granting free tickets to viewers for a future show in place of a refund if there was a problem with a show, or user bought at the last second and missed the show.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketShowOTList', label: '6X. OT List -- If the Outstanding Ticket feature is enabled above, enter the names of any viewers you would like to grant a ticket to a future show. The user will be notified when they enter that they have a free ticket, and if they choose to use it, the broadcaster is notified so they can remove them from the list before next show. The format should be a comma separated list (user1,user2,user3)', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false}, {name: 'ticketShowAllowGift', label: '6Y. Gifting Allowed? -- Allow users to buy additional tickets they can use as gifts to other users', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'ticketShowPreviewLength', label: '6Z. If a free preview will be allowed for people joining the room after the show starts, define the length of the preview period. Set to "No Preview" to disable, or select a length from the list.',type: 'choice', choice1: 'No Preview', choice2: '10 seconds',choice3: '20 seconds', choice4: '30 seconds', choice5: '1 minute', choice6: '2 minutes', choice7: '3 minutes',choice8: '4 minutes',choice9: '5 minutes',defaultValue: 'No Preview'}, {name: 'ticketShowPreviewGrays', label: '6AA. Allow users without tokens to view the free preview?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'ticketshowEnableIcon', label: '6AB. Show the ticket icon next to names that have bought a ticket to the show? Defaulted to Yes, but can be diabled if it interferes with other icons (can only have a max of 3 icons/gifs per message)', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'ticketNoticeInterval', label: '6AC. Time interval for displaying the Ticket Show Price Notice and tip menu 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.',required: false,type: 'str',defaultValue: 1.2}, {name: 'ticketShowTextColor', label: '6AD. Text color for chat notices related to the Ticket Show App',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: 'Custom',defaultValue: 'Dark Blue'}, {name: 'ticketShowCustomTextColor', label: '6AE. 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: 'ticketShowBgColor', label: '6AF. Background/Highlight color for chat notices related to the Ticket Show App', 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: 'Custom',defaultValue: 'Light Aqua'}, {name: 'ticketShowCustomBgColor', label: '6AG. 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: 'ticketShowEnablePresales', label: '6AH. When using pre-sales, will the pre-sale be performed in the UltraApp or Fembot? It is always recommended to perform pre-sales in the UltraApp when the ticket show is in the UltraApp', type: 'choice', choice1: 'UltraApp', choice2: 'Fembot', defaultValue: 'UltraApp'}, {name: 'ticketShowPresalesMode', label: '6AJ. Ticket show pre-sales mode to use at the start of the broadcast? Note you can also start selling pre-sale tickets later during the broadcast using the "/startpresale" command if the above setting indicates UltraApp will be used for pre-sales. You can also change the mode during the show using the command "/chgpresalemode [mode]". There are three modes available, with further settings below for the automated modes', type: 'choice', choice1: 'No Pre-sales', choice2: 'Yes, Mode 1: Increment Manually', choice3: 'Yes, Mode 2: Increment on X Tickets Sold',choice4: 'Yes, Mode 3: Increment on Automatic Timer',defaultValue: 'No Pre-sales'}, {name: 'ticketShowPresaleCountIncrement', label: '6AK. For Presales Mode 2: If setting an automatic increment per number of tickets sold, indicate the number of tickets to be sold in each increment here. After this number are sold, price will increase by the amount specified in the later setting.',type: 'int',minValue: 1,maxValue: 50,required: false,defaultValue: 10}, {name: 'ticketShowPresaleTimedIncrement', label: '6AL. For Presales Mode 3: If setting an automatic timer increment, this is the number of minutes for the timer. Timer will recycle and continue incrementing until limit is reached, or next increment would exceed the planned ticket show price. After each cycle of the timer expires, the price will automatically increase by the amount specified in the below setting.',type: 'int',minValue: 1,maxValue: 50,required: false,defaultValue: 15}, {name: 'ticketShowPresaleIncreasePerIncrement',label: '6AM. If setting an automatic increment by timer or number of tickets sold, indicate the increment in ticket price for each occurrence. This means every [X] minutes (defined in previous setting), the price will go up by the number of tokens defined here, or if selling by count, once all tickets have been sold at the current price, the price will increment by this amount. Note that the price will never increment above the defined ticket price above.',type: 'int',minValue: 1,maxValue: 100,required: false,defaultValue: 10}, {name: 'ticketShowPresaleMaxIncrements', label: '6AN. When using mode 2 or mode 3 for an automatic increment, this is the maximum number of increments before the presale stops increments. Once it reaches this point (or next increment would exceed the planned ticket price), the price stops incrementing and pre-sales will continue at the same price until they are ended.',type: 'int',minValue: 1,maxValue: 10,required: false,defaultValue: 3}, {name: 'ticketShowPresalePrice', label: '6AP. If the ticket show pre-sales are enabled at the start of the show, use this price as the initial pre-sale price. Otherwise, price can be updated during show with /presaleprice [p]. Note that as soon as pre-sales are enabled, this ticket price will be used if defined, so leave it blank here if it will be defined during the show.',type: 'int',minValue: 1,maxValue: 1000,required: false,defaultValue: 45}, {name: 'ticketShowPresaleNoticeInterval', label: '6AQ. Display Interval for generic Ticket Show Pre-sales notice (in minutes). This notice just alerts the room that a pre-sale is active, regardless of mode',type: 'int',minValue: 1,maxValue: 15,required: false,defaultValue: 2}, {name: 'prepTicketStartTimer', label: '6AR. Start a Countdown timer for the ticketshow when /prepticket is used? Note this will only be allowed if the Ticket Show start mode near the top of this section is set to manual start ("Start Show Anytime"). If set to "Yes", and no timer is specified on the /prepticket command, the "Default Timer" setting above is used', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, // *** Goal Race {name: 'goalrace', label: '---------------------------------------------------------------------------------- PART 7: GOAL RACE ---------------------------------------------------------------------------------- With this Feature, the broadcaster defines two goals that the viewers can vote for when tipping. The App keeps track of the progress toward the two goals until one of the goals wins. There are commands to change the room subject, panel subject, goal amounts, and goal descriptions during the show.', type: 'choice',required: false}, {name: 'goalraceSubjectText', label: '7A. Room Title? -- Enter any show description text or hashtags you would like to appear in the configurable part of the room title.', type: 'str',required: false, minLength: 1, maxLength: 125, defaultValue: 'Sex Show at Final Goal #couple #goals'}, {name: 'goalracePanelText', label: '7B. Panel Description? -- Shorter description that will appear in the panel, must be less than 30 characters.', type: 'str',required: false, minLength: 1, maxLength: 30, defaultValue: 'Panel Description'}, {name: 'goalraceDesc1', label: '7C. Goal Description #1', type: 'str',required: false, minLength: 1, maxLength: 20, defaultValue: 'Oral for him'}, {name: 'goalraceAmount1', label: '7D. Goal Amount #1', type: 'int',required: false, minValue: 1, maxValue: 10000, defaultValue: 500}, {name: 'goalraceDesc2', label: '7E. Goal Description #2', type: 'str',required: false, minLength: 1, maxLength: 20, defaultValue: 'Oral for her'}, {name: 'goalraceAmount2', label: '7F. Goal Amount #2', type: 'int',required: false, minValue: 1, maxValue: 10000, defaultValue: 500}, {name: 'goalraceAllowClaim', label: '7G. Allow users to "claim" their unspecified votes later in the goal race.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'goalraceBonusFC', label: '7H. Percent bonus for CB Fan Club tips when voting. Leave as 1 for all votes to count the same. Use 20 for 20% bonus, 50 for 50% bonus, etc (100% doubles their tip amount). Allowable values from 0 to 100%', type: 'int',minValue: 0,maxValue: 100, defaultValue: 0,required: false}, {name: 'goalraceBonusEFC', label: '7J1. Percent bonus for External Fan Club 1 tips when voting. Leave as 1 for all votes to count the same. Use 20 for 20% bonus, 50 for 50% bonus, etc (100% doubles their tip amount). Allowable values from 0 to 100%', type: 'int',minValue: 0,maxValue: 100,defaultValue: 0,required: false}, {name: 'goalraceBonusEFC2', label: '7J2. Percent bonus for External Fan Club 2 tips when voting. Leave as 1 for all votes to count the same. Use 20 for 20% bonus, 50 for 50% bonus, etc (100% doubles their tip amount). Allowable values from 0 to 100%', type: 'int',minValue: 0,maxValue: 100,defaultValue: 0,required: false}, {name: 'goalraceBonusVIP', label: '7K. Percent bonus for VIP tips when voting. Leave as 1 for all votes to count the same. Use 20 for 20% bonus, 50 for 50% bonus, etc (100% doubles their tip amount). Allowable values from 0 to 100%', type: 'int',minValue: 0,maxValue: 100,defaultValue: 0,required: false}, {name: 'goalRaceNoticeInterval', label: '7L. Time interval for displaying the recurring Goal Race 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.',required: false,type: 'str',defaultValue: 3.2}, {name: 'goalraceTextColor', label: '7M. Text color for chat notices related to the Goal Race App',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: 'goalraceCustomTextColor', label: '7N. 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: 'goalraceBgColor', label: '7P. Background/Highlight color for chat notices related to the Goal Race App', 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: 'goalraceCustomBgColor', label: '7Q. 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}, // *** Spank-a-thon {name: 'spankathon', label: '---------------------------------------------------------------------------------- PART 8: SPANKATHON ---------------------------------------------------------------------------------- The "Spank-a-thon" is a is a show format that allows you to setup a spank tip menu and spank goals so people can tip for different types of spanks, the total count is tracked for each type, and then also track progress toward goals at which the spanking occurs. Note that the App Feature will not start if there are duplicate prices in the Spank Tip Menu, and each individual goal has it\'s own total (it is NOT a cumulative amount).', type: 'choice',required: false}, {name: 'spankSubjectText', label: '8A. Title? -- Description of the Spank-a-thon to appear as part of the room title (optional). You can include hashtags for keywords you want to be searchable', type:'str', minLength: 1,maxLength: 125, required: false, defaultValue: 'Spank-a-thon Show! Tip for your Favorite type of Spank to be performed at goal!'}, {name: 'spankNoticeInterval', label: '8B. Time interval for displaying the Spank-a-thon notice and tip menu 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.',required: false,type: 'str',defaultValue: 1.8}, {name: 'spankSepChar', label: '8C. Choose your separator character to appear between menu items in the Spank Menu. You can also use a custom specific gif not in the list by entering one in the next setting below, which will override this setting', type: 'choice',choice1: 'Spank',choice2: 'Hearts',choice3: 'Glitter',choice4: 'Flowers',choice5: 'Bow',choice6: 'Hearts2',choice7: 'Smiley',choice8: 'Text Heart',choice9: 'Text Diamond',choice10: 'Text Star',choice11: 'Vertical Bar',choice12: 'Custom',defaultValue: 'Spank'}, {name: 'spankSepCharCustom', label: '8D. Choose your custom separator (optional) for the Spank Menu. It can be a gif or a string of text/special characters (&!&). If using a gif, make sure to start it with the colon (:) as it would be typed in the chat',type: 'str',required: false}, {name: 'spankGoalDescription1', label: 'Goal #1 Description', type: 'str',required: false, minLength: 1, maxLength: 100, defaultValue: 'Goal #1 Name'}, {name: 'spankGoalAmount1', label: 'Goal #1 Amount (tokens)', type: 'int',required: false, minValue: 1, maxValue: 100000, defaultValue: 500}, {name: 'spankGoalDescription2', label: 'Goal #2 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'spankGoalAmount2', label: 'Goal #2 Amount (tokens)', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'spankGoalDescription3', label: 'Goal #3 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'spankGoalAmount3', label: 'Goal #3 Amount (tokens)', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'spankGoalDescription4', label: 'Goal #4 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'spankGoalAmount4', label: 'Goal #4 Amount (tokens)', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'spankGoalDescription5', label: 'Goal #5 Description', type: 'str',required: false, minLength: 1, maxLength: 100}, {name: 'spankGoalAmount5', label: 'Goal #5 Amount (tokens)', type: 'int',required: false, minValue: 1, maxValue: 100000}, {name: 'spankMenuType1', label: '***** Tip Menu Spank Type 1 - Set the per spank price, and any multiple spank bundle prices that can be discounted when buying in bulk',type: 'str',required: false,defaultValue: 'Spank Type 1'}, {name: 'spankMenuType1Price1', label: 'Spank Type 1 Price per Spank',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType1Amount2', label: 'Spank Type 1 Bundle 1 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType1Price2', label: 'Spank Type 1 Bundle 1 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType1Amount3', label: 'Spank Type 1 Bundle 2 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType1Price3', label: 'Spank Type 1 Bundle 2 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType2', label: '***** Tip Menu Spank Type 2 - Set the per spank price, and any multiple spank bundle prices that can be discounted when buying in bulk',type: 'str',required: false}, {name: 'spankMenuType2Price1', label: 'Spank Type 2 Price per Spank',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType2Amount2', label: 'Spank Type 2 Bundle 1 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType2Price2', label: 'Spank Type 2 Bundle 1 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType2Amount3', label: 'Spank Type 2 Bundle 2 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType2Price3', label: 'Spank Type 2 Bundle 2 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType3', label: '***** Tip Menu Spank Type 3 - Set the per spank price, and any multiple spank bundle prices that can be discounted when buying in bulk',type: 'str',required: false}, {name: 'spankMenuType3Price1', label: 'Spank Type 3 Price per Spank',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType3Amount2', label: 'Spank Type 3 Bundle 1 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType3Price2', label: 'Spank Type 3 Bundle 1 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType3Amount3', label: 'Spank Type 3 Bundle 2 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType3Price3', label: 'Spank Type 3 Bundle 2 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType4', label: '***** Tip Menu Spank Type 4 - Set the per spank price, and any multiple spank bundle prices that can be discounted when buying in bulk',type: 'str',required: false}, {name: 'spankMenuType4Price1', label: 'Spank Type 4 Price per Spank',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType4Amount2', label: 'Spank Type 4 Bundle 1 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType4Price2', label: 'Spank Type 4 Bundle 1 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType4Amount3', label: 'Spank Type 4 Bundle 2 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType4Price3', label: 'Spank Type 4 Bundle 2 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType5', label: '***** Tip Menu Spank Type 5 - Set the per spank price, and any multiple spank bundle prices that can be discounted when buying in bulk',type: 'str',required: false}, {name: 'spankMenuType5Price1', label: 'Spank Type 5 Price per Spank',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType5Amount2', label: 'Spank Type 5 Bundle 1 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType5Price2', label: 'Spank Type 5 Bundle 1 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType5Amount3', label: 'Spank Type 5 Bundle 2 - Number of Spanks',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankMenuType5Price3', label: 'Spank Type 5 Bundle 2 - Price per Bundle',type: 'int',minValue: 0,maxValue: 99999,required: false}, {name: 'spankTextColor', label: '8E. Text color for chat notices related to the Spank-a-thon App',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: 'Custom',defaultValue: 'Dark Pink'}, {name: 'spankCustomTextColor', label: '8F. 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: 'spankBgColor', label: '8G. Background/Highlight color for chat notices related to the Spank-a-thon App', 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: 'Custom',defaultValue: 'Light Pink'}, {name: 'spankCustomBgColor', label: '8H. 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}, // *** Peep Show {name: 'peepshow', label: '---------------------------------------------------------------------------------- PART 9: PEEP SHOWS ---------------------------------------------------------------------------------- The "Peep Show" is a hidden show format that requires viewers to pay as they go and buy time in the show. The broadcaster sets a "per minute" price, and then viewers can tip to buy time at that rate. Prices should ideally be a multiple of 6 as the Peep Show will check hidden show status every 10 seconds, and access is being bought in 10 second chunks. As a guideline, if doing a show that you may charge 60 tokens for in ticket format that would last 10 minutes, charging 6 tokens per minute would equate to the same amount. This does assume someone stayed for the whole show, however, so going a little higher is also fine. If the price were set at 10 tokens/min, and a user tips 17, they would be buying 1.7 minutes or 102 seconds. Since the access check is made every 10 seconds, they would get 11 "chunks" of 10 second viewing time (still 2 seconds left after the 10th check).', type: 'choice',required: false}, {name: 'peepshowSubjectText', label: '9A. Title? -- Description of the Peep Show to appear as part of the room title (optional). You can include hashtags for keywords you want to be searchable', type:'str', minLength: 1,maxLength: 100, required: false, defaultValue: 'Hidden Sex Show!'}, {name: 'peepshowAfterNotice', label: '9B. Message to display in the Room Subject and Notice after the show has ended', type:'str',minLength: 1,maxLength: 100,required: false,defaultValue: 'After show hangout, please follow us on twitter @yourusername.'}, {name: 'peepshowPrice', label: '9C. Peep Show Price per Minute? -- The Peep Show feature cannot be enabled without a "per minute" price defined.', type: 'int',minValue: 6,maxValue: 9999,defaultValue: 12,required: false}, {name: 'peepshowStartAuto', label: '9D. AutoStart? -- Do you want the show to start automtically from the end of a timer, or upon user command. Note that the timer is started automatically once sales are started if a time is specified below, otherwise the timer can be started by command with either mode. You can use a timer in either mode, and this seeting defines if the show starts automatically when the timer ends. Usually the show is started manually by the broadcaster (or moderator).', type: 'choice', choice1: 'Manual Start from Command', choice2: 'Automated Start from Timer', defaultValue: 'Manual Start from Command'}, {name: 'peepshowStartTimer', label: '9E. Default Time to Start -- If a value is set here and show is defined to start automatically at end of timer, this value is used for the countdown timer. Timer will start immediately upon starting the broadcast, or when the Peep Show feature is turned on later. For manual timer control, start the show in "Manual Start from Command" mode, and use "/peeptimer" to do a countdown', type: 'int',minValue: 0,maxValue: 120,defaultValue: 0,required: false}, {name: 'peepshowLengthOfShow', label: '9F. Peep Show Length (in minutes)? -- The Peep Show feature cannot be enabled without an estimated length of show configured. With the Peep Show feature, since viewers are buying time in the show in increments, it is VERY important to be as accurate as possible when defining the show length. You should try to avoid using the Peep Show for types of shows that could end earlier than expected. This could be used to do a show where you will do an activity for a specified amount of time, such as "Finger myself for 10 minutes" or "Have sex for 15 minutes". If people prepay for a 15 minute show and you stop afte 5 minutes, it will likely lead to down votes. Note that you can change the length of the show using the command "/peeplength xx", where xx is the new show length in minutes.', type: 'int',minValue: 1,maxValue: 300,defaultValue: 15,required: false}, {name: 'peepshowAutoEnd', label: '9G. Auto End? -- Automatically end the show after the configured Show Length?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'peepshowFreeFC', label: '9H. Allow free access to CB Fanclub members?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'peepshowFreeMods', label: '9J. Allow free access to moderators?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'peepshowFreeEFC', label: '9K1. Allow free access to External Fanclub 1 members? Even if the External FanClub 1 list has been setup in the Fembot, it must also be duplicated here in the UltraApp (see General Setup section above) to provide Peep Show privileges', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'peepshowFreeEFC2', label: '9K2. Allow free access to External Fanclub 2 members? Even if the External FanClub 2 list has been setup in the Fembot, it must also be duplicated here in the UltraApp (see General Setup section above) to provide Peep Show privileges', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'peepshowFreeVIP', label: '9L. Allow free access to VIP List members? Even if the VIP list has been setup in the Fembot, it must also be duplicated here in the UltraApp (see General Setup section above) to provide Peep Show privileges', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'peepshowModsAdd', label: '9M. Allow moderators to use the "/peepadd" command? This allows them to add users to the show for free', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'peepshowModsChgPrice', label: '9N. Allow moderators to use the "/peepprice" command? This allows them to change the per minute rate for watching the show', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'peepshowTextColor', label: '9P. Text color for chat notices related to the Peep Show App',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: 'Custom',defaultValue: 'Dark Blue'}, {name: 'peepshowCustomTextColor', label: '9Q. 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: 'peepshowBgColor', label: '9R. Background/Highlight color for chat notices related to the Peep Show App', 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: 'Custom',defaultValue: 'Light Aqua'}, {name: 'peepshowCustomBgColor', label: '9S. 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}, // *** Auto-Reset Goal {name: 'autoresetgoal', label: '---------------------------------------------------------------------------------- PART 10: AUTO RESET GOAL ---------------------------------------------------------------------------------- You can set up a Single goal that will continually repeat, recylcing each time the goal is hit, and rolling any excess tips into the next cycle.', type: 'choice',required: false}, {name: 'autoresetSubjectSfx', label: '10A. Room Title -- (Optional) Enter any show description text or hashtags you would like appended to the goal description shown in the room title', type: 'str',required: false, minLength: 1, maxLength: 125, defaultValue: 'Welcome to our show! #couple #goals #sextease'}, {name: 'autoresetGoalAmount', label: '10B. Individual Goal Amount -- (Required) Each time this goal is hit, it recycles. It can keep going forever, or a limit on the number of goals may be set below', type: 'int',minValue: 1, maxValue: 99999, defaultValue: 500}, {name: 'autoresetEachGoal', label: '10C. Individual Goal Prize -- (Required) Prize Description used for the individual goals (all goals have the same description until the final goal).', type: 'str',minLength: 0, maxLength: 100, defaultValue: 'Sex Tease'}, {name: 'autoresetEndAfter', label: '10D. End After X Goals -- (Optional) If you want to recycle the goals a specific number of times (usually to do a final prize at the last goal), define the total number of goals. Otherwise leave this as zero to keep repeating the goal without end.', type: 'int',minValue: 0,maxValue: 9999,defaultValue: 10,required: false}, {name: 'autoresetFinalGoal', label: '10E. Final Goal Prize -- (Optional) If you plan to do a grand prize after the total goals specified above, put the Prize Description here', type: 'str',required: false, minLength: 1, maxLength: 100, defaultValue: 'Sex Show'}, {name: 'resetShowCount', label: '10F. Show Count? -- Show the number of goals that have been hit so far in the panel and Goal Reached announcement?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'autoresetTextColor', label: '10G. Text color for chat notices related to the Auto-Reset Goal',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: 'Custom',defaultValue: 'Dark Green'}, {name: 'autoresetCustomTextColor', label: '10H. 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: 'autoresetBgColor', label: '10J. Background/Highlight color for chat notices related to the Auto-Reset Goal', 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: 'Custom',defaultValue: 'Light Yellow'}, {name: 'autoresetCustomBgColor', label: '10K. 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} ]; } { // *********************************** Variables and Arrays ************************************** var initialize = 0; var numberOfModerators = 1; var timerStart = 0; var chatMsgToggle = 0; var groupTipToggle = 0; var BC = cb.room_slug; var noFeatureText = ''; var finalGoalMet = false; var currentGoalMet = false; var noAppPanelText1 = ' '; var noAppPanelText2 = ' '; var noAppPanelText3 = ' '; var ticketAppPanelText3 = ' '; var panelText3Updated = false; var highestTip = 0; var highestTipper = 'None'; var mostRecentTip = 0; var mostRecentTipper = 'None'; var whichApp = ''; var currentGoal = 1; var currentGoalTips = 0; var currentGoalTotal = 0; var currentSessionTotal = 0; var currentGoalRecycleCnt = 0; var currentGoalLevel = 1; var currentGoalCountAmt = 0; var sequenceTotalTipsGoal = 0; var currentAppTotalGoal = 0; var currentAppTotalCounter = 0; var currentAppTotalSequence = 0; var currentAppTotalTipJar = 0; var currentAppTotalTicket = 0; var currentAppTotalGoalRace = 0; var currentAppTotalPeep = 0; var currentAppTotalNone = 0; var currentAppTotalSpanks = 0; var currentAppTotalAutoreset = 0; var savedProgGoals = false; var savedGoalCount = false; var savedGoalRace = false; var savedGoalSequence = false; var savedSpankGoals = false; var savedTipJar = false; var savedAutoresetGoals = false; var tipJarRunning = false; var tipOptions = false; var lastTipJarEmptyNotice = 0; var skipWarned = false; var tipJarPaused = false; var goalSubjectText = cb.settings.progressiveRoomSubjectSfx; var counterSubjectText = cb.settings.goalcounterRoomSubjectSfx; var sequenceSubjectText = cb.settings.tipsequenceRoomSubjectSfx; var tipjarSubjectText = cb.settings.tipjarRoomSubjectSfx; var ticketSubjectText = cb.settings.ticketRoomSubjectSfx; var goalraceSubjectText = cb.settings.goalraceSubjectText; var goalracePanelText = cb.settings.goalracePanelText; var spankSubjectText = cb.settings.spankSubjectText; var autoresetSubjectSfx = cb.settings.autoresetSubjectSfx; var genericRoomSubjectSfx = cb.settings.genericRoomSubjectSfx; var genericRoomSubjectPosn = cb.settings.genericRoomSubjectPosn; var ticketStartMode = ''; var ticketModeAuto = ''; var ticketShowTotalTips = 0; var ticketShowTotalTicketsBought = 0; var ticketStartTime = 0; var ticketStopTime = 0; var ticketTimeAdded = 0; var ticketMinsRemain = 0; var ticketSecsRemain = 0; var ticketShowGoal = parseInt(cb.settings.ticketShowGoal); var ticketShowEnableOT = cb.settings.ticketShowEnableOT; var ticketShowAllowGift = cb.settings.ticketShowAllowGift; var ticketShowOtToggle = 0; var ticketPrice = cb.settings.ticketShowPrice; var ticketShowEnded = false; var countTickets = 0; var countPresaleTickets = 0; var countTicketsFromPreview = 0; var presalePrice = cb.settings.ticketShowPresalePrice; var presaleTimeAmt = cb.settings.ticketShowPresaleTimedIncrement; var presaleIncAmt = cb.settings.ticketShowPresaleIncreasePerIncrement; var presaleCountAmt = cb.settings.ticketShowPresaleCountIncrement; var nextPresalePrice = 0; var countPresaleSold = 0; var presaleMode = ''; var presaleModeText = ''; var presalesToggle = 0; var presaleStartTime = 0; var presaleStopTime = 0; var presaleTimeAdded = 0; var presaleMinsRemain = 0; var presaleSecsRemain = 0; var presaleSkipNotice = false; var lowSequence = cb.settings.tipsequenceLowNumber; var highSequence = cb.settings.tipsequenceHighNumber; var peepshowStartMode = cb.settings.peepshowStartMode; var peepshowModeAuto = cb.settings.peepshowModeAuto; var peepshowPrice = cb.settings.peepshowPrice; var peepshowSubjectText = cb.settings.peepshowSubjectText; var peepshowLengthOfShow = cb.settings.peepshowLengthOfShow; var peepshowAutoEnd = cb.settings.peepshowAutoEnd; var peepshowTotalTips = 0; var peepshowStartStartTime = 0; var peepshowStartStopTime = 0; var peepshowStartMinsRemain = 0; var peepshowStartSecsRemain = 0; var monitorMinsRem = 0; var monitorMins = 0; var monitorSecs = 0; var peepshowEnded = false; var peepshowSalesEnded = false; var peepShowEndTime = 0; var peepshowStartHiddenTime = 0; var totalSpanksTipped = 0; var totalSpanksCompleted = 0; var autoresetGoalAmount = cb.settings.autoresetGoalAmount; var autoresetEachGoal = cb.settings.autoresetEachGoal; var autoresetEndAfter = cb.settings.autoresetEndAfter; var autoresetFinalGoal = cb.settings.autoresetFinalGoal; var resetShowCount = true; var resetLastTip = 'No Tips Yet'; var progressiveGoalDescription1 = cb.settings.progressiveGoalDescription1; var progressiveGoalDescription2 = cb.settings.progressiveGoalDescription2; var progressiveGoalDescription3 = cb.settings.progressiveGoalDescription3; var progressiveGoalDescription4 = cb.settings.progressiveGoalDescription4; var progressiveGoalDescription5 = cb.settings.progressiveGoalDescription5; var progressiveGoalDescription6 = cb.settings.progressiveGoalDescription6; var progressiveGoalDescription7 = cb.settings.progressiveGoalDescription7; var progressiveGoalDescription8 = cb.settings.progressiveGoalDescription8; var progressiveGoalDescription9 = cb.settings.progressiveGoalDescription9; var progressiveGoalDescription10 = cb.settings.progressiveGoalDescription10; var progressiveGoalDescription11 = cb.settings.progressiveGoalDescription11; var progressiveGoalDescription12 = cb.settings.progressiveGoalDescription12; var progressiveGoalDescription13 = cb.settings.progressiveGoalDescription13; var progressiveGoalDescription14 = cb.settings.progressiveGoalDescription14; var progressiveGoalDescription15 = cb.settings.progressiveGoalDescription15; var progressiveGoalDescription16 = cb.settings.progressiveGoalDescription16; var progressiveGoalDescription17 = cb.settings.progressiveGoalDescription17; var progressiveGoalDescription18 = cb.settings.progressiveGoalDescription18; var progressiveGoalDescription19 = cb.settings.progressiveGoalDescription19; var progressiveGoalDescription20 = cb.settings.progressiveGoalDescription20; var progressiveGoalAmount1 = cb.settings.progressiveGoalAmount1; var progressiveGoalAmount2 = cb.settings.progressiveGoalAmount2; var progressiveGoalAmount3 = cb.settings.progressiveGoalAmount3; var progressiveGoalAmount4 = cb.settings.progressiveGoalAmount4; var progressiveGoalAmount5 = cb.settings.progressiveGoalAmount5; var progressiveGoalAmount6 = cb.settings.progressiveGoalAmount6; var progressiveGoalAmount7 = cb.settings.progressiveGoalAmount7; var progressiveGoalAmount8 = cb.settings.progressiveGoalAmount8; var progressiveGoalAmount9 = cb.settings.progressiveGoalAmount9; var progressiveGoalAmount10 = cb.settings.progressiveGoalAmount10; var progressiveGoalAmount11 = cb.settings.progressiveGoalAmount11; var progressiveGoalAmount12 = cb.settings.progressiveGoalAmount12; var progressiveGoalAmount13 = cb.settings.progressiveGoalAmount13; var progressiveGoalAmount14 = cb.settings.progressiveGoalAmount14; var progressiveGoalAmount15 = cb.settings.progressiveGoalAmount15; var progressiveGoalAmount16 = cb.settings.progressiveGoalAmount16; var progressiveGoalAmount17 = cb.settings.progressiveGoalAmount17; var progressiveGoalAmount18 = cb.settings.progressiveGoalAmount18; var progressiveGoalAmount19 = cb.settings.progressiveGoalAmount19; var progressiveGoalAmount20 = cb.settings.progressiveGoalAmount20; var goalCounterDescription1 = cb.settings.goalcounterGoalDescription1; var goalCounterDescription2 = cb.settings.goalcounterGoalDescription2; var goalCounterDescription3 = cb.settings.goalcounterGoalDescription3; var goalCounterDescription4 = cb.settings.goalcounterGoalDescription4; var goalCounterDescription5 = cb.settings.goalcounterGoalDescription5; var goalCounterDescription6 = cb.settings.goalcounterGoalDescription6; var goalCounterDescription7 = cb.settings.goalcounterGoalDescription7; var goalCounterDescription8 = cb.settings.goalcounterGoalDescription8; var goalCounterDescription9 = cb.settings.goalcounterGoalDescription9; var goalCounterDescription10 = cb.settings.goalcounterGoalDescription10; var goalCounterDescription11 = cb.settings.goalcounterGoalDescription11; var goalCounterDescription12 = cb.settings.goalcounterGoalDescription12; var goalCounterDescription13 = cb.settings.goalcounterGoalDescription13; var goalCounterDescription14 = cb.settings.goalcounterGoalDescription14; var goalCounterDescription15 = cb.settings.goalcounterGoalDescription15; var goalCounterAmount1 = cb.settings.goalcounterGoalAmount1; var goalCounterAmount2 = cb.settings.goalcounterGoalAmount2; var goalCounterAmount3 = cb.settings.goalcounterGoalAmount3; var goalCounterAmount4 = cb.settings.goalcounterGoalAmount4; var goalCounterAmount5 = cb.settings.goalcounterGoalAmount5; var goalCounterAmount6 = cb.settings.goalcounterGoalAmount6; var goalCounterAmount7 = cb.settings.goalcounterGoalAmount7; var goalCounterAmount8 = cb.settings.goalcounterGoalAmount8; var goalCounterAmount9 = cb.settings.goalcounterGoalAmount9; var goalCounterAmount10 = cb.settings.goalcounterGoalAmount10; var goalCounterAmount11 = cb.settings.goalcounterGoalAmount11; var goalCounterAmount12 = cb.settings.goalcounterGoalAmount12; var goalCounterAmount13 = cb.settings.goalcounterGoalAmount13; var goalCounterAmount14 = cb.settings.goalcounterGoalAmount14; var goalCounterAmount15 = cb.settings.goalcounterGoalAmount15; var sequenceDescription1 = cb.settings.tipsequenceGoalDescription1; var sequenceDescription2 = cb.settings.tipsequenceGoalDescription2; var sequenceDescription3 = cb.settings.tipsequenceGoalDescription3; var sequenceDescription4 = cb.settings.tipsequenceGoalDescription4; var sequenceDescription5 = cb.settings.tipsequenceGoalDescription5; var sequenceDescription6 = cb.settings.tipsequenceGoalDescription6; var sequenceDescription7 = cb.settings.tipsequenceGoalDescription7; var sequenceDescription8 = cb.settings.tipsequenceGoalDescription8; var sequenceDescription9 = cb.settings.tipsequenceGoalDescription9; var sequenceDescription10 = cb.settings.tipsequenceGoalDescription10; var sequenceAmount1 = cb.settings.tipsequenceGoalAmount1; var sequenceAmount2 = cb.settings.tipsequenceGoalAmount2; var sequenceAmount3 = cb.settings.tipsequenceGoalAmount3; var sequenceAmount4 = cb.settings.tipsequenceGoalAmount4; var sequenceAmount5 = cb.settings.tipsequenceGoalAmount5; var sequenceAmount6 = cb.settings.tipsequenceGoalAmount6; var sequenceAmount7 = cb.settings.tipsequenceGoalAmount7; var sequenceAmount8 = cb.settings.tipsequenceGoalAmount8; var sequenceAmount9 = cb.settings.tipsequenceGoalAmount9; var sequenceAmount10 = cb.settings.tipsequenceGoalAmount10; var tipjarDescription1 = cb.settings.tipjarDescription1; var tipjarDescription2 = cb.settings.tipjarDescription2; var tipjarDescription3 = cb.settings.tipjarDescription3; var tipjarDescription4 = cb.settings.tipjarDescription4; var tipjarDescription5 = cb.settings.tipjarDescription5; var tipjarDescription6 = cb.settings.tipjarDescription6; var tipjarDescription7 = cb.settings.tipjarDescription7; var tipjarDescription8 = cb.settings.tipjarDescription8; var tipjarDescription9 = cb.settings.tipjarDescription9; var tipjarDescription10 = cb.settings.tipjarDescription10; var tipjarAmount1 = cb.settings.tipjarAmount1; var tipjarAmount2 = cb.settings.tipjarAmount2; var tipjarAmount3 = cb.settings.tipjarAmount3; var tipjarAmount4 = cb.settings.tipjarAmount4; var tipjarAmount5 = cb.settings.tipjarAmount5; var tipjarAmount6 = cb.settings.tipjarAmount6; var tipjarAmount7 = cb.settings.tipjarAmount7; var tipjarAmount8 = cb.settings.tipjarAmount8; var tipjarAmount9 = cb.settings.tipjarAmount9; var tipjarAmount10 = cb.settings.tipjarAmount10; var tipjarRecycle1 = cb.settings.tipjarRecycle1; var tipjarRecycle2 = cb.settings.tipjarRecycle2; var tipjarRecycle3 = cb.settings.tipjarRecycle3; var tipjarRecycle4 = cb.settings.tipjarRecycle4; var tipjarRecycle5 = cb.settings.tipjarRecycle5; var tipjarRecycle6 = cb.settings.tipjarRecycle6; var tipjarRecycle7 = cb.settings.tipjarRecycle7; var tipjarRecycle8 = cb.settings.tipjarRecycle8; var tipjarRecycle9 = cb.settings.tipjarRecycle9; var tipjarRecycle10 = cb.settings.tipjarRecycle10; var goalraceDesc1 = cb.settings.goalraceDesc1; var goalraceDesc2 = cb.settings.goalraceDesc2; var goalraceAmount1 = cb.settings.goalraceAmount1; var goalraceAmount2 = cb.settings.goalraceAmount2; var currentGoalRace1Tips = 0; var currentGoalRace2Tips = 0; var spankGoalDescription1 = cb.settings.spankGoalDescription1; var spankGoalDescription2 = cb.settings.spankGoalDescription2; var spankGoalDescription3 = cb.settings.spankGoalDescription3; var spankGoalDescription4 = cb.settings.spankGoalDescription4; var spankGoalDescription5 = cb.settings.spankGoalDescription5; var spankGoalAmount1 = cb.settings.spankGoalAmount1; var spankGoalAmount2 = cb.settings.spankGoalAmount2; var spankGoalAmount3 = cb.settings.spankGoalAmount3; var spankGoalAmount4 = cb.settings.spankGoalAmount4; var spankGoalAmount5 = cb.settings.spankGoalAmount5; var spankMenuType1 = cb.settings.spankMenuType1; var spankMenuType2 = cb.settings.spankMenuType2; var spankMenuType3 = cb.settings.spankMenuType3; var spankMenuType4 = cb.settings.spankMenuType4; var spankMenuType5 = cb.settings.spankMenuType5; var spankMenuType1Amount1 = 1; var spankMenuType2Amount1 = 1; var spankMenuType3Amount1 = 1; var spankMenuType4Amount1 = 1; var spankMenuType5Amount1 = 1; var spankMenuType1Price1 = cb.settings.spankMenuType1Price1; var spankMenuType2Price1 = cb.settings.spankMenuType2Price1; var spankMenuType3Price1 = cb.settings.spankMenuType3Price1; var spankMenuType4Price1 = cb.settings.spankMenuType4Price1; var spankMenuType5Price1 = cb.settings.spankMenuType5Price1; var spankMenuType1Amount2 = cb.settings.spankMenuType1Amount2; var spankMenuType2Amount2 = cb.settings.spankMenuType2Amount2; var spankMenuType3Amount2 = cb.settings.spankMenuType3Amount2; var spankMenuType4Amount2 = cb.settings.spankMenuType4Amount2; var spankMenuType5Amount2 = cb.settings.spankMenuType5Amount2; var spankMenuType1Price2 = cb.settings.spankMenuType1Price2; var spankMenuType2Price2 = cb.settings.spankMenuType2Price2; var spankMenuType3Price2 = cb.settings.spankMenuType3Price2; var spankMenuType4Price2 = cb.settings.spankMenuType4Price2; var spankMenuType5Price2 = cb.settings.spankMenuType5Price2; var spankMenuType1Amount3 = cb.settings.spankMenuType1Amount3; var spankMenuType2Amount3 = cb.settings.spankMenuType2Amount3; var spankMenuType3Amount3 = cb.settings.spankMenuType3Amount3; var spankMenuType4Amount3 = cb.settings.spankMenuType4Amount3; var spankMenuType5Amount3 = cb.settings.spankMenuType5Amount3; var spankMenuType1Price3 = cb.settings.spankMenuType1Price3; var spankMenuType2Price3 = cb.settings.spankMenuType2Price3; var spankMenuType3Price3 = cb.settings.spankMenuType3Price3; var spankMenuType4Price3 = cb.settings.spankMenuType4Price3; var spankMenuType5Price3 = cb.settings.spankMenuType5Price3; var appNoticeColor = '#f4d599'; var red = "#f4c1bc"; var ticketHolderBgColor = 'linear-gradient(to bottom, #ffffff 20%, #cdf2ff 100%)'; var peepshowViewerBgColor = 'linear-gradient(to bottom, #ffffff 20%, #f2e8fb 100%)'; var freePreviewerBgColor = '#fff6e7' var dashLine80 = new Array(80).join("-"); var dashLine60 = new Array(60).join("-"); var dashLine70 = new Array(70).join("-"); var dashLine90 = new Array(90).join("-"); var backgroundImage = ''; var textColor = 'black'; var leftjust1 = 20; var leftjust2 = 20; var leftjust3 = 20; var topjust1 = 4; var topjust2 = 27; var topjust3 = 49; // Arrays */ var fanClubList = []; var VIPListArray = []; var VIPsInShow = []; var extFanListArray = []; var extFanList2Array = []; var extFansInShow = []; var extFansInShow2 = []; var botModListArray = []; var modsInShow = []; var ticketShowViewerList = []; var ticketShowPreViewerList = []; var ticketHolderList = []; var raceTipNotesOn = []; var ninjaTipsOn = []; var tipNoteMessageArray = []; var moderatorList = {name: [], type: []}; var tipCountArray = {name: [], amount: []}; var ticketCumulative = {name: [], amount: []}; var outstandingTicketArray = []; var otChangesArray = {name: [], type: []}; var ticketShowExtraTickets = {name: [], count: []}; var progGoalArray = {desc: [], amt: [], recyc: []}; var sequenceArray = {desc: [], amt: []}; var goalCounterArray = {desc: [], amt: []}; var tipjarGoalArray = {desc: [], amt: [], recyc: []}; var drawpanel = {panel: {}}; var raceUnclaimedVotes = {name: [], amount: []}; var peepshowViewers = []; var peepshowFreeViewers = []; var peepshowPurchasers = []; var peepshowPurchasedTime = [0]; var freePreviewUserArray = []; var freePreviewTimeArray = [0]; var spankGoalArray = {desc: [], amt: []}; var spankPricesArray = {typ: [], number: [], price: []}; var spankRequestsArray = {name: [], amt: [], type: []}; var spankTotalsArray = {typ: [], tipped: [], completed: []}; } { // *********************************** 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 checkSepChar(char) { switch (char) { case 'Spank': return ':spankasss'; case 'Hearts': return ':heart2'; case 'Glitter': return ':pixelglitter'; case 'Flowers': return ':tinyflower2'; case 'Bow': return ':bluebow'; case 'Hearts2': return ':Hearts2'; case 'Smiley': return ':smile'; case 'Text Heart': return '\u2665'; case 'Text Diamond': return '\u2666'; case 'Text Star': return '\u2605'; case 'Vertical Bar': return '|'; default: return ':spankasss'; } } function leftJustify(textstring,line) { textStringLength = textstring.length; if (fontSize == 11) { if (line == 1) { if (textStringLength < 4) { return 114; } else if (textStringLength < 6) { return 109; } else if (textStringLength < 8) { return 104; } else if (textStringLength < 10) { return 100; } else if (textStringLength < 12) { return 95; } else if (textStringLength < 14) { return 90; } else if (textStringLength < 16) { return 86; } else if (textStringLength < 18) { return 82; } else if (textStringLength < 20) { return 77; } else if (textStringLength < 22) { return 72; } else if (textStringLength < 24) { return 67; } else if (textStringLength < 26) { return 62; } else if (textStringLength < 28) { return 58; } else if (textStringLength < 30) { return 53; } else if (textStringLength < 32) { return 49; } else if (textStringLength < 34) { return 44; } else if (textStringLength < 37) { return 39; } else if (textStringLength < 40) { return 34; } else if (textStringLength < 42) { return 30; } else if (textStringLength < 44) { return 26; } else if (textStringLength < 47) { return 21; } else if (textStringLength < 49) { return 16; } else if (textStringLength < 51) { return 11; } else { return 7; } } else { if (textStringLength < 4) { return 114; } else if (textStringLength < 6) { return 110; } else if (textStringLength < 8) { return 105; } else if (textStringLength < 10) { return 100; } else if (textStringLength < 12) { return 97; } else if (textStringLength < 14) { return 93; } else if (textStringLength < 16) { return 88; } else if (textStringLength < 18) { return 83; } else if (textStringLength < 20) { return 79; } else if (textStringLength < 22) { return 74; } else if (textStringLength < 24) { return 71; } else if (textStringLength < 26) { return 66; } else if (textStringLength < 28) { return 61; } else if (textStringLength < 30) { return 57; } else if (textStringLength < 32) { return 53; } else if (textStringLength < 34) { return 48; } else if (textStringLength < 37) { return 44; } else if (textStringLength < 39) { return 39; } else if (textStringLength < 42) { return 34; } else if (textStringLength < 44) { return 29; } else if (textStringLength < 47) { return 24; } else if (textStringLength < 49) { return 19; } else if (textStringLength < 52) { return 14; } else { return 7; } } } else { if (line == 1) { if (textStringLength < 4) { return 113; } else if (textStringLength < 6) { return 108; } else if (textStringLength < 8) { return 103; } else if (textStringLength < 10) { return 99; } else if (textStringLength < 12) { return 94; } else if (textStringLength < 14) { return 89; } else if (textStringLength < 16) { return 84; } else if (textStringLength < 18) { return 80; } else if (textStringLength < 20) { return 75; } else if (textStringLength < 22) { return 70; } else if (textStringLength < 24) { return 65; } else if (textStringLength < 26) { return 60; } else if (textStringLength < 28) { return 55; } else if (textStringLength < 30) { return 50; } else if (textStringLength < 32) { return 46; } else if (textStringLength < 34) { return 41; } else if (textStringLength < 37) { return 36; } else if (textStringLength < 40) { return 31; } else if (textStringLength < 42) { return 26; } else if (textStringLength < 44) { return 22; } else if (textStringLength < 47) { return 17; } else if (textStringLength < 49) { return 12; } else if (textStringLength < 51) { return 7; } else { return 3; } } else { if (textStringLength < 4) { return 113; } else if (textStringLength < 6) { return 109; } else if (textStringLength < 8) { return 104; } else if (textStringLength < 10) { return 99; } else if (textStringLength < 12) { return 95; } else if (textStringLength < 14) { return 91; } else if (textStringLength < 16) { return 86; } else if (textStringLength < 18) { return 81; } else if (textStringLength < 20) { return 77; } else if (textStringLength < 22) { return 72; } else if (textStringLength < 24) { return 68; } else if (textStringLength < 26) { return 63; } else if (textStringLength < 28) { return 58; } else if (textStringLength < 30) { return 54; } else if (textStringLength < 32) { return 50; } else if (textStringLength < 34) { return 45; } else if (textStringLength < 37) { return 40; } else if (textStringLength < 39) { return 35; } else if (textStringLength < 42) { return 30; } else if (textStringLength < 44) { return 25; } else if (textStringLength < 47) { return 20; } else if (textStringLength < 49) { return 15; } else if (textStringLength < 52) { return 10; } else { return 3; } } } } //********** Build Moderator Array ************** 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 addRmvModsInShow(user,mode) { if (mode == 'a') { if (cbjs.arrayContains(modsInShow,user)) { return; } else { modsInShow.push(user); } } else if (mode == 'r') { if (cbjs.arrayContains(modsInShow,user)) { cbjs.arrayRemove(modsInShow,user); } else { return; } } } function populateFanClubArray(user) { if (!cbjs.arrayContains(fanClubList,user)) { fanClubList.push(user); } 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 addRmvVIPInShow(user,mode) { if (mode == 'a') { if (cbjs.arrayContains(VIPsInShow,user)) { return; } else { VIPsInShow.push(user); } } else if (mode == 'r') { if (cbjs.arrayContains(VIPsInShow,user)) { cbjs.arrayRemove(VIPsInShow,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 addRmvExtFan2(user,mode) { if (mode == 'a') { if (cbjs.arrayContains(extFanList2Array,user)) { return; } else { extFanList2Array.push(user); } } else if (mode == 'r') { if (cbjs.arrayContains(extFanList2Array,user)) { cbjs.arrayRemove(extFanList2Array,user); } else { return; } } } function addRmvExtFanInShow(user,mode) { if (mode == 'a') { if (cbjs.arrayContains(extFansInShow,user)) { return; } else { extFansInShow.push(user); } } else if (mode == 'r') { if (cbjs.arrayContains(extFansInShow,user)) { cbjs.arrayRemove(extFansInShow,user); } else { return; } } } function addRmvExtFanInShow2(user,mode) { if (mode == 'a') { if (cbjs.arrayContains(extFansInShow2,user)) { return; } else { extFansInShow2.push(user); } } else if (mode == 'r') { if (cbjs.arrayContains(extFansInShow2,user)) { cbjs.arrayRemove(extFansInShow2,user); } else { return; } } } function genericInit() { finalGoalMet = false; currentGoalMet = false; currentGoalTips = 0; currentGoalCountAmt = 0; currentGoal = 1; currentGoalLevel = 1; currentGoalRecycleCount = 0; currentGroupTipAmt = 0; fontSize = 12; } //********** Tipper List ************** function findTipper(user) { for (var i = 0; i < tipCountArray.name.length; i++) { if(tipCountArray.name[i] == user) { break; } } return i; } //********** Set which Feature is Running ************** function setAppFeature(startapp, setby) { if (startapp == whichApp && startapp != 'none') { cb.sendNotice('The requested App feature is already running.', '', appNoticeColor, '', 'bold'); } else { switch (whichApp) { case 'goals': { setProgressiveGoalsToggle('off', setby); break; } case 'goalcount': { setGoalCounterToggle('off', setby); break; } case 'ticket': { setTicketShowToggle('off', setby); break; } case 'sequence': { setSequenceToggle('off', setby); break; } case 'tipjar': { setTipJarToggle('off', setby); break; } case 'goalrace': { setGoalRaceToggle('off', setby); break; } case 'spank': { setSpankToggle('off', setby); break; } case 'peep': { setPeepShowToggle('off', setby); break; } case 'autoreset': { setAutoresetToggle('off', setby); break; } } switch (startapp) { case 'goals': { progGoalColors(); setProgressiveGoalsToggle('on', setby); break; } case 'goalcount': { goalCounterColors(); setGoalCounterToggle('on', setby); break; } case 'ticket': { setTicketShowToggle('on', setby); break; } case 'sequence': { sequenceColors(); setSequenceToggle('on', setby); break; } case 'tipjar': { tipJarColors(); setTipJarToggle('on', setby); break; } case 'goalrace': { goalraceColors(); setGoalRaceToggle('on', setby); break; } case 'spank': { spankColors(); spankSepChar(); spankNoticeTimer(); setSpankToggle('on', setby); break; } case 'peep': { setPeepShowToggle('on', setby); break; } case 'autoreset': { autoresetGoalColors(); setAutoresetToggle('on', setby); break; } case 'none': { whichApp = 'none'; if (!panelText3Updated) { if (cb.settings.showTotals == 'Yes') { noAppPanelText3 = 'Total Show Tips: ' + currentSessionTotal; } } changeRoomSubject(); break; } } cb.drawPanel(); } } //********** Reset current feature ************** function resetApp() { switch (whichApp) { case 'goals': { genericInit(); initProgGoal(); break; } case 'goalcount': { genericInit(); initGoalCounter(); break; } case 'sequence': { genericInit(); initSequence(); break; } case 'tipjar': { genericInit(); initTipJar(); break; } case 'goalrace': { genericInit(); initGoalRace(); break; } case 'spank': { genericInit(); initSpanks(); break; } case 'autoreset': { genericInit(); initAutoresetGoal(); break; } } cb.drawPanel(); } //********** Validate minimum required settings for each feature ************** function validateFeature(whichApp) { switch (whichApp) { case 'goals': { if (progGoalArray.desc.length <= 0) { cb.sendNotice('UltraApp: The Feature of "Single/Progressive Goals" was chosen, but no goals have been defined. Please restart the UltraApp and define the goals you would like to use or change the app using the "/chgapp" command', cb.room_slug, appNoticeColor); return false; } else { return true; } } case 'goalcount': { if (goalCounterArray.desc.length <= 0) { cb.sendNotice('UltraApp: The Feature of "Goal Counter" was chosen, but no goals have been defined. Please restart the UltraApp and define the goals you would like to use or change the app using the "/chgapp" command', cb.room_slug, appNoticeColor); return false; } else { allowGoals = true; let i = 1; while (goalCounterArray.amt[i] > 0) { if (goalCounterArray.amt[i] <= goalCounterArray.amt[i-1]) { allowGoals = false; } i++; } if (allowGoals) { return true; } else { cb.sendNotice('UltraApp: The Feature of "Goal Counter" was chosen, but the "Number of goals" amounts are not listed in increasing value - each goal number setting amount be greater than the previous. Please restart the UltraApp and correct the goal amounts.', cb.room_slug, appNoticeColor); return false; } } break; } case 'ticket': { if (ticketPrice <= 0) { cb.sendNotice('UltraApp: Unable to start the Ticket Show feature, a ticket price is not set. You can either set the price now using the command "/ticketprice [amt]" where [amt] is in the price in tokens, or restart the UltraApp and set the price. The Ticket Show feature can be enabled after setting a price using the command "/chgapp ticket". ', cb.room_slug, appNoticeColor); return false; } else { return true; } } case 'sequence': { if (sequenceArray.desc.length <= 0) { cb.sendNotice('UltraApp: The Feature of "Asc/Desc Tip Sequence Goals" was chosen, but no goals have been defined. Please restart the UltraApp and define the goals you would like to use or change the app using the "/chgapp" command', cb.room_slug, appNoticeColor); return false; } else if (cb.settings.tipsequenceLowNumber >= cb.settings.tipsequenceHighNumber) { cb.sendNotice('UltraApp: The Feature of "Asc/Desc Tip Sequence Goals" was chosen, but the lower end of the sequence is configured as higher than the high end of the sequence. Please restart the UltraApp and define the high and low end sequence appropriately.', cb.room_slug, appNoticeColor); return false; } else { allowSeq = true; if (tipSequenceDirection == 'up') { let i = 0; while (sequenceArray.amt[i+1] > 0) { if (sequenceArray.amt[i] > sequenceArray.amt[i+1]) { allowSeq = false; } i++; } } else if (tipSequenceDirection == 'down') { let i = 0; while (sequenceArray.amt[i+1] > 0) { if (sequenceArray.amt[i] < sequenceArray.amt[i+1]) { allowSeq = false; } i++; } } if (allowSeq) { return true; } else { cb.sendNotice('UltraApp: The Feature of "Asc/Desc Tip Sequence Goals" was chosen, but the goals are not sequenced correctly per the ascending or descending direction. Please restart the UltraApp and make sure the goal sequence matches the ascending/descending setting (for example, use 5,10,15 for ascending, or 15,10,5 for descending).', cb.room_slug, appNoticeColor); return false; } } } case 'tipjar': { if (tipjarGoalArray.desc.length <= 0) { cb.sendNotice('UltraApp: The Feature of "Tip Jar" was chosen, but no goals have been defined. Please restart the UltraApp and define the goals you would like to use or change the app using the "/chgapp" command', cb.room_slug, appNoticeColor); return false; } else { return true; } break; } case 'goalrace': { if (goalraceDesc1 == '' || goalraceDesc1 == null || goalraceDesc2 == '' || goalraceDesc2 == null) { cb.sendNotice('UltraApp: Unable to start the Goal Race feature, either the Goal 1 or Goal 2 Description is missing.', cb.room_slug, appNoticeColor); return false; } else if (goalraceAmount1 == 0 || goalraceAmount2 == 0) { cb.sendNotice('UltraApp: Unable to start the Goal Race feature, either the Goal 1 or Goal 2 Amount is zero.', cb.room_slug, appNoticeColor); return false; } else { return true; } } case 'spank': { if (spankGoalDescription1 == '' || spankGoalDescription1 == null) { cb.sendNotice('UltraApp: Unable to start the Spank-a-thon feature, Goal #1 Description is missing and at least one goal is required.', cb.room_slug, appNoticeColor); return false; } else if (spankGoalAmount1 < 1 || spankGoalAmount1 == null) { cb.sendNotice('UltraApp: Unable to start the Spank-a-thon feature, Goal #1 Tip Amount is missing and at least one goal is required.', cb.room_slug, appNoticeColor); return false; } else if (spankPricesArray.typ[0] == '' || spankPricesArray.typ[0] == null) { cb.sendNotice('UltraApp: Unable to start the Spank-a-thon feature, Spank Type 1 description is missing and at least one type is required.', cb.room_slug, appNoticeColor); return false; } else if (spankPricesArray.price[0] < 1 || spankPricesArray.price[0] == null) { cb.sendNotice('UltraApp: Unable to start the Spank-a-thon feature, Spank Type 1 price is missing and at least one type is required.', cb.room_slug, appNoticeColor); return false; } else { checkdup = true; duprice = 0; for (i = 0; i < spankPricesArray.price.length; i++) { for (j = i+1; j < spankPricesArray.price.length; j++) { if (j != i && spankPricesArray.price[j] == spankPricesArray.price[i] && spankPricesArray.price[j] != 0) { duprice = spankPricesArray.price[j]; checkdup = false; break; } } } if (checkdup) { return true; } else { cb.sendNotice('UltraApp: Unable to start the Spank-a-thon feature, there are duplicate entries with a price of ' + duprice + ' tokens.', cb.room_slug, appNoticeColor); return false; } } } case 'peep': { if (peepshowPrice <= 0) { cb.sendNotice('Unable to start the Peep Show feature, a "per minute" price was not set on the start page. You can either set the price now using the command "/peepprice [amt]" where [amt] is in the price per minute in tokens, or restart the UltraApp and set the price. The Peep Show feature can be enabled after setting a price using the command "/chgapp peepshow". ', cb.room_slug, appNoticeColor); return false; } else { return true; } if (peepshowLengthOfShow <= 0) { cb.sendNotice('Unable to start the Peep Show feature, a "Length of Show" was not set on the start page. You can either set the length now using the command "/pslength [time]" where [time] is in the expected length of the show in minutes, or restart the UltraApp and set the Peep Show Length. The Peep Show feature can be enabled after setting a price using the command "/chgapp peepshow". ', cb.room_slug, appNoticeColor); return false; } else { return true; } } case 'autoreset': { if (autoresetGoalAmount <= 0) { cb.sendNotice('UltraApp: The Feature of "Auto-Reset Goal" was chosen, but no individual goal amount has been defined. Please restart the UltraApp and define the goals you would like to use or change the app using the "/chgapp" command', cb.room_slug, appNoticeColor); return false; } else { return true; } if (autoresetEachGoal <= 0) { cb.sendNotice('UltraApp: The Feature of "Auto-Reset Goal" was chosen, but no individual goal amount has been defined. Please restart the UltraApp and define the goals you would like to use or change the app using the "/chgapp" command', cb.room_slug, appNoticeColor); return false; } else { return true; } } case 'none': { return true; } } } //********** Set custom panel text and background ************** function customizePanelText(newcolor,sendto) { if (!newcolor && cb.settings.panelTextColor == 'Custom') { textcolorchk = checkTextColor(cb.settings.panelCustomTextColor); if (textcolorchk == 'default') { cb.sendNotice('Draw Panel Text Color - Error while setting the text color. It has to be in a HEX format.', sendto, appNoticeColor, ''); } else { textColor = textcolorchk; cb.drawPanel(); } } else if (newcolor) { textcolorchk = checkTextColor(newcolor); if (textcolorchk == 'default') { cb.sendNotice('Draw Panel Text Color - Error while setting the text color. It has to be in a HEX format.', sendto, appNoticeColor, ''); } else { textColor = textcolorchk; cb.drawPanel(); } } else { textColor = checkTextColor(cb.settings.panelTextColor); cb.drawPanel(); } } function customizePanelBackground(newbackground,sendto) { customPanel = false; if (cbjs.arrayContains(backgroundArray.command,newbackground)) { index = backgroundArray.command.indexOf(newbackground); if (cb.room_slug == 'dorothy') { backgroundImage = backgroundArray.devfile[index]; customPanel = true; currentPanel = newbackground; cb.drawPanel(); } else { menuname = backgroundArray.menu[index]; if (menuname.substring(0,12) == 'personalized') { if (newbackground == cb.room_slug) { if (appVersion == 'Show1') { backgroundImage = backgroundArray.livefile[index]; } else if (appVersion == 'Show2') { backgroundImage = backgroundArray.livefile2[index]; } customPanel = true; currentPanel = newbackground; cb.drawPanel(); } else { cb.sendNotice('You have requested a personalized background, but you are not the room owner for that background, please choose again.', sendto, appNoticeColor, ''); } } else { if (appVersion == 'Show1') { backgroundImage = backgroundArray.livefile[index]; } else if (appVersion == 'Show2') { backgroundImage = backgroundArray.livefile2[index]; } customPanel = true; currentPanel = newbackground; cb.drawPanel(); } } } else { cb.sendNotice('Invalid background name. The valid names are: \n' + cbjs.arrayJoin(backgroundArray.command, ', '), sendto, appNoticeColor, ''); } } // *********************************** Length of show ************************************** function clockTimeCal() { timeNow = new Date(); return timeNow - ultraAppStartTime.getTime(); } 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' : ''); } } //******************** Goal Bar ************************** function goalBar(current,total) { if (current > 0 && total > 0) { percent = Math.round(100*(current/total)); } else { percent = 0; } bar = ''; full = '\u25C6'; half = '\u25C8'; empty = '\u25C7'; a = (percent - (percent % 10)) / 10; b = (percent % 10) > 0 ? 1 : 0; c = 10 - (a + b); bar += charRepeat(full, a); (b === 1 ? bar += half : bar += ""); bar += charRepeat(empty, c) return bar; } function charRepeat(d, e) { var string = ""; for (var index = 1; index <= e; index++) { string += d } return string; } //********** Record Tip and Track Goal Progress ************** function recordTip(tippedamount,tippedby,tippednote,tippedisfan,tippedisextfan,tippedisextfan2,tippedisvip) { switch (whichApp) { case 'goals': { if (tippedby != 'bc') { currentAppTotalGoal += tippedamount; currentSessionTotal += tippedamount; } if (!finalGoalMet) { if (cb.settings.progressiveUpDown == 'Count Up To Goal') { savedCurrentGoalTips = currentGoalTips; currentGoalTips += tippedamount; if (currentGoalTips >= currentGoalTotal) { if (cb.settings.progressiveAutoNext == 'Auto-start next') { exceedGoal(tippedamount); } else { if (!currentGoalMet) { goalComplete(); } } } } else { savedCurrentGoalTips = currentGoalTips; currentGoalTips -= tippedamount; if (currentGoalTips <= 0) { if (cb.settings.progressiveAutoNext == 'Auto-start next') { exceedGoal(tippedamount); } else { if (!currentGoalMet) { goalComplete(); } } } } } cb.drawPanel(); break; } case 'goalcount': { if (tippedby != 'bc') { currentAppTotalCounter += tippedamount; currentSessionTotal += tippedamount; } if (!finalGoalMet) { savedCurrentGoalTips = currentGoalTips; currentGoalTips += tippedamount; if (currentGoalTips >= currentGoalTotal) { exceedGoal(tippedamount); } } cb.drawPanel(); break; } case 'ticket': { if (tippedby != 'bc') { currentAppTotalTicket += tippedamount; currentSessionTotal += tippedamount; } if (cb.settings.ticketShowFanAppreciation != 'Yes') { if (!ticketShowEnded && !ticketSalesEnded && (!cb.limitCam_userHasAccess(tippedby) || cbjs.arrayContains(ticketShowPreViewerList,tippedby))) { if (tippedisfan) { if (tippedamount >= cb.settings.ticketShowPriceFC) { addRmvTicket('addtip',tippedby,'fan',tippedamount); } else { checkCumulative(tippedby,tippedamount,cb.settings.ticketShowPriceFC,'fan','ticket'); } } else if (tippedisextfan) { if (tippedamount >= cb.settings.ticketShowPriceEFC) { addRmvTicket('addtip',tippedby,'extfan',tippedamount); } else { checkCumulative(tippedby,tippedamount,cb.settings.ticketShowPriceEFC,'extfan','ticket'); } } else if (tippedisextfan2) { if (tippedamount >= cb.settings.ticketShowPriceEFC2) { addRmvTicket('addtip',tippedby,'extfan2',tippedamount); } else { checkCumulative(tippedby,tippedamount,cb.settings.ticketShowPriceEFC2,'extfan2','ticket'); } } else if (tippedisvip) { if (tippedamount >= cb.settings.ticketShowPriceVIP) { addRmvTicket('addtip',tippedby,'vip',tippedamount); } else { checkCumulative(tippedby,tippedamount,cb.settings.ticketShowPriceVIP,'vip','ticket'); } } else { if (tippedamount >= ticketPrice) { addRmvTicket('addtip',tippedby,'common',tippedamount); } else { checkCumulative(tippedby,tippedamount,ticketPrice,'common','ticket'); } } } else if (!ticketShowEnded && !ticketSalesEnded && (!cb.limitCam_userHasAccess(tippedby) || cbjs.arrayContains(ticketShowPreViewerList,tippedby)) && ticketShowAllowGift == 'Yes') { if (tippedamount >= ticketPrice) { addRmvTicket('addextra', tippedby, 'common', tippedamount); } } ticketShowGoalProgress(tippedamount); } cb.drawPanel(); break; } case 'sequence': { if (tippedby != 'bc') { currentAppTotalSequence += tippedamount; currentSessionTotal += tippedamount; } if (!finalGoalMet) { if (tippedamount < nextSequence) { if (groupTipToggle == 1) { currentGroupTipAmt += tippedamount; if (currentGroupTipAmt >= nextSequence) { exceedGoal(currentGroupTipAmt-nextSequence); } } } else { exceedGoal(tippedamount-nextSequence); } } cb.drawPanel(); break; } case 'tipjar': { if (tippedby != 'bc') { currentAppTotalTipJar += tippedamount; currentSessionTotal += tippedamount; } if (tipJarRunning) { tipJarCurrentTokens += tippedamount; } else { if (!finalGoalMet) { savedCurrentGoalTips = currentGoalTips; currentGoalTips += tippedamount; if (currentGoalTips >= currentGoalTotal) { exceedGoal(tippedamount); } } } cb.drawPanel(); break; } case 'goalrace': { if (tippedby != 'bc') { currentAppTotalGoalRace += tippedamount; currentSessionTotal += tippedamount; } if (!finalGoalMet) { originalTipAmount = tippedamount; if (tippedisfan && cb.settings.goalraceBonusFC > 0) { tippedamount = parseInt(tippedamount * (1 + cb.settings.goalraceBonusFC/100)); } else if (tippedisextfan && cb.settings.goalraceBonusEFC > 0) { tippedamount = parseInt(tippedamount * (1 + cb.settings.goalraceBonusEFC/100)); } else if (tippedisextfan2 && cb.settings.goalraceBonusEFC2 > 0) { tippedamount = parseInt(tippedamount * (1 + cb.settings.goalraceBonusEFC2/100)); } else if (tippedisvip && cb.settings.goalraceBonusVIP > 0) { tippedamount = parseInt(tippedamount * (1 + cb.settings.goalraceBonusVIP/100)); } if (tippednote == goalraceDesc1) { currentGoalRace1Tips += tippedamount; if (currentGoalRace1Tips >= goalraceAmount1) { goalRaceWinner = goalraceDesc1; goalComplete(); } } else if (tippednote == goalraceDesc2) { currentGoalRace2Tips += tippedamount; if (currentGoalRace2Tips >= goalraceAmount2) { goalRaceWinner = goalraceDesc2; goalComplete(); } } else { raceAddUnclaimed(tippedby,originalTipAmount); } } cb.drawPanel(); break; } case 'spank': { checkSpankMenu(tippedamount,tippedby); if (tippedby != 'bc') { currentAppTotalSpanks += tippedamount; currentSessionTotal += tippedamount; } if (!finalGoalMet) { savedcurrentGoalTips = currentGoalTips; currentGoalTips += tippedamount; if (currentGoalTips >= currentGoalTotal) { exceedGoal(tippedamount); } } cb.drawPanel(); break; } case 'peep': { if (tippedby != 'bc') { currentAppTotalPeep += tippedamount; currentSessionTotal += tippedamount; } if (showStage == 'peepfinale') { cb.sendNotice('Thank you for tipping, however, the show is nearly over and ' + bctext + ' has suspended purchases of Peep Show time.', tippedby, peepBgColor, peepTxtColor, 'bold'); } if (!peepshowEnded && !peepshowSalesEnded && !cbjs.arrayContains(peepshowFreeViewers,tippedby)) { if (tippedamount >= minimumPeepShowTip) { peepshowAddRmvTime('addtip', tippedby, 'common', tippedamount); } else { if (tippedamount > 1) { cb.sendNotice('Thank you for tipping, sorry that amount is below the minimum required to add time to your show (' + minimumPeepShowTip + ' tokens).', tippedby, peepBgColor, peepTxtColor, 'bold'); } } } cb.drawPanel(); break; } case 'autoreset': { if (tippedby != 'bc') { currentAppTotalAutoreset += tippedamount; currentSessionTotal += tippedamount; resetLastTip = tippedby + ' (' + tippedamount + ')'; } if (!finalGoalMet) { savedCurrentGoalTips = currentGoalTips; currentGoalTips += tippedamount; if (currentGoalTips >= currentGoalTotal) { exceedGoal(tippedamount); } } cb.drawPanel(); break; } case 'none': { if (tippedby != 'bc') { currentAppTotalNone += tippedamount; currentSessionTotal += tippedamount; if (!panelText3Updated) { if (cb.settings.showTotals == 'Yes') { noAppPanelText3 = 'Total Show Tips: ' + currentSessionTotal; } } } cb.drawPanel(); break; } } } function raceAddUnclaimed(tippedbyunc,originalTipAmount) { if (cb.settings.goalraceAllowClaim == 'Yes') { if (!cbjs.arrayContains(raceUnclaimedVotes.name, tippedbyunc)) { raceUnclaimedVotes.name.push(tippedbyunc); raceUnclaimedVotes.amount.push(originalTipAmount); } else { index = raceUnclaimedVotes.name.indexOf(tippedbyunc); raceUnclaimedVotes.amount[index] += originalTipAmount; } cb.sendNotice(tippedbyunc + ', your tip was not recorded against a Goal Race choice, you can add your unclaimed tips to one of the goals with the command "/addrace1" for goal #1 or "/addrace2" for goal #2', tippedbyunc, goalraceBgColor, goalraceTxtColor, 'bold'); } } function checkCumulative(tippedbycum,tippedamountcum,cumTktPrice,usertype,saletype) { if (cb.settings.ticketShowCumulative == 'Yes') { if (!cbjs.arrayContains(ticketCumulative.name, tippedbycum)) { ticketCumulative.name.push(tippedbycum); ticketCumulative.amount.push(tippedamountcum); } else { index = ticketCumulative.name.indexOf(tippedbycum); if (ticketCumulative.amount[index] + tippedamountcum >= cumTktPrice) { if (saletype == 'ticket') { addRmvTicket('addtip',tippedbycum,usertype,tippedamountcum); } else if (saletype == 'presale') { addRmvPresale('addtip',tippedbycum,'common'); } ticketCumulative.amount[index] = 0; } else { ticketCumulative.amount[index] += tippedamountcum; } } } } function exceedGoal(tippedamountexc) { switch (whichApp) { case 'ticket': { break; } case 'peep': { break; } case 'goals': { if (cb.settings.progressiveUpDown == 'Count Up To Goal') { excessTip = tippedamountexc - (currentGoalTotal - savedCurrentGoalTips); goalComplete(); if (!finalGoalMet) { nextGoal(); currentGoalTips = excessTip; if (currentGoalTips >= currentGoalTotal) { savedCurrentGoalTips = 0; exceedGoal(currentGoalTips); } } } else { excessTip = tippedamountexc - savedCurrentGoalTips; goalComplete(); if (!finalGoalMet) { nextGoal(); currentGoalTips = currentGoalTotal - excessTip; if (currentGoalTips <= 0) { savedCurrentGoalTips = 0; exceedGoal(0 - currentGoalTips); } } } break; } case 'goalcount': { cb.sendNotice('Goal #' + (currentGoalCountAmt + 1) + ' has been Completed!', '', goalCountBgColor, goalCountTxtColor, 'bold'); excessTip = tippedamountexc - (currentGoalTotal - savedCurrentGoalTips); if ((currentGoalCountAmt + 1) >= goalCounterArray.amt[currentGoalLevel-1]) { goalComplete(); } if (!finalGoalMet) { nextGoal(); currentGoalTips = excessTip; if (currentGoalTips >= currentGoalTotal) { savedCurrentGoalTips = 0; exceedGoal(currentGoalTips); } } break; } case 'sequence': { if (tipSequenceDirection == 'up') { nextSequence++; if (chatMsgToggle == 1 && nextSequence <= endSequence) { var nextgif = ':next' + nextSequence; cb.sendNotice('Tip Sequence ' + (nextSequence-1) + ' has been Completed --- ' + nextgif, '', sequenceBgColor, sequenceTxtColor, 'bold'); } if (nextSequence > sequenceArray.amt[currentGoalLevel-1]) { goalComplete(); if (nextSequence > endSequence) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine80 + '\n :CGGoal15 The Tip Sequence has been Completed!! :CGGoal15 \n \u2724 \u2749 \u2724 \u2749 \u2724 ' + getTopTipper() + ' was the top tipper!!! \u2724 \u2749 \u2724 \u2749 \u2724 \n' + dashLine80, '', sequenceBgColor, sequenceTxtColor, 'bold'); } else { nextGoal(); } } else { if (nextSequence > endSequence) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine80 + '\n :CGGoal15 The Tip Sequence has been Completed!! :CGGoal15 \n \u2724 \u2749 \u2724 \u2749 \u2724 ' + getTopTipper() + ' was the top tipper!!! \u2724 \u2749 \u2724 \u2749 \u2724 \n' + dashLine80, '', sequenceBgColor, sequenceTxtColor, 'bold'); } } } else if (tipSequenceDirection == 'down') { nextSequence--; if (chatMsgToggle == 1 && nextSequence >= endSequence) { var nextgif = ':next' + nextSequence; cb.sendNotice('Tip Sequence ' + (nextSequence+1) + ' has been Completed --- ' + nextgif, '', sequenceBgColor, sequenceTxtColor, 'bold'); } if (nextSequence < sequenceArray.amt[currentGoalLevel-1]) { goalComplete(); if (nextSequence < endSequence) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine80 + '\n :CGGoal15 The Tip Sequence has been Completed!! :CGGoal15 \n \u2724 \u2749 \u2724 \u2749 \u2724 ' + getTopTipper() + ' was the top tipper!!! \u2724 \u2749 \u2724 \u2749 \u2724 \n' + dashLine80, '', sequenceBgColor, sequenceTxtColor, 'bold'); } else { nextGoal(); } } else { if (nextSequence < endSequence) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine80 + '\n :CGGoal15 The Tip Sequence has been Completed!! :CGGoal15 \n \u2724 \u2749 \u2724 \u2749 \u2724 ' + getTopTipper() + ' was the top tipper!!! \u2724 \u2749 \u2724 \u2749 \u2724 \n' + dashLine80, '', sequenceBgColor, sequenceTxtColor, 'bold'); } } } currentGroupTipAmt = 0; excessTip = tippedamountexc; if (excessTip > 0) { if (!finalGoalMet) { if (excessTip < nextSequence) { if (groupTipToggle == 1) { currentGroupTipAmt += excessTip; } } else { exceedGoal(excessTip-nextSequence); } } } break; } case 'tipjar': { goalComplete(); tipJarCurrentTokens = currentGoalTips; startTipJar(); break; } case 'spank': { excessTip = tippedamountexc - (currentGoalTotal - savedcurrentGoalTips); goalComplete(); if (!finalGoalMet) { nextGoal(); currentGoalTips = excessTip; if (currentGoalTips >= currentGoalTotal) { savedcurrentGoalTips = 0; exceedGoal(currentGoalTips); } } break; } case 'autoreset': { excessTip = tippedamountexc - (currentGoalTotal - savedCurrentGoalTips); goalComplete(); if (!finalGoalMet) { nextGoal(); currentGoalTips = excessTip; if (currentGoalTips >= currentGoalTotal) { savedCurrentGoalTips = 0; exceedGoal(currentGoalTips); } } break; } } } function goalComplete() { switch (whichApp) { case 'ticket': { break; } case 'peep': { break; } case 'goals': { currentGoalMet = true; if (progGoalArray.desc.length == 1) { cb.sendNotice(dashLine60 + '\n :CGGoal15 The Goal has been met!! :CGGoal15 \n' + dashLine60, '', progGoalBgColor, progGoalTxtColor, 'bold'); finalGoalMet = true; changeRoomSubject(); } else if ((currentGoal) < progGoalArray.desc.length) { cb.sendNotice(dashLine60 + '\n :CGGoal15 Goal #' + currentGoal + ' (' + progGoalArray.desc[currentGoal-1] + ') has been met!! :CGGoal15 \n' + dashLine60, '', progGoalBgColor, progGoalTxtColor, 'bold'); if (cb.settings.progressiveAutoNext != 'Auto-start next') { cb.sendNotice('The goal has been completed and per configuration the app is awaiting manual advance using the "/next" command', '', appNoticeColor, '', '', 'red') cb.sendNotice('The goal has been completed and per configuration the app is awaiting manual advance using the "/next" command', cb.room_slug, appNoticeColor, '', '') } } else if ((currentGoal) == progGoalArray.desc.length) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine60 + '\n :CGGoal15 Final Goal (' + progGoalArray.desc[currentGoal-1] + ') has been met!! :CGGoal15 \n *****' + getTopTipper() + ' was the top tipper!!! *****\n' + dashLine60, '', progGoalBgColor, progGoalTxtColor, 'bold'); } break; } case 'goalcount': { if (goalCounterArray.desc.length == 1) { cb.sendNotice(dashLine80 + '\n :CGGoal15 The Goal Counter Prize Level has been met!! :CGGoal15 \n' + dashLine80, '', goalCountBgColor, goalCountTxtColor, 'bold'); } else if ((currentGoalLevel) < goalCounterArray.desc.length) { cb.sendNotice(dashLine80 + '\n :CGGoal15 Goal Counter Prize Level #' + currentGoalLevel + ' (' + goalCounterArray.desc[currentGoalLevel-1] + ') has been met!! :CGGoal15 \n' + dashLine80, '', goalCountBgColor, goalCountTxtColor, 'bold'); } else if ((currentGoalLevel) == goalCounterArray.desc.length) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine60 + '\n :CGGoal15 Final Prize Level (' + goalCounterArray.desc[currentGoalLevel-1] + ') has been met!! :CGGoal15 \n *****' + getTopTipper() + ' was the top tipper!!! *****\n' + dashLine60, '', goalCountBgColor, goalCountTxtColor, 'bold'); } break; } case 'sequence': { cb.sendNotice(dashLine80 + '\n :CGGoal15 Tip Sequence Goal #' + currentGoalLevel + ' (' + sequenceArray.desc[currentGoalLevel-1] + ') has been met!! :CGGoal15 \n' + dashLine80, '', sequenceBgColor, sequenceTxtColor, 'bold'); break; } case 'tipjar': { cb.sendNotice(dashLine80 + '\n :CGGoal15 Tip Jar Goal #' + currentGoalLevel + ' (' + currentGoalDesc + ') has been met!! :CGGoal15 \n ***** The Tip Jar will start to empty, tip to keep it full! *****\n' + dashLine80, '', tipjarBgColor, tipjarTxtColor, 'bold'); changeRoomSubject(); break; } case 'goalrace': { cb.sendNotice(dashLine80 + '\n :CGGoal15 Goal Race Winner : ' + goalRaceWinner + ' !! :CGGoal15 \n' + dashLine80, '', goalraceBgColor, goalraceTxtColor, 'bold'); cb.sendNotice('The Goal Race has finished, you can use the command /restartrace to play the same race again (you can change the goal descriptions with the command /setgoal1 or /setgoal2), or change to a different App Feature.', '', appNoticeColor, '', 'bold'); finalGoalMet = true; changeRoomSubject(); break; } case 'spank': { if (spankGoalArray.desc.length == 1) { cb.sendNotice(dashLine60 + '\n :CGGoal15 The Spank Goal has been met!! :CGGoal15 \n' + dashLine60, '', spankBgColor, spankTextColor, 'bold'); finalGoalMet = true; changeRoomSubject(); } else if ((currentGoal) < spankGoalArray.desc.length) { cb.sendNotice(dashLine60 + '\n :CGGoal15 Spank Goal #' + currentGoal + ' (' + spankGoalArray.desc[currentGoal-1] + ') has been met!! :CGGoal15 \n' + dashLine60, '', spankBgColor, spankTextColor, 'bold'); } else if ((currentGoal) == spankGoalArray.desc.length) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine60 + '\n :CGGoal15 Final Spank Goal (' + spankGoalArray.desc[currentGoal-1] + ') has been met!! :CGGoal15 \n *****' + getTopTipper() + ' was the top tipper!!! *****\n' + dashLine60, '', spankBgColor, spankTextColor, 'bold'); } spankTotals(); break; } case 'autoreset': { if (autoresetEndAfter > 0 && currentGoal >= autoresetEndAfter) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine70 + '\n :CGGoal15 Final Goal (' + autoresetFinalGoal + ') has been met!! :CGGoal15 \n *****' + getTopTipper() + ' was the top tipper!!! *****\n' + dashLine70, '', autoresetBgColor, autoresetTextColor, 'bold'); } else { if (resetShowCount) { cb.sendNotice(dashLine70 + '\n :CGGoal15 The Goal has been met ' + currentGoal + ' time' + (currentGoal == 1 ? '' : 's') + '!! :CGGoal15 \n' + dashLine70, '', autoresetBgColor, autoresetTextColor, 'bold'); } else { cb.sendNotice(dashLine70 + '\n :CGGoal15 The Goal has been met!!! :CGGoal15 \n' + dashLine70, '', autoresetBgColor, autoresetTextColor, 'bold'); } } break; } } } function advanceTipJar() { tipJarRunning = false; if (currentGoalRecycleCount >= tipjarGoalArray.recyc[currentGoalLevel-1]) { if (currentGoalLevel < totalTipJarLevels) { nextGoal(); } else { currentGoalTips = 0; finalGoalMet = true; cb.sendNotice('The Tip Jar is empty and the last goal is completed!!', '', tipjarNoticesBgColor, tipjarNoticesTxtColor, 'bold'); changeRoomSubject(); } } else { cb.sendNotice('The Tip Jar has emptied and the current goal recycled, tip to reach the goal to start the prize again!', '', tipjarNoticesBgColor, tipjarNoticesTxtColor, 'bold'); currentGoalRecycleCount++; currentGoalTips = 0; changeRoomSubject(); } cb.drawPanel(); } function skipGoal() { switch (whichApp) { case 'goals': { goalComplete(); if (!finalGoalMet) { nextGoal(); } break; } case 'goalcount': { cb.sendNotice('Goal #' + (currentGoalCountAmt + 1) + ' has been Completed!', '', goalCountBgColor, goalCountTxtColor, 'bold'); if ((currentGoalCountAmt + 1) >= goalCounterArray.amt[currentGoalLevel-1]) { goalComplete(); } if (!finalGoalMet) { nextGoal(); currentGoalTips = 0; } break; } case 'sequence': { exceedGoal(); break; } case 'tipjar': { tipJarRunning = false; if (currentGoalRecycleCount >= tipjarGoalArray.recyc[currentGoalLevel-1]) { if (currentGoalLevel < totalTipJarLevels) { nextGoal(); } else { currentGoalTips = 0; finalGoalMet = true; cb.sendNotice('The Tip Jar is empty and the last goal is completed!!', '', tipjarNoticesBgColor, tipjarNoticesTxtColor, 'bold'); changeRoomSubject(); } } else { cb.sendNotice('The Tip Jar has emptied and the current goal recycled, tip to reach the goal to start the prize again!', '', tipjarNoticesBgColor, tipjarNoticesTxtColor, 'bold'); currentGoalRecycleCount++; currentGoalTips = 0; changeRoomSubject(); } break; } case 'spank': { currentGoalTips = 0; goalComplete(); if (!finalGoalMet) { nextGoal(); } break; } case 'autoreset': { currentGoalTips = 0; goalComplete(); if (!finalGoalMet) { nextGoal(); } break; } } cb.drawPanel(); } function advanceGoalLevel() { switch (whichApp) { case 'goalcount': { currentGoalCountAmt = goalCounterArray.amt[currentGoalLevel-1]; goalComplete(); currentGoalLevel++; currentGoalDesc = goalCounterArray.desc[currentGoalLevel-1]; currentGoalCountLevelAmt = goalCounterArray.amt[currentGoalLevel-1]; if ((currentGoalLevel) <= goalCounterArray.desc.length) { changeRoomSubject(); } currentGoalTips = 0; break; } case 'sequence': { if (tipSequenceDirection == 'up') { nextSequence = sequenceArray.amt[currentGoalLevel-1] + 1; if (chatMsgToggle == 1 && nextSequence <= endSequence) { var nextgif = ':next' + nextSequence; cb.sendNotice('Tip Sequence ' + (nextSequence-1) + ' has been Completed --- ' + nextgif, '', sequenceBgColor, sequenceTxtColor, 'bold'); } goalComplete(); if (nextSequence > endSequence) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine80 + '\n :CGGoal15 The Tip Sequence has been Completed!! :CGGoal15 \n ***** ' + getTopTipper() + ' was the top tipper!!! *****\n' + dashLine80, '', sequenceBgColor, sequenceTxtColor, 'bold'); } else { nextGoal(); } } else if (tipSequenceDirection == 'down') { nextSequence = sequenceArray.amt[currentGoalLevel-1] - 1; if (chatMsgToggle == 1 && nextSequence >= endSequence) { var nextgif = ':next' + nextSequence; cb.sendNotice('Tip Sequence ' + (nextSequence+1) + ' has been Completed --- ' + nextgif, '', sequenceBgColor, sequenceTxtColor, 'bold'); } goalComplete(); if (nextSequence < endSequence) { finalGoalMet = true; changeRoomSubject(); cb.sendNotice(dashLine80 + '\n :CGGoal15 The Tip Sequence has been Completed!! :CGGoal15 \n ***** ' + getTopTipper() + ' was the top tipper!!! *****\n' + dashLine80, '', sequenceBgColor, sequenceTxtColor, 'bold'); } else { nextGoal(); } } break; } } cb.drawPanel(); } function getTopTipper() { var swapped, temp1, temp2; do { swapped = false; for (var i = 0; i < tipCountArray.amount.length ; i++) { if (tipCountArray.amount[i] < tipCountArray.amount[i + 1]) { temp1 = tipCountArray.amount[i]; temp2 = tipCountArray.name[i]; tipCountArray.amount[i] = tipCountArray.amount[i + 1]; tipCountArray.amount[i + 1] = temp1; tipCountArray.name[i] = tipCountArray.name[i + 1]; tipCountArray.name[i + 1] = temp2; swapped = true; } } } while (swapped); return tipCountArray.name[0]; } function nextGoal() { switch (whichApp) { case 'ticket': { break; } case 'peep': { break; } case 'goals': { currentGoal++; currentGoalDesc = progGoalArray.desc[currentGoal-1]; currentGoalTotal = progGoalArray.amt[currentGoal-1]; if (cb.settings.progressiveUpDown == 'Count Up To Goal') { currentGoalTips = 0; } else { currentGoalTips = currentGoalTotal; } currentGoalMet = false; changeRoomSubject(); break; } case 'goalcount': { currentGoalCountAmt++; if (currentGoalCountAmt >= goalCounterArray.amt[currentGoalLevel-1]) { currentGoalLevel++; currentGoalDesc = goalCounterArray.desc[currentGoalLevel-1]; currentGoalCountLevelAmt = goalCounterArray.amt[currentGoalLevel-1]; changeRoomSubject(); } break; } case 'sequence': { currentGoalLevel++; currentGoalSequence = sequenceArray.amt[currentGoalLevel-1]; currentGoalDesc = sequenceArray.desc[currentGoalLevel-1]; changeRoomSubject(); break; } case 'tipjar': { currentGoalLevel++; currentGoalRecycleCount = 0; currentGoalTips = 0; currentGoalRecycleTotal = tipjarGoalArray.recyc[currentGoalLevel-1]; currentGoalTotal = tipjarGoalArray.amt[currentGoalLevel-1]; currentGoalDesc = tipjarGoalArray.desc[currentGoalLevel-1]; changeRoomSubject(); break; } case 'spank': { currentGoal++; currentGoalDesc = spankGoalArray.desc[currentGoal-1]; currentGoalTotal = spankGoalArray.amt[currentGoal-1]; changeRoomSubject(); break; } case 'autoreset': { currentGoal++; break; } } } function changeRoomSubject() { if (genericRoomSubjectPosn == 'Beginning') { newsubject = genericRoomSubjectSfx + ' '; } else { newsubject = ''; } switch (whichApp) { case 'goals': { if (!finalGoalMet) { if (cb.settings.progressiveUpDown == 'Count Up To Goal') { newsubject += 'Current Goal: ' + currentGoalDesc + ' at ' + currentGoalTotal + ' tokens.'; } else { newsubject += 'Current Goal: ' + currentGoalDesc + ' once countdown reaches zero.'; } if (progGoalArray.desc.length >= (currentGoal + 1)) { newsubject += ' --- Next Goal: ' + progGoalArray.desc[currentGoal] + '. '; } else if (progGoalArray.desc.length > 1) { newsubject += ' --- This is the Last Goal! '; } } else { newsubject += 'All Goals Have Been Completed!!! '; } newsubject += goalSubjectText; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'goalcount': { if (!finalGoalMet) { startlevel = currentGoalLevel - 1; numremgoals = goalCounterArray.desc.length - startlevel; endlevel = startlevel + 3; if (endlevel > goalCounterArray.desc.length) { endlevel = goalCounterArray.desc.length; } if (numremgoals == 1) { newsubject += 'Final Prize Level: '; } else if (numremgoals == 2) { newsubject += 'Final 2 Prize Levels: '; } else if (numremgoals == 3) { newsubject += 'Final 3 Prize Levels: '; } else if (numremgoals > 3) { newsubject += 'Next 3 Prize Levels: '; } for (let i = startlevel; i < endlevel; i++) { if (goalCounterArray.desc[i] != '' && goalCounterArray.desc[i] != null) { newsubject += (i > startlevel ? ', ' : '') + goalCounterArray.amt[i] + (goalCounterArray.amt[i] > 1 ? ' goals (' : ' goal (') + goalCounterArray.desc[i] + ')'; } else { break; } } newsubject += '. '; } else { newsubject += 'All Goals Have Been Completed!!! '; } newsubject += counterSubjectText; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'ticket': { if (cb.settings.ticketShowFanAppreciation == 'Yes') { if (showStage == 'ticketsales') { newsubject += 'FANCLUB APPRECIATION SHOW STARTING SOON! JOIN FANCLUB TO SEE! '; } else if (showStage == 'ticketshow' || showStage == 'showwarn' || showStage == 'showfinale') { newsubject += 'FANCLUB APPRECIATION SHOW IN PROGRESS! JOIN FANCLUB TO SEE! '; } else if (showStage == 'aftershow') { newsubject += 'FANCLUB APPRECIATION SHOW HAS ENDED. THANK YOU FANS! '; } else { newsubject += 'FANCLUB APPRECIATION SHOW '; } } else { if (showStage == 'ticketsales') { newsubject += 'TICKET SHOW SALES [' + ticketPrice + ' tokens]: '; } else if (showStage == 'ticketshow') { newsubject += 'TICKET SHOW IN PROGRESS [' + ticketPrice + ' tokens]: '; } else if (showStage == 'showwarn') { newsubject += 'TICKET SHOW ENDING SOON [' + ticketPrice + ' tokens]: '; } else if (showStage == 'showfinale') { newsubject += 'TICKET SHOW SALES ENDED -- DO NOT BUY A TICKET!: '; } else if (showStage == 'aftershow') { newsubject += 'TICKET SHOW HAS ENDED: '; } else { newsubject += 'TICKET SHOW '; } } newsubject += ticketSubjectText; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'sequence': { if (!finalGoalMet) { newsubject += 'Remaining Sequence Goals: '; startlevel = currentGoalLevel - 1; if (tipSequenceDirection == 'up' && nextSequence <= sequenceArray.amt[sequenceArray.amt.length-1] || tipSequenceDirection == 'down' && nextSequence >= sequenceArray.amt[sequenceArray.amt.length-1]) { for (let i = startlevel; i < sequenceArray.desc.length; i++) { if (sequenceArray.desc[i] != '' && sequenceArray.desc[i] != null) { newsubject += (i > startlevel ? ', at ' : 'at ') + sequenceArray.amt[i] + ' (' + sequenceArray.desc[i] + ')'; } } } else { newsubject += 'Final Tip Sequence'; currentGoalSequence = endSequence; currentGoalDesc = 'Final Tip Sequence'; } } else { newsubject += 'All Goals Have Been Completed!!! '; } newsubject += sequenceSubjectText; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'tipjar': { if (!finalGoalMet) { if (tipJarRunning) { newsubject += 'Tip Jar Prize has started! Tip to keep it full! The prize for this goal (' + tipjarGoalArray.desc[currentGoalLevel-1] + ') will end if the jar empties. '; } else { newsubject += 'Tip Jar Goal: [' + tipjarGoalArray.amt[currentGoalLevel-1] + ' tokens]. At goal, the prize (' + tipjarGoalArray.desc[currentGoalLevel-1] + ') will be performed until the jar empties. '; } } else { newsubject += 'All Goals Have Been Completed!!! '; } newsubject += tipjarSubjectText; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'goalrace': { if (!finalGoalMet) { newsubject += 'Goal Race! Tip to vote for [' + goalraceDesc1 + '] vs [' + goalraceDesc2 + ']. '; } else { newsubject += 'The Goal Race has been Completed! ' + goalRaceWinner + ' has won the race!!! '; } newsubject += goalraceSubjectText; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'spank': { if (!finalGoalMet) { newsubject += 'Current Goal: ' + currentGoalDesc + ' at ' + currentGoalTotal + ' tokens.'; if (spankGoalArray.desc.length >= (currentGoal + 1)) { newsubject += ' --- Next Goal: ' + spankGoalArray.desc[currentGoal] + '. '; } else if (spankGoalArray.desc.length > 1) { newsubject += ' --- This is the Last Goal! '; } } else { newsubject += 'All Spank Goals Have Been Completed!!! '; } newsubject += spankSubjectText; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'peep': { if (showStage == 'peepsales') { newsubject += 'PEEP SHOW SALES [' + peepshowPrice + ' tokens/min]: '; } else if (showStage == 'peepshow') { newsubject += 'PEEP SHOW IN PROGRESS [' + peepshowPrice + ' tokens/min]: '; } else if (showStage == 'peepwarn') { newsubject += 'PEEP SHOW ENDING SOON [' + peepshowPrice + ' tokens/min]: '; } else if (showStage == 'peepfinale') { newsubject += 'PEEP SHOW SALES ENDED -- DO NOT TIP TO JOIN!: '; } else if (showStage == 'peepaftershow') { newsubject += 'PEEP SHOW HAS ENDED: '; } else { newsubject += 'PEEP SHOW '; } newsubject += peepshowSubjectText; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'autoreset': { if (!finalGoalMet) { newsubject += 'At Goal: ' + currentGoalDesc + ' [every ' + currentGoalTotal + ' tokens]. '; if (autoresetEndAfter > 0) { if (autoresetFinalGoal) { newsubject += ' --- Show Ends after ' + autoresetEndAfter + ' goals. Final Goal Prize: ' + autoresetFinalGoal + '. '; } else { newsubject += ' --- Show Ends after ' + autoresetEndAfter + ' goals. '; } } } else { newsubject += 'All Goals Have Been Completed!!! Final Goal Prize: ' + autoresetFinalGoal + '. '; } newsubject += autoresetSubjectSfx; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } case 'none': { newsubject += 'Welcome! No app currently running.'; if (genericRoomSubjectPosn == 'End') { newsubject += ' ' + genericRoomSubjectSfx; } cb.changeRoomSubject(newsubject); break; } } } function listGoals(group,reqby,listmode) { switch (whichApp) { case 'goals': { if (group == 'all') { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Goal List (sent to All) :'; sendto = ''; } else { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Goal List (sent to You) :'; sendto = reqby; } if (listmode == 'r') { listindex = (currentGoal-1); } else { listindex = 0; } if (listmode == 'r' && finalGoalMet) { outString += '\nAll Goals Complete'; } else { while (progGoalArray.amt[listindex] > 0 && progGoalArray.desc[listindex] != null && progGoalArray.desc[listindex] != '') { outString += '\nGoal #' + (listindex+1) + ' : ' + progGoalArray.desc[listindex] + ' (' + progGoalArray.amt[listindex] + ' tokens)'; listindex++; } } if (listindex > 0) { cb.sendNotice(dashLine60 + '\n' + outString + '\n' + dashLine60, sendto, progGoalBgColor, progGoalTxtColor, 'bold'); } else { cb.sendNotice('There are no goals configured', reqby, appNoticeColor); } break; } case 'goalcount': { if (group == 'all') { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Goal Count Prize Level List (sent to All) :'; sendto = ''; } else { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Goal Count Prize Level List (sent to You) :'; sendto = reqby; } if (listmode == 'r') { listindex = (currentGoalLevel-1); } else { listindex = 0; } if (listmode == 'r' && finalGoalMet) { outString += '\nAll Goal Levels Complete'; } else { while (goalCounterArray.amt[listindex] > 0 && goalCounterArray.desc[listindex] != null && goalCounterArray.desc[listindex] != '') { outString += '\nPrize Level #' + (listindex+1) + ' : ' + goalCounterArray.desc[listindex] + ' (' + goalCounterArray.amt[listindex] + ' goals)'; listindex++; } } if (listindex > 0) { cb.sendNotice(dashLine60 + '\n' + outString + '\n' + dashLine60, sendto, goalCountBgColor, goalCountTxtColor, 'bold'); } else { cb.sendNotice('There are no Prize Levels configured', reqby, appNoticeColor); } break; } case 'sequence': { if (group == 'all') { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Sequence Level List (sent to All) :'; sendto = ''; } else { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Sequence Level List (sent to You) :'; sendto = reqby; } if (listmode == 'r') { listindex = (currentGoalLevel-1); } else { listindex = 0; } if (listmode == 'r' && finalGoalMet) { outString += '\nAll Goal Levels Complete'; } else { while (sequenceArray.amt[listindex] > 0 && sequenceArray.desc[listindex] != null && sequenceArray.desc[listindex] != '') { outString += '\nGoal Level #' + (listindex+1) + ' : ' + sequenceArray.desc[listindex] + ' (at sequence ' + sequenceArray.amt[listindex] + ')'; listindex++; } outString += '\nFinal Count Sequence' + ' (at sequence ' + endSequence + ')'; } if (listindex > 0) { cb.sendNotice(dashLine60 + '\n' + outString + '\n' + dashLine60, sendto, sequenceBgColor, sequenceTxtColor, 'bold'); } else { cb.sendNotice('There are no sequence levels configured', reqby, appNoticeColor); } break; } case 'tipjar': { if (group == 'all') { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Tip Jar Goal List (sent to All) :'; sendto = ''; } else { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Tip Jar Goal List (sent to You) :'; sendto = reqby; } if (listmode == 'r') { listindex = (currentGoalLevel-1); } else { listindex = 0; } if (listmode == 'r' && finalGoalMet) { outString += '\nAll Goals Complete'; } else { while (tipjarGoalArray.amt[listindex] > 0 && tipjarGoalArray.desc[listindex] != null && tipjarGoalArray.desc[listindex] != '') { outString += '\nGoal Level #' + (listindex+1) + ' : ' + tipjarGoalArray.desc[listindex] + ' (' + tipjarGoalArray.amt[listindex] + ' tokens) [recycle count: ' + tipjarGoalArray.recyc[listindex] + ']'; listindex++; } } if (listindex > 0) { cb.sendNotice(dashLine60 + '\n' + outString + '\n' + dashLine60, sendto, tipjarBgColor, tipjarTxtColor, 'bold'); } else { cb.sendNotice('There are no goals configured', reqby, appNoticeColor); } break; } case 'spank': { if (group == 'all') { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Spank Goal List (sent to All) :'; sendto = ''; } else { outString = (listmode == 'a' ? 'Full' : 'Remaining') + ' Spank Goal List (sent to You) :'; sendto = reqby; } if (listmode == 'r') { listindex = (currentGoal-1); } else { listindex = 0; } if (listmode == 'r' && finalGoalMet) { outString += '\nAll Goals Complete'; } else { while (spankGoalArray.amt[listindex] > 0 && spankGoalArray.desc[listindex] != null && spankGoalArray.desc[listindex] != '') { outString += '\nGoal #' + (listindex+1) + ' : ' + spankGoalArray.desc[listindex] + ' (' + spankGoalArray.amt[listindex] + ' tokens)'; listindex++; } } if (listindex > 0) { cb.sendNotice(dashLine60 + '\n' + outString + '\n' + dashLine60, sendto, spankBgColor, spankTextColor, 'bold'); } else { cb.sendNotice('There are no goals configured', reqby, appNoticeColor); } break; } case 'autoreset': { if (group == 'all') { outString = 'Auto-Reset Goal Info (sent to All) :'; sendto = ''; } else { outString = 'Auto-Reset Goal Info (sent to You) :'; sendto = reqby; } outString += '\nFor the Auto-Reset Goal Feature, there is a single repeating goal every ' + autoresetGoalAmount + ' tokens: ' + autoresetEachGoal; if (autoresetEndAfter > 0) { if (autoresetFinalGoal) { outString += '\nShow Ends after ' + autoresetEndAfter + ' goals. Final Goal Prize: ' + autoresetFinalGoal; } else { outString += '\nShow Ends after ' + autoresetEndAfter + ' goals. '; } } cb.sendNotice(dashLine60 + '\n' + outString + '\n' + dashLine60, sendto, progGoalBgColor, progGoalTxtColor, 'bold'); break; } break; } } // *********************************** Progressive Goal Functions ************************************** function setProgressiveGoalsToggle(option, setby) { if (option == 'on') { whichApp = 'goals'; if (savedProgGoals) { restoreProgGoals(); } else { genericInit(); initProgGoal(); } changeRoomSubject(); initProgGoalsNoticeTimer(); if (progGoalArray.desc.length <= 1) { cb.sendNotice(dashLine70 + '\n* ' + setby + ' has started the Progressive Goal Feature.\n* There is a single goal for the show.\n' + dashLine70, '', progGoalBgColor, progGoalTxtColor, 'bold'); } else { cb.sendNotice(dashLine70 + '\n* ' + setby + ' has started the Progressive Goal Feature.\n* There are ' + totalProgGoals + ' goals in the current show.\n' + dashLine70, '', progGoalBgColor, progGoalTxtColor, 'bold'); } } else if (option == 'off') { saveProgGoals(); cb.sendNotice(dashLine70 + '\n* ' + setby + ' has suspended the Progressive Goal Feature.\n' + dashLine70, '', progGoalBgColor, progGoalTxtColor, 'bold'); } } function initProgGoal() { totalProgGoals = progGoalArray.desc.length; currentGoalDesc = progGoalArray.desc[currentGoal-1]; currentGoalTotal = progGoalArray.amt[currentGoal-1]; if (cb.settings.progressiveUpDown == 'Count Down To Zero') { currentGoalTips = currentGoalTotal; } } function saveProgGoals() { pgSave_finalGoalMet = finalGoalMet; pgSave_currentGoalTips = currentGoalTips; pgSave_currentGoal = currentGoal; pgSave_currentGoalDesc = currentGoalDesc; pgSave_currentGoalTotal = currentGoalTotal; savedProgGoals = true; } function restoreProgGoals() { finalGoalMet = pgSave_finalGoalMet; currentGoalTips = pgSave_currentGoalTips; currentGoal = pgSave_currentGoal; currentGoalDesc = pgSave_currentGoalDesc; currentGoalTotal = pgSave_currentGoalTotal; savedProgGoals = false; } function progGoalColors() { progGoalNoticesTxtColor = checkTextColor('Dark Red'); progGoalNoticesBgColor = checkBgColor('Cream'); if (cb.settings.progressiveGoalTextColor == 'Custom') { progGoalTxtColor = checkTextColor(cb.settings.progressiveGoalCustomTextColor); if (progGoalTxtColor == 'default') { cb.sendNotice('Progressive Goals - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); progGoalTxtColor = '#FFFFFF'; } } else { progGoalTxtColor = checkTextColor(cb.settings.progressiveGoalTextColor); } if (cb.settings.progressiveGoalBgColor == 'Custom') { progGoalBgColor = checkBgColor(cb.settings.progressiveGoalCustomBgColor); if (progGoalBgColor == 'default') { cb.sendNotice('Progressive Goals - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); progGoalBgColor = '#FFFFFF'; } } else { progGoalBgColor = checkBgColor(cb.settings.progressiveGoalBgColor); } } function initProgGoalsNoticeTimer() { if (cb.settings.progressiveGoalNoticeInterval == '' || cb.settings.progressiveGoalNoticeInterval == null) { cb.sendNotice('Progressive Goal Chat Notice Interval is not set. Using default value of 5.1 minutes.', cb.room_slug, appNoticeColor); progGoalNoticeInt = 5.1; } else { progGoalNoticeInt = parseFloat(cb.settings.progressiveGoalNoticeInterval); } if (progGoalNoticeInt < 1 && progGoalNoticeInt != 0) { cb.sendNotice('Progressive Goal Chat Notice Interval is too short, must be zero to disable, or at least 1 minute. Using default value of 5.1 minutes.', cb.room_slug, appNoticeColor); progGoalNoticeInt = 5.1; } if (progGoalNoticeInt > 0) { progGoalNoticeInt *= 60000; progGoalNoticeInt = parseInt(progGoalNoticeInt); cb.setTimeout(progGoalNoticeTimer, progGoalNoticeInt); } } function progGoalNoticeTimer() { if (whichApp == 'goals' && !finalGoalMet) { listGoals('all','','r'); cb.setTimeout(progGoalNoticeTimer, progGoalNoticeInt); } } function restartGoal() { currentGoal--; finalGoalMet = false; currentGoalMet = false; nextGoal(); cb.drawPanel(); } // *********************************** Tip Goal Counter Functions ************************************** function setGoalCounterToggle(option, setby) { if (option == 'on') { whichApp = 'goalcount'; if (savedGoalCount) { restoreGoalCount(); } else { genericInit(); initGoalCounter(); } changeRoomSubject(); initGoalCountNoticeTimer(); cb.sendNotice(dashLine90 + '\n* ' + setby + ' has started the Tip Goal Counter Feature.\n* There are prizes at specifc goal count levels (' + (cbjs.arrayJoin(goalCounterArray.amt, 'g, ')) + 'g).\n* You can tip toward the goal, the app will keep track of progress.\n' + dashLine90, '', goalCountBgColor, goalCountTxtColor, 'bold'); } else if (option == 'off') { saveGoalCount(); cb.sendNotice(dashLine70 + '\n* ' + setby + ' has suspended the Tip Goal Counter Feature.\n' + dashLine70, '', goalCountBgColor, goalCountTxtColor, 'bold'); } } function initGoalCounter() { currentGoalDesc = goalCounterArray.desc[currentGoalLevel-1]; currentGoalCountLevelAmt = goalCounterArray.amt[currentGoalLevel-1]; currentGoalTotal = cb.settings.goalcounterPerGoalAmount; } function saveGoalCount() { gcSave_finalGoalMet = finalGoalMet; gcSave_currentGoalTips = currentGoalTips; gcSave_currentGoalDesc = currentGoalDesc; gcSave_currentGoalTotal = currentGoalTotal; gcSave_currentGoalCountAmt = currentGoalCountAmt; gcSave_currentGoalLevel = currentGoalLevel; savedGoalCount = true; } function restoreGoalCount() { finalGoalMet = gcSave_finalGoalMet; currentGoalTips = gcSave_currentGoalTips; currentGoalDesc = gcSave_currentGoalDesc; currentGoalTotal = gcSave_currentGoalTotal; currentGoalCountAmt = gcSave_currentGoalCountAmt; currentGoalLevel = gcSave_currentGoalLevel; savedGoalCount = false; } function goalCounterColors() { goalCountNoticesTxtColor = checkTextColor('Dark Red'); goalCountNoticesBgColor = checkBgColor('Cream'); if (cb.settings.goalcounterTextColor == 'Custom') { goalCountTxtColor = checkTextColor(cb.settings.goalcounterCustomTextColor); if (goalCountTxtColor == 'default') { cb.sendNotice('Goal Counter - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); goalCountTxtColor = '#FFFFFF'; } } else { goalCountTxtColor = checkTextColor(cb.settings.goalcounterTextColor); } if (cb.settings.goalcounterBgColor == 'Custom') { goalCountBgColor = checkBgColor(cb.settings.goalcounterCustomBgColor); if (goalCountBgColor == 'default') { cb.sendNotice('Goal Counter - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); goalCountBgColor = '#FFFFFF'; } } else { goalCountBgColor = checkBgColor(cb.settings.goalcounterBgColor); } } function initGoalCountNoticeTimer() { if (cb.settings.goalcounterNoticeInterval == '' || cb.settings.goalcounterNoticeInterval == null) { cb.sendNotice('Goal Count Chat Notice Interval is not set. Using default value of 5.1 minutes.', cb.room_slug, appNoticeColor); goalCountNoticeInt = 5.1; } else { goalCountNoticeInt = parseFloat(cb.settings.goalcounterNoticeInterval); } if (goalCountNoticeInt < 1 && goalCountNoticeInt != 0) { cb.sendNotice('Goal Count Chat Notice Interval is too short, must be zero to disable, or at least 1 minute. Using default value of 5.1 minutes.', cb.room_slug, appNoticeColor); goalCountNoticeInt = 5.1; } if (goalCountNoticeInt > 0) { goalCountNoticeInt *= 60000; goalCountNoticeInt = parseInt(goalCountNoticeInt); cb.setTimeout(goalCountNoticeTimer, goalCountNoticeInt); } } function goalCountNoticeTimer() { if (whichApp == 'goalcount') { listGoals('all','','r'); cb.setTimeout(goalCountNoticeTimer, goalCountNoticeInt); } } function updateGoalCount(goalnum) { currentGoalDesc = goalCounterArray.desc[currentGoalLevel-1]; currentGoalCountLevelAmt = goalCounterArray.amt[currentGoalLevel-1]; changeRoomSubject(); cb.drawPanel(); } function changeCountGoal(newgoal) { currentGoalTotal = newgoal; cb.drawPanel(); } // *********************************** Tip Jar Functions ************************************** function setTipJarToggle(option, setby) { if (option == 'on') { whichApp = 'tipjar'; if (savedTipJar) { restoreTipJar(); } else { genericInit(); initTipJar(); } changeRoomSubject(); cb.sendNotice(dashLine90 + '\n* ' + setby + ' has started the Tip Jar Feature.\n* Once goal is met, the prize will be performed until the tip jar is empty.\n' + dashLine90, '', tipjarBgColor, tipjarTxtColor, 'bold'); } else if (option == 'off') { saveTipJar(); cb.sendNotice(dashLine60 + '\n* ' + setby + ' has suspended the Tip Jar Feature.\n' + dashLine60, '', tipjarBgColor, tipjarTxtColor, 'bold'); } } function initTipJar() { tipJarRunning = false; totalTipJarLevels = tipjarGoalArray.desc.length; currentGoalTotal = tipjarGoalArray.amt[currentGoalLevel-1]; currentGoalDesc = tipjarGoalArray.desc[currentGoalLevel-1]; currentGoalTotal = tipjarGoalArray.amt[currentGoalLevel-1]; currentGoalRecycleTotal = tipjarGoalArray.recyc[currentGoalLevel-1]; } function saveTipJar() { tjSave_finalGoalMet = finalGoalMet; tjSave_currentGoalTips = currentGoalTips; tjSave_currentGoal = currentGoal; tjSave_currentGoalDesc = currentGoalDesc; tjSave_currentGoalTotal = currentGoalTotal; tjSave_currentGoalLevel = currentGoalLevel; tjSave_currentGoalRecycleTotal = currentGoalRecycleTotal; tjSave_currentGoalRecycleCount = currentGoalRecycleCount; savedTipJar = true; } function restoreTipJar() { finalGoalMet = tjSave_finalGoalMet; currentGoalTips = tjSave_currentGoalTips; currentGoal = tjSave_currentGoal; currentGoalDesc = tjSave_currentGoalDesc; currentGoalTotal = tjSave_currentGoalTotal; currentGoalLevel = tjSave_currentGoalLevel; currentGoalRecycleTotal = tjSave_currentGoalRecycleTotal; currentGoalRecycleCount = tjSave_currentGoalRecycleCount; savedTipJar = false; } function tipJarColors() { tipjarNoticesTxtColor = checkTextColor('Dark Red'); tipjarNoticesBgColor = checkBgColor('Cream'); if (cb.settings.tipjarTextColor == 'Custom') { tipjarTxtColor = checkTextColor(cb.settings.tipjarCustomTextColor); if (tipjarTxtColor == 'default') { cb.sendNotice('Tip Jar - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); tipjarTxtColor = '#FFFFFF'; } } else { tipjarTxtColor = checkTextColor(cb.settings.tipjarTextColor); } if (cb.settings.tipjarBgColor == 'Custom') { tipjarBgColor = checkBgColor(cb.settings.tipjarCustomBgColor); if (tipjarBgColor == 'default') { cb.sendNotice('Tip Jar - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); tipjarBgColor = '#FFFFFF'; } } else { tipjarBgColor = checkBgColor(cb.settings.tipjarBgColor); } } function startTipJar() { tipJarRunning = true; changeRoomSubject(); cb.setTimeout(checkJar, jarEmptyRate); } function pauseTipJar() { tipJarPaused = true; } function resumeTipJar() { tipJarPaused = false; cb.setTimeout(checkJar, jarEmptyRate); } function checkJar() { if (tipJarRunning && !tipJarPaused) { if (tipJarCurrentTokens > 0) { tipJarCurrentTokens -= jarEmptyTokens; if (tipJarCurrentTokens <= 0) { tipJarCurrentTokens = 0; tipjarIsEmpty(); } } cb.setTimeout(checkJar, jarEmptyRate); } cb.drawPanel(); } function setDrainRate(level) { switch (level) { case 1: { jarEmptyRate = 1000; jarEmptyTokens = 5; drainLevel = 1; break; } case 2: { jarEmptyRate = 1000; jarEmptyTokens = 4; drainLevel = 2; break; } case 3: { jarEmptyRate = 1000; jarEmptyTokens = 3; drainLevel = 3; break; } case 4: { jarEmptyRate = 1000; jarEmptyTokens = 2; drainLevel = 4; break; } case 5: { jarEmptyRate = 1000; jarEmptyTokens = 1; drainLevel = 5; break; } case 6: { jarEmptyRate = 2000; jarEmptyTokens = 1; drainLevel = 6; break; } case 7: { jarEmptyRate = 3000; jarEmptyTokens = 1; drainLevel = 7; break; } case 8: { jarEmptyRate = 4000; jarEmptyTokens = 1; drainLevel = 8; break; } case 9: { jarEmptyRate = 5000; jarEmptyTokens = 1; drainLevel = 9; break; } case 10: { jarEmptyRate = 10000; jarEmptyTokens = 1; drainLevel = 10; break; } } } function drainRateText() { switch (drainLevel) { case 1: { return '5 tok/sec'; } case 2: { return '4 tok/sec'; } case 3: { return '3 tok/sec'; } case 4: { return '2 tok/sec'; } case 5: { return '1 tok/sec'; } case 6: { return '1 tok/2 sec'; } case 7: { return '1 tok/3 sec'; } case 8: { return '1 tok/4 sec'; } case 9: { return '1 tok/5 sec'; } case 10: { return '1 tok/10 sec'; } default: { return 'Invalid'; } } } function tipjarIsEmpty() { if (cb.settings.tipjarWhenEmpty == 'Advance to Next Goal/Cycle') { cb.sendNotice('The Tip Jar is empty, current goal is ending.', '', tipjarNoticesBgColor, tipjarNoticesTxtColor, 'bold'); advanceTipJar(); } else { currenttime = new Date(); if ((currenttime - lastTipJarEmptyNotice) > 30000) { lastTipJarEmptyNotice = currenttime; cb.sendNotice('The Tip Jar is empty, you can tip to fill the jar again and re-start the prize', '', tipjarNoticesBgColor, tipjarNoticesTxtColor, 'bold'); cb.sendNotice(bctext + ': The Tip Jar is configured to allow tipping to continue on the current goal when empty, therefore it will not advance to the next goal or cycle until you use the command "/skip" to advance.', cb.room_slug, appNoticeColor); cb.sendNotice('Moderators: The Tip Jar is configured to allow tipping to continue on the current goal when empty, therefore it will not advance to the next goal or cycle until you use the command "/skip" to advance.', '', appNoticeColor, '', '', 'red'); } } } function updateTipjarGoal(goalnum,amt,desc) { currentGoalDesc = tipjarGoalArray.desc[currentGoalLevel-1]; currentGoalTotal = tipjarGoalArray.amt[currentGoalLevel-1]; changeRoomSubject(); cb.drawPanel(); } // *********************************** Sequence Goal Functions ************************************** function setSequenceToggle(option, setby) { if (option == 'on') { whichApp = 'sequence'; if (savedGoalSequence) { restoreSequence(); } else { genericInit(); initSequence(); } changeRoomSubject(); cb.sendNotice(dashLine80 + '\n* ' + setby + ' has started the Tip Sequence Feature.\n* Tip in ' + (tipSequenceDirection == 'up' ? 'Ascending' : 'Descending') + ' Sequence to the final goal.\n* There are prizes at specifc count sequence levels (' + (cbjs.arrayJoin(sequenceArray.amt, ', ')) + ').\n' + dashLine80, '', sequenceBgColor, sequenceTxtColor, 'bold'); } else if (option == 'off') { saveSequence(); cb.sendNotice(dashLine60 + '\n* ' + setby + ' has suspended the Tip Sequence Feature.\n' + dashLine60, '', sequenceBgColor, sequenceTxtColor, 'bold'); } } function initSequence() { currentGoalSequence = sequenceArray.amt[currentGoalLevel-1]; currentGoalDesc = sequenceArray.desc[currentGoalLevel-1]; if (tipSequenceDirection == 'up') { nextSequence = lowSequence; endSequence = highSequence; } else if (tipSequenceDirection == 'down') { endSequence = lowSequence; nextSequence = highSequence; } if (cb.settings.tipsequenceChatMsg == 'Yes') { setChatMsgToggle('on',cb.room_slug, 'init'); } if (cb.settings.tipsequenceGroupTips == 'Group Tipping') { setGroupTipToggle('on', cb.room_slug, 'init'); } sequenceTotalTipsGoal = sequenceTotal(lowSequence,highSequence); } function saveSequence() { sqSave_finalGoalMet = finalGoalMet; sqSave_currentGoalDesc = currentGoalDesc; sqSave_currentGroupTipAmt = currentGroupTipAmt; sqSave_currentGoalLevel = currentGoalLevel; savedGoalSequence = true; } function restoreSequence() { finalGoalMet = sqSave_finalGoalMet; currentGoalDesc = sqSave_currentGoalDesc; currentGroupTipAmt = sqSave_currentGroupTipAmt; currentGoalLevel = sqSave_currentGoalLevel; savedGoalSequence = false; } function sequenceTotal(low,high) { sum = 0; for (var i = low; i <= high ; i++) { sum += i; } return sum } function sequenceColors() { sequenceNoticesTxtColor = checkTextColor("Dark Red"); sequenceNoticesBgColor = checkBgColor("Cream"); if (cb.settings.tipsequenceTextColor == 'Custom') { sequenceTxtColor = checkTextColor(cb.settings.tipsequenceCustomTextColor); if (sequenceTxtColor == 'default') { cb.sendNotice('Tip Sequence - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); sequenceTxtColor = '#FFFFFF'; } } else { sequenceTxtColor = checkTextColor(cb.settings.tipsequenceTextColor); } if (cb.settings.tipsequenceBgColor == 'Custom') { sequenceBgColor = checkBgColor(cb.settings.tipsequenceCustomBgColor); if (sequenceBgColor == 'default') { cb.sendNotice('Tip Sequence - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); sequenceBgColor = '#FFFFFF'; } } else { sequenceBgColor = checkBgColor(cb.settings.tipsequenceBgColor); } } function updateSequenceGoal(goalnum) { currentGoalDesc = sequenceArray.desc[currentGoalLevel-1]; currentGoalSequence = sequenceArray.amt[currentGoalLevel-1]; changeRoomSubject(); cb.drawPanel(); } function setChatMsgToggle(option, mod, mode) { if(option == 'on') { if(chatMsgToggle == 1) { if(mode != 'init') { cb.sendNotice('The chat notice toggle is already turned on.', mod, appNoticeColor); } } else { chatMsgToggle = 1; if(mode != 'init') { cb.sendNotice('You have enabled the display of chat notices for tip sequences completed.', mod, appNoticeColor); } } } else if(option == 'off') { if(chatMsgToggle == 0) { if(mode != 'init') { cb.sendNotice('The chat notice toggle is already turned off.', mod, appNoticeColor); } } else { chatMsgToggle = 0; if(mode != 'init') { cb.sendNotice('You have disabled the display of chat notices for tip sequences completed.', mod, appNoticeColor); } } } } function setGroupTipToggle(option, mod, mode) { if(option == 'on') { if(groupTipToggle == 1) { if(mode != 'init') { cb.sendNotice('The group tipping feature is already turned on.', mod, appNoticeColor); } } else { groupTipToggle = 1; if(mode != 'init') { cb.sendNotice('You have enabled the group tipping feature.', mod, appNoticeColor); } cb.drawPanel(); } } else if(option == 'off') { if(groupTipToggle == 0) { if(mode != 'init') { cb.sendNotice('The group tipping feature is already turned off.', mod, appNoticeColor); } } else { groupTipToggle = 0; if(mode != 'init') { cb.sendNotice('You have disabled the group tipping feature.', mod, appNoticeColor); } cb.drawPanel(); } } } function changeEndSequence(newseq) { endSequence = newseq; if (tipSequenceDirection == 'up') { highSequence = newseq; } else { lowSequence = newseq; } sequenceTotalTipsGoal = sequenceTotal(lowSequence,highSequence); cb.drawPanel(); } // *********************************** Ultra App Ticket Show Functions ************************************** function setTicketShowToggle(option, sendto) { if(option == 'on') { initTicketShow(sendto); if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice(dashLine80 + '\nToday\'s Ticket Show is a Fan Club Appreciation Show!\nOnly configured Fan Club Members will be admitted to the show!\nPlease consider joining the Fan Club!\n' + dashLine80, sendto, ticketBgColor, ticketTxtColor, "bold"); } else { cb.sendNotice(dashLine90 + '\n* ' + bctext + ' has started selling tickets for the show.\n* Tickets are ' + ticketPrice + ' tokens.\n' + ticketModeMessage + '\n' + dashLine90, '', ticketBgColor, ticketTxtColor, 'bold'); cb.sendNotice('***Warning Regarding the Ticket Show***: Do not deactivate or restart the Ultra App once ticket sales have started without saving the ticket show list or you will lose the list of ticket holders.\n* If it is necessary to restart, please save the ticket list first (use /tickets to view and then copy) and then add those users back to the show once restarted (using /add).\n* If you are using Dorothy\'s Ultra Fembot alongside this app, it can save a backup ticket list for you if configured to do so.',cb.room_slug,appNoticeColor); if (ticketShowAllowGift == 'Yes') { cb.sendNotice(dashLine90 + '\n* ' + bctext + ' has enabled the the gifting of tickets. \n* You can buy extra tickets and gift them to others.\n' + dashLine90, '', ticketBgColor, ticketTxtColor, 'bold'); } } } else if(option == 'off') { if (cb.limitCam_isRunning()) { cb.limitCam_stop(); cb.sendNotice('The UltraApp Hidden Ticket Show feature has ended.', sendto, appNoticeColor, '', 'bold'); hiddenTime = 0; ticketShowEnded = true; ticketSalesEnded = true; showStage = ''; } if (ticketMinsRemain > 0 || ticketSecsRemain > 0) { stopTicketTimer(); } cb.sendNotice('You have disabled the Ultra App Ticket Show feature. The ticket list and outstanding ticket list are still intact.', sendto, appNoticeColor); cb.sendNotice(dashLine70 + '\n* ' + sendto + ' has ended the UltraApp Ticket Show Feature.\n' + dashLine70, '', ticketBgColor, ticketTxtColor, 'bold'); } } function initTicketShow(sendto) { whichApp = 'ticket'; if (ticketHolderList.length > 0) { countTickets = ticketHolderList.length; } else { countTickets = 0; } countTicketsFromPreview = 0; if (presalesToggle == 1) { setPresalesToggle('off',sendto); } ticketShowColors(); showStage = 'ticketsales'; changeRoomSubject(); setTicketMode('init',sendto); ticketShowEnded = false; ticketSalesEnded = false; loadFreeTickets(); if (ticketShowEnableOT == 'Yes' && cb.settings.ticketShowFanAppreciation != 'Yes') { setTicketShowOtToggle('on',sendto) } initTicketNoticeTimer(); cb.drawPanel(); } function ticketShowColors() { ticketNoticesTxtColor = checkTextColor('Dark Red'); ticketNoticesBgColor = checkBgColor('Cream'); ticketTxtColorFan = checkTextColor('Black'); ticketBgColorFan = checkBgColor('Light Green'); ticketTxtColorVIP = checkTextColor('Black'); ticketBgColorVIP = checkBgColor('Light Purple'); ticketTxtColorMod = checkTextColor('Black'); ticketBgColorMod = checkBgColor('Light Red'); if (cb.settings.ticketShowTextColor == 'Custom') { ticketTxtColor = checkTextColor(cb.settings.ticketShowCustomTextColor); if (ticketTxtColor == 'default') { cb.sendNotice('Ticket Show - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); ticketTxtColor = '#FFFFFF'; } } else { ticketTxtColor = checkTextColor(cb.settings.ticketShowTextColor); } if (cb.settings.ticketShowBgColor == 'Custom') { ticketBgColor = checkBgColor(cb.settings.ticketShowCustomBgColor); if (ticketBgColor == 'default') { cb.sendNotice('Ticket Show - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); ticketBgColor = '#FFFFFF'; } } else { ticketBgColor = checkBgColor(cb.settings.ticketShowBgColor); } } function initTicketNoticeTimer() { if (cb.settings.ticketNoticeInterval == '' || cb.settings.ticketNoticeInterval == null) { cb.sendNotice('Ticket Show Chat Notice Interval is not set. Using default value of 1.2 minutes.', cb.room_slug, appNoticeColor); ticketNoticeInt = 1.2; } else { ticketNoticeInt = parseFloat(cb.settings.ticketNoticeInterval); } if (ticketNoticeInt < 1) { cb.sendNotice('Ticket Show Chat Notice Interval is too short, must be at least 1 minute. Using default value of 1.2 minutes.', cb.room_slug, appNoticeColor); ticketNoticeInt = 1.2; } ticketNoticeInt *= 60000; ticketNoticeInt = parseInt(ticketNoticeInt); cb.setTimeout(ticketNoticeTimer, ticketNoticeInt); } function ticketNoticeTimer() { if (whichApp == 'ticket' && (showStage == 'ticketsales' || showStage == 'ticketshow' || showStage == 'showwarn')) { ticketNotice(); } cb.setTimeout(ticketNoticeTimer, ticketNoticeInt); } function ticketNotice() { if (cb.settings.ticketShowFanAppreciation == 'Yes') { msg = '**** Today\'s Ticket Show is a Fan Club Appreciation Show! ****\nOnly configured Fan Club Members will be admitted to the show, please consider joining the Fan Club!'; } else { msg = ':uaticketsmall Welcome to ' + bctext + '\'s Ticket Show! The general admission ticket price is ' + ticketPrice + ' token' + (ticketPrice > 1 ? 's.' : '.'); if (ticketShowStartPrice > 0 && whichApp == 'ticket' && showStage == 'ticketsales') { msg += '\nThe ticket price will increase to ' + ticketShowStartPrice + ' tokens when the show is started.'; msg += '\nGet your ticket before the price goes up!'; } if (cb.settings.ticketShowPriceFC > 1 && cb.settings.ticketShowFreeFC != 'Yes') { msg += '\nChaturbate Fanclub members can buy a ticket to the show for ' + cb.settings.ticketShowPriceFC + ' token' + (cb.settings.ticketShowPriceFC > 1 ? 's.' : '.'); } else if (cb.settings.ticketShowFreeFC == 'Yes') { msg += '\nChaturbate Fanclub members get a free ticket!'; } if (cb.settings.ticketShowPriceEFC > 1 && cb.settings.ticketShowFreeEFC != 'Yes') { msg += '\n' + EFCname + ' members can buy a ticket to the show for ' + cb.settings.ticketShowPriceEFC + ' token' + (cb.settings.ticketShowPriceEFC > 1 ? 's.' : '.'); } else if (cb.settings.ticketShowFreeEFC == 'Yes') { msg += '\n' + EFCname + ' members get a free ticket!'; } if (cb.settings.ticketShowPriceEFC2 > 1 && cb.settings.ticketShowFreeEFC2 != 'Yes') { msg += '\n' + EFCname2 + ' members can buy a ticket to the show for ' + cb.settings.ticketShowPriceEFC2 + ' token' + (cb.settings.ticketShowPriceEFC2 > 1 ? 's.' : '.'); } else if (cb.settings.ticketShowFreeEFC2 == 'Yes') { msg += '\n' + EFCname2 + ' members get a free ticket!'; } if (cb.settings.ticketShowPriceVIP > 1 && cb.settings.ticketShowFreeVIP != 'Yes') { msg += '\n' + VIPname + ' members can buy a ticket to the show for ' + cb.settings.ticketShowPriceVIP + ' token' + (cb.settings.ticketShowPriceVIP > 1 ? 's.' : '.'); } else if (cb.settings.ticketShowFreeVIP == 'Yes') { msg += '\n' + VIPname + ' members get a free ticket!'; } } cb.sendNotice(msg, '', ticketBgColor, ticketTxtColor, 'bold'); } function setTicketShowOtToggle(mode,sendto) { if (mode == 'on') { if (ticketShowOtToggle == 1) { cb.sendNotice('The Outstanding Ticket feature is already enabled.',sendto,appNoticeColor); } else { ticketShowOtToggle = 1; cb.sendNotice(dashLine90 + '\n* The Outstanding Ticket (OT) feature is enabled.\n* You can save your ticket if you have to leave before the show starts.\n* Use the command "/saveticket" to save it, but note that by\n* saving your ticket you will be REMOVED from the current show\'s list.\n* You can view the OT List with the command "/otlist".\n* You can redeem an outstanding ticket with the command "/useticket".\n' + dashLine90, '', ticketBgColor, ticketTxtColor, 'bold'); cb.sendNotice('***Notice Regarding Outstanding Tickets***: The Outstanding tickets added and removed during the show must be made permanent by updating the list on the App Launch page.\n* The list can be viewed using the command "/otlist".\n* The changes for the current session can be seen using "/otchanges".\n* It is recommended to save the list externally and update the OT list before the next show.\n* Changes made during the show are not saved beyond the current session.',cb.room_slug,appNoticeColor); } } else if (mode == 'off') { if (ticketShowOtToggle == 0) { cb.sendNotice('The Outstanding Ticket feature is already disabled.',sendto,appNoticeColor); } else { ticketShowOtToggle = 0; cb.sendNotice('You have disabled the Outstanding Ticket (OT) feature.\n* The outstanding ticket list is still intact, but no more tickets will be sold.\n* The list can be viewed using the command "/otlist".\n* The changes for the current session can be seen using "/otchanges" \n* Be sure to update these entries into the OT List on the App Launch Page, they cannot be saved automatically.',sendto,appNoticeColor); } } } function setTicketPrice(amount,announce) { ticketPrice = parseInt(amount); if (announce == 'yes') { ticketPriceChangeNotice(ticketPrice); } } function ticketPriceChangeNotice(price) { cb.sendNotice(':ticket_red_small \u2749 \u2749 \u2749 :ticket_red_small \u2749 \u2749 \u2749 :ticket_red_small \n' + '\u21D2 . . . . Ticket Show Price Updated!!!. . . . . \u21D0 \n' + '\u21D2 . . . . Tickets are now ' + ticketPrice + ' tokens!!! . . . . . \u21D0 \n' + ':ticket_red_small \u2749 \u2749 \u2749 :ticket_red_small \u2749 \u2749 \u2749 :ticket_red_small' , "", ticketNoticesBgColor, ticketNoticesTxtColor, "bold"); changeRoomSubject(); cb.drawPanel(); } function loadFreeTickets() { if (cb.settings.ticketShowFreeMods == 'Yes') { for (let i = 0; i < modsInShow.length; i++) { if (!cb.limitCam_userHasAccess(modsInShow[i])) { addRmvTicket('add',modsInShow[i],'mod'); } } } if (cb.settings.ticketShowFreeFC == 'Yes') { for (let i = 0; i < fanClubList.length; i++) { if (!cb.limitCam_userHasAccess(fanClubList[i])) { addRmvTicket('add',fanClubList[i],'fan'); } } } if (cb.settings.ticketShowFreeEFC == 'Yes') { for (let i = 0; i < extFansInShow.length; i++) { if (!cb.limitCam_userHasAccess(extFansInShow[i])) { addRmvTicket('add',extFansInShow[i],'extfan'); } } } if (cb.settings.ticketShowFreeEFC2 == 'Yes') { for (let i = 0; i < extFansInShow2.length; i++) { if (!cb.limitCam_userHasAccess(extFansInShow2[i])) { addRmvTicket('add',extFansInShow2[i],'extfan2'); } } } if (cb.settings.ticketShowFreeVIP == 'Yes') { for (let i = 0; i < VIPsInShow.length; i++) { if (!cb.limitCam_userHasAccess(VIPsInShow[i])) { addRmvTicket('add',VIPsInShow[i],'vip'); } } } } function checkFreeTickets(user,checkfreemod,checkfreefan,checkfreeextfan,checkfreeextfan2,checkfreevip,checkmode) { if (!cb.limitCam_userHasAccess(user) && showStage != 'aftershow') { if (checkfreemod) { if (cb.settings.ticketShowFreeMods == 'Yes') { if (whichApp == 'ticket') { addRmvTicket('add',user,'mod'); cb.sendNotice(dashLine80 + '\nYou\'ve been added to the show because you\'re a moderator! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } else if (presalesToggle == 1) { addRmvPresale('add',user,'mod'); cb.sendNotice(dashLine80 + '\nYou\'ve been added to the pre-sale ticket list because you\'re a moderator! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (checkmode == 'enter') { cb.sendNotice(dashLine80 + '\n* The Ticket Show has not been configured to give a free ticket to moderators. \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (checkfreefan) { if (cb.settings.ticketShowFreeFC == 'Yes') { if (whichApp == 'ticket') { addRmvTicket('add',user,'fan'); cb.sendNotice(dashLine80 + '\nYou\'ve automatically been added to the show because you\'re in the CB Fan Club! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } else if (presalesToggle == 1) { addRmvPresale('add',user,'fan'); cb.sendNotice(dashLine80 + '\nYou\'ve automatically been added to the pre-sale ticket list because you\'re in the CB Fan Club! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (cb.settings.ticketShowPriceFC > 1 && checkmode == 'enter') { cb.sendNotice(dashLine80 + '\n* As a CB Fan Club member, you can buy a ticket to the show for ' + cb.settings.ticketShowPriceFC + ' tokens. \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (checkfreeextfan) { if (cb.settings.ticketShowFreeEFC == 'Yes') { if (whichApp == 'ticket') { addRmvTicket('add',user,'extfan'); cb.sendNotice(dashLine80 + '\nYou\'ve automatically been added to the show because you\'re in ' + EFCname + '! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } else if (presalesToggle == 1) { addRmvPresale('add',user,'extfan'); cb.sendNotice(dashLine80 + '\nYou\'ve automatically been added to the pre-sale ticket list because you\'re in ' + EFCname + '! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (cb.settings.ticketShowPriceEFC > 1 && checkmode == 'enter') { cb.sendNotice(dashLine80 + '\n* As a member of ' + EFCname + ', you can buy a ticket to the show for ' + cb.settings.ticketShowPriceEFC + ' tokens. \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (checkfreeextfan2) { if (cb.settings.ticketShowFreeEFC2 == 'Yes') { if (whichApp == 'ticket') { addRmvTicket('add',user,'extfan2'); cb.sendNotice(dashLine80 + '\nYou\'ve automatically been added to the show because you\'re in ' + EFCname2 + '! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } else if (presalesToggle == 1) { addRmvPresale('add',user,'extfan2'); cb.sendNotice(dashLine80 + '\nYou\'ve automatically been added to the pre-sale ticket list because you\'re in ' + EFCname2 + '! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (cb.settings.ticketShowPriceEFC2 > 1 && checkmode == 'enter') { cb.sendNotice(dashLine80 + '\n* As a member of ' + EFCname2 + ', you can buy a ticket to the show for ' + cb.settings.ticketShowPriceEFC2 + ' tokens. \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (checkfreevip) { if (cb.settings.ticketShowFreeVIP == 'Yes') { if (whichApp == 'ticket') { addRmvTicket('add',user,'vip'); cb.sendNotice(dashLine80 + '\nYou\'ve automatically been added to the show because you\'re a ' + VIPname + ' member! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } else if (presalesToggle == 1) { addRmvPresale('add',user,'vip'); cb.sendNotice(dashLine80 + '\nYou\'ve automatically been added to the pre-sale ticket list because you\'re a ' + VIPname + ' member! \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } else if (cb.settings.ticketShowPriceVIP > 1 && checkmode == 'enter') { cb.sendNotice(dashLine80 + '\n* As a ' + VIPname + ' member, you can buy a ticket to the show for ' + cb.settings.ticketShowPriceVIP + ' tokens. \n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } } } function setTicketMode(startmode,sendto) { if (startmode === 'init') { if (cb.settings.ticketShowStartMode === 'Start Show Anytime') { newTicketMode = 'manual'; } else if (cb.settings.ticketShowStartMode === 'Start Show after Timer') { newTicketMode = 'timer'; } else if (cb.settings.ticketShowStartMode === 'Start Show after Ticket Goal') { newTicketMode = 'ticketgoal'; } else if (cb.settings.ticketShowStartMode === 'Start Show after Token Goal') { newTicketMode = 'tokengoal'; } if (cb.settings.ticketShowStartAuto === 'Start from Command') { newTicketAuto = 'bc'; } else if (cb.settings.ticketShowStartAuto === 'Automated Start') { newTicketAuto = 'auto'; } } else { newTicketAuto = ticketModeAuto; if (startmode != '' && startmode != null) { newTicketMode = startmode; } else { newTicketMode = ticketStartMode; } } if (ticketStartMode === 'timer' && newTicketMode != 'timer') { if (ticketMinsRemain > 0 || ticketSecsRemain > 0) { stopTicketTimer(sendto); } } if (newTicketMode == 'manual') { ticketStartMode = 'manual'; ticketModeAuto = 'bc'; updtTicketModeMessage(); } else if (newTicketMode == 'timer') { if (cb.settings.ticketShowStartTimer >= 1) { ticketStartMode = 'timer'; ticketTimeAmt = cb.settings.ticketShowStartTimer; if (newTicketAuto == 'auto') { ticketAutoTimer(ticketTimeAmt); ticketModeAuto = 'auto'; updtTicketModeMessage(); } else { ticketAutoTimer(ticketTimeAmt); ticketModeAuto = 'bc'; updtTicketModeMessage(); } } else { ticketStartMode = 'manual'; ticketModeAuto = 'bc'; ticketIncAmt = cb.settings.ticketIncreasePerIncrement; updtTicketModeMessage(); cb.sendNotice('Ticket Show start is set to manual mode. Mode was requested for automatic timer, but the timer was not set on the start page. You can restart the bot and update the missing time, or continue and start the show manually at the end of a timer or at a time of your choosing.', sendto, appNoticeColor); } } else if (newTicketMode == 'tokengoal') { if (cb.settings.ticketShowGoal >= 1) { ticketStartMode = 'tokengoal'; ticketShowGoalTokens = cb.settings.ticketShowGoal; if (newTicketAuto == 'auto') { ticketModeAuto = 'auto'; updtTicketModeMessage(); } else { ticketModeAuto = 'bc'; updtTicketModeMessage(); } } else { ticketStartMode = 'manual'; ticketModeAuto = 'bc'; ticketIncAmt = cb.settings.ticketIncreasePerIncrement; updtTicketModeMessage(); cb.sendNotice('Ticket Show start is set to manual mode. Mode was requested for automatic goal start, but the goal was not set on the start page. You can restart the bot and update the missing goal, update the goal using the command "/chgticketgoal [amt]" and then change the mode using "/chgticketmode goal", or continue and start the show manually at the end of a timer or at a time of your choosing.', sendto, appNoticeColor); } } else if (newTicketMode == 'ticketgoal') { if (cb.settings.ticketShowGoal >= 1) { ticketStartMode = 'ticketgoal'; ticketShowGoalTickets = cb.settings.ticketShowGoal; if (newTicketAuto == 'auto') { ticketModeAuto = 'auto'; updtTicketModeMessage(); } else { ticketModeAuto = 'bc'; updtTicketModeMessage(); } } else { ticketStartMode = 'manual'; ticketModeAuto = 'bc'; ticketIncAmt = cb.settings.ticketIncreasePerIncrement; updtTicketModeMessage(); cb.sendNotice('Ticket Show start is set to manual mode. Mode was requested for automatic goal start, but the goal was not set on the start page. You can restart the bot and update the missing goal, update the goal using the command "/chgticketgoal [amt]" and then change the mode using "/chgticketmode goal", or continue and start the show manually at the end of a timer or at a time of your choosing.', sendto, appNoticeColor); } } } function setTicketAuto(automode) { if (automode === 'bc') { ticketModeAuto = 'bc'; updtTicketModeMessage(); } else if (automode === 'auto') { ticketModeAuto = 'auto'; updtTicketModeMessage(); } } function updtTicketModeMessage() { if (ticketStartMode == 'manual') { ticketModeMessage = '* Ticket Show start mode is set to "Manual"\n* The show will be started by ' + bctext + ' or a moderator.'; } else if (ticketStartMode == 'timer') { if (ticketModeAuto == 'auto') { ticketModeMessage = '* Ticket Show start mode is set to "Automatic timer" with a duration of ' + ticketTimeAmt + ' minutes.\n* The Ticket Show will start automatically when the timer runs out.'; } else if (ticketModeAuto == 'bc') { ticketModeMessage = '* Ticket Show start mode is set to "Broadcaster managed timer". \n* ' + bctext + ' will set a timer and start the show when the timer runs out.'; } } else if (ticketStartMode == 'tokengoal') { if (ticketModeAuto == 'auto') { ticketModeMessage = '* Ticket Show start mode is set to "Automatic at token goal." \n* There will be a short 2 minute countdown started once the goal is met for total tip amount (' + ticketShowGoalTokens + ' tokens), and then the show will start automatically.'; } else if (ticketModeAuto == 'bc') { ticketModeMessage = '* Ticket Show start mode is set to "Broadcaster managed token goal". \n* ' + bctext + ' will start the show once the goal is met for the total tips (' + ticketShowGoalTokens + ' tokens).'; } } else if (ticketStartMode == 'ticketgoal') { if (ticketModeAuto == 'auto') { ticketModeMessage = '* Ticket Show start mode is set to "Automatic at ticket goal." \n* There will be a short 2 minute countdown started once the goal is met for tickets sold (' + ticketShowGoalTickets + ' tickets), and then the show will start automatically.'; } else if (ticketModeAuto == 'bc') { ticketModeMessage = '* Ticket Show start mode is set to "Broadcaster managed ticket goal". \n* ' + bctext + ' will start the show once the goal is met for tickets sold (' + ticketShowGoalTickets + ' tickets).'; } } } function startTicketShowTimer(numtimer) { ticketMinsRemain = numtimer; ticketStartMode = 'timer'; ticketAutoTimer(ticketMinsRemain); cb.drawPanel(); } function ticketAutoTimer(addtime) { if (ticketModeAuto == 'auto') { if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice('An automatic timer was started for the countdown to the Fan Appreciation show.', "", ticketBgColor, ticketTxtColor, "bold"); } else { cb.sendNotice('An automatic timer was started, ticket show price will be ' + ticketPrice + ' tokens.', "", ticketBgColor, ticketTxtColor, "bold"); } } else if (ticketModeAuto == 'bc') { cb.sendNotice('A timer was started to provide an countdown to approximate showtime. \n ' + bctext + ' will start the show after the timer runs out.', "", ticketBgColor, ticketTxtColor, "bold"); } ticketMinsRemain = addtime; ticketSecsRemain = 0; ticketStartTime = new Date(); ticketStopTime = new Date(ticketStartTime.getTime() + ticketMinsRemain * 60000); ticketTimerStopping = false; ticketTimerMin(); } function ticketTimerMin() { if (!ticketTimerStopping && ticketStartMode == 'timer' && whichApp == 'ticket') { switch (ticketMinsRemain) { case 60: case 45: case 30: case 25: case 20: case 15: case 10: case 9: case 8: case 7: case 6: case 5: case 4: case 3: case 2: if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice('\u23f1 \u23f1 \u23f1 There are ' + ticketMinsRemain + ' minutes left until the Fan Appreciation Show! \u23f1 \u23f1 \u23f1', '', appNoticeColor, '', 'bold'); } else { cb.sendNotice('\u23f1 \u23f1 \u23f1 There are ' + ticketMinsRemain + ' minutes left to buy a ticket for ' + ticketPrice + ' tokens before the show starts! \u23f1 \u23f1 \u23f1', '', appNoticeColor, '', 'bold'); } break; case 1: if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice('\u23f1 \u23f1 \u23f1 There is 1 minute left until the Fan Appreciation Show! \u23f1 \u23f1 \u23f1', '', appNoticeColor, '', "bold"); } else { cb.sendNotice('\u23f1 \u23f1 \u23f1 There is 1 minute left to buy a ticket for ' + ticketPrice + ' tokens before the show starts! \u23f1 \u23f1 \u23f1', '', appNoticeColor, '', 'bold'); } break; } cb.drawPanel(); ticketMinsRemain--; if (ticketMinsRemain > 0) { ticketDisplaySeconds = false; } else { ticketDisplaySeconds = true; } ticketSecsRemain = 60; ticketTimerSec(); } } function ticketTimerSec() { if (!ticketTimerStopping && ticketStartMode === 'timer' && whichApp === 'ticket') { if (ticketDisplaySeconds) { switch (ticketSecsRemain) { case 30: case 10: case 5: case 4: case 3: case 2: cb.sendNotice('\u23f1 \u23f1 \u23f1 There are ' + ticketSecsRemain + ' seconds left! \u23f1 \u23f1 \u23f1', '', red, '', 'bold'); break; case 1: cb.sendNotice('\u23f1 \u23f1 \u23f1 There is 1 second left! \u23f1 \u23f1 \u23f1', '', red, '', 'bold'); break; } cb.drawPanel(); } if (ticketSecsRemain < 1) { if (ticketMinsRemain >= 1) { ticketTimerMin(); } else { if (ticketStartMode = 'timer' && ticketModeAuto === 'auto') { cb.sendNotice('\u23f0 \u23f0 \u23f0 Time is up! Ticket Show is starting! \u23f0 \u23f0 \u23f0', '', ticketNoticesBgColor, ticketNoticesTxtColor, 'bold'); startTicketShow(bctext); } else { cb.sendNotice('\u23f0 \u23f0 \u23f0 Time is up! ' + bctext + ' will be starting the show! \u23f0 \u23f0 \u23f0', '', ticketNoticesBgColor, ticketNoticesTxtColor, 'bold'); } } } else { ticketSecsRemain--; cb.setTimeout(ticketTimerSec, 1000); } } } function ticketAddTime(tickettimetoadd, user) { ticketStopTime = new Date(ticketStopTime.getTime() + tickettimetoadd * 60000); timetoaddabs = Math.abs(tickettimetoadd); if (tickettimetoadd > 0) { cb.sendNotice(user + ' has added ' + tickettimetoadd + ' minute' + (tickettimetoadd === 1 || tickettimetoadd === -1 ? '' : 's') + ' to the timer.',cb.room_slug,'','', 'bold'); cb.sendNotice(tickettimetoadd + ' minute' + (tickettimetoadd === 1 || tickettimetoadd === -1 ? ' has' : 's have') + ' been added to the timer. Now ' + ticketTimeLeft(),'',appNoticeColor,'', 'bold'); } else { cb.sendNotice(user + ' has subtracted ' + timetoaddabs + ' minute' + (timetoaddabs === 1 || timetoaddabs === -1 ? '' : 's') + ' from the timer.',cb.room_slug,'','', 'bold'); cb.sendNotice(timetoaddabs + ' minute' + (timetoaddabs === 1 || timetoaddabs === -1 ? ' has' : 's have') + ' been subtracted from the timer. Now ' + ticketTimeLeft(),'',appNoticeColor,'', 'bold'); } ticketMinsRemain = ticketMinsRemain + tickettimetoadd; if (ticketMinsRemain > 0) { ticketDisplaySeconds = false; } else { ticketDisplaySeconds = true; } cb.drawPanel(); return; } function ticketTimeCal() { ticketStartTime = new Date(); return ticketStopTime - ticketStartTime.getTime(); } function stopTicketTimer(mod) { ticketStopTime = new Date(); ticketTimerStopping = true; ticketMinsRemain = 0; ticketSecsRemain = 0; if(mod != null && mod != '') { cb.sendNotice(mod + ' has stopped the ticket show timer.','',appNoticeColor,'', 'bold'); } cb.drawPanel(); } function ticketTimeLeft(user) { var ticketTimeLeft = ticketTimeCal(); var ticketMS = ticketTimeLeft % 1000; var ticketSeconds = ((ticketTimeLeft - ticketMS) % 60000); var ticketMinutes = ((ticketTimeLeft - ticketSeconds - ticketMS) % 3600000); var ticketHours = (ticketTimeLeft - ticketMinutes - ticketSeconds - ticketMS); ticketSeconds = ticketSeconds / 1000; ticketMinutes = ticketMinutes / 60000; ticketHours = ticketHours / 3600000; if (ticketHours > 0) { return ticketHours + " hour" + (ticketHours > 1 ? "s" : "") + " and " + ticketMinutes + " minute" + (ticketMinutes > 1 ? "s" : "") + " remaining on the ticket show timer."; } else if (ticketMinutes > 0 && ticketSeconds === 0) { return ticketMinutes + " minute" + (ticketMinutes > 1 ? "s" : "") + " remaining on the ticket show timer."; } else if (ticketMinutes > 0) { return ticketMinutes + " minute" + (ticketMinutes > 1 ? "s" : "") + " and " + ticketSeconds + " second" + (ticketSeconds > 1 ? "s" : "") + " remaining on the ticket show timer."; } else { return ticketSeconds + " second" + (ticketSeconds > 1 ? "s" : "") + " remaining on the ticket show timer."; } } function ticketTimeLeftPanel() { var ticketTimeLeft = ticketTimeCal(); var ticketMS = ticketTimeLeft % 1000; var ticketSeconds = ((ticketTimeLeft - ticketMS) % 60000); var ticketMinutes = ((ticketTimeLeft - ticketSeconds - ticketMS) % 3600000); var ticketHours = (ticketTimeLeft - ticketMinutes - ticketSeconds - ticketMS); ticketSeconds = ticketSeconds / 1000; ticketMinutes = ticketMinutes / 60000; if (ticketMinutes > 0) { return 'Less than ' + (ticketMinutes+1) + ' min rem'; } else { return (ticketSeconds) + ' sec rem'; } } function addRmvTicket(mode,user,usertype,tipamt) { switch (mode) { case 'add': { if (cbjs.arrayContains(freePreviewUserArray,user)) { addindex = freePreviewUserArray.indexOf(user); freePreviewUserArray.splice(addindex,1); freePreviewTimeArray.splice(addindex,1); removePreViewer(user); } cb.limitCam_addUsers([user]); addViewer(user); addTicketHolder(user); if (usertype == 'fan') { cb.sendNotice('CB Fan Club member ' + user + ' has been added to the ticket show list.', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'extfan') { cb.sendNotice(EFCname + ' member ' + user + ' has been added to the ticket show list.', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'extfan2') { cb.sendNotice(EFCname2 + ' member ' + user + ' has been added to the ticket show list.', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'vip') { cb.sendNotice(VIPname + ' member ' + user + ' has been added to the ticket show list.', '', ticketBgColorVIP, ticketTxtColorVIP, 'bold'); } else if (usertype == 'mod') { cb.sendNotice('Moderator ' + user + ' has been added to the ticket show list.', '', ticketBgColorMod, ticketTxtColorMod, 'bold'); } else { cb.sendNotice(user + ' has been added to the ticket show list.', '', ticketBgColor, ticketTxtColor, 'bold'); } cb.drawPanel(); break; } case 'rmv': { cb.limitCam_removeUsers([user]); removeTicketHolder(user); removeViewer(user); cb.sendNotice(user + ' has been removed from the ticket show list.', '', ticketBgColor, ticketTxtColor, 'bold'); cb.drawPanel(); break; } case 'addtip': { if (cbjs.arrayContains(freePreviewUserArray,user)) { addtipindex = freePreviewUserArray.indexOf(user); freePreviewUserArray.splice(addtipindex,1); freePreviewTimeArray.splice(addtipindex,1); countTicketsFromPreview ++; removePreViewer(user); } cb.limitCam_addUsers([user]); addViewer(user); addTicketHolder(user); ticketShowTotalTicketsBought++; if (usertype == 'fan') { cb.sendNotice(':uaticketsmall Welcome CB Fan Club member ' + user + ', you have bought a ticket to the show!', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'extfan') { cb.sendNotice(':uaticketsmall Welcome ' + EFCname + ' member ' + user + ', you have bought a ticket to the show!', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'extfan2') { cb.sendNotice(':uaticketsmall Welcome ' + EFCname2 + ' member ' + user + ', you have bought a ticket to the show!', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'vip') { cb.sendNotice(':uaticketsmall Welcome ' + VIPname + ' member ' + user + ', you have bought a ticket to the show!', '', ticketBgColorVIP, ticketTxtColorVIP, 'bold'); } else if (usertype == 'mod') { cb.sendNotice(':uaticketsmall Welcome ' + user + ', you have bought a ticket to the show!', '', ticketBgColorMod, ticketTxtColorMod, 'bold'); } else { cb.sendNotice(':uaticketsmall Welcome ' + user + ', you have bought a ticket to the show!', '', ticketBgColor, ticketTxtColor, 'bold'); } if (ticketShowAllowGift == 'Yes' && tipamt >= (2*ticketPrice)) { addRmvTicket('addextra',user,'common',(tipamt - ticketPrice)); } break; } case 'addextra': { var numtickets = Math.floor(parseInt(tipamt / ticketPrice)); if (numtickets > 0) { if (!cbjs.arrayContains(ticketShowExtraTickets.name,user)) { ticketShowExtraTickets.name.push(user); ticketShowExtraTickets.count.push(numtickets); } else { addextraindex = ticketShowExtraTickets.name.indexOf(user); ticketShowExtraTickets.count[addextraindex] = ticketShowExtraTickets.count[addextraindex] + numtickets; } cb.sendNotice(user + ', you have purchased ' + numtickets + ' extra tickets to the show. You can gift these to other users with the command "/giftticket user". Each time you use the command uses up one of your extra tickets. Please make sure to spell the user name right, gifted tickets cannot be recovered if they are gifted incorrectly.', user, ticketBgColor, ticketTxtColor, "bold"); } cb.drawPanel(); break; } } } function addViewer(user) { if (!cbjs.arrayContains(ticketShowViewerList,user)) { ticketShowViewerList.push(user); } } function removeViewer(user) { if (cbjs.arrayContains(ticketShowViewerList,user)) { rmvvindex = ticketShowViewerList.indexOf(user); ticketShowViewerList.splice(rmvvindex,1); } } function addTicketHolder(user) { if (!cbjs.arrayContains(ticketHolderList,user)) { ticketHolderList.push(user); countTickets ++; } } function removeTicketHolder(user) { if (cbjs.arrayContains(ticketHolderList,user)) { rmvvindex = ticketHolderList.indexOf(user); ticketHolderList.splice(rmvvindex,1); if (countTickets > 0) { countTickets --; } } } function addPreViewer(user) { if (!cbjs.arrayContains(ticketShowPreViewerList,user)) { ticketShowPreViewerList.push(user); } } function removePreViewer(user) { if (cbjs.arrayContains(ticketShowPreViewerList,user)) { rmvpindex = ticketShowPreViewerList.indexOf(user); ticketShowPreViewerList.splice(rmvpindex,1); } } function addRmvPreview(mode,user) { switch (mode) { case 'add': { cb.limitCam_addUsers([user]); addViewer(user); addPreViewer(user); endtime = Date.now() + (freePreviewLength * 1000); freePreviewUserArray.push(user); index = freePreviewUserArray.indexOf(user); freePreviewTimeArray[index] = endtime; break; } case 'rmv': { cb.limitCam_removeUsers([user]); removeViewer(user); removePreViewer(user); break; } } } function previewMonitorTimer() { cb.setTimeout(previewMonitor, 5000); } function previewMonitor() { if (showStage == 'ticketshow' || showStage == 'showwarn' || showStage == 'showfinale') { previewCheckViewers(); previewMonitorTimer(); } cb.drawPanel(); } function previewCheckViewers() { nowtime = Date.now(); for (var chk = 0; chk < freePreviewUserArray.length; chk++) { user = freePreviewUserArray[chk]; if (cb.limitCam_userHasAccess(user)) { if (freePreviewTimeArray[chk] < nowtime) { addRmvPreview('rmv',user); cb.sendNotice(dashLine80 + '\n Your free preview period has ended. \nPlease buy a ticket for ' + ticketPrice + ' tokens to see the rest of the show.\n' + dashLine80, user, ticketBgColor, ticketTxtColor, 'bold'); } } } } function giftTicket(fromuser,touser) { cb.limitCam_addUsers([touser]); addViewer(touser); addTicketHolder(touser); cb.sendNotice('Welcome ' + touser + ', ' + fromuser + ' has gifted you a ticket to the show!', '', ticketBgColor, ticketTxtColor, 'bold'); cb.drawPanel(); } function giveAwayTicket(fromuser,touser) { cb.limitCam_addUsers([touser]); addViewer(touser); addTicketHolder(touser); cb.limitCam_removeUsers([fromuser]); removeViewer(fromuser); removeTicketHolder(fromuser); cb.sendNotice('Welcome ' + touser + ', ' + fromuser + ' has gifted you a ticket to the show!', '', ticketBgColor, ticketTxtColor, 'bold'); cb.drawPanel(); } function addRmvOutstandingTicket(mode,user) { switch (mode) { case 'add': { if (!cbjs.arrayContains(outstandingTicketArray,user)) { outstandingTicketArray.push(user); } populateOtChangesArray(user,'add'); break; } case 'rmv': { if (cbjs.arrayContains(outstandingTicketArray,user)) { cbjs.arrayRemove(outstandingTicketArray,user); } populateOtChangesArray(user,'rmv'); break; } } } function populateOtChangesArray(user,type) { if (cbjs.arrayContains(otChangesArray.name,user)) { otindex = otChangesArray.name.indexOf(user); if (otChangesArray.type[otindex] != type) { otChangesArray.name.push(user); otChangesArray.type.push(type); } else { return; } } else { otChangesArray.name.push(user); otChangesArray.type.push(type); } } function ticketShowGoalProgress(tippedamountprogress) { ticketShowTotalTips = ticketShowTotalTips + tippedamountprogress; if (ticketStartMode == 'tokengoal' && ticketShowTotalTips >= ticketShowGoalTokens) { cb.sendNotice(dashLine80 + '\n :siren1 \u25C8 \u25C8 \u25C8 The ticket show Tip goal has been met!! \u25C8 \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 \u25C8 Starting a 2 minute timer for automatic start of show! \u25C8 \u25C8 \u25C8 \n' + dashLine80, '', ticketNoticesBgColor, ticketNoticesTxtColor, 'bold'); ticketStartMode = 'timer'; ticketAutoTimer(2); } else if (ticketStartMode == 'ticketgoal' && ticketShowTotalTicketsBought >= ticketShowGoalTickets) { cb.sendNotice(dashLine80 + '\n :siren1 \u25C8 \u25C8 The ticket show Ticket goal has been met!! \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 \u25C8 Starting a 2 minute timer for automatic start of show! \u25C8 \u25C8 \u25C8 \n' + dashLine80, '', ticketNoticesBgColor, ticketNoticesTxtColor, 'bold'); ticketStartMode = 'timer'; ticketAutoTimer(2); } } function startTicketShow(startedby) { if (ticketShowStartPrice > 0) { ticketPrice = ticketShowStartPrice; ticketPriceChangeNotice(ticketShowStartPrice); } cb.sendNotice(dashLine60 + '\n :siren1 :siren1 :siren1 ' + startedby + ' has started the show! :siren1 :siren1 :siren1 \n' + dashLine60,'',ticketBgColor, ticketNoticesTxtColor, 'bold'); if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.limitCam_start('Ultra App Hidden Show\n\nFan Club Appreciation Show in progress. Join the Fanclub to unlock the screen!'); } else { cb.limitCam_start('Ultra App Ticket Show\n\nHidden Cam show in progress \nCheck room notices for ticket price'); } showStage = 'ticketshow'; changeRoomSubject(); if (ticketMinsRemain > 0 || ticketSecsRemain > 0) { stopTicketTimer(); } hiddenTime = Date.now(); if (freePreviewLength > 0) { previewMonitorTimer(); } cb.drawPanel(); } function restartTicketShow(startedby) { cb.sendNotice(dashLine80 + '\n :siren1 \u25C8 \u25C8 \u25C8 ' + startedby + ' has restarted the ticket show! \u25C8 \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 \u25C8 All current ticket holders still have access. \u25C8 \u25C8 \u25C8 \n \u25C8 \u25C8 \u25C8 Ticket sales are open, price is ' + ticketPrice + ' tokens. \u25C8 \u25C8 \u25C8 \n' + dashLine80,'',ticketBgColor, ticketNoticesTxtColor, 'bold'); if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.limitCam_start('Ultra App Ticket Show\n\nFan Club Appreciation Show in progress. Join the Fanclub to unlock the screen!'); } else { cb.limitCam_start('Ultra App Ticket Show\n\nHidden Cam show in progress \nCheck room notices for ticket price'); } if (showStage == 'aftershow') { ticketSubjectText = savedTicketSubjectText; } showStage = 'ticketshow'; changeRoomSubject(); ticketShowEnded = false; ticketSalesEnded = false; if (ticketMinsRemain > 0 || ticketSecsRemain > 0) { stopTicketTimer(); } hiddenTime = Date.now(); if (freePreviewLength > 0) { previewMonitorTimer(); } cb.drawPanel(); } function restartTicketSales(startedby) { if (showStage == 'aftershow') { cb.sendNotice(dashLine80 + '\n :siren1 ' + startedby + ' has restarted ticket sales! :siren1 \n * All current ticket holders still have access. \n * Ticket price is ' + ticketPrice + ' tokens. \n' + dashLine80,'',ticketBgColor, ticketNoticesTxtColor, 'bold'); showStage = 'ticketsales'; ticketSubjectText = savedTicketSubjectText; ticketShowEnded = false; } else if (showStage == 'showfinale') { cb.sendNotice(dashLine80 + '\n :siren1 ' + startedby + ' has restarted ticket sales! :siren1 \n * Ticket price is ' + ticketPrice + ' tokens. \n' + dashLine80,'',ticketBgColor, ticketNoticesTxtColor, 'bold'); showStage = 'ticketshow'; } ticketSalesEnded = false; changeRoomSubject(); cb.drawPanel(); } function warnShowEnding(warnby) { showStage = 'showwarn'; if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice(dashLine90 + '\n :siren1 ' + warnby + ' has indicated the Fan Appreciation Show is nearly finished :siren1 \n' + dashLine90,'',ticketBgColor,ticketNoticesTxtColor,'bold'); } else { if (cb.settings.ticketShowReducePriceWarn > 0) { ticketPrice = ticketPrice - cb.settings.ticketShowReducePriceWarn; cb.sendNotice(dashLine90 + '\n :siren1 \u25C8 \u25C8 \u25C8 ' + warnby + ' has indicated the show is nearly finished. \u25C8 \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 It is not recommended to buy a ticket, but sales are still open. \u25C8 \u25C8 \n \u25B7 \u25B7 \u25B7 \u25B7 \u25B7 The Ticket Price has been reduced to ' + ticketPrice + ' tokens! \u25C1 \u25C1 \u25C1 \u25C1 \u25C1 \n' + dashLine90,'',ticketBgColor,ticketNoticesTxtColor,'bold'); } else { cb.sendNotice(dashLine90 + '\n :siren1 \u25C8 \u25C8 \u25C8 ' + warnby + ' has indicated the show is nearly finished. \u25C8 \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 It is not recommended to buy a ticket, but sales are still open. \u25C8 \u25C8 \n' + dashLine90,'',ticketBgColor,ticketNoticesTxtColor,'bold'); } } changeRoomSubject(); cb.drawPanel(); } function stopTicketSales(salesstoppedby) { if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice(dashLine90 + '\n :siren1 ' + salesstoppedby + ' has indicated the Fan Appreciation Show is nearly finished :siren1 \n' + dashLine90,'',ticketBgColor,ticketNoticesTxtColor,'bold'); } else { cb.sendNotice(dashLine70 + '\n :siren1 :siren1 :siren1 \u25B7 \u25B7 ' + salesstoppedby + ' has ended ticket sales. \u25C1 \u25C1 :siren1 :siren1 :siren1 \n' + dashLine70,'',ticketBgColor,ticketNoticesTxtColor,'bold'); } showStage = 'showfinale'; changeRoomSubject(); ticketSalesEnded = true; cb.drawPanel(); afterNoticeInt = 90000; setAfterNoticeTimeout(); } function stopTicketShow(stoppedby) { cb.sendNotice(dashLine60 + '\n :siren1 \u25C8 \u25C8 \u25C8 ' + stoppedby + ' has ended the show \u25C8 \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 \u25C8 \u25C8 Ticket Show length ' + ((Date.now() - hiddenTime)/60000).toFixed(2) + ' minutes. \u25C8 \u25C8 \u25C8 \u25C8 \n' + dashLine60,'',ticketBgColor,ticketNoticesTxtColor,'bold'); cb.limitCam_stop(); cb.sendNotice(dashLine70 + '\n :siren1 :siren1 :siren1 The broadcast is returning to Public Chat. :siren1 :siren1 :siren1 \n' + dashLine70, '',ticketBgColor,ticketNoticesTxtColor,'bold'); hiddenTime = 0; ticketShowEnded = true; ticketSalesEnded = true; showStage = 'aftershow'; savedTicketSubjectText = ticketSubjectText; ticketSubjectText = cb.settings.ticketShowAfterNotice; changeRoomSubject(); cb.drawPanel(); if (ticketShowOtToggle == 1) { if (otChangesArray.name.length > 0) { outString = ''; for (var i = 0; i < otChangesArray.name.length; i++) { if (otChangesArray.name[i] == null) { break } else { outString += (i > 0 ? ',' : '') + otChangesArray.name[i] + '(' + otChangesArray.type[i] + ')'; } } cb.sendNotice('Listing of Changes to the Outstanding Ticket List from this show : \n' + outString + '\nEnd of List', cb.room_slug, appNoticeColor); cb.sendNotice('Listing of Changes to the Outstanding Ticket List from this show : \n' + outString + '\nEnd of List', '', appNoticeColor, '', '', 'red'); } else { cb.sendNotice('No entries have been added to the Outstanding Ticket Changes list from this show.', cb.room_slug, appNoticeColor); } } if (countTicketsFromPreview > 0) { cb.sendNotice('Good news! ' + countTicketsFromPreview + ' viewers bought tickets from watching the free preview period.', cb.room_slug, appNoticeColor); } } function setAfterNoticeTimeout() { cb.setTimeout(afterNoticeTimer, afterNoticeInt); } function afterNoticeTimer() { if (showStage == 'showfinale') { cb.sendNotice(' :siren1 Ticket Sales Ended! Do not tip to buy a ticket! :siren1 ','',ticketBgColor,ticketNoticesTxtColor,'bold'); setAfterNoticeTimeout(); } } function useTicket(user) { addRmvOutstandingTicket('rmv',user); cb.limitCam_addUsers([user]); addViewer(user); addTicketHolder(user); cb.sendNotice('Welcome ' + user + ', your Outstanding Ticket has been redeemed for a ticket to this show.', '', ticketBgColor, ticketTxtColor, 'bold'); cb.drawPanel(); } function saveTicket(user) { addRmvOutstandingTicket('add',user); cb.limitCam_removeUsers([user]); removeTicketHolder(user); removeViewer(user); cb.drawPanel(); } function sendPublicNotice (message, user, type) { if (message != null) { if (message != '' || message != ' ' || message != '\u00a0') { switch (type) { case 'div': cb.sendNotice(dashLine80 + '\n\u25ba ' + message.capitalize() + '\n' + dashLine80, '', '', ticketNoticesTxtColor, 'bold'); break; case 'divh': cb.sendNotice(dashLine80 + '\n\u25ba ' + message.capitalize() + '\n' + dashLine80, '', ticketBgColor,ticketNoticesTxtColor, 'bold'); break; case 'h': cb.sendNotice("\u25ba " + message.capitalize(), '', ticketBgColor,ticketNoticesTxtColor, 'bold'); break; case '': cb.sendNotice('\u25ba ' + message.capitalize(), '', '', ticketNoticesTxtColor, 'bold'); break; } } else { cb.sendNotice('You cannot send a blank message. Type a message and try again.', user, appNoticeColor); } } else { cb.sendNotice('You cannot send a blank message. Type a message and try again.', user, appNoticeColor); } } function prepTicketShow(startedby,numtimer) { if (ticketPrice <= 0) { cb.sendNotice('Unable to start the Ultra App Ticket Show feature, a ticket price is not defined. The command "/ticketprice [price]" can be used to set a price.', startedby, appNoticeColor); } else { setAppFeature('ticket', startedby); if (presalesToggle == 1) { setPresalesToggle('off',startedby); } } if (cb.settings.prepTicketStartTimer == 'Yes' && ticketStartMode == 'manual') { if (numtimer > 0) { startTicketShowTimer(numtimer); } else if (cb.settings.ticketShowStartTimer > 0) { startTicketShowTimer(cb.settings.ticketShowStartTimer); } else { cb.sendNotice('Unable to start the ticket show countdown timer, a value was not provided on the /prepticket command and no "Default Timer" duration is defined on the launch page. You can manually start a timer with the "/ticketstarttimer xx" command (no quotes).', startedby, appNoticeColor); } } } // *********************************** Ticket Show Pre-sales ************************************** function setPresalesToggle(mode, sendto, price) { if (mode == 'on') { if (presalesToggle == 1) { cb.sendNotice('The Pre-Sales Ticket feature is already enabled.',sendto,appNoticeColor); } else { presalePrice = price; presalesToggle = 1; showStage = 'presales'; if (whichApp != 'ticket') { ticketShowColors(); } cb.sendNotice('***Warning Regarding Presales***: Once tickets have been sold, do not deactivate or restart the UltraApp without saving the pre-sale ticket list. If it is necessary to restart, please save the pre-sale list first (use /tickets to view and copy) and then add those users back to the presale (/addpresale) or the actual ticket show (/add).',cb.room_slug,appNoticeColor); presaleSkipNotice = false; setPresaleMode('init',sendto); countPresaleSold = 0; presaleIncrements = 0; stopIncrement = false; loadFreeTicketsPresale(); cb.setTimeout(presaleNoticeTimer, cb.settings.presaleNoticeInterval * 60000); } } else if (mode == 'off') { if (presalesToggle == 0) { cb.sendNotice('The Pre-Sales Ticket feature is already disabled.', sendto, appNoticeColor); } else { presalesToggle = 0; stopPresaleTimer(sendto); presaleSkipNotice = true; cb.sendNotice('You have disabled the Pre-Sales Ticket feature. The pre-sales list is still intact, but no more Pre-sale tickets will be sold.', sendto, appNoticeColor); cb.sendNotice(sendto + ' has disabled the Ticket Show Pre-sales Feature. You can no longer buy Pre-sale tickets.', '', ticketBgColor, ticketTxtColor, 'bold'); } } } function loadFreeTicketsPresale() { if (cb.settings.ticketShowFreeMods == 'Yes') { for (let i = 0; i < modsInShow.length; i++) { if (!cb.limitCam_userHasAccess(modsInShow[i])) { addRmvPresale('add',modsInShow[i],'mod'); } } } if (cb.settings.ticketShowFreeFC == 'Yes') { for (let i = 0; i < fanClubList.length; i++) { if (!cb.limitCam_userHasAccess(fanClubList[i])) { addRmvPresale('add',fanClubList[i],'fan'); } } } if (cb.settings.ticketShowFreeEFC == 'Yes') { for (let i = 0; i < extFansInShow.length; i++) { if (!cb.limitCam_userHasAccess(extFansInShow[i])) { addRmvPresale('add',extFansInShow[i],'extfan'); } } } if (cb.settings.ticketShowFreeEFC2 == 'Yes') { for (let i = 0; i < extFansInShow2.length; i++) { if (!cb.limitCam_userHasAccess(extFansInShow2[i])) { addRmvPresale('add',extFansInShow2[i],'extfan2'); } } } if (cb.settings.ticketShowFreeVIP == 'Yes') { for (let i = 0; i < VIPsInShow.length; i++) { if (!cb.limitCam_userHasAccess(VIPsInShow[i])) { addRmvPresale('add',VIPsInShow[i],'vip'); } } } } function setPresaleMode(mode,sendto) { if (mode === 'init') { if (cb.settings.ticketShowPresalesMode === 'Yes, Mode 1: Increment Manually') { newPresaleMode = 'manual'; } else if (cb.settings.ticketShowPresalesMode === 'Yes, Mode 2: Increment on X Tickets Sold') { newPresaleMode = 'count'; } else if (cb.settings.ticketShowPresalesMode === 'Yes, Mode 3: Increment on Automatic Timer') { newPresaleMode = 'timer'; } else { newPresaleMode = 'initmanual'; } } else { countPresaleSold = 0; presaleIncrements = 0; stopIncrement = false; newPresaleMode = mode; } if (presaleMode === 'timer' && newPresaleMode != 'timer') { stopPresaleTimer(sendto); } if (newPresaleMode === 'manual') { presaleMode = 'manual'; cb.sendNotice('Pre-sales is set to manual mode. The broadcaster or a moderator can change the presale price on demand using the command "/presaleprice [newprice]".', sendto, appNoticeColor); } else if (newPresaleMode === 'timer') { if (presaleIncAmt >= 1 && presaleTimeAmt >= 1) { presaleMode = 'timer'; presaleAutoTimer(presaleTimeAmt); cb.sendNotice('Pre-sales is set to Mode 3: Automatic timer mode. Timer cycle is set to ' + presaleTimeAmt + ' minutes, and price will increase ' + presaleIncAmt + ' tokens each time, with a maximum of ' + cb.settings.ticketShowPresaleMaxIncrements + ' increases.', sendto, appNoticeColor); } else { presaleMode = 'manual'; cb.sendNotice('Pre-sales is set to manual mode. Mode was requested for automatic timer, but either the price increment or number of minutes per increment is not set. You can restart the bot and update the missing values, update the pre-sale price manually without a timer, or manually start a single increment timer.', sendto, appNoticeColor); } } else if (newPresaleMode === 'count') { if (presaleIncAmt >= 1 && presaleCountAmt >= 1) { presaleMode = 'count'; ticketsLeft = presaleCountAmt; cb.sendNotice('Pre-sales is set to Mode 2: Increment by tickets sold. Ticket count cycle is set to ' + presaleCountAmt + ' tickets sold, and price will increase ' + presaleIncAmt + ' tokens each time, with a maximum of ' + cb.settings.ticketShowPresaleMaxIncrements + ' increases.', sendto, appNoticeColor); cb.sendNotice('Pre-sale tickets are limited. The pre-sale price will increase from ' + presalePrice + ' to ' + (presalePrice + presaleIncAmt) + ' tokens once ' + presaleCountAmt + ' tickets are sold. Buy now before the price goes up!', '', ticketBgColor, ticketTxtColor, 'bold'); } else { presaleMode = 'manual'; cb.sendNotice('Pre-sales is set to manual mode. Mode was requested for increment by tickets sold, but either the price increment or number of tickets sold per increment is not set. You can restart the bot and update the missing values, update the pre-sale price manually with a count, or manually start a single increment timer.', sendto, appNoticeColor); } } else if (newPresaleMode === 'initmanual') { presaleMode = 'manual'; cb.sendNotice('Pre-sales is set to manual mode since pre-sale was turned off on the start page. You can change the mode using the command "/chgpresalemode [mode]", where [mode] is "manual", "count", or "timer".', sendto, appNoticeColor); } } function presalePriceChange(price,mod) { cb.sendNotice('\u21D2 . . . . Ticket Show Pre-Sales Price Updated!!!. . . . . \u21D0 \n \u21D2 . . . . . Pre-sale Tickets are now ' + price + ' tokens!!! . . . . . \u21D0' , '', ticketBgColor, ticketTxtColor, 'bold'); presalePrice = price; } function presaleNoticeTimer() { if (presalesToggle == 1 && enablePresales == true) { if (presaleMode === 'manual') { cb.sendNotice('Ticket Show Pre-sales are active. You can now buy advance tickets to the show at a price of ' + presalePrice + ' tokens. Planned ticket price for the show is ' + ticketPrice + ' tokens.', '', ticketBgColor, ticketTxtColor, 'bold'); } else if (presaleMode === 'timer') { if (stopIncrement === true || (presalePrice + presaleIncAmt) > ticketPrice || presaleIncrements > cb.settings.ticketShowPresaleMaxIncrements) { cb.sendNotice('Ticket Show Pre-sales are active. You can now buy advance tickets to the show at a price of ' + presalePrice + ' tokens. Planned ticket price for the show is ' + ticketPrice + ' tokens.', '', ticketBgColor, ticketTxtColor, 'bold'); } else { cb.sendNotice('Ticket Show Pre-sales are active. You can now buy advance tickets to the show at a price of ' + presalePrice + ' tokens. Pre-sale tickets are being sold at this price for a limited period of time. The pre-sale price will increase from ' + presalePrice + ' to ' + (presalePrice + presaleIncAmt) + ' tokens once the timer runs out. Buy now before the price goes up!', '', ticketBgColor, ticketTxtColor, 'bold'); } } else if (presaleMode === 'count') { if (stopIncrement === true || (presalePrice + presaleIncAmt) > ticketPrice || (presaleIncrements + 1) > cb.settings.ticketShowPresaleMaxIncrements) { cb.sendNotice('Ticket Show Pre-sales are active. You can now buy advance tickets to the show at a price of ' + presalePrice + ' tokens. Planned ticket price for the show is ' + ticketPrice + ' tokens.', '', ticketBgColor, ticketTxtColor, 'bold'); } else { cb.sendNotice('Ticket Show Pre-sales are active. You can now buy advance tickets to the show at a price of ' + presalePrice + ' tokens. Pre-sale tickets are limited. The pre-sale price will increase from ' + presalePrice + ' to ' + (presalePrice + presaleIncAmt) + ' tokens once ' + ticketsLeft + ' more ticket' + (ticketsLeft > 1 ? "s are" : " is") + ' sold. Buy now before the price goes up!', '', ticketBgColor, ticketTxtColor, 'bold'); } } if (!presaleSkipNotice) { cb.setTimeout(presaleNoticeTimer, cb.settings.ticketShowPresaleNoticeInterval * 60000); } else { presaleSkipNotice = false; } } } function presaleAutoTimer(addtime) { cb.sendNotice('An automatic timer was started, pre-sale ticket prices will increase from ' + presalePrice + ' to ' + (presalePrice + presaleIncAmt) + ' tokens in ' + addtime + ' minutes. Buy now before the price goes up! Ticket show price will be ' + ticketPrice + ' tokens.', '', ticketBgColor, ticketTxtColor, 'bold'); if (presaleMode != 'timer') { presaleMode = 'timer'; } presaleMinsRemain = addtime; presaleSecsRemain = 0; presaleStartTime = new Date(); presaleStopTime = new Date(presaleStartTime.getTime() + presaleMinsRemain * 60000); presaleTimerStopping = false; presaleTimerMin(); } function presaleTimerMin() { if (!presaleTimerStopping && presaleMode == 'timer') { switch (presaleMinsRemain) { case 120: case 90: case 60: case 45: case 30: case 25: case 20: case 15: 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 ' + presaleMinsRemain + ' minutes left on the timer to buy a pre-sale ticket for ' + presalePrice + ' tokens! \u23f1 \u23f1 \u23f1', '', appNoticeColor, '', 'bold'); break; case 1: cb.sendNotice('\u23f1 \u23f1 \u23f1 There is 1 minute left to buy a presale ticket for ' + presalePrice + ' tokens before the show starts! \u23f1 \u23f1 \u23f1', '', appNoticeColor, '', 'bold'); break; } presaleMinsRemain--; if (presaleMinsRemain > 0) { presaleDisplaySeconds = false; } else { presaleDisplaySeconds = true; } presaleSecsRemain = 60; presaleTimerSec(); } } function presaleTimerSec() { if (!presaleTimerStopping && presaleMode == 'timer') { if (presaleDisplaySeconds) { switch (presaleSecsRemain) { case 30: case 10: case 5: case 4: case 3: case 2: case 1: cb.sendNotice('\u23f1 \u23f1 \u23f1 There are ' + presaleSecsRemain + ' second' + (presaleSecsRemain > 1 ? "s" : "") + ' left on the timer to buy a pre-sale ticket for ' + presalePrice + ' tokens! \u23f1 \u23f1 \u23f1', "", red, "", "bold"); } } if (presaleSecsRemain < 1) { if (presaleMinsRemain >= 1) { presaleTimerMin(); } else { cb.sendNotice("\u23f0 \u23f0 \u23f0 Time is up! Pre-sale Price is changing! \u23f0 \u23f0 \u23f0", "", appNoticeColor, "", "bold"); nextPresalePrice = presalePrice + presaleIncAmt; presalePriceChange(nextPresalePrice,cb.room_slug); presalePrice = nextPresalePrice; presaleIncrements ++; if (presalePrice + presaleIncAmt > ticketPrice) { stopIncrement = true; cb.sendNotice('The automated timer has ended. Pre-sale tickets will remain at ' + presalePrice + ' tokens until start of show unless manually updated by ' + bctext + '.','', ticketBgColor, ticketTxtColor, 'bold'); cb.sendNotice('No additional timer started, next increment would have exceeded planned ticket show price of ' + ticketPrice + '.',cb.room_slug, appNoticeColor); } else if ((presaleIncrements + 1) > cb.settings.ticketShowPresaleMaxIncrements) { stopIncrement = true; cb.sendNotice('The automated timer has ended. Pre-sale tickets will remain at ' + presalePrice + ' tokens until start of show unless manually updated by ' + bctext + '.','', ticketBgColor, ticketTxtColor, 'bold'); cb.sendNotice('No additional timer started, next increment would have exceeded max increments of ' + cb.settings.ticketShowPresaleMaxIncrements + '.',cb.room_slug, appNoticeColor); } else { presaleAutoTimer(presaleTimeAmt); } } } else { presaleSecsRemain--; cb.setTimeout(presaleTimerSec, 1000); } } } function presaleAddTime(presaletimetoadd, u) { presaleStopTime = new Date(presaleStopTime.getTime() + presaletimetoadd * 60000); timetoaddabs = Math.abs(presaletimetoadd); if (presaletimetoadd > 0) { cb.sendNotice(u + ' has added ' + presaletimetoadd + ' minute' + (presaletimetoadd == 1 ? '' : 's') + ' to the presale timer.',cb.room_slug,'','', 'bold'); cb.sendNotice(presaletimetoadd + ' minute' + (presaletimetoadd == 1 ? ' has' : 's have') + ' been added to the timer. Now ' + presaleTimeLeft(),'',appNoticeColor,'', 'bold'); } else { cb.sendNotice(u + ' has removed ' + timetoaddabs + ' minute' + (timetoaddabs == 1 ? '' : 's') + ' from the presale timer.',cb.room_slug,'','', 'bold'); cb.sendNotice(timetoaddabs + ' minute' + (timetoaddabs == 1 ? ' has' : 's have') + ' been removed from the timer. Now ' + presaleTimeLeft(),'',appNoticeColor,'', 'bold'); } presaleMinsRemain = presaleMinsRemain + presaletimetoadd; if (presaleMinsRemain > 0) { presaleDisplaySeconds = false; } else { presaleDisplaySeconds = true; } return; } function presaleTimeCal() { presaleStartTime = new Date(); return presaleStopTime - presaleStartTime.getTime(); } function stopPresaleTimer(mod) { presaleStopTime = new Date(); presaleMinsRemain = 0; presaleSecsRemain = 0; presaleTimerStopping = true; if(mod != null && mod != '') { cb.sendNotice(mod + ' has stopped the ticket show pre-sales timer.',"",appNoticeColor,"", "bold"); } } function presaleTimeLeft(user) { var presaleTimeLeft = presaleTimeCal(); var presaleMS = presaleTimeLeft % 1000; var presaleSeconds = ((presaleTimeLeft - presaleMS) % 60000); var presaleMinutes = ((presaleTimeLeft - presaleSeconds - presaleMS) % 3600000); var presaleHours = (presaleTimeLeft - presaleMinutes - presaleSeconds - presaleMS); presaleSeconds = presaleSeconds / 1000; presaleMinutes = presaleMinutes / 60000; presaleHours = presaleHours / 3600000; if (presaleHours > 0) { return presaleHours + " hour" + (presaleHours > 1 ? "s" : "") + " and " + presaleMinutes + " minute" + (presaleMinutes > 1 ? "s" : "") + " remaining to vote."; } else if (presaleMinutes > 0 && presaleSeconds === 0) { return presaleMinutes + " minute" + (presaleMinutes > 1 ? "s" : "") + " remaining on the timer."; } else if (presaleMinutes > 0) { return presaleMinutes + " minute" + (presaleMinutes > 1 ? "s" : "") + " and " + presaleSeconds + " second" + (presaleSeconds > 1 ? "s" : "") + " remaining on the timer."; } else { return presaleSeconds + " second" + (presaleSeconds > 1 ? "s" : "") + " remaining on the timer."; } } function addRmvPresale(mode,user,usertype) { switch(mode) { case 'add': { cb.limitCam_addUsers([user]); addViewer(user); addTicketHolder(user); if (usertype == 'fan') { cb.sendNotice('CB Fan Club member ' + user + ' has been added to the pre-sale ticket list.', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'extfan') { cb.sendNotice(EFCname + ' member ' + user + ' has been added to the pre-sale ticket list.', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'extfan2') { cb.sendNotice(EFCname2 + ' member ' + user + ' has been added to the pre-sale ticket list.', '', ticketBgColorFan, ticketTxtColorFan, 'bold'); } else if (usertype == 'vip') { cb.sendNotice(VIPname + ' member ' + user + ' has been added to the pre-sale ticket list.', '', ticketBgColorVIP, ticketTxtColorVIP, 'bold'); } else if (usertype == 'mod') { cb.sendNotice('Moderator ' + user + ' has been added to the pre-sale ticket list.', '', ticketBgColorMod, ticketTxtColorMod, 'bold'); } else { cb.sendNotice(user + ' has been added to the pre-sale ticket list.', '', ticketBgColor, ticketTxtColor, 'bold'); } countPresaleSold ++; countPresaleTickets ++; if (presaleMode == 'count' && stopIncrement === false) { checkPresaleCount(); } break; } case 'rmv': { cb.limitCam_removeUsers([user]); removeTicketHolder(user); removeViewer(user); if (countPresaleTickets > 0) { countPresaleTickets --; } break; } case 'addtip': { cb.limitCam_addUsers([user]); addViewer(user); addTicketHolder(user); cb.sendNotice('Welcome ' + user + ', you have been added to the pre-sale ticket list.', '', ticketBgColor, ticketTxtColor, 'bold'); countPresaleSold ++; countPresaleTickets ++; if (presaleMode == 'count' && stopIncrement === false) { checkPresaleCount(); } break; } } } function checkPresaleCount() { ticketsLeft = (presaleCountAmt - countPresaleSold) if (ticketsLeft > 0) { cb.sendNotice('There ' + (ticketsLeft > 1 ? "are " : "is ") + (ticketsLeft) + ' pre-sale ticket' + (ticketsLeft > 1 ? "s" : "") + ' remaining at a price of ' + presalePrice + ' tokens!',"", ticketBgColor, ticketTxtColor, 'bold'); } else { if (presalePrice + presaleIncAmt > ticketPrice) { stopIncrement = true; cb.sendNotice('Pre-sale tickets will remain at ' + presalePrice + ' tokens until start of show','', ticketBgColor, ticketTxtColor, 'bold'); cb.sendNotice('No additional price changes made, next increment would have exceeded planned ticket show price of ' + ticketPrice + '.',cb.room_slug, appNoticeColor); } else if (presaleIncrements + 1 > cb.settings.ticketShowPresaleMaxIncrements) { stopIncrement = true; cb.sendNotice('Pre-sale tickets will remain at ' + presalePrice + ' tokens until start of show','', ticketBgColor, ticketTxtColor, 'bold'); cb.sendNotice('No additional price changes made, next increment would have exceeded max increments of ' + cb.settings.ticketShowPresaleMaxIncrements + '.',cb.room_slug, appNoticeColor); } else { cb.sendNotice('All pre-sale tickets at a price of ' + presalePrice + ' tokens have been sold!','', ticketBgColor, ticketTxtColor, 'bold'); presaleIncrements ++; nextPresalePrice = presalePrice + presaleIncAmt; presalePriceChange(nextPresalePrice,cb.room_slug); countPresaleSold = 0; ticketsLeft = presaleCountAmt; } } } // *********************************** Goal Race ************************************** function setGoalRaceToggle(option, setby) { if (option == 'on') { whichApp = 'goalrace'; if (savedGoalRace) { restoreGoalRace(); } else { genericInit(); initGoalRace(); } changeRoomSubject(); initGoalRaceNoticeTimer(); cb.sendNotice(dashLine80 + '\n* ' + setby + ' has started the Goal Race feature.\n* Select which goal to vote for when you tip!\n' + dashLine80, '', goalraceBgColor, goalraceTxtColor, 'bold'); } else if (option == 'off') { saveGoalRace(); cb.sendNotice(dashLine60 + '\n* ' + setby + ' has suspended the Goal Race feature.\n' + dashLine60, '', goalraceBgColor, goalraceTxtColor, 'bold'); } } function initGoalRace() { tipOptions = true; fontSize = 11; } function saveGoalRace() { grSave_finalGoalMet = finalGoalMet; grSave_currentGroupTipAmt = currentGroupTipAmt; savedGoalRace = true; } function restoreGoalRace() { finalGoalMet = grSave_finalGoalMet; currentGroupTipAmt = grSave_currentGroupTipAmt; savedGoalRace = false; } function goalraceColors() { if (cb.settings.goalraceTextColor == 'Custom') { goalraceTxtColor = checkTextColor(cb.settings.goalraceCustomTextColor); if (goalraceTxtColor == 'default') { cb.sendNotice('Goal Race - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); goalraceTxtColor = '#FFFFFF'; } } else { goalraceTxtColor = checkTextColor(cb.settings.goalraceTextColor); } if (cb.settings.goalraceBgColor == 'Custom') { goalraceBgColor = checkBgColor(cb.settings.goalraceCustomBgColor); if (goalraceBgColor == 'default') { cb.sendNotice('Goal Race - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); goalraceBgColor = '#FFFFFF'; } } else { goalraceBgColor = checkBgColor(cb.settings.goalraceBgColor); } } function initGoalRaceNoticeTimer() { if (cb.settings.goalRaceNoticeInterval == '' || cb.settings.goalRaceNoticeInterval == null) { cb.sendNotice('Goal Race Chat Notice Interval is not set. Using default value of 3.2 minutes.', cb.room_slug, appNoticeColor); goalRaceNoticeInt = 3.2; } else { goalRaceNoticeInt = parseFloat(cb.settings.goalRaceNoticeInterval); } if (goalRaceNoticeInt < 1 && goalRaceNoticeInt != 0) { cb.sendNotice('Goal Race Chat Notice Interval is too short, must be zero to disable, or at least 1 minute. Using default value of 3.2 minutes.', cb.room_slug, appNoticeColor); goalRaceNoticeInt = 3.2; } if (goalRaceNoticeInt > 0) { goalRaceNoticeInt *= 60000; goalRaceNoticeInt = parseInt(goalRaceNoticeInt); cb.setTimeout(goalRaceNoticeTimer, goalRaceNoticeInt); } } function goalRaceNoticeTimer() { if (whichApp == 'goalrace') { goalRaceNotice(); cb.setTimeout(goalRaceNoticeTimer, goalRaceNoticeInt); } } function goalRaceNotice() { msg = 'The Goal Race is active!'; msg += '\nChoose to have your tips count toward goal 1 (' + goalraceDesc1 + ') or goal 2 (' + goalraceDesc2 + ') using the selection box in the tip window.'; msg += '\nIf you forget to select a goal while tipping, you can add your missed tips later using the /addrace1 or /addrace2 command, which correspond to the goal race options.'; msg += '\nTo toggle voting vs sending regular tip notes for yourself, you can use the commands /tipnoteon or /tipnoteoff.'; cb.sendNotice(msg, '', goalraceBgColor, goalraceTxtColor, 'bold'); } function restartRace() { currentGoalRace1Tips = 0; currentGoalRace2Tips = 0; finalGoalMet = false; cb.drawPanel(); } // *********************************** Spank-a-thon Functions ************************************** function setSpankToggle(mode, setby) { if (mode == 'on') { whichApp = 'spank'; if (savedSpankGoals) { restoreSpankGoals(); } else { genericInit(); initSpanks(); } changeRoomSubject(); cb.sendNotice(dashLine70 + '\n* ' + setby + ' has started the Spank-a-thon Feature.\n* Use the Spanks Tip Menu to tip for a type of spank (/spankmenu).\n* Spanking commences at each goal or at ' + bctext + '\'s discretion.\n' + dashLine70, '', spankBgColor, spankTextColor, 'bold'); } else if (mode == 'off') { saveSpankGoals(); cb.sendNotice(dashLine70 + '\n* ' + setby + ' has suspended the Spank-a-thon Feature.\n' + dashLine70, '', spankBgColor, spankTextColor, 'bold'); } } function initSpanks() { totalSpankGoals = spankGoalArray.desc.length; currentGoalDesc = spankGoalArray.desc[currentGoal-1]; currentGoalTotal = spankGoalArray.amt[currentGoal-1]; } function saveSpankGoals() { spSave_finalGoalMet = finalGoalMet; spSave_currentGoalTips = currentGoalTips; spSave_currentGoal = currentGoal; spSave_currentGoalDesc = currentGoalDesc; spSave_currentGoalTotal = currentGoalTotal; savedSpankGoals = true; } function restoreSpankGoals() { finalGoalMet = spSave_finalGoalMet; currentGoalTips = spSave_currentGoalTips; currentGoal = spSave_currentGoal; currentGoalDesc = spSave_currentGoalDesc; currentGoalTotal = spSave_currentGoalTotal; savedSpankGoals = false; } function spankSepChar() { if (cb.settings.spankSepChar == 'Custom') { if (cb.settings.spankSepCharCustom) { spankCharacter = cb.settings.spankSepCharCustom; } else { spankCharacter = ':spankasss'; } } else { spankCharacter = checkSepChar(cb.settings.spankSepChar) } spankCharacter += ' '; } function spankColors() { if (cb.settings.spankTextColor == 'Custom') { spankTextColor = checkTextColor(cb.settings.spankCustomTextColor); if (spankTextColor == 'default') { cb.sendNotice('Spank-a-thon - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); spankTextColor = '#FFFFFF'; } } else { spankTextColor = checkTextColor(cb.settings.spankTextColor); } if (cb.settings.spankGoalBgColor == 'Custom') { spankBgColor = checkBgColor(cb.settings.spankCustomBgColor); if (spankBgColor == 'default') { cb.sendNotice('Spank-a-thon - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); spankBgColor = '#FFFFFF'; } } else { spankBgColor = checkBgColor(cb.settings.spankBgColor); } } function spankNoticeTimer() { if (cb.settings.spankNoticeInterval == '' || cb.settings.spankNoticeInterval == null) { cb.sendNotice('Spank-a-thon - Chat Notice Interval is not set. Using default value of 1.8 minutes.', cb.room_slug, appNoticeColor); spankNoticeInt = 1.8; } else { spankNoticeInt = parseFloat(cb.settings.spankNoticeInterval); } if (spankNoticeInt < 1) { cb.sendNotice('Spank-a-thon - Chat Notice Interval is too short, must be at least 1 minute. Using default value of 2.6 minutes.', cb.room_slug, appNoticeColor); spankNoticeInt = 1.8; } spankNoticeInt *= 60000; spankNoticeInt = parseInt(spankNoticeInt); cb.setTimeout(spanksNoticeTimer, spankNoticeInt); } function spanksNoticeTimer() { if (whichApp == 'spank') { spanksNotice(); } cb.setTimeout(spanksNoticeTimer, spankNoticeInt); } function spanksNotice(sendto) { msg = 'The "Spank-a-thon" Feature is active, you can tip for the types of spanks listed below.'; msg += '\nThe tips will accumulate in the spank bank until goal is reached and then the spanking begins (or at ' + bctext + '\'s discretion).'; msg += '\n' + spankMenu(); cb.sendNotice(msg, sendto, spankBgColor, spankTextColor, 'bold'); } function updateSpankGoal(goalnum) { currentGoalDesc = progGoalArray.desc[currentGoal-1]; currentGoalTotal = progGoalArray.amt[currentGoal-1]; changeRoomSubject(); cb.drawPanel(); } function checkSpankMenu(tippedamountspank,tippedby) { for (let smindex = 0; smindex < spankPricesArray.typ.length; smindex++) { if (tippedamountspank == spankPricesArray.price[smindex]) { spankRequestsArray.name.push(tippedby); spankRequestsArray.amt.push(spankPricesArray.number[smindex]); spankRequestsArray.type.push(spankPricesArray.typ[smindex]); totalsindex = spankTotalsArray.typ.indexOf(spankPricesArray.typ[smindex]) spankTotalsArray.tipped[totalsindex] += spankPricesArray.number[smindex]; totalSpanksTipped += spankPricesArray.number[smindex]; if (spankPricesArray.number[smindex] == 1) { cb.sendNotice(tippedby + ' tipped for ' + spankPricesArray.typ[smindex] + '.', '', spankBgColor, spankTextColor, 'bold'); } else { cb.sendNotice(tippedby + ' tipped for ' + spankPricesArray.typ[smindex] + ' (bundle of ' + spankPricesArray.number[smindex] + ').', '', spankBgColor, spankTextColor, 'bold'); } } } } function spankTips() { tipsmessage = 'Spank Tips:'; if (spankRequestsArray.name.length > 0) { for (let stindex = 0; stindex < spankRequestsArray.name.length; stindex++) { if (spankRequestsArray.name[stindex]) { tipsmessage += '\n' + spankRequestsArray.name[stindex] + ' tipped for (' + spankRequestsArray.amt[stindex] + ') ' + spankRequestsArray.type[stindex]; } } } else { tipsmessage += '\nNo Spank Tips Yet'; } cb.sendNotice(tipsmessage, '', spankBgColor, spankTextColor, 'bold'); } function spanksCompleted(scindex,number) { spankTotalsArray.completed[scindex] += number; totalSpanksCompleted += number; cb.sendNotice(number + (number == 1 ? ' spank has' : ' spanks have') + ' just been completed for ' + spankTotalsArray.typ[scindex] + ' (' + spankTotalsArray.completed[scindex] + ' completed so far, ' + (spankTotalsArray.tipped[scindex] - spankTotalsArray.completed[scindex]) + ' remaining).', '', spankBgColor, spankTextColor, 'bold'); cb.drawPanel(); } function spankTotals() { totalsmessage = 'Spank Totals:'; for (let totindex = 0; totindex < spankTotalsArray.typ.length; totindex++) { if (spankTotalsArray.typ[totindex]) { totalsmessage += '\n' + spankTotalsArray.typ[totindex] + ' (' + spankTotalsArray.tipped[totindex] + ' spanks tipped for / ' + spankTotalsArray.completed[totindex] + ' completed)'; } } cb.sendNotice(totalsmessage, '', spankBgColor, spankTextColor, 'bold'); } function spankMenu() { menumessage = 'Spank Menu:'; savetype = ''; for (let m = 0; m < spankPricesArray.typ.length; m++) { if (spankPricesArray.typ[m]) { if (spankPricesArray.typ[m] != savetype) { menumessage += '\n' + spankPricesArray.typ[m] + ' '; savetype = spankPricesArray.typ[m]; } if (spankPricesArray.price[m] > 0 && spankPricesArray.number[m] > 0) { menumessage += spankCharacter + '(' + spankPricesArray.price[m] + ') for ' + spankPricesArray.number[m] + (spankPricesArray.number[m] > 1 ? ' spanks ' : ' spank '); } } } return menumessage; } // *********************************** Peep Show Functions ************************************** function setPeepShowToggle(option, sendto) { if (option == 'on') { initPeepShow(sendto); cb.sendNotice(dashLine90 + '\n* ' + bctext + ' has started selling time for the Peep Show.\n* You can buy time in the show at a rate of ' + peepshowPrice + ' tokens per minute.\n* You must tip at least ' + minimumPeepShowTip + ' tokens to buy time!!!\n* Use the command to /mytime to see how much time you have remaining. \n' + peepshowModeMessage + '\n' + dashLine90, '', peepBgColor, peepTxtColor, 'bold'); } else if (option == 'off') { if (cb.limitCam_isRunning()) { cb.limitCam_stop(); cb.sendNotice('The Peep Show hidden cam feature has ended.', sendto, appNoticeColor, '', 'bold'); hiddenTime = 0; peepshowEnded = true; showStage = ''; } if (peepshowStartMinsRemain > 0 || peepshowStartSecsRemain > 0) { stopPeepShowStartTimer(); } cb.sendNotice('You have disabled the Peep Show feature, everyone\'s remaining time is left intact.', sendto, appNoticeColor); cb.sendNotice(dashLine70 + '\n* ' + sendto + ' has ended the Peep Show Feature.\n' + dashLine70, '', peepBgColor, peepTxtColor, 'bold'); } } function initPeepShow(sendto) { if (presalesToggle == 1) { setPresalesToggle('off',sendto); } whichApp = 'peep'; peepshowColors(); minimumPeepShowTip = Math.floor(peepshowPrice/6); if (minimumPeepShowTip < 1) { minimumPeepShowTip = 1; } monitorMinsRem = peepshowLengthOfShow; monitorMins = 0; monitorSecs = 0; showStage = 'peepsales'; changeRoomSubject(); setPeepStartMode('init',sendto); peepshowEnded = false; peepshowSalesEnded = false; peepshowLoadFree(); cb.drawPanel(); } function peepshowColors() { peepNoticesTxtColor = checkTextColor('Dark Red'); peepNoticesBgColor = checkBgColor('Cream'); peepTxtColorFan = checkTextColor('Black'); peepBgColorFan = checkBgColor('Light Green'); peepTxtColorVIP = checkTextColor('Black'); peepBgColorVIP = checkBgColor('Light Purple'); peepTxtColorMod = checkTextColor('Black'); peepBgColorMod = checkBgColor('Light Red'); if (cb.settings.peepshowTextColor == 'Custom') { peepTxtColor = checkTextColor(cb.settings.peepshowCustomTextColor); if (peepTxtColor == 'default') { cb.sendNotice('Peep Show - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); peepTxtColor = '#FFFFFF'; } } else { peepTxtColor = checkTextColor(cb.settings.peepshowTextColor); } if (cb.settings.peepshowBgColor == 'Custom') { peepBgColor = checkBgColor(cb.settings.peepshowCustomBgColor); if (peepBgColor == 'default') { cb.sendNotice('Peep Show - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); peepBgColor = '#FFFFFF'; } } else { peepBgColor = checkBgColor(cb.settings.peepshowBgColor); } } function setPeepShowPrice(amount,announce) { peepshowPrice = parseInt(amount); minimumPeepShowTip = Math.floor(peepshowPrice/6); if (minimumPeepShowTip < 1) { minimumPeepShowTip = 1; } if (announce === 'yes') { cb.sendNotice( '\u21D2 . . . . Peep Show Price Updated!!!. . . . . \u21D0 \n' + '\u21D2 . . . . Price is now ' + peepshowPrice + ' tokens per min!!! . . . . . \u21D0 \n' + '\u21D2 . . . . You must tip at least ' + minimumPeepShowTip + ' tokens to buy time!!! . . . . . \u21D0' , '', peepNoticesBgColor, peepNoticesTxtColor, 'bold'); changeRoomSubject(); cb.drawPanel(); } } function setPeepShowLength(length,announce) { peepshowLengthOfShow = parseInt(length); monitorMinsRem = peepshowLengthOfShow - monitorMins; if (whichApp == 'peep' && showStage != 'peepsales') { peepShowEndTime = peepshowStartHiddenTime + (peepshowLengthOfShow * 60000); } if (announce === 'yes') { cb.sendNotice( '\u21D2 . . . . Peep Show Length Updated!!!. . . . . \u21D0 \n' + '\u21D2 . . . . Length of Show is now ' + peepshowLengthOfShow + ' minutes!!! . . . . . \u21D0' , '', peepNoticesBgColor, peepNoticesTxtColor, 'bold'); changeRoomSubject(); cb.drawPanel(); } } function peepshowLoadFree() { if (cb.settings.peepshowFreeMods == 'Yes') { for (let freeindex = 0; freeindex < modsInShow.length; freeindex++) { if (!cb.limitCam_userHasAccess(modsInShow[freeindex])) { peepshowAddRmvTime('addfree',modsInShow[freeindex],'mod'); } } } if (cb.settings.peepshowFreeFC == 'Yes') { for (let freeindex = 0; freeindex < fanClubList.length; freeindex++) { if (!cb.limitCam_userHasAccess(fanClubList[freeindex])) { peepshowAddRmvTime('addfree',fanClubList[freeindex],'fan'); } } } if (cb.settings.peepshowFreeEFC == 'Yes') { for (let freeindex = 0; freeindex < extFansInShow.length; freeindex++) { if (!cb.limitCam_userHasAccess(extFansInShow[freeindex])) { peepshowAddRmvTime('addfree',extFansInShow[freeindex],'extfan'); } } } if (cb.settings.peepshowFreeEFC2 == 'Yes') { for (let freeindex = 0; freeindex < extFansInShow2.length; freeindex++) { if (!cb.limitCam_userHasAccess(extFansInShow2[freeindex])) { peepshowAddRmvTime('addfree',extFansInShow2[freeindex],'extfan2'); } } } if (cb.settings.peepshowFreeVIP == 'Yes') { for (let freeindex = 0; freeindex < VIPsInShow.length; freeindex++) { if (!cb.limitCam_userHasAccess(VIPsInShow[freeindex])) { peepshowAddRmvTime('addfree',VIPsInShow[freeindex],'vip'); } } } } function checkFreePeepShow(user,checkfreepeepmod,checkfreepeepfan,checkfreepeepextfan,checkfreepeepextfan2,checkfreepeepvip) { if (checkfreepeepmod) { if (cb.settings.peepshowFreeMods == 'Yes') { peepshowAddRmvTime('addfree',user,'mod',0); cb.sendNotice(dashLine80 + '\n* You\'ve been added to the Peep Show because you\'re a moderator! \n' + dashLine80, user, peepBgColor, peepTxtColor, 'bold'); } cb.sendNotice(dashLine80 + '\n* Moderators: The Peep Show feature is enabled. \nType "/uahelp peepshow" to see details on available commands for this feature. \n' + dashLine80, user, peepBgColor, peepTxtColor, 'bold'); } else if (checkfreepeepfan) { if (cb.settings.peepshowFreeFC == 'Yes') { peepshowAddRmvTime('addfree',user,'fan',0); cb.sendNotice(dashLine80 + '\n* You\'ve automatically been added to the Peep Show because you\'re in the CB Fan Club! \n' + dashLine80, user, peepBgColor, peepTxtColor, 'bold'); } } else if (checkfreepeepextfan) { if (cb.settings.peepshowFreeEFC == 'Yes') { peepshowAddRmvTime('addfree',user,'extfan',0); cb.sendNotice(dashLine80 + '\n* You\'ve automatically been added to the Peep Show because you\'re in the ' + EFCname + '! \n' + dashLine80, user, peepBgColor, peepTxtColor, 'bold'); } } else if (checkfreepeepextfan2) { if (cb.settings.peepshowFreeEFC2 == 'Yes') { peepshowAddRmvTime('addfree',user,'extfan2',0); cb.sendNotice(dashLine80 + '\n* You\'ve automatically been added to the Peep Show because you\'re in the ' + EFCname2 + '! \n' + dashLine80, user, peepBgColor, peepTxtColor, 'bold'); } } else if (checkfreepeepvip) { if (cb.settings.peepshowFreeVIP == 'Yes') { peepshowAddRmvTime('addfree',user,'vip',0); cb.sendNotice(dashLine80 + '\n* You\'ve automatically been added to the Peep Show because you\'re in the ' + VIPname + '! \n' + dashLine80, user, peepBgColor, peepTxtColor, 'bold'); } } } function setPeepStartMode(startmode,sendto) { if (cb.settings.peepshowStartAuto == 'Manual Start from Command') { peepshowModeAuto = 'bc'; peepshowStartMode = 'manual'; } else { peepshowModeAuto = 'auto'; } if (peepshowModeAuto == 'auto') { if (cb.settings.peepshowStartTimer >= 1) { peepshowStartMode = 'timer'; peepshowTimeAmt = cb.settings.peepshowStartTimer; if (peepshowModeAuto == 'auto') { peepshowStartAutoTimer(peepshowTimeAmt); } } else { peepshowStartMode = 'manual'; cb.sendNotice('Peep Show start is set to manual mode. Mode was requested for automatic timer, but the timer was not set on the start page. You can start the show manually at the end of a timer or at a time of your choosing.', sendto, appNoticeColor); } } if (peepshowStartMode == 'manual') { peepshowModeMessage = '* Peep Show start mode is set to "Manual"\n* The show will be started by ' + bctext + ' or a moderator.'; } else if (peepshowStartMode == 'timer') { if (peepshowModeAuto == 'auto') { peepshowModeMessage = '* Peep Show start mode is set to "Automatic timer" with a duration of ' + peepshowTimeAmt + ' minutes.\n* The Peep Show will start automatically when the timer runs out.'; } else if (peepshowModeAuto == 'bc') { peepshowModeMessage = '* Peep Show start mode is set to "Broadcaster managed timer". \n* ' + bctext + ' will set a timer and start the show when the timer runs out.'; } } } function startPeepShowStartTimer(numtimer) { peepshowStartMinsRemain = numtimer; peepshowStartMode = 'timer'; peepshowStartAutoTimer(peepshowStartMinsRemain); cb.drawPanel(); } function peepshowStartAutoTimer(addtime) { if (peepshowModeAuto == 'auto') { cb.sendNotice('An automatic timer was started, Peep Show price will be ' + peepshowPrice + ' tokens/min.', '', peepBgColor, peepTxtColor, 'bold'); } else if (peepshowModeAuto == 'bc') { cb.sendNotice('A timer was started to provide an countdown to approximate showtime. \n ' + bctext + ' will start the show after the timer runs out.', '', peepBgColor, peepTxtColor, 'bold'); } peepshowStartMinsRemain = addtime; peepshowStartSecsRemain = 0; peepshowStartStartTime = new Date(); peepshowStartStopTime = new Date(peepshowStartStartTime.getTime() + peepshowStartMinsRemain * 60000); peepshowTimerStopping = false; peepshowStartTimerMin(); } function peepshowStartTimerMin() { if (!peepshowTimerStopping && peepshowStartMode == 'timer' && whichApp == 'peep') { switch (peepshowStartMinsRemain) { case 120: case 90: case 60: case 45: case 30: case 25: case 20: case 15: 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 ' + peepshowStartMinsRemain + ' minutes left until the Peep Show starts! \u23f1 \u23f1 \u23f1', '', appNoticeColor, '', 'bold'); break; case 1: cb.sendNotice('\u23f1 \u23f1 \u23f1 There is 1 minute left until the Peep Show starts! \u23f1 \u23f1 \u23f1', '', appNoticeColor, '', 'bold'); break; } cb.drawPanel(); peepshowStartMinsRemain--; if (peepshowStartMinsRemain > 0) { peepDisplaySeconds = false; } else { peepDisplaySeconds = true; } peepshowStartSecsRemain = 60; peepshowStartTimerSec(); } } function peepshowStartTimerSec() { if (!peepshowTimerStopping && peepshowStartMode == 'timer' && whichApp == 'peep') { if (peepDisplaySeconds) { switch (peepshowStartSecsRemain) { case 30: case 10: case 5: case 4: case 3: case 2: cb.sendNotice('\u23f1 \u23f1 \u23f1 There are ' + peepshowStartSecsRemain + ' seconds left! \u23f1 \u23f1 \u23f1', '', red, '', 'bold'); break; case 1: cb.sendNotice('\u23f1 \u23f1 \u23f1 There is 1 second left! \u23f1 \u23f1 \u23f1', '', red, '', 'bold'); break; } cb.drawPanel(); } if (peepshowStartSecsRemain < 1) { if (peepshowStartMinsRemain >= 1) { peepshowStartTimerMin(); } else { if (peepshowStartMode = 'timer' && peepshowModeAuto === 'auto') { cb.sendNotice('\u23f0 \u23f0 \u23f0 Time is up! Peep Show is starting! \u23f0 \u23f0 \u23f0', '', peepNoticesBgColor, peepNoticesTxtColor, 'bold'); startPeepShow(bctext); } else { cb.sendNotice('\u23f0 \u23f0 \u23f0 Time is up! ' + bctext + ' will be starting the Peep Show! \u23f0 \u23f0 \u23f0', '', peepNoticesBgColor, peepNoticesTxtColor, 'bold'); } } } else { peepshowStartSecsRemain--; cb.setTimeout(peepshowStartTimerSec, 1000); } } } function peepshowStartAddTime(peeptimetoadd, u) { peepshowStartStopTime = new Date(peepshowStartStopTime.getTime() + peeptimetoadd * 60000); cb.sendNotice(u + ' has added ' + peeptimetoadd + ' minute' + (peeptimetoadd === 1 || peeptimetoadd === -1 ? '' : 's') + ' to the Peep Show start timer.',cb.room_slug,'','', 'bold'); cb.sendNotice(peeptimetoadd + ' minute' + (peeptimetoadd === 1 || peeptimetoadd === -1 ? '' : 's') + ' have been added to the Peep Show start timer. Now ' + peepshowStartTimeLeft(),'',appNoticeColor,'', 'bold'); peepshowStartMinsRemain = peepshowStartMinsRemain + peeptimetoadd; if (peepshowStartMinsRemain > 0) { peepDisplaySeconds = false; } else { peepDisplaySeconds = true; } cb.drawPanel(); return; } function peepshowStartTimeCal() { peepshowStartStartTime = new Date(); return peepshowStartStopTime - peepshowStartStartTime.getTime(); } function stopPeepShowStartTimer(mod) { peepshowStartStopTime = new Date(); peepshowTimerStopping = true; peepshowStartMinsRemain = 0; peepshowStartSecsRemain = 0; if(mod != null && mod != '') { cb.sendNotice(mod + ' has stopped the Peep Show start timer.','',appNoticeColor,'', 'bold'); } cb.drawPanel(); } function peepshowStartTimeLeft(user) { var peepshowStartTimeLeft = peepshowStartTimeCal(); var peepMS = peepshowStartTimeLeft % 1000; var peepSeconds = ((peepshowStartTimeLeft - peepMS) % 60000); var peepMinutes = ((peepshowStartTimeLeft - peepSeconds - peepMS) % 3600000); var peepHours = (peepshowStartTimeLeft - peepMinutes - peepSeconds - peepMS); peepSeconds = peepSeconds / 1000; peepMinutes = peepMinutes / 60000; peepHours = peepHours / 3600000; if (peepHours > 0) { return peepHours + ' hour' + (peepHours > 1 ? 's' : '') + ' and ' + peepMinutes + ' minute' + (peepMinutes > 1 ? 's' : '') + ' remaining on the Peep Show start timer.'; } else if (peepMinutes > 0 && peepSeconds === 0) { return peepMinutes + ' minute' + (peepMinutes > 1 ? 's' : '') + ' remaining on the Peep Show start timer.'; } else if (peepMinutes > 0) { return peepMinutes + ' minute' + (peepMinutes > 1 ? 's' : '') + ' and ' + peepSeconds + ' second' + (peepSeconds > 1 ? 's' : '') + ' remaining on the Peep Show start timer.'; } else { return peepSeconds + ' second' + (peepSeconds > 1 ? 's' : '') + ' remaining on the Peep Show start timer.'; } } function peepshowStartTimeLeftPanel() { var peepshowStartTimeLeft = peepshowStartTimeCal(); var peepMS = peepshowStartTimeLeft % 1000; var peepSeconds = ((peepshowStartTimeLeft - peepMS) % 60000); var peepMinutes = ((peepshowStartTimeLeft - peepSeconds - peepMS) % 3600000); var peepHours = (peepshowStartTimeLeft - peepMinutes - peepSeconds - peepMS); peepSeconds = peepSeconds / 1000; peepMinutes = peepMinutes / 60000; if (peepMinutes > 0) { return 'Less than ' + (peepMinutes+1) + ' min rem'; } else { return 'Less than ' + (peepSeconds) + ' sec rem';; } } function peepshowAddRmvTime(mode,user,usertype,tipamt) { switch(mode) { case 'addtip': { peepTimeToAdd = peepshowCheckTimeAdd(tipamt); totaltime = peepshowAddTime(user,peepTimeToAdd); if (cb.limitCam_isRunning()) { cb.sendNotice('Thank you ' + user + ', you have purchased ' + timeMinSecLiteral(peepTimeToAdd) + ' of time in the show.', user, peepBgColor, peepTxtColor, 'bold'); if (!cb.limitCam_userHasAccess(user)) { cb.limitCam_addUsers([user]); if (!cbjs.arrayContains(peepshowViewers,user)) { peepshowViewers.push(user); } } else { cb.sendNotice('You now have ' + timeMinSecLiteral(totaltime) + ' remaining.', user, peepBgColor, peepTxtColor, 'bold'); } } else { if (totaltime > peepTimeToAdd) { cb.sendNotice('Thank you ' + user + ', you have purchased ' + timeMinSecLiteral(peepTimeToAdd) + ' of time in the show. You now have ' + timeMinSecLiteral(totaltime) + ' that will be applied to the show when it starts.', user, peepBgColor, peepTxtColor, 'bold'); } else { cb.sendNotice('Thank you ' + user + ', you have purchased ' + timeMinSecLiteral(peepTimeToAdd) + ' of time in the show, which will be applied when the show starts.', user, peepBgColor, peepTxtColor, 'bold'); } } cb.drawPanel(); break; } case 'addfree': { if (cbjs.arrayContains(peepshowPurchasers,user)) { afindex = peepshowPurchasers.indexOf(user); peepshowPurchasers.splice(afindex,1); peepshowPurchasedTime.splice(afindex,1); } cb.limitCam_addUsers([user]); if (!cbjs.arrayContains(peepshowFreeViewers,user)) { peepshowFreeViewers.push(user); } if (!cbjs.arrayContains(peepshowViewers,user)) { peepshowViewers.push(user); } if (usertype == 'fan') { cb.sendNotice('CB Fan Club member ' + user + ' has been added to the Peep Show viewer list.', '', peepBgColorFan, peepTxtColorFan, 'bold'); } else if (usertype == 'extfan') { cb.sendNotice(EFCname + ' member ' + user + ' has been added to the Peep Show viewer list.', '', peepBgColorFan, peepTxtColorFan, 'bold'); } else if (usertype == 'extfan2') { cb.sendNotice(EFCname2 + ' member ' + user + ' has been added to the Peep Show viewer list.', '', peepBgColorFan, peepTxtColorFan, 'bold'); } else if (usertype == 'vip') { cb.sendNotice(VIPname + ' member ' + user + ' has been added to the Peep Show viewer list.', '', peepBgColorVIP, peepTxtColorVIP, 'bold'); } else if (usertype == 'mod') { cb.sendNotice('Moderator ' + user + ' has been added to the Peep Show viewer list.', '', peepBgColorMod, peepTxtColorMod, 'bold'); } else { cb.sendNotice(user + ' has been added to the Peep Show viewer list.', '', peepBgColor, peepTxtColor, 'bold'); } cb.drawPanel(); break; } case 'remove': { cb.limitCam_removeUsers([user]); cbjs.arrayRemove(peepshowViewers,user); cbjs.arrayRemove(peepshowFreeViewers,user); if (cbjs.arrayContains(peepshowPurchasers,user)) { rmvppindex = peepshowPurchasers.indexOf(user); peepshowPurchasers.splice(rmvppindex,1); peepshowPurchasedTime.splice(rmvppindex,1); } cb.sendNotice(user + ' has been removed from the Peep Show.', '', peepBgColor, peepTxtColor, 'bold'); cb.drawPanel(); break; } case 'expire': { cb.limitCam_removeUsers([user]); cbjs.arrayRemove(peepshowViewers,user); cb.sendNotice('Sorry ' + user + ', your time has expired, you can tip to continue watching the Peep Show.', user, peepBgColor, peepTxtColor, 'bold'); cb.drawPanel(); break; } } } function timeMinSecLiteral(totaltimesec) { minutes = Math.floor(totaltimesec / 60); seconds = Math.floor(totaltimesec - (minutes * 60)); literal = ''; if (minutes > 0) { literal = minutes + (minutes > 1 ? ' minutes' : ' minute'); if (seconds > 0) { literal += ' and ' + seconds + (seconds > 1 ? ' seconds' : ' second'); } } else if (seconds > 0) { literal = seconds + (seconds > 1 ? ' seconds' : ' second'); } else { literal = 'no time' } return literal; } function peepshowMyTimeLeft(user) { if (cbjs.arrayContains(peepshowPurchasers,user)) { mtindex = peepshowPurchasers.indexOf(user); purchasedTimeRemaining = peepshowPurchasedTime[mtindex]; if (purchasedTimeRemaining > 0) { return timeMinSecLiteral(purchasedTimeRemaining); } else { return 'expired'; } } else { return 'none'; } } function peepshowCheckTimeAdd(tippedamountpeep) { if (tippedamountpeep >= minimumPeepShowTip) { return Math.floor((tippedamountpeep / peepshowPrice) * 60); } else { return 0; } } function peepshowAddTime(user,time) { if (cbjs.arrayContains(peepshowPurchasers,user)) { psatindex = peepshowPurchasers.indexOf(user); peepshowPurchasedTime[psatindex] += time; } else { peepshowPurchasers.push(user); psatindex = peepshowPurchasers.indexOf(user); peepshowPurchasedTime[psatindex] = time; } return peepshowPurchasedTime[psatindex]; } function peepshowAddPrepurchases() { for (var preindex = 0; preindex < peepshowPurchasers.length; preindex++) { if (peepshowPurchasedTime[preindex] > 0) { cb.limitCam_addUsers([peepshowPurchasers[preindex]]); if (!cbjs.arrayContains(peepshowViewers,peepshowPurchasers[preindex])) { peepshowViewers.push(peepshowPurchasers[preindex]); } if (peepshowPurchasedTime[preindex] < 10 ) { peepshowPurchasedTime[preindex] = 0; } else { peepshowPurchasedTime[preindex] -= 10; } } } } function peepshowMonitorTimer() { cb.setTimeout(peepShowMonitor, 10000); } function peepShowMonitor() { monitorSecs += 10; if (whichApp == 'peep' && (showStage == 'peepshow' || showStage == 'peepwarn' || showStage == 'peepfinale')) { peepshowCheckViewers(); monitorCalls++; if (monitorCalls >= 6) { monitorMins++; monitorMinsRem = peepshowLengthOfShow - monitorMins; monitorCalls = 0; monitorSecs = 0; monitormessage = 'The Peep Show has been active for ' + monitorMins + ' minute' + (monitorMins > 1 ? 's.' : '.'); var peepshowlist = cb.limitCam_allUsersWithAccess().slice(); numberPeepViewers = peepshowlist.length; if (monitorMinsRem > 1) { monitormessage += '\nThere are approximately ' + monitorMinsRem + ' minutes remaining in the show.'; } else if (monitorMins > peepshowLengthOfShow) { monitormessage += '\nThe show has gone beyond the planned length of ' + peepshowLengthOfShow + ' minute' + (peepshowLengthOfShow > 1 ? 's.' : '.'); } if ((showStage == 'peepshow' || showStage == 'peepwarn') && (monitorMinsRem != 0 || peepshowAutoEnd != 'Yes')) { monitormessage += '\nYou can buy time in the show for ' + peepshowPrice + ' tokens/min.\nThe minimum tip amount to buy time is ' + minimumPeepShowTip + ' token' + (minimumPeepShowTip > 1 ? 's.' : '.'); } if (numberPeepViewers > 0) { monitormessage += '\nThere ' + (numberPeepViewers > 1 ? 'are ' : 'is ') + numberPeepViewers + ' viewer' + (numberPeepViewers > 1 ? 's' : '') + ' currently in the Peep Show!'; } cb.sendNotice(monitormessage, '', peepBgColor, peepNoticesTxtColor, 'bold'); } if (monitorMinsRem > 0 && monitorMinsRem <= 1) { cb.sendNotice('The Peep Show is planned to end in approximately ' + (60 - monitorSecs) + ' seconds.', '', peepBgColor, peepNoticesTxtColor,'bold'); } else if (monitorMinsRem == 0) { if (peepshowAutoEnd == 'Yes') { cb.sendNotice('The Peep Show planned time is completed, the show is ending!', '', peepBgColor, peepNoticesTxtColor,'bold'); stopPeepShow(cb.room_slug); } else { if (monitorCalls == 0) { cb.sendNotice('The Peep Show planned time is completed, ' + bctext + ' will end the show when finished.', '', peepBgColor, peepNoticesTxtColor,'bold'); } } } peepshowMonitorTimer(); } cb.drawPanel(); } function peepshowCheckViewers() { for (var chkv = 0; chkv < peepshowPurchasers.length; chkv++) { user = peepshowPurchasers[chkv]; if (peepshowPurchasedTime[chkv] > 0) { if (peepshowPurchasedTime[chkv] > 20 && peepshowPurchasedTime[chkv] <= 30) { if (showStage == 'peepshow' || showStage == 'peepwarn') { cb.sendNotice(user + ': Warning! You have approximately 30 seconds left in your show purchase. \nYou can tip to add more time at the rate of ' + peepshowPrice + ' tokens/min.', user, peepBgColor, peepTxtColor, 'bold'); } else { cb.sendNotice(user + ': Warning! You have approximately 30 seconds left in your show purchase, and ' + bctext + ' has ended sales of additional time.', user, peepBgColor, peepTxtColor, 'bold'); } } if (peepshowPurchasedTime[chkv] < 10 ) { peepshowPurchasedTime[chkv] = 0 } else { peepshowPurchasedTime[chkv] -= 10; } } else { if (cb.limitCam_userHasAccess(user)) { peepshowAddRmvTime('expire',user,'',0); } } } } function startPeepShow(startedby) { cb.sendNotice(dashLine80 + '\n :siren1 :siren1 :siren1 ' + startedby + ' has started the Peep Show! :siren1 :siren1 :siren1 \n' + dashLine80, '', peepBgColor, peepNoticesTxtColor, 'bold'); cb.limitCam_start('Ultra App Peep Show\n\nHidden Cam show in progress \nCheck room notices for instructions'); showStage = 'peepshow'; peepshowAddPrepurchases(); monitorCalls = 0; monitorMins = 0; peepshowMonitorTimer(); changeRoomSubject(); if (peepshowStartMinsRemain > 0 || peepshowStartSecsRemain > 0) { stopPeepShowStartTimer(); } peepshowStartHiddenTime = Date.now(); peepShowEndTime = peepshowStartHiddenTime + (peepshowLengthOfShow * 60000); cb.drawPanel(); } function restartPeepShow(startedby) { cb.sendNotice(dashLine80 + '\n :siren1 \u25C8 \u25C8 \u25C8 ' + startedby + ' has restarted the Peep Show! \u25C8 \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 \u25C8 All current Peep Show time purchases are intact. \u25C8 \u25C8 \u25C8 \n' + dashLine80,'',peepBgColor, peepNoticesTxtColor, 'bold'); cb.limitCam_start('Ultra App Peep Show\n\nHidden Cam show in progress \nCheck room notices for instructions'); if (showStage == 'peepaftershow') { peepshowSubjectText = savedpeepshowSubjectText; } showStage = 'peepshow'; changeRoomSubject(); peepshowMonitorTimer(); peepshowEnded = false; peepshowSalesEnded = false; if (peepshowStartMinsRemain > 0 || peepshowStartSecsRemain > 0) { stopPeepShowStartTimer(); } peepshowStartHiddenTime = Date.now(); cb.drawPanel(); } function peepShowEnding(pswarnby) { showStage = 'peepwarn'; cb.sendNotice(dashLine90 + '\n :siren1 \u25C8 \u25C8 \u25C8 ' + pswarnby + ' has indicated the show is nearly finished. \u25C8 \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 It is not recommended to buy additional time, but sales are still open. \u25C8 \u25C8 \n' + dashLine90,'',peepBgColor,peepNoticesTxtColor,'bold'); changeRoomSubject(); cb.drawPanel(); } function stopPeepShowSales(pssalesstoppedby) { cb.sendNotice(dashLine80 + '\n :siren1 :siren1 :siren1 \u25B7 \u25B7 ' + pssalesstoppedby + ' has ended sales for the Peep Show. \u25C1 \u25C1 :siren1 :siren1 :siren1 \n' + dashLine80,'',peepBgColor,peepNoticesTxtColor,'bold'); showStage = 'peepfinale'; changeRoomSubject(); peepshowSalesEnded = true; cb.drawPanel(); peepNoticeInt = 90000; setPeepNoticeTimeout(); } function stopPeepShow(psstoppedby) { cb.sendNotice(dashLine80 + '\n :siren1 \u25C8 \u25C8 \u25C8 ' + psstoppedby + ' has ended the Peep Show \u25C8 \u25C8 \u25C8 :siren1 \n \u25C8 \u25C8 \u25C8 \u25C8 Show length ' + ((Date.now() - peepshowStartHiddenTime)/60000).toFixed(1) + ' minutes. \u25C8 \u25C8 \u25C8 \u25C8 \n' + dashLine80,'',peepBgColor,peepNoticesTxtColor,'bold'); cb.limitCam_stop(); cb.sendNotice(dashLine80 + '\n :siren1 :siren1 :siren1 The broadcast is returning to Public Chat. :siren1 :siren1 :siren1 \n' + dashLine80, '',peepBgColor,peepNoticesTxtColor,'bold'); peepshowStartHiddenTime = 0; peepshowEnded = true; peepshowSalesEnded = true; showStage = 'peepaftershow'; savedpeepshowSubjectText = peepshowSubjectText; peepshowSubjectText = cb.settings.peepshowAfterNotice; changeRoomSubject(); cb.drawPanel(); } function setPeepNoticeTimeout() { cb.setTimeout(peepNoticeTimer, peepNoticeInt); } function peepNoticeTimer() { if (showStage == 'peepfinale') { cb.sendNotice(' :siren1 Peep Show Sales Ended! Do not tip to join the show! :siren1 ','',peepBgColor,peepNoticesTxtColor,'bold'); setPeepNoticeTimeout(); } } // *********************************** Auto-Reset Goal Functions ************************************** function setAutoresetToggle(mode, setby) { if (mode == 'on') { whichApp = 'autoreset'; if (savedAutoresetGoals) { restoreAutoresetGoals(); } else { genericInit(); initAutoresetGoal(); } changeRoomSubject(); cb.sendNotice(dashLine70 + '\n* ' + setby + ' has started the Auto-Reset Goal Feature.\n* The same goal will continually repeat every ' + autoresetGoalAmount + ' tokens.\n' + dashLine70, '', autoresetBgColor, autoresetTextColor, 'bold'); } else if (mode == 'off') { saveAutoresetGoals(); cb.sendNotice(dashLine70 + '\n* ' + setby + ' has suspended the Auto-Reset Goal Goal Feature.\n' + dashLine70, '', autoresetBgColor, autoresetTextColor, 'bold'); } } function initAutoresetGoal() { currentGoalDesc = autoresetEachGoal; currentGoalTotal = autoresetGoalAmount; } function saveAutoresetGoals() { arSave_finalGoalMet = finalGoalMet; arSave_currentGoalTips = currentGoalTips; arSave_currentGoal = currentGoal; arSave_currentGoalDesc = currentGoalDesc; arSave_currentGoalTotal = currentGoalTotal; savedAutoresetGoals = true; } function restoreAutoresetGoals() { finalGoalMet = arSave_finalGoalMet; currentGoalTips = arSave_currentGoalTips; currentGoal = arSave_currentGoal; currentGoalDesc = arSave_currentGoalDesc; currentGoalTotal = arSave_currentGoalTotal; savedAutoresetGoals = false; } function autoresetGoalColors() { if (cb.settings.autoresetTextColor == 'Custom') { autoresetTextColor = checkTextColor(cb.settings.autoresetCustomTextColor); if (autoresetTextColor == 'default') { cb.sendNotice('Auto-Reset Goals - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); autoresetTextColor = '#FFFFFF'; } } else { autoresetTextColor = checkTextColor(cb.settings.autoresetTextColor); } if (cb.settings.autoresetBgColor == 'Custom') { autoresetBgColor = checkBgColor(cb.settings.autoresetCustomBgColor); if (autoresetBgColor == 'default') { cb.sendNotice('Auto-Reset Goals - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, appNoticeColor, '', 'bold'); autoresetBgColor = '#FFFFFF'; } } else { autoresetBgColor = checkBgColor(cb.settings.autoresetBgColor); } } function updateAutoresetGoal() { currentGoalDesc = autoresetEachGoal; currentGoalTotal = autoresetGoalAmount; changeRoomSubject(); cb.drawPanel(); } // *********************************** Help Function ************************************** function helpCommon(option,from) { if(option == null){option = '';} cb.sendNotice('Dorothy\'s UltraApp Help Menu', from, appNoticeColor); cb.sendNotice('',from,appNoticeColor); cb.sendNotice( '\== General ==' + '\n/ninjatipon, /ninjatipoff: These commands let you toggle whether your tips are counting toward the goals. They are not valid when using the ticket or peep shows. You can also type the text --NOGOAL-- in your tip note instead of using the commands.' + '\== Goal Race ==' + '\n/tipnoteon, /tipnoteoff: This command lets you toggle whether you are sending tip notes to ' + bctext + ' or casting votes for the goal.' + '\n== Spank-a-thon ==' + '\n/spanktotals: Display the current totals for spanks tipped for and administered per spank type.' + '\n/spankmenu: Display the spank menu on demand, note it also shows in the chat notice periodically.' + '\n/spanktips: Display the history of the spank tips.' + '\n== Ticket Show Presales ==' + '\n/presalelist: Display the list of users on the pre-sale list.' + '\n== Ticket Show ==' + '\n/tickets : Display the list of users that have bought or been given a ticket. If the parameter of "alpha" is added, the list is displayed alphabetically. Note that viewers can be added back to the show using the "/add" command and pasting the list that is shown from the "/tickets" command. ' + '\n/previewers : Display the list of users that are currently viewing a free preview. If the parameter of "alpha" is added, the list is displayed alphabetically. ' + '\n/otlist : Display the list of outstanding ticket holders, can be used by anyone if the Outstanding Ticket feature is enabled.' + '\n/saveticket: If ' + bctext + ' has enabled Outstanding Tickets (and is tracking them) - If you have bought a ticket and will not be able to stay for the show, you can save it for a future show. You will no longer be able to see the current show. IMPORTANT: If in the same session, the ticket will be available automatically. However for future shows or if ' + bctext + ' restarts the bot, they must add the saved tickets to the outstanding ticket list to be able to use them with /useticket. ' + '\n/useticket: If ' + bctext + ' has enabled Outstanding Tickets (and is tracking them) - Redeem an outstanding ticket and use it for access to this show. You can use the command "/otlist" to view the list of outstanding ticket holders if ' + bctext + ' has enabled this feature.' + '\n/tickettimeleft: Display the time left on the ticket show countdown for either automatic or manual starting mode.' + '\n/showtime: Display a message showing how long the current show has been hidden.' + '\n/giftticket username: If the "gifting" feature is enabled, when you tip enough to buy extra tickets, you can gift those tickets to other users using this command. Each time you gift, it removes one of your "extra" tickets. You can only gift extra tickets with this command, to give away your own ticket, you can use /givemyticketto as noted below. Be sure to type the user name correctly for the person you are gifting to, extra tickets cannot be recovered once they are gifted. This can be done before and during the show.' + '\n== Peep Show ==' + '\n/mytime: Display the amount of time you have purchased so far, and time remaining.' + '\n/peepviewers : Display the list of users that have bought a ticket. If the parameter of "alpha" is added, the list is displayed alphabetically. Note that viewers can be added back to the show using the "/add" command and pasting the list that is shown from the "/tickets" command. ' + '\n/peeptimeleft : Display the time left in the Peep Show based on the planned show length (estimate).' ,from); cb.sendNotice('',from,appNoticeColor); } function helpModBC(option,from) { var valid = 0; if(option == null){option = '';} switch(option) { case '': { valid = 1; cb.sendNotice('Dorothys Ultra App Help Menu for Broadcasters and Moderators' + '\nType /uahelp [menu], where [menu] is one of the following choices, for more detailed information.\nEx: "/uahelp goals" to see the submenu for the Progressive Goal Show related commands.' + '\n"all" : (/chgapp, /stats, /addtips, /listgoals (/lg), /listremgoals (/lrg),/setgentext, /gentextposn, /ninjatipon, /ninjatipoff)' + '\n"goals" : (/restartgoal, /setgoal1, /setgoal2, /setgoal3...(thru /setgoal20), /rmvgoal, /setgoaltext, /next, /skip, /resetapp)' + '\n"autoreset" : (/setautogoal, /setautofinal, /setautotext, /resetapp, /skip)' + '\n"goalcount" : (/setcount1, /setcount2, /setcount3...(thru /setcount10), /rmvcount, /setcounttext, /chgcountgoal, /skip, /skiplevel, /resetapp)' + '\n"sequence" : (/setseq1, /setseq2, /setseq3...(thru /setseq10), /rmvseq, /setsequencetext, /usechatmsg, /usegrouptips, /skip, /skiplevel, /chgendseq )' + '\n"tipjar" : (/setjar1, /setjar2, /setjar3...(thru /setjar10), /rmvjar, /setjartext, /faster, slower, /skip, /pause, /resume)' + '\n"goalrace" : (/setrace1, /setrace2, /restartrace, /addrace1, /addrace2, /tipnoteon, tipnoteoff, /setracetext, /setracepaneltext, /resetapp)' + '\n"ticketshow" : (see full command list in submenu "ticketshow")' + '\n"presales" : (see full command list in submenu "presales")' + '\n"spankathon" : (/setspankgoal1, /setspankgoal2,...(thru /setspankgoal5), /rmvspankgoal, /setspanktext, /skip, /spanked, /spankmenu, /spanktips, /spanktotals, /spankall, /resetapp)' + '\n"peepshow" : (see full command list in submenu "peepshow")' ,from); break; } case 'all': { valid = 1; cb.sendNotice('Ultra App General Commands - these are used across all app features. The primary command noted below is the /chgapp command, which lets you switch between each of the 5 apps that are built into the UltraApp so far. You can switch at any time, but you if you change in the middle of a goal, you cancel any open goals in that app when you do. Total tipping and time online stats are also kept and can be accessed anytime. ' + '\n/chgapp [newapp] : switch from one app to another, or turn off the current app. The values used for [newapp] are "goals", "goalcount", "sequence", "tipjar", and "ticket" to go along with the 5 types of shows, or the value of "none" to turn off the current app feature and not start a new one immediately.' + '\n/stats : Display a listing of your time online (with the app running), total tips, and tips broken down by app.' + '\n/addtips [tokens] : Within the goal apps (Progressive Goal, Goal Count, and Tip Jar), this can be used to simulate users having tipped and advance the token count within a goal. Indicate the number of tokens you are adding as the [tokens] parameter, and note the value can be negative. You can add more than the current goal, but you cannot subtract less than has been tipped in the current goal.' + '\n/listgoals (also /lg) : List the current setup of all goals for the App feature that is active. You can add the "all" parameter to display to the entire chat ("/lg all" for example).' + '\n/listremgoals (also /lrg) : List the current setup of the remaining goals for the App feature that is active. You can add the "all" parameter to display to the entire chat ("/lrg all" for example).' + '\n/chgpanelbg [imagename]: Change the background of the drawpanel to one of the valid images. Images are updated regularly, so you can see the current list by entering this command with no parameter and the error message will show the current valid choices. Note that you can also see the images by going to the "Source Code" tab for the app and clicking the link for "App Images".' + '\n/chgpaneltext [newcolor]: Change the color of the text in the drawpanel to either a hex code (#0000ff) or the exact text of one of the color choices from the menu ("Dark Green", "Dark Red", etc). You can lookup hex codes for any color on a site such as Color-hexa: https://www.colorhexa.com/' + '\n/paneltext1 [newtext] (also /paneltext2, /paneltext3): When there is no App running, change the text displayed in the draw panel, separate commands for lines 1-3, max of 50 characters each. If an app is running but completed, can change to no app running with "/chgapp none".' + '\n/setgentext [newtext]: Update the general text that is shown across all app features.' + '\n/gentextposn [0 or 1]: Update the default setting for whether the General Text shown across all App features is shown at the beginning or the end of the room title.' + '\n/ninjatipon, /ninjatipoff: These commands let any viewer toggle whether their tips are counting toward the goals. The commands are not valid when using the ticket or peep shows.' ,from); break; } case 'goals': { valid = 1; cb.sendNotice('Ultra App Help - Progressive Goals' + '\nFor the progressive goal show, you can setup a single goal, or multiple goals that will be progressed through in sequence as users tip. There is a configuration flag that defines if the app automatically moves from one goal to the next, or requires the use of the /next command to advance after the goal is met. If set to automatic advance, tips that exceed the goal will carry over to the next goal. If set to advance by command, the tips do not roll over.' + '\nBy default, the room subject will show the current goal amount and description, the next goal description and a configurable block of text that you can use to describe what happens at the last goal or after the goals, or even just put searchable hashtags to draw more people into the show. This room subject text can be edited using the "/setgoaltext" command as noted below.' + '\nAny changes you make are not stored permanently, they are only stored within the current session. They will be kept if you switch between app features, but not if you deactivate the app. ' + '\nAlso, you must keep the goals in sequence, and cannot add an entry that would leave an empty level. For example, if goal levels 1-3 are filled in, you can\'t add a level 5, you must add a level 4 first. ' + '\nCOMMANDS: ' + '\n/restartgoal : If you\'d like to repeat a goal (common if you have a single goal you\'re recycling), you can use this command at any time to reset the tip count on the current goal to 0 (even if already complete)' + '\n/setgoal1, /setgoal2, /setgoal3...(thru /setgoal20) [goal] [description] : These are the commands that let you edit the goals for your show. Both the [goal] and [description] parameters must be entered every time and will update both values. Note this is also only a temporary change made within the session, it does not permanently update the launch page config.' + '\n--The 1-20 designation as part of the command identifies which entry you are modifying.' + '\n--The [goal] parameter is the new value you are setting for the goal amount. Even if you are not changing the goal (only changing the description, you must still enter the existing value for the goal.' + '\n--The [description] Parameter is the new value you are setting for the goal description. Even if you are not changing the description (only changing the goal amount), you must still enter the existing value for the description.' + '\n--An example of the syntax for this command would be "/setgoal4 400 Blow job", which would set goal 4 to be a Blow Job once you reach 400 tokens. ' + '\n--Note that you can\'t make updates to the current goal or past goal, only future goals.' + '\n/rmvgoal [level] : Remove the goal entry for goal level of [level] (amount and description are both removed). Note this is also only a temporary change made within the session, it does not permanently update the launch page config. ' + '\n/setgoaltext [newsubject] : Update the text that is shown in the Room Subject between the current goal and the next goal.' + '\n/next : Used to advance to the next goal once the current goal is complete, when auto advance is turned off.' + '\n/skip : Advance to the next goal regardless of the status of the current goal.' ,from); break; } case 'autoreset': { valid = 1; cb.sendNotice('Ultra App - Auto-reset Goal' + '\nFor the Auto-Reset Goal show, you define a single goal that will be recycled repeatedly each time it is hit. Tips that exceed the current goal will carry over and be applied to the next goal. ' + '\nYou can also configure if there is and end to the show after a certain number of goals, or if it just keeps going, and if there is a final goal prize after all goals are complete.' + '\nBy default, the room subject will show the current goal amount and description, the final goal count and grand prize (if used), and a configurable block of text that you can use to describe the show, and even put searchable hashtags to draw more people into the show. This room subject text can be edited using the "/setautotext" command as noted below.' + '\nCOMMANDS: ' + '\n/setautogoal [amount] [description]: This command allows you to edit the goal amount and goal description for your show (or just goal amount). Note this is also only a temporary change made within the session, it does not permanently update the launch page config.' + '\n/setautofinal [amount] [description]: This command allows you to edit the final number of goals for End of Show / Grand Prize, and the description of that prize or what happens at the end of the show. You can also just change the number of goals without changing the description). Note this is also only a temporary change made within the session, it does not permanently update the launch page config.' + '\n/setautotext [description]: Update the configurable text that describes the show.' + '\n/resetapp: Reset the App to the very beginning to start a new show, starting over at goal 1.' + '\n/skip: Advance to the next goal regardless of the status of the current goal. Since all auto-reset goals are the same, this wouldn\'t likely be used much unless trying to advance closer to the end of show goal.' ,from); break; } case 'goalcount': { valid = 1; cb.sendNotice('Ultra App Help - Goal Counter' + '\nFor the Goal Counter show, you define the smaller goal amount that will be tipped repeatedly, and then define prizes that will occur at a certain number of goals reached. For example, you may define that each goal will be 99 tokens, and then at 5 goals you take off your shirt, 10 goals take off your pants, etc. If there is a final/end goal, set it up as the highest of the goal level thresholds in the configuration list, the app will stop counting once the highest goal count is met. ' + '\nBy default, the room subject will show the remaining goals levels and their descriptions/prizes, plus a configurable block of text that you can use to describe what happens at the last goal or after the goals, or even just put searchable hashtags to draw more people into the show. This room subject text can be edited using the "/setcounttext" command as noted below.' + '\nCOMMANDS: ' + '\n/setcount1, /setcount2, /setcount3...(thru /setcount15) [goal] [description] : These are the commands that let you edit the goal levels for your show. Both the [goal] and [description] parameters must be entered every time and will update both values. Note that you can use these commands to add or edit an entry, however they cannot be used to delete an entry (use the /rmvcount).' + '\n--The 1-15 designation as part of the command identifies which Goal Level entry you are adding or modifying.' + '\n--The [goal] parameter is the new value you are setting for the goal level (such as "10" for doing a prize at the 10th goal). Even if you are not changing the goal level (only changing the description, you must still enter the existing value for the goal level.' + '\n--The [description] Parameter is the new value you are setting for the goal level description. Even if you are not changing the description (only changing the goal level), you must still enter the existing value for the description.' + '\n--An example of the syntax for this command would be "/setcount5 20 Blow job", which would set goal level 5 to be a Blow Job, to be done after you\'ve hit the individual goals 20 times. ' + '\n--Note that you can\'t make updates to the current goal level or past goal levels, only future goal levels.' + '\n/rmvcount [level] : Remove the goal from goal counter level of [level] (amount and description are both removed). Note this is also only a temporary change made within the session, it does not permanently update the launch page config. ' + '\n/setcounttext [newsubject] : Update the text that is shown in the Room Subject after the listing of the remaining goal levels.' + '\n/chgcountgoal [amt] : Change the amount that is being used for the individual goal levels (99 in the above example) to a new value of [amt]. If changing the value after the tipping has already started, it cannot be set to a value that is less than the tips received against the current goal.' + '\n/skip : Advance to the next individual goal regardless of the status of the current goal. Note this will only do one individual goal at a time, you can use the command /skiplevel described below to skip past the current goal level threshold' + '\n/skiplevel : Advance to the point the next goal level is complete, regardless of the status of the current goal. If there are no more goal level prizes, this will skip to the end of the show, so check the goal list (/lg) to be sure you know how what levels remaining have goals. As an example, if you are on goal 7, and there are prizes every 5 goals, it will skip ahead to having completed goal 10.' ,from); break; } case 'sequence': { valid = 1; cb.sendNotice('Ultra App Help - Sequence Goals' + '\nFor the Tip Sequence goal show, you can setup the starting and ending points in a sequence that users will tip through, and there can be intermediate goals defined at certain sequence thresholds. The tip sequence can be ascending or descending. For example, you could define the sequence as ascending from 1 to 50, with a goal threshold at 15, 20, 30, and 40... you could also define a sequence as descending from 60 to 10, with goal thresholds at 50, 40, 30, 20, 10, the direction, the range, and the goal levels are all configurable. ' + '\nBy default, the room subject will show the remaining goals sequence levels and their descriptions/prizes, plus a configurable block of text that you can use to describe what happens at the last goal or after the goals, or even just put searchable hashtags to draw more people into the show. This room subject text can be edited using the "/setsequencetext" command as noted below.' + '\nGroup tipping is available, which allows smaller tips to be accumulated against the current tip sequence number, and advancing when the accumulation meets or exceeds the next number. ' + '\nCOMMANDS: ' + '\n/setseq1, /setseq2, /setseq3...(thru /setseq10) [goal] [description] : These are the commands that let you edit the goal levels for your show. Both the [goal] and [description] parameters must be entered every time and will update both values. Note that you can use these commands to add or edit an entry, however they cannot be used to delete an entry (use the /rmvseq).' + '\n--The 1-10 designation as part of the command identifies which Sequence Goal Level entry you are adding or modifying.' + '\n--The [goal] parameter is the new value you are setting for the goal level (such as "10" for doing a prize once the count sequence reaches and exceeds the number 10). Even if you are not changing the sequence goal level (only changing the description), you must still enter the existing value for the sequence goal level.' + '\n--The [description] Parameter is the new value you are setting for the goal level description. Even if you are not changing the description (only changing the goal level), you must still enter the existing value for the description.' + '\n--An example of the syntax for this command would be "/setcount5 20 Blow job", which would set goal level 5 to be a Blow Job, to be done after you\'ve hit the individual goals 20 times.' + '\n--Note that you can\'t make updates to the current sequence goal level or past sequence goal levels, only future sequence goal levels.' + '\n/rmvseq [level] : Remove the goal from sequence goal level of [level] (amount and description are both removed). Note this is also only a temporary change made within the session, it does not permanently update the launch page config. ' + '\n/setsequencetext [newsubject] : Update the text that is shown in the Room Subject after the listing of the remaining goal sequence levels.' + '\n/usechatmsg [on/off] : Toggle the flag on and off for whether a message is posted in the chat for each sequence as it is achieved.' + '\n/usegrouptips [on/off] : Toggle the flag on and off for whether group tipping is allowed.' + '\n/skip : Advance to the next sequence regardless of the status of the current sequence.' + '\n/chgendseq [newseq] : Update the value for the end of the sequence. When ascending this is the higher number of the range, and when descending it is the low number of the range. The value cannot be updated to a sequence that has already been passed, or affect the current goal level target.' ,from); break; } case 'tipjar': { valid = 1; cb.sendNotice('Ultra App Help - Tip Jar Goals' + '\nFor the Tip Jar show, you can setup a single goal, or multiple goals that will be progressed through in sequence as users tip. As each goal is reach, a countdown begins using the number of tokens in the jar (total tips when goal was hit or passed). Tokens begin to "drain" out of the jar at the specified rate of tokens per second. During this time, the user is performing the prize for that goal, and they would stop performing once the tip jar runs out/empties. While it is draining, users can continue to tip to keep it full and keep the performance going. ' + '\nOne the jar is empty, there is a configuration flag that defines if the app automatically moves from the completed goal to the next, or allows viewers to fill up the jar again (requires the use of the /skip command to advance). If set to automatic advance, the next goal starts, and viewers will now be able to tip towards the next goal. ' + '\nThe goals also have a recyle count setting, which lets the broadcaster identify that some goals will be repeated over and over, to the defined threshold. Note that a recycle of "1", means that the goal will be performed twice (original plus one recycle). ' + '\nBy default, the room subject will show the current goal amount and description, and a configurable block of text that you cn use to describe what happens when the tip jar is running, or even just put searchable hashtags to draw more people into the show. This room subject text can be edited using the "/setjartext" command as noted below.' + '\nCOMMANDS: ' + '\n/setjar1, /setjar2, /setjar3...(thru /setjar10) [goal] [recyc] [description] : These are the commands that let you edit the goals for your show. All three of the [goal], [recyc], and [description] parameters must be entered every time and it will update all three values. Note that you can use these commands to add or edit an entry, however they cannot be used to delete an entry (use the /rmvjar for that).' + '\n--The 1-10 designation as part of the command identifies which entry you are modifying ' + '\n--The [goal] parameter is the value you are setting for the goal amount. Even if you are not changing the goal (only changing the description), you must still re-enter the existing value for the goal.' + '\n--The [recyc] parameter is the value you are setting for the recycle count. Even if you are not changing the recycle count (only changing the goal amount or description), you must still re-enter the existing value for the recycle count. Note that the default for recycle is "0", which means the goal is done once. With a recycle of "1", the goal is done twice, and if the recycle is "2", the goal is done three times, etc. ' + '\n--The [description] Parameter is the value you are setting for the goal description. Even if you are not changing the description (only changing the goal amount), you must still re-enter the existing value for the description.' + '\n--And example of the syntax for this command would be "/setjar2 400 Blow job", which would set goal 2 to begin a Blow Job once you reach 400 tokens and continue that prize as long as the tip jar has tokens in it. ' + '\n--Note that you can\'t make updates to the current goal or past goals, only future goals.' + '\n/rmvjar [level] : Remove the goal for the tip jar goal level of [level] (amount and description are both removed). Note this is also only a temporary change made within the session, it does not permanently update the launch page config. ' + '\n/setjartext [newsubject] : Update the text that is shown in the Room Subject after the current goal.' + '\n/faster [levels] : Speeds up the drain rate by the specified number of levels. If no level is specified it is assumed to be by one level. If a level is specified beyond the maximum, the maximum is used.' + '\n/slower [levels] : Slows down up the drain rate by the specified number of levels. If no level is specified it is assumed to be by one level. If a level is specified below the minimum, the minimum is used.' + '\n/pause : Pause the draining of the jar.' + '\n/resume : Resume the draining of the jar.' + '\n/skip : Advance to the next goal regardless of the status of the current goal. This will also bypass the prize/draining of the jar for the current goal (will get a warning and must enter twice when tokens in the jar).' ,from); break; } case 'ticketshow': { valid = 1; cb.sendNotice('Ultra App - Ticket Show' + '\nCOMMANDS:' + '\n/tickets : (all users) Display the list of users that have bought or been given a ticket. If the parameter of "alpha" is added, the list is displayed alphabetically. Note that viewers can be added back to the show using the "/add" command and pasting the list that is shown from the /tickets command. ' + '\n/previewers : (all users) Display the list of users that are currently viewing in their free preview period.' + '\n/usegift [on/off]: (mods/bc only) Toggle the setting for whether the ability to gift tickets is "on" or "off". Overrides the initial setting from the launch page, and allows you to turn the gifting of tickets on or off during the show.' + '\n/useot [on/off]: (mods/bc only) Toggle the setting for whether the Outstanding Ticket feature of the Ticket Show is "on" or "off". Overrides the initial setting, and allows you to turn the Outstanding Ticket usage feature on or off during the show. .' + '\n/otlist : (all users) Display the list of outstanding ticket holders, can be used by anyone if the Outstanding Ticket feature is enabled.' + '\n/otchanges : (mods/bc only) ** IMPORTANT when using the OT feature ** Displays a list of tickets that have been saved or used during the current session so the permanent list can be updated.' + '\n/saveticket: (all ticket buyers) If the broadcaster has enabled Outstanding Tickets (and is tracking them) - If you have bought a ticket and will not be able to stay for the show, you can save it for a future show. You will no longer be able to see the current show. IMPORTANT: If in the same session, the ticket will be available automatically. However for future shows or if the broadcaster restarts the bot, the broadcaster must add the saved tickets to the outstanding ticket list to be able to use them with /useticket. ' + '\n/useticket: (all users with an outstanding ticket) If the broadcaster has enabled Outstanding Tickets (and is tracking them) - Redeem an outstanding ticket and use it for access to this show. You can use the command "/otlist" to view the list of outstanding ticket holders if the broadcaster has enabled this feature.' + '\n/addot : (mods, bc if granted privileges) If the outstanding ticket feature is in use, the broadcaster can manually give a user an outstanding ticket. Moderators can also add if they have authority. The addition still must be made permanent by updating the launch page outstanding ticket list.' + '\n/rmvot : (mods/bc only) Remove a user from the outstanding ticket list within the current show. The removal still must be made permanent by updating the launch page outstanding ticket list.' + '\n/add or (/addticket) [user]: (bc only, moderator when granted privileges) Manually add a user to the ticket show list. Can be a specific user or a list of users separated by a comma.' + '\n/rmv (or /rmvticket or /del or /delticket) [user]: (mods/bc only) Manually remove a specific user from the ticket show list, only used for one user at a time. ' + '\n/startshow: (mods/bc only) Start the ticket show when not set to automatic start. Once started, the show will only be visible to ticket holders. Hint: start the show when you are in a good position for the preview pic to be frozen that will attract more ticket buyers.' + '\n/showwarn (or /showover): (mods/bc only) Display a warning that the show will be ending soon and ticket purchases are allowed but not recommended. If configured, this can also end the positions menu, and reduce the ticket price.' + '\n/showend (or /stopsales): (mods/bc only) Suspend ticket sales, no more automatic ticket purchases can be made. Recommended to always do this once you are less than a few minutes from the end of the show so people do not buy at the last second and are disappointed by getting a short show. If configured, this can also end the positions menu, and reduce the ticket price.' + '\n/stopshow: (mods/bc only) End the hidden show and return to a public broadcast.' + '\n/newticketshow: (mods/bc only) Completely refresh the ticket show to start a brand new show. This will remove all the ticket holders from the list, and re-initialize all settings using the configuration from the launch page.' + '\n/restartshow: (mods/bc only) Go back into hidden cam mode if the show was accidentally ended too soon, or the broadcaster wanted to go back to public to sell more tickets. The ticket holder list and all settings are kept intact.' + '\n/restartsales: (mods/bc only) Restart ticket sales either during the show (after /showend was used), or after you\'ve ended the show to go back to the ticket sales stage. The ticket holder list, ticket price and show description are kept intact.' + '\n/ticketprice (or /ctprice, or /chgticketprice) [newprice]: (mods/bc only) Update the ticket price to the [newprice].' + '\n/showstartprice [newprice]: (mods/bc only) Update the increased price that can be used at the start of the show to a new value of [newprice].' + '\n/starttimer (or /ticketstarttimer, or /starttickettimer) [time]: (mods/bc only) Start a [time] minute timer for the ticket show when in "timer" mode with the start of the show to be triggered by the /startshow command. The timer will count down but not automatically start the show unless configured to do so.' + '\n/addtime (or /ticketaddtime, or /addtickettime) [time]: (mods/bc only) Add [time] minutes to the timer for either automatic or manual drawing mode. The [time] value can be a negative number to subtract time, but cannot be greater than the remaining time.' + '\n/stoptimer (or /ticketstoptimer, or /stoptickettimer): (mods/bc only) Stop the ticket show timer for either automatic or manual drawing mode.' + '\n/tickettimeleft : (mods/bc only) Display the time left on the ticket show countdown for either automatic or manual starting mode.' + '\n/showtime : (all users) Display a message showing how long the current show has been hidden.' + '\n/chgticketmode (or /chgtktmode) [manual/timer/ticketgoal/tokengoal]: (mods/bc only) Switch between the modes being used to determine when to start the ticket show. If switching from a timer show to a non-timer show, the timer will be ended. Ticket count and Tip Count are being tracked regardless of mode, so switching to a "goal" mode should not require starting progress at 0.' + '\n/chgticketauto (or /chgtktauto) [auto/bc]: (mods/bc only) Switch between the modes being used to define if the show starts automatically when a goal is reached or timer expires, or if the broadcaster or mods still control the start of the show. ' + '\n/giftticket [user]: (all users, once you have extra tickets) If the "gifting" feature is enabled, when you tip enough to buy extra tickets, you can gift those tickets to other users using this command. Each time you gift, it removes one of your "extra" tickets. You can only gift extra tickets with this command, to give away your own ticket, you can use /givemyticketto as noted below. Be sure to type the user name correctly for the person you are gifting to, extra tickets cannot be recovered once they are gifted. This can be done before and during the show.' + '\n/givemyticketto [user]: (all ticket buyers) If you cannot stay for a show, and outstanding ticket feature is no used to allow saving your ticket, you can give your ticket to another user. This can only be done before the show starts, and you will be removed from the ticket show list!' + '\n/ticketsubject (or /ctsubject) [newsubject]: (mods/bc only) Change the room description/subject/title to a new value. This keeps the standard ticket show formatting and only changes the configurable part of the subject.' + '\n/previewlength [newlength]: (mods/bc only) Update the length of the free preview period. Note that setting it to zero ("0") will disable the free preview. Please make sure to use one of the following values as the parameter: "0", "10sec", "20sec", "30sec", "1min", "2min", "3min", "4min", or "5min"' + '\n/addlbtop [X]: (bc/mods - Fembot command) Add the top [X] number of tippers for the current session to the ticket show. Moderators may only use this if allowed per configuration. Note this command is actually being executed in the Fembot, so the Ultra Fembot must be running to make use of it. The /add command is executed, which will add them to the show if the user executing them has authority to the /add command' + '\n/addlbamt [X]: (bc/mods - Fembot command) Add tippers who have tipped at least [X] number of tokens for the current session to the ticket show. Moderators may only use this if allowed per configuration. Note this command is actually being executed in the Fembot, so the Ultra Fembot must be running to make use of it. The /add command is executed, which will add them to the show if the user executing them has authority to the /add command' + '\n/ctn: (bc/mods) Post a one-time notice in the chat. The syntax for using this type of notice is "/ctn [X]", where [X] is the message you want to send. This is the plain notification without any separators or highlighting.' + '\n/ctnd: (bc/mods) Post a one-time notice in the chat. The syntax for using this type of notice is "/ctnd [X]", where [X] is the message you want to send. This notification includes a dash separator before and after the message, but no highlighting.' + '\n/ctnh: (bc/mods) Post a one-time notice in the chat. The syntax for using this type of notice is "/ctnh [X]", where [X] is the message you want to send. This notification includes highlighting, but no separators.' + '\n/ctndh: (bc/mods) Post a one-time notice in the chat. The syntax for using this type of notice is "/ctndh [X]", where [X] is the message you want to send. This notification includes both separators and highlighting.' ,from); break; } case 'presales': { valid = 1; cb.sendNotice('Ultra App - Ticket Show Pre-sales' + '\nCOMMANDS:' + '\n/uapresale [on/off]: (bc/mods only) overrides the launch page setting for whether Pre-sales are conducted in the UltraApp or the Fembot. Using a parameter of "on" enables presales in the UltraApp. Note you can still start and stop the actual pre-sale of tickets once enabled for the ultraApp using the two commands below.' + '\n/startpresale: (bc/mods only) Begin selling pre-sales tickets. Only allowed if Pre-sales are enabled for the UltraApp (see above command).' + '\n/stoppresale: (bc/mods only) Stop selling pre-sales tickets. Only allowed if Pre-sales are enabled for the UltraApp (see above command). Note the ticket list remains intact, but new pre-sale purchases are disabled' + '\n/presalelist: (all users) Display the list of users on the ticket holder list when performing pre-sales. Once the ticket show sales are started, use the "/tickets" command instead.' + '\n/presaleprice [price]: (mods/bc only) Set the pre-sales ticket price to a value of [price]. This can either be done to set the initial price before the pre-sales start, if not set in the bot start page, or it can be used after pre-sales start to change the price to a new price. Note the timer can also be set to change the price using the command below.' + '\n/pspricetimer [time] [price]: (mods/bc only) When using manual mode, set the pre-sales ticket price to a new value of [price] when the timer for [time] minutes runs out. Timer warnings will be displayed and the price will automatically update at the end of the timer. Time can be added or removed from the timer using the command below.' + '\n/presaletimer [time]: (mods/bc only) When using manual mode, start a timer to increase the price at the end of the timer by the pre-defined increment value specified on the start page.' + '\n/presaleaddtime [time]: (mods/bc only) Add [time] minutes to the timer. If a negative number is used, time is subtracted.' + '\n/presalestoptimer: (mods/bc only) Stops the pre-sale timer and no price update is made.' + '\n/presaletimeleft: (mods/bc only) Displays the time left on the current pre-sale timer, whether started manually or automated.' + '\n/chgpresalemode [mode]: (mods/bc only) Change the presale mode that is currently running. The default value is set on the start page, and can be change on the fly during the show to "manual", "timer", or "count".' + '\n--Manual Mode: The broadcaster or moderator controls the price increases (or there are no price increases). Price can either be changed immediately using /presaleprice, or a timer can be started to change it by a specified amount (/presalepricetimer) or by the default increment amount (/presalestarttimer).' + '\n--Timer Mode: The price is changed automatically on a recycling timer as defined on the start page. The broadcaster or a moderator can add or remove time from the timer as needed, or stop the timer. At the end of each cycle, the price will increase by the configured increment and a new timer will be kicked off as long as it does not exceed the maximum number of increments and would not exceed the ticket price with the next cycle.' + '\n--Count Mode: The price is changed automatically on a recycling ticket count as defined on the start page. At the end of each cycle when the defined number of tickets is sold, the price will increase by the configured increment as long as it does not exceed the maximum number of increments and does not exceed the ticket price with the next cycle.' + '\n/addpresale: (mods/bc only) Add a user or list of users to the pre-sale ticket list.' + '\n/rmvpresale: (mods/bc only) Remove an individual user from the pre-sale list.' ,from); break; } case 'goalrace': { valid = 1; cb.sendNotice('Ultra App Help - Goal Race' + '\nFor the Goal Race, you define the two goal amounts and descriptions, and viewers tip toward each goal.' + '\nWhen this app is active and a user tips, the tip panel will show a choice of the two goals to tip toward, they can choose one of the two goals, or not make a selection.' + '\nThe user can also toggle on and off a personal setting that allows them to either send votes or regular tip notes.' + '\nThe goals, goal descriptions, room subject text, and panel subject text are configurable on the launch page and also through the commands below, so you don\'t have to restart the app to make changes.' + '\nCOMMANDS: ' + '\n/restartrace: Lets you restart the goal race (reset tip amounts to 0) with the same settings.' + '\n/setrace1, /setrace2 [amount] [description] : These are the commands that let you edit the goal amounts and goal descriptions for your show. Both the [amount] and [description] parameters must be entered every time and will update both values.' + '\n--The "1" or "2" designation as part of the command identifies which Goal Choice entry you are modifying.' + '\n--The [amount] parameter is the new value you are setting for the goal amount (such as "500" for a goal amount). Even if you are not changing the goal amount (only changing the description, you must still enter the existing value for the goal amount as both will be updated.' + '\n--The [description] parameter is the new value you are setting for the goal description (such as "Bra Off"). Even if you are not changing the description (only changing the goal amount), you must still enter the existing value for the description.' + '\n--An example of the syntax for this command would be "/setrace2 500 Bra Off", which would set goal #2 to be the choice of "Bra Off" (which may compete against "Panties Off, for example). ' + '\n--Note that you can\'t make updates to the goal amount that would be less than what is already tipped for that goal.' + '\n/addrace1, /addrace2: If you have tipped during the Race and did not specify a goal at the time, these tips are accumulated and can be "claimed" for either goal 1 or goal 2 using one of these two commands. The accrued amount cannot be split, the whole amount will go toward the goal selected.' + '\n/tipnoteon, /tipnoteoff: This command lets you toggle whether you are sending tip notes to the broadcaster or casting votes for the goal.' + '\n/setracetext [newsubject] : Update the text that is shown in the Room Subject after the listing of the race goals.' + '\n/setracepaneltext [newsubject] : Update the text that is shown in the First Line of the Draw Panel.' ,from); break; } case 'spankathon': { valid = 1; cb.sendNotice('Ultra App Help - Spank-a-thon' + '\nThe Spank-a-thon is a combination of Tip Menu and Goals. The broadcaster can configure up to 5 types of spankings to be administered (such as hand spanks, paddle spanks, riding crop, etc). For each type, a price is defined per spank, and there is configuration available for 2 more "bundle" prices as well. The types and prices can also be set using commands.' + '\nGoals can also be setup to set a point at which the spanks will be done. Only one goal is required and up to 5 goals can be configured.' + '\nThere is a setting to define if all tips count toward the goal or if only spank tips count.' + '\nWhen spanks are completed, the /spanked command can be used to mark them off from the "to do" list.' + '\nCOMMANDS: ' + '\n/setspanktype1, /setspanktype2, ...(thru /setspanktype5) [description]: These commands let you create or edit each of the 5 available spank types, such as "hand spanks", "paddle spanks", etc. The types must be defined before bundle quantities and prices can be set with the below command. Note this is also only a temporary change made within the session, it does not permanently update the launch page config.' + '\n/setspankXpY [bundle amount] [price]: For each of the 5 types (once a type is defined), you can define up to 3 bundle amounts and prices. ' + '\n--The "X" in the command is the spank type (1-5), and the "Y" is the price level (1-3). ' + '\n--The first parameter is how many spanks in the bundle. For example, you may set price level 1 as the price per spank, so the number would be 1. For price level 2, you may be pricing a bundle of 10, and for price level 3, you may be pricing a bundle of 50.' + '\n--The second parameter is the correspondnig price for each.' + '\n--Therefore, in the example "/setspank2p3 50 499", you would be defining that for spank type 2, price level 3, the price is 499 for a bundle of 50.' + '\n--Note this is also only a temporary change made within the session, it does not permanently update the launch page config.' + '\n/setspankgoal1, /setspankgoal2, ...(thru /setspankgoal5) [goal] [description]: These are the commands that let you edit the spank goals for your show. Both the [goal] and [description] parameters must be entered every time and will update both values. Note this is also only a temporary change made within the session, it does not permanently update the launch page config.' + '\n--The 1-5 designation as part of the command identifies which entry you are modifying.' + '\n--The [goal] parameter is the new value you are setting for the goal amount. Even if you are not changing the goal (only changing the description), you must still enter the existing value for the goal.' + '\n--The [description] Parameter is the new value you are setting for the goal description. Even if you are not changing the description (only changing the goal amount), you must still enter the existing value for the description.' + '\n--An example of the syntax for this command would be "/setspankgoal2 500 Administer Spanks Round 2", which would set goal 2 to be the described text once you reach 500 tokens.' + '\n--Note that you can\'t make updates to the current goal or past goal, only future goals.' + '\n/rmvspankgoal [level]: Remove the goal entry for goal level of [level] (amount and description are both removed). Note this is also only a temporary change made within the session, it does not permanently update the launch page config.' + '\n/setspanktext [newsubject]: Update the text that is shown in the Room Subject between the current goal and the next goal.' + '\n/spanktotals: Display the current totals for spanks tipped for and administered per spank type.' + '\n/spankmenu: Display the spank menu on demand, note it also shows in the chat notice periodically.' + '\n/spanktips: Display the history of the spank tips.' + '\n/spanked X Y: (bc/mods with authority) Update the number of completed spanks for the spank type X, adding Y spanks to the current total.' + '\n/spankall: (bc/mods with authority) Mark all outstanding spanks as complete, rather than the one at a time that is done with the /spanked command.' ,from); break; } case 'peepshow': { valid = 1; cb.sendNotice('Ultra App - Peep Show' + '\nCOMMANDS:' + '\n/mytime: (all users) display the amount of time you have purchased so far, and time remaining.' + '\n/peepviewers (or /pv) : (all users) Display the list of all users with access to the hidden show. Prior to show start, this will be anyone granted free access (mods, Fans, VIPs, etc). After the hidden peep show starts, it will be all users with access - free viewers and viewers who have purchased time remaining.' + '\n/peepbuyers (or /pb) : (all users) Display the list of all users who have purchased time in the show, either before show start or during the show. The list will also show the amount of time remaining for each viewer. After a viewer\'s time expires, they are still in this list with 0 time remaining (but will not be in the viewer list above).' + '\n/peepadd [user]: (mods/bc only) Manually add a specific [user] to the Peep Show Free Viewer list - they will be able to see the whole show.' + '\n/peeprmv [user]: (mods/bc only) Manually remove a specific user from the Peep Show. Applies to both Free Viewers or viewers with purchased time.' + '\n/startshow: (mods/bc only) Start the Peep Show when not set to automatic start. Once started, the show will only be visible to Free Viewers and those who have purchased time. Hint: start the show when you are in a good position for the preview pic to be frozen that will attract more buyers after the show starts.' + '\n/showwarn (or /showover): (mods/bc only) Display a warning that the Peep Show will be ending soon and that time purchases are allowed but not recommended.' + '\n/showend (or /stopsales): (mods/bc only) Suspend Peep Show sales, no more time purchases can be made. Recommended to always do this once you are less than a few minutes from the end of the show so people do not buy at the last second and are disappointed by getting a short show.' + '\n/stopshow: (mods/bc only) End the hidden Peep Show and return to a public broadcast if not configured to autmatically end.' + '\n/peeprestart: (mods/bc only) Go back into hidden cam mode if the show was accidentally ended too soon. The viewer list and time purchase amounts are kept intact.' + '\n/peepprice [newprice]: (mods/bc only) Update the peep show per minute price to the [newprice] in tokens per minute. If changed during the show, it will not affect viewers who have already purchased time. Once a purchase is made, they are locked in to the time they have bought.' + '\n/peeplength [time]: (mods/bc only) Update the planned length of the peep show to [time] in terms of minutes. This is only an estimate.' + '\n/peeptimer [time]: (mods/bc only) Start a [time] minute timer for the start of the peep show when in "timer" mode The timer will count down but not automatically start the show.' + '\n/peepaddtime [time]: (mods/bc only) Add [time] minutes to the timer for the Peep Show start countdown. The [time] value can be a negative number to subtract time, but cannot be greater than the remaining time.' + '\n/peepstoptimer: (mods/bc only) Stop the Peep Show Start timer for either automatic or manual drawing mode.' + '\n/peeptimeleft : (mods/bc only) Display the time left in the Peep Show based on the broadcaster\'s planned show length (estimate).' + '\n/peepautoend [on/off]: (mods/bc only) Overrides the initial launch page setting and changes the parameter for whether the show automatically ends after the planned show length. A parameter of "on" enables the automatic end, a parameter of "off" disabled the automatic end.' + '\n/peepsubject [newsubject]: (mods/bc only) Change the room description/subject/title to a new value. This keeps the standard Peep Show Room Subject formatting and only changes the configurable part of the subject.' ,from); break; } } if (valid == 0) { cb.sendNotice(option + ' is not a valid subsection of the help menu. Type "/uahelp" to access the main help menu.',from,appNoticeColor); } } } } // ******************************* Upon user entry of a Message ************************************** { cb.onMessage(function (msg) { var message = msg['m'].split(' '); var cmd = 0; var symbolString = '~`!@#$%^&*()_-+={[}]|\\:;"\'<,>.?/'; var listRegExp = /[,\s]+/; var listRegExpSpc = /[,]+/; var m = msg.m; var u = msg.user; var isMod = msg.is_mod; var isFanMsg = msg.in_fanclub; var isExtFanMsg = cbjs.arrayContains(extFanListArray,u); var isExtFanMsg2 = cbjs.arrayContains(extFanList2Array,u); var isVIPMsg = cbjs.arrayContains(VIPListArray,u); var isBC = (u === cb.room_slug); var BC = cb.room_slug; var command = message[0] var commandVar1 = parseInt(message[1]); var commandVar2 = parseInt(message[2]); var commandVar3 = parseInt(message[3]); 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; } } } if (isMod) { addRmvModsInShow(u,'a'); } if (isFanMsg) { populateFanClubArray(u); } if (isVIPMsg) { addRmvVIPInShow(u,'a'); } if (isExtFanMsg) { addRmvExtFanInShow(u,'a'); } if (isExtFanMsg2) { addRmvExtFanInShow2(u,'a'); } if (isMod || isFanMsg || isExtFanMsg || isExtFanMsg2 || isVIPMsg) { if (whichApp == 'ticket' || presalesToggle == 1) { checkFreeTickets(u,isMod,isFanMsg,isExtFanMsg,isExtFanMsg2,isVIPMsg,'msg'); } } if(message[0].charAt(0) == '/') { msg['X-Spam'] = true; var ntc = null; for (var n1 = 1; n1 < message.length; n1++) { if (n1 == 1) ntc = message[n1]; else ntc += ' ' + message[n1]; } var ntc2 = null; for (var n2 = 2; n2 < message.length; n2++) { if (n2 == 2) ntc2 = message[n2]; else ntc2 += ' ' + message[n2]; } var cmdval = null; for (var n3 = 1; n3 < message.length; n3++) { if (n3 == 1) cmdval = message[n3]; else cmdval += ' ' + message[n3]; } switch(command) { //********* General Ultra App Commands case '/chgapp': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newApp = message[1].toLowerCase(); if (newApp != 'ticket' && newApp != 'goals' && newApp != 'goalcount' && newApp != 'sequence' && newApp != 'tipjar' && newApp != 'goalrace' && newApp != 'peep' && newApp != 'spank' && newApp != 'autoreset' && newApp != 'none') { cb.sendNotice('The value entered for the app to use is invalid, please try again using a value of "ticket", "goals", "autoreset", "goalcount", "sequence", "tipjar", "goalrace", "spank", "peep", or "none".', u, appNoticeColor); } else { if (validateFeature(newApp)) { if (newApp === whichApp) { cb.sendNotice('The value entered for the new mode is the same as the existing mode, command ignored.', u, appNoticeColor); } else { setAppFeature(newApp, u); } } } } else { cb.sendNotice('This command requires a parameter to define to the new app feature that is to be used, in the format "/chgapp [appname]", where [appname] is one of the defined app features ("ticket", "goals", "autoreset", "goalcount", "sequence", "tipjar", "goalrace", "spank", "peep", or "none").', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chgpanelbg': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newBg = message[1].toLowerCase(); customizePanelBackground(newBg,u); } else { cb.sendNotice('The /chgpanelbg command requires the entry of a parameter following the command, such as "/chgpanelbg lavalamp". The valid formats are: \n' + cbjs.arrayJoin(backgroundArray.command, ', '), u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/chgpaneltext': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { newcolor = msg['m'].substring(14).trim(); if (newcolor) { customizePanelText(newcolor,u); } else { cb.sendNotice('The /chgpaneltext command requires the entry of a parameter following the command, which represents either the color name or the color hex code, such as "/chgpaneltext blue" or "/chgpaneltext #0000ff".' , u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/next': { cmd = 1; if (whichApp == 'goals') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (finalGoalMet) { cb.sendNotice('Command cannot be used once all goals have been completed.', u, appNoticeColor); } else if (cb.settings.progressiveUpDown == 'Count Up To Goal' && currentGoalTips < currentGoalTotal) { cb.sendNotice('Command cannot be used during goal, it should be used only to manually advance a goal once complete if the auto-advance is off. The /skip command can be used to bypass the rest of a goal.', u, appNoticeColor); } else if (cb.settings.progressiveUpDown == 'Count Down To Zero' && currentGoalTips > 0) { cb.sendNotice('Command cannot be used during goal, it should be used only to manually advance a goal once complete if the auto-advance is off. The /skip command can be used to bypass the rest of a goal.', u, appNoticeColor); } else { cb.sendNotice('You have manually advanced to the next goal.', u, appNoticeColor); nextGoal(); cb.drawPanel(); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/next" command is for use with the Progressive Goals, which is not currently running.', u, appNoticeColor); } break; } case '/skip': { cmd = 1; if (whichApp == 'tipjar' || whichApp == 'goals' || whichApp == 'goalcount' || whichApp == 'sequence' || whichApp == 'spank' || whichApp == 'autoreset') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (finalGoalMet) { cb.sendNotice('Command cannot be used once all goals, cycles or sequences have been completed.', u, appNoticeColor); } else if (whichApp == 'tipjar' && tipJarRunning && tipJarCurrentTokens > 0) { if (skipWarned) { cb.sendNotice('Skipping the draining of the rest of the jar and advancing to next goal/cycle.', u, appNoticeColor); skipGoal(); skipWarned = false; } else { skipWarned = true; cb.sendNotice('Warning! The "/skip" command should not be used while tip jar is running and there are tokens in the jar, but you can enter the /next command again and it will skip the draining of the rest of the jar and advance. Tokens can be removed from the tip jar using "/addtips" with a negative number.', u, appNoticeColor); } } else { skipGoal(); cb.sendNotice('You have skipped the remainder of the current goal, cycle, or sequence and advanced to the next.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/skip" command is for use with the Tip Jar, Progressive Goals, Auto-Reset Goal, Goal Counter, or Tip Sequence apps (current app is ' + whichApp + ').', u, appNoticeColor); } break; } case '/skiplevel': { cmd = 1; if (whichApp == 'goalcount' || whichApp == 'sequence') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (finalGoalMet) { cb.sendNotice('Command cannot be used once all goals, cycles or sequences have been completed.', u, appNoticeColor); } else if (whichApp == 'goalcount' && (currentGoalLevel) > goalCounterArray.amt.length) { cb.sendNotice('No further Goal Counter Prize Levels to skip.', u, appNoticeColor); } else if (whichApp == 'sequence' && (currentGoalLevel) > sequenceArray.amt.length) { cb.sendNotice('No further Sequence Prize Levels to skip.', u, appNoticeColor); } else { advanceGoalLevel(); cb.sendNotice('You have skipped the remainder of the current Prize Level and advanced to the next Prize Level.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/skiplevel" command is for use with the Goal Counter or Tip Sequence apps (current app is ' + whichApp + ').', u, appNoticeColor); } break; } case '/addtips': { cmd = 1; if (whichApp == 'tipjar' || whichApp == 'goals' || whichApp == 'goalcount' || whichApp == 'goalrace' || whichApp == 'spank' || whichApp == 'autoreset') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (commandVar1 == 0 || isNaN(commandVar1)) { if (whichApp == 'goalrace') { cb.sendNotice('The first parameter is the tip amount to be added to the current tip count, and must be a positive or negative number other than 0. For example, use "/addtips 100 1" to simulate a user having tipped 100 tokens for goal choice 1.',u,appNoticeColor); } else { cb.sendNotice('The parameter is the tip amount to be added to the current tip count, and must be a positive or negative number other than 0. For example, use "/addtips 100" to simulate a user having tipped 100 tokens.',u,appNoticeColor); } } else if (finalGoalMet) { cb.sendNotice('Command cannot be used once all goals, cycles or sequences have been completed.', u, appNoticeColor); } else if (!tipJarRunning && commandVar1 < 0 && Math.abs(commandVar1) > currentGoalTips) { cb.sendNotice('You cannot subtract more tokens than have been tipped for the current goal.', u, appNoticeColor); } else if (tipJarRunning && commandVar1 < 0 && Math.abs(commandVar1) > tipJarCurrentTokens) { cb.sendNotice('You cannot subtract more tokens than are in the tip jar.', u, appNoticeColor); } else if (whichApp == 'goalrace' && commandVar2 != 1 && commandVar2 != 2) { cb.sendNotice('For Goal Race, the second parameter must be a "1" or a "2" to specify which goal the amout is added. Example syntax to add 25 tokens to Goal Choice 2 is "/addtips 25 2".', u, appNoticeColor); } else { if (whichApp == 'goalrace' && commandVar2 == 1) { tipNote = goalraceDesc1; } else if (whichApp == 'goalrace' && commandVar2 == 2) { tipNote = goalraceDesc2; } else { tipNote = ''; } recordTip(commandVar1,'bc',tipNote,isFanMsg,isExtFanMsg,isExtFanMsg2,isVIPMsg); if (commandVar1 > 0) { cb.sendNotice('You have added ' + commandVar1 + ' tokens.', u, appNoticeColor); } else { cb.sendNotice('You have subtracted ' + Math.abs(commandVar1) + ' tokens.', u, appNoticeColor); } } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/addtips" command is only for use with the Tip Jar, Progressive Goals, Auto-Reset Goal, Goal Race, Spank-a-thon, or Goal Counter (current app is ' + whichApp + ').', u, appNoticeColor); } break; } case '/stats': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsStats == 'Yes')) { cb.sendNotice('Current Session Stats:' + '\n \u21D2 UltraApp Time Online................ ' + timeOnline() + '\n \u21D2 Total Tips................................. ' + currentSessionTotal + ' tokens ($' + Number(currentSessionTotal*.05).toFixed(2) + ' @ 5 cents per token)' + '\n \u21D2 \u21D2 \u21D2 Progressive Goal Total....... ' + currentAppTotalGoal + ' tokens' + '\n \u21D2 \u21D2 \u21D2 Auto-Reset Goal Total........ ' + currentAppTotalAutoreset + ' tokens' + '\n \u21D2 \u21D2 \u21D2 Goal Counter Total............ ' + currentAppTotalCounter + ' tokens' + '\n \u21D2 \u21D2 \u21D2 Tip Sequence Goal Total.... ' + currentAppTotalSequence + ' tokens' + '\n \u21D2 \u21D2 \u21D2 Tip Jar Total...................... ' + currentAppTotalTipJar + ' tokens' + '\n \u21D2 \u21D2 \u21D2 Goal Race Total................. ' + currentAppTotalGoalRace + ' tokens' + '\n \u21D2 \u21D2 \u21D2 Spank-a-thon Total........... ' + currentAppTotalSpanks + ' tokens' + '\n \u21D2 \u21D2 \u21D2 Ticket Show Total............. ' + currentAppTotalTicket + ' tokens' + '\n \u21D2 \u21D2 \u21D2 \u21D2 Pre-sale Tickets Sold........... ' + countPresaleTickets + ' tickets' + '\n \u21D2 \u21D2 \u21D2 \u21D2 Total Tickets Sold.............. ' + countTickets + ' tickets' + '\n \u21D2 \u21D2 \u21D2 \u21D2 Tickets Sold From Preview.. ' + countTicketsFromPreview + ' tickets' + '\n \u21D2 \u21D2 \u21D2 Peep Show Total............... ' + currentAppTotalPeep + ' tokens' + '\n \u21D2 \u21D2 \u21D2 No App Running Total....... ' + currentAppTotalNone + ' tokens', u, appNoticeColor, '', 'bold'); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/lg': case '/listgoals': { cmd = 1; if (whichApp == 'tipjar' || whichApp == 'goals' || whichApp == 'goalcount' || whichApp == 'sequence' || whichApp == 'spank' || whichApp == 'autoreset') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (!message[1] || message[1] == 'all') { listGoals(message[1],u,'a'); } else { cb.sendNotice('Invalid parameter provided, the parameter should be left blank to send the list to only the requester, or can be set to "all" to send to the entire room.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/listgoals" command is for use with the Progressive Goals, Auto-Reset Goal, Goal Count, Tip Sequence, Spank-a-thon, and Tip Jar apps.', u, appNoticeColor); } break; } case '/lrg': case '/listremgoals': { cmd = 1; if (whichApp == 'tipjar' || whichApp == 'goals' || whichApp == 'goalcount' || whichApp == 'sequence' || whichApp == 'spank' || whichApp == 'autoreset') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (!message[1] || message[1] == 'all') { listGoals(message[1],u,'r'); } else { cb.sendNotice('Invalid parameter provided, the parameter should be left blank to send the list to only the requester, or can be set to "all" to send to the entire room.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/listremgoals" command is for use with the Progressive Goals, Auto-Reset Goal, Goal Count, Tip Sequence, Spank-a-thon, and Tip Jar apps.', u, appNoticeColor); } break; } case '/resetapp': { cmd = 1; if (whichApp == 'tipjar' || whichApp == 'goals' || whichApp == 'goalcount' || whichApp == 'sequence' || whichApp == 'autoreset') { if (isBC) { resetApp(); cb.sendNotice('You have reset the App and started the goal show again at the first goal.', u, appNoticeColor); } else { cb.sendNotice('Only broadcasters are able to use the "/resetapp" command.', u, appNoticeColor); } } else { cb.sendNotice('The "/resetapp" command is for use with the Progressive Goals, Auto-Reset Goal, Goal Count, Tip Sequence and Tip Jar apps.', u, appNoticeColor); } break; } case '/paneltext1': case '/paneltext2': case '/paneltext3': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { linenum = parseInt(message[0].substring(10)); paneltext = msg['m'].substring(12).trim(); if (!paneltext) { cb.sendNotice('No value was specified for the new panel text line ' + linenum + '.', u, appNoticeColor); } else if (whichApp == 'none') { if (linenum == 1) { noAppPanelText1 = paneltext; cb.drawPanel(); cb.sendNotice('Panel Line 1 Text has been updated.', u, appNoticeColor); } else if (linenum == 2) { noAppPanelText2 = paneltext; cb.drawPanel(); cb.sendNotice('Panel Line 2 Text has been updated.', u, appNoticeColor); } else if (linenum == 3) { noAppPanelText3 = paneltext; panelText3Updated = true; cb.drawPanel(); cb.sendNotice('Panel Line 3 Text has been updated.', u, appNoticeColor); } cb.drawPanel(); } else if (whichApp == 'ticket' && linenum == 3 && showStage == 'aftershow') { if (linenum == 3) { ticketAppPanelText3 = paneltext; cb.drawPanel(); cb.sendNotice('Panel Line 3 Text has been updated.', u, appNoticeColor); } } else { cb.sendNotice('The "/paneltextX" command is only for use when no UltraApp feature is running, or for line 3 when in the "after show" portion of the Ticket Show Feature. For example, at the end of the show, you may turn off all the features and simply put a text message in the panel. Message can either be set on launch page or with this command.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/setgentext': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { genericRoomSubjectSfx = msg['m'].substring(12).trim() if (genericRoomSubjectSfx != '' && genericRoomSubjectSfx != null) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new generic room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/gentextposn': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { if (message[1] != '0' && message[1] != '1' ) { cb.sendNotice('Invalid parameter value, valid values are "0" for the beginning or "1" for the end of the room title.', u, appNoticeColor); } else { if (message[1] == 0) { if (genericRoomSubjectPosn == 'Beginning') { cb.sendNotice('The General Text position is already set to "Beginning".', u, appNoticeColor); } else { genericRoomSubjectPosn = 'Beginning'; cb.sendNotice('The UltraApp General Text position has been updated to "Beginning".', u, appNoticeColor); changeRoomSubject(); } } else if (message[1] == 1) { if (genericRoomSubjectPosn == 'End') { cb.sendNotice('The General Text position is already set to "End".', u, appNoticeColor); } else { genericRoomSubjectPosn = 'End'; cb.sendNotice('The UltraApp General Text position has been updated to "End".', u, appNoticeColor); changeRoomSubject(); } } } } else { cb.sendNotice('No parameter was specified for the new position, valid values are "0" for the beginning or "1" for the end of the room title.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/ninjatipon': case '/ninjatip': { cmd = 1; if (whichApp == 'ticket' || whichApp == 'peep') { cb.sendNotice('This command cannot be used during a ticket show or peep show.', u, appNoticeColor); } else { if (cbjs.arrayContains(ninjaTipsOn, u)) { cb.sendNotice('You have already enabled Ninja Tipping for yourself during this show. Note you can turn this off with the command /ninjatipoff.', u, appNoticeColor); } else { ninjaTipsOn.push(u); cb.sendNotice('You have enabled Ninja Tipping for yourself during this show, you will now be able to select the --NOGOAL-- tip note so yor tips do not count toward goal. You can switch back to regular tipping using the command /ninjatipoff.', u, appNoticeColor); } } break; } case '/ninjatipoff': { cmd = 1; if (cbjs.arrayContains(ninjaTipsOn, u)) { index = ninjaTipsOn.indexOf(u); ninjaTipsOn.splice(index,1); cb.sendNotice('You have disabled Ninja Tipping for yourself, your tips will now count toward goals.', u, appNoticeColor); } else { cb.sendNotice('You have already disabled (or never enabled) Ninja Tipping for yourself.', u, appNoticeColor); } break; } //********* Progressive Goal Commands case '/restartgoal': { cmd = 1; if (whichApp == 'goals') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { restartGoal(); cb.sendNotice('You have restarted the current goal.', u, appNoticeColor); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/restartgoal" command is for use with the Progressive Goals app, which is not running.', u, appNoticeColor); } break; } case '/setgoal1': case '/setgoal2': case '/setgoal3': case '/setgoal4': case '/setgoal5': case '/setgoal6': case '/setgoal7': case '/setgoal8': case '/setgoal9': case '/setgoal10': case '/setgoal11': case '/setgoal12': case '/setgoal13': case '/setgoal14': case '/setgoal15': case '/setgoal16': case '/setgoal17': case '/setgoal18': case '/setgoal19': case '/setgoal20': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = parseInt(message[0].substring(8)); if (commandVar1 <= 0 || isNaN(commandVar1)) { cb.sendNotice('The first parameter is the new amount for goal ' + goalnum + ' and has be be a number greater than 0. For example, "/setgoal' + goalnum + ' 300 Shirt Off" to set goal ' + goalnum + ' to Shirt off at 300 tokens.', u, appNoticeColor); } else if (cb.settings.progressiveUpDown == 'Count Up To Goal' && goalnum == currentGoal && commandVar1 <= currentGoalTips) { cb.sendNotice('The current goal cannot be updated to an amount less than what has already been tipped for this goal, or would complete the goal. The "/restartgoal" command can be used to clear the current goal tip totals, but this is not recommended.', u, appNoticeColor); } else if (cb.settings.progressiveUpDown == 'Count Down To Zero' && goalnum == currentGoal && commandVar1 <= (currentGoalTotal - currentGoalTips)) { cb.sendNotice('The current goal cannot be updated to an amount less than what has already been tipped for this goal, or would complete the goal. The "/restartgoal" command can be used to clear the current goal tip totals, but this is not recommended.', u, appNoticeColor); } else if (!message[2]) { cb.sendNotice('The second parameter is the description of goal ' + goalnum + ' (can be multiple words). For example, "/setgoal' + goalnum + ' 300 Shirt Off" to set goal ' + goalnum + ' to Shirt off at 300 tokens.', u, appNoticeColor); } else if (goalnum > 1 && !progGoalArray.amt[goalnum-2] >= 1) { cb.sendNotice('You cannot skip goal levels. If setting a goal for level ' + goalnum + ', then level ' + (goalnum-1) + ' must already have a goal defined.', u, appNoticeColor); } else { for (let m6 = 2; m6 < message.length; m6++) { if (m6 == 2) { label = message[m6]; } else { label += ' ' + message[m6]; } } progGoalArray.amt[goalnum-1] = commandVar1; progGoalArray.desc[goalnum-1] = label; if (goalnum == currentGoal) { currentGoalDesc = label; savcurrenttotal = currentGoalTotal; currentGoalTotal = commandVar1; if (cb.settings.progressiveUpDown == 'Count Down To Zero' && savcurrenttotal != currentGoalTotal) { currentGoalTips = currentGoalTotal - (savcurrenttotal - currentGoalTips); } } if (finalGoalMet == true && goalnum == (currentGoal + 1)) { finalGoalMet = false; if (cb.settings.progressiveUpDown == 'Count Up To Goal') { currentGoalTips = 0; } else { currentGoalTips = currentGoalTotal; } nextGoal(); } else { changeRoomSubject(); } cb.drawPanel(); cb.sendNotice('Goal ' + goalnum + ' was added/updated to the amount of ' + commandVar1 + ' and a description of "' + label + '".', u, appNoticeColor); cb.sendNotice(u + ' added/updated Progressive Goal #' + goalnum + ' to the goal amount of ' + commandVar1 + ' and a description of "' + label + '".', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' added/updated Progressive Goal #' + goalnum + ' to the goal amount of ' + commandVar1 + ' and a description of "' + label + '".', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/rmvgoal': { cmd = 1; if (whichApp == 'goals') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = message[1]; if (isNaN(goalnum) || goalnum < 1 || goalnum > 20) { cb.sendNotice('The first parameter is the goal level being removed, and must be a number from 1 to 20 to indicate the goal level number that should be removed. For example, "/rmvgoal 3" will remove the goal and description info for level 3.', u, appNoticeColor); } else if (goalnum > progGoalArray.amt.length) { cb.sendNotice('There is no goal entry at level ' + goalnum + ', there are currently only entries up to goal level ' + progGoalArray.amt.length + '.', u, appNoticeColor); } else { progGoalArray.amt.splice((goalnum-1),1); progGoalArray.desc.splice((goalnum-1),1); currentGoalDesc = progGoalArray.desc[currentGoal-1]; currentGoalTotal = progGoalArray.amt[currentGoal-1]; changeRoomSubject(); cb.drawPanel(); cb.sendNotice('Progressive Goal #' + goalnum + ' was removed from the goal list', u, appNoticeColor); cb.sendNotice(u + ' removed Progressive Goal #' + goalnum + ' from the goal list', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' removed Progressive Goal #' + goalnum + ' from the goal list', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/rmvgoal" command is for use with the Progressive Goals app, and that feature is not running.', u, appNoticeColor); } break; } case '/setgoaltext': { cmd = 1; if (whichApp == 'goals') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalSubjectText = msg['m'].substring(13).trim() if (goalSubjectText != '' && goalSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new Goal Show room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setgoaltxt" command is for use with the Progressive Goals app, and that feature is not running.', u, appNoticeColor); } break; } //********* Auto-Reset Goal Commands case '/setautogoal': { cmd = 1; if (whichApp == 'autoreset') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { goalnum = parseInt(message[1]); if (goalnum <= 0 || isNaN(commandVar1)) { cb.sendNotice('The first parameter is the new Auto-Reset goal amount and must be be a number greater than 0. For example, use "/setautogoal 300 Edging show" to set the recurring goal to Edging Show every 300 tokens, or use "/setautogoal 300" to change only the goal amount to 300, but leave the description the same as it already is.', u, appNoticeColor); } else if (goalnum < currentGoalTips) { cb.sendNotice('The goal amount cannot be updated to an amount less than what has already been tipped for the current cycle.', u, appNoticeColor); } else { if (message[2] != '' && message[2] != null) { for (let m6 = 2; m6 < message.length; m6++) { if (m6 == 2) { label = message[m6]; } else { label += ' ' + message[m6]; } } autoresetGoalAmount = goalnum; autoresetEachGoal = label; updateAutoresetGoal(); cb.sendNotice(u + ' updated the Auto-Reset goal amount to ' + goalnum + ' tokens, and a description of "' + label + '".', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' updated the Auto-Reset goal amount to ' + goalnum + ' tokens, and a description of "' + label + '".', cb.room_slug, appNoticeColor); } else { autoresetGoalAmount = goalnum; updateAutoresetGoal(); cb.sendNotice(u + ' updated the Auto-Reset goal amount to ' + goalnum + ' tokens.', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' updated the Auto-Reset goal amount to ' + goalnum + ' tokens.', cb.room_slug, appNoticeColor); } } } else { cb.sendNotice('No parameter was specified for the goal amount. You can either change the goal amount (/setautogoal [amt]), or change both the amount and goal description (/setautogoal [amt] [description]), but the goal amount is required.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setautogoal" command is for use with the Auto-Reset Goal app, and that feature is not running.', u, appNoticeColor); } break; } case '/setautofinal': { cmd = 1; if (whichApp == 'autoreset') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { goalnum = parseInt(message[1]); if (goalnum <= 0 || isNaN(commandVar1)) { cb.sendNotice('The first parameter is the new Auto-Reset Final Goal Count amount and must be be a number greater than 0. For example, use "/setautofinal 10 Cum Show" to set the Final Goal to a Cum Show after 10 reset goals have been completed, or use "/setautofinal 10" to change only the final goal count to 10, but leave the description the same as it already is.', u, appNoticeColor); } else if (goalnum < currentGoal) { cb.sendNotice('The final goal count cannot be updated to an amount less than the number of the current goal (' + currentGoal + ').', u, appNoticeColor); } else { if (message[2] != '' && message[2] != null) { for (let m7 = 2; m7 < message.length; m7++) { if (m7 == 2) { label = message[m7]; } else { label += ' ' + message[m7]; } } autoresetEndAfter = goalnum; autoresetFinalGoal = label; updateAutoresetGoal(); cb.sendNotice(u + ' updated the Auto-Reset total goal count for End of Show to ' + goalnum + ' goals, and a Show End description of "' + label + '".', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' updated the Auto-Reset total goal count for End of Show to ' + goalnum + ' goals, and a Show End description of "' + label + '".', cb.room_slug, appNoticeColor); } else { autoresetEndAfter = goalnum; updateAutoresetGoal(); cb.sendNotice(u + ' updated the Auto-Reset total goal count for End of Show to ' + goalnum + ' goals.', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' updated the Auto-Reset total goal count for End of Show to ' + goalnum + ' goals.', cb.room_slug, appNoticeColor); } } } else { cb.sendNotice('No parameter was specified for the goal amount. You can either change the goal amount (/setautofinal [amt]), or change both the amount and goal description (/setautofinal [amt] [description]), but the goal amount is required.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setautofinal" command is for use with the Auto-Reset Goal app, and that feature is not running.', u, appNoticeColor); } break; } case '/setautotext': { cmd = 1; if (whichApp == 'autoreset') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { autoresetSubjectSfx = msg['m'].substring(13).trim() if (autoresetSubjectSfx) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new Auto-Reset Goal room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setautotext" command is for use with the Auto-Reset Goal app, and that feature is not running.', u, appNoticeColor); } break; } //********* Goal Counter Commands case '/setcount1': case '/setcount2': case '/setcount3': case '/setcount4': case '/setcount5': case '/setcount6': case '/setcount7': case '/setcount8': case '/setcount9': case '/setcount10': case '/setcount11': case '/setcount12': case '/setcount13': case '/setcount14': case '/setcount15': { cmd = 1; if (whichApp == 'goalcount') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = parseInt(message[0].substring(9)); if (commandVar1 <= 0 || isNaN(commandVar1)) { cb.sendNotice('The first parameter is the new goal count for goal level ' + goalnum + ' and has be be a number greater than 0. For example, "/setcount' + goalnum + ' 20 Shirt Off" to set goal level ' + goalnum + ' as Shirt off at 20 goals.', u, appNoticeColor); } else if (goalnum <= currentGoal) { cb.sendNotice('You cannot update the attributes of the current goal level or a goal level that has already been passed in the goal sequence.', u, appNoticeColor); } else if (!message[2]) { cb.sendNotice('The second parameter is the description of prize at goal level ' + goalnum + ' (can be multiple words). For example, "/setcount' + goalnum + ' 20 Shirt Off" to set goal level ' + goalnum + ' as Shirt off at 20 goals.', u, appNoticeColor); } else if (goalnum > 1 && !goalCounterArray.amt[goalnum-2] >= 1) { cb.sendNotice('You cannot skip goal levels. If setting a value for level ' + goalnum + ', then level ' + (goalnum-1) + ' must already have a goal value defined.', u, appNoticeColor); } else if (goalnum > 1 && commandVar1 <= goalCounterArray.amt[goalnum-2]) { cb.sendNotice('You cannot update the value for a goal level to be less than or equal to the value for the previous level (level ' + (goalnum-1) + ' has a value of ' + goalCounterArray.amt[goalnum-2] + ', so you must use a value greater than ' + goalCounterArray.amt[goalnum-2] + ' for level ' + goalnum + ').', u, appNoticeColor); } else if (goalnum < 15 && commandVar1 >= goalCounterArray.amt[goalnum] && goalCounterArray.amt[goalnum] > 0) { cb.sendNotice('You cannot update the value for a goal level to be greater than or equal to the value for the next level (level ' + (goalnum+1) + ' has a value of ' + goalCounterArray.amt[goalnum] + ', so you must use a value less than ' + goalCounterArray.amt[goalnum] + ' for level ' + goalnum + ').', u, appNoticeColor); } else { for (let i = 2; i < message.length; i++) { if (i === 2) { label = message[i]; } else { label += " " + message[i]; } } goalCounterArray.amt[goalnum-1] = commandVar1; goalCounterArray.desc[goalnum-1] = label; updateGoalCount(goalnum); cb.sendNotice('Goal Counter Level ' + goalnum + ' was updated to the goal count of ' + commandVar1 + ' and a description of "' + label + '".', u, appNoticeColor); cb.sendNotice(u + ' added/updated Goal Counter Level #' + goalnum + ' to the goal count of ' + commandVar1 + ' and a description of "' + label + '".', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' added/updated Goal Counter Level #' + goalnum + ' to the goal count of ' + commandVar1 + ' and a description of "' + label + '".', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setcountX" command is for use with the Tip Goal Counter App, and that feature is not running.', u, appNoticeColor); } break; } case '/rmvcount': { cmd = 1; if (whichApp == 'goalcount') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = message[1]; if (isNaN(goalnum) || goalnum < 1 || goalnum > 15) { cb.sendNotice('The first parameter is the goal level being removed, and must be a number from 1 to 15 to indicate the goal level number that should be removed. For example, "/rmvcount 3" will remove the goal and description info for level 3.', u, appNoticeColor); } else if (goalnum > goalCounterArray.amt.length) { cb.sendNotice('There is no goal entry at level ' + goalnum + ', there are currently only entries up to goal level ' + goalCounterArray.amt.length + '.', u, appNoticeColor); } else { goalCounterArray.amt.splice((goalnum-1),1); goalCounterArray.desc.splice((goalnum-1),1); updateGoalCount(goalnum); cb.sendNotice('Goal Counter Level #' + goalnum + ' was removed from the goal list', u, appNoticeColor); cb.sendNotice(u + ' removed Goal Counter Level #' + goalnum + ' from the goal list', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' removed Goal Counter Level #' + goalnum + ' from the goal list', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/rmvcount" command is for use with the Tip Goal Counter App, and that feature is not running.', u, appNoticeColor); } break; } case '/chgcountgoal': { cmd = 1; if (whichApp == 'goalcount') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (commandVar1 <= 0 || isNaN(commandVar1)) { cb.sendNotice('The parameter is the new Tip Goal Counter individual goal amount and has be be a number greater than 0. For example, use "/chgcountgoal 99" to set each goal to 99 tokens.', u, appNoticeColor); } else if (commandVar1 <= currentGoalTips){ cb.sendNotice('Cannot change the goal amount to be less then or equal to the tip count for the current goal (' + currentGoalTips + ').', u, appNoticeColor); } else { changeCountGoal(commandVar1); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/chgcountgoal" command is for use with the Tip Goal Counter App, and that feature is not running.', u, appNoticeColor); } break; } case '/setcounttext': { cmd = 1; if (whichApp == 'goalcount') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { counterSubjectText = msg['m'].substring(14).trim() if (counterSubjectText != '' && counterSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new Goal Counter room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setcounttxt" command is for use with the Tip Goal Counter App, and that feature is not running.', u, appNoticeColor); } break; } //********* Tip Sequence Commands case '/setseq1': case '/setseq2': case '/setseq3': case '/setseq4': case '/setseq5': case '/setseq6': case '/setseq7': case '/setseq8': case '/setseq9': case '/setseq10': { cmd = 1; if (whichApp == 'sequence') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = parseInt(message[0].substring(7)); if (commandVar1 <= 0 || isNaN(commandVar1)) { cb.sendNotice('The first parameter is the new tip sequence for goal ' + goalnum + ' and has be be a number greater than 0. For example, "/setseq' + goalnum + ' 20 Shirt Off" to set goal ' + goalnum + ' as Shirt off at tip sequence 20.', u, appNoticeColor); } else if (goalnum <= currentGoal) { cb.sendNotice('You cannot update the attributes of the current goal or a goal that has already been passed in the tip sequence.', u, appNoticeColor); } else if (!message[2]) { cb.sendNotice('The second parameter is the description of tip sequence goal ' + goalnum + ' (can be multiple words). For example, "/setseq' + goalnum + ' 20 Shirt Off" to set goal ' + goalnum + ' as Shirt off at tip sequence 20.', u, appNoticeColor); } else if (tipSequenceDirection == 'up' && commandVar1 > endSequence || tipSequenceDirection == 'down' && commandVar1 < endSequence ) { cb.sendNotice('You cannot set a goal level sequence target outside of the configured tip sequence range (ending sequence is at ' + endSequence + ').', u, appNoticeColor); } else if (tipSequenceDirection == 'up' && commandVar1 <= nextSequence || tipSequenceDirection == 'down' && commandVar1 >= nextSequence) { cb.sendNotice('You cannot set a goal level sequence target to a sequence value that has already been passed.', u, appNoticeColor); } else if (goalnum > 1 && !sequenceArray.amt[goalnum-2] >= 1) { cb.sendNotice('You cannot skip goal levels. If setting a value for level ' + goalnum + ', then level ' + (goalnum-1) + ' must already have a sequence value defined (and be greater than or less than based on sequence direction).', u, appNoticeColor); } else if (goalnum > 1 && tipSequenceDirection == 'up' && commandVar1 <= sequenceArray.amt[goalnum-2]) { cb.sendNotice('For ascending sequence, you cannot update the sequence for a goal level to be less than or equal to the sequence for the previous level (level ' + (goalnum-1) + ' has a sequence of ' + sequenceArray.amt[goalnum-2] + ', so you must use a sequence greater than ' + sequenceArray.amt[goalnum-2] + ' for level ' + goalnum + ').', u, appNoticeColor); } else if (goalnum < 10 && tipSequenceDirection == 'up' && commandVar1 >= sequenceArray.amt[goalnum] && sequenceArray.amt[goalnum] > 0) { cb.sendNotice('For ascending sequence, you cannot update the sequence for a goal level to be greater than or equal to the sequence for the next level (level ' + (goalnum+1) + ' has a sequence of ' + sequenceArray.amt[goalnum] + ', so you must use a sequence less than ' + sequenceArray.amt[goalnum] + ' for level ' + goalnum + ').', u, appNoticeColor); } else if (goalnum > 1 && tipSequenceDirection == 'down' && commandVar1 >= sequenceArray.amt[goalnum-2]) { cb.sendNotice('For descending sequence, you cannot update the sequence for a goal level to be greater than or equal to the sequence for the previous level (level ' + (goalnum-1) + ' has a sequence of ' + sequenceArray.amt[goalnum-2] + ', so you must use a sequence less than ' + sequenceArray.amt[goalnum-2] + ' for level ' + goalnum + ').', u, appNoticeColor); } else if (goalnum < 10 && tipSequenceDirection == 'down' && commandVar1 <= sequenceArray.amt[goalnum]) { cb.sendNotice('For descending sequence, you cannot update the sequence for a goal level to be less than or equal to the sequence for the next level (level ' + (goalnum+1) + ' has a sequence of ' + sequenceArray.amt[goalnum] + ', so you must use a sequence greater than ' + sequenceArray.amt[goalnum] + ' for level ' + goalnum + ').', u, appNoticeColor); } else { for (let m1 = 2; m1 < message.length; m1++) { if (m1 == 2) { label = message[m1]; } else { label += " " + message[m1]; } } sequenceArray.amt[goalnum-1] = commandVar1; sequenceArray.desc[goalnum-1] = label; updateSequenceGoal(goalnum); cb.sendNotice('Sequence Goal #' + goalnum + ' was added/updated to occur at sequence ' + commandVar1 + ' and with a description of "' + label + '".', u, appNoticeColor); cb.sendNotice(u + ' added/updated Sequence Goal #' + goalnum + ' to occur at sequence ' + commandVar1 + ' and with a description of "' + label + '".', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' added/updated Sequence Goal #' + goalnum + ' to occur at sequence ' + commandVar1 + ' and with a description of "' + label + '".', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setseqX" command is for use with the Tip Sequence app, and that feature is not running.', u, appNoticeColor); } break; } case '/rmvseq': { cmd = 1; if (whichApp == 'sequence') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = message[1]; if (isNaN(goalnum) || goalnum < 1 || goalnum > 10) { cb.sendNotice('The first parameter is the sequence goal level being removed, and must be a number from 1 to 10 to indicate the goal level number that should be removed. For example, "/rmvseq 3" will remove the goal and description info for sequence goal level 3.', u, appNoticeColor); } else if (goalnum > sequenceArray.amt.length) { cb.sendNotice('There is no goal entry at level ' + goalnum + ', there are currently only entries up to goal level ' + sequenceArray.amt.length + '.', u, appNoticeColor); } else { sequenceArray.amt.splice((goalnum-1),1); sequenceArray.desc.splice((goalnum-1),1); updateSequenceGoal(goalnum); cb.sendNotice('Sequence Goal #' + goalnum + ' was removed from the goal list', u, appNoticeColor); cb.sendNotice(u + ' removed Sequence Goal #' + goalnum + ' from the goal list', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' removed Sequence Goal #' + goalnum + ' from the goal list', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/rmvseq" command is for use with the Tip Sequence app, and that feature is not running.', u, appNoticeColor); } break; } case '/usechatmsg': { cmd = 1; if (whichApp == 'sequence') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (!message[1] || (message[1] != 'on' && message[1] != 'off')) { cb.sendNotice('The "/usechatmsg" command requires a parameter of either "on" or "off".', u, appNoticeColor); } else { setChatMsgToggle(message[1], u, 'updt') } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.\nType "/uahelp commands" to see a full list of the available commands.', u, appNoticeColor); } } else { cb.sendNotice('The "/usechatmsg" command is for use with the Tip Sequence app, and that feature is not running.', u, appNoticeColor); } break; } case '/chgendseq': { cmd = 1; if (whichApp == 'sequence') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { lastgoalindex = sequenceArray.amt.length - 1; if (commandVar1 <= 0 || isNaN(commandVar1)) { cb.sendNotice('The parameter is the new Tip Sequence end goal and has be be a number greater than 0. For example, use "/chgendseq 50" to set the new sequence end goal to 50.', u, appNoticeColor); } else if (tipSequenceDirection == 'up' && commandVar1 <= sequenceArray.amt[lastgoalindex]){ cb.sendNotice('For ascending sequence, cannot change the end sequence to be less then or equal to the sequence for the last tip sequence goal (' + sequenceArray.amt[lastgoalindex] + ').', u, appNoticeColor); } else if (tipSequenceDirection == 'down' && commandVar1 >= sequenceArray.amt[lastgoalindex]){ cb.sendNotice('For descending sequence, cannot change the end sequence to be greater then or equal to the sequence for the last tip sequence goal (' + sequenceArray.amt[lastgoalindex] + ').', u, appNoticeColor); } else { changeEndSequence(commandVar1); cb.sendNotice('The ending sequence number has been updated to ' + commandVar1 + '.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.\nType "/uahelp commands" to see a full list of the available commands.',u,appNoticeColor); } } else { cb.sendNotice('The "/chgendseq" command is for use with the Tip Sequence App, and that feature is not running.', u, appNoticeColor); } break; } case '/setseqtext': { cmd = 1; if (whichApp == 'sequence') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { sequenceSubjectText = msg['m'].substring(12).trim() if (sequenceSubjectText != '' && sequenceSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new Sequence Goal room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setseqtext" command is for use with the Tip Sequence App, and that feature is not running.', u, appNoticeColor); } break; } case '/usegrouptips': { cmd = 1; if (whichApp == 'sequence') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (!message[1] || (message[1] != 'on' && message[1] != 'off')) { cb.sendNotice('The "/usegrouptips" command requires a parameter of either "on" or "off".', u, appNoticeColor); } else { setGroupTipToggle(message[1], u, 'updt') } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.\nType "/uahelp commands" to see a full list of the available commands.', u, appNoticeColor); } } else { cb.sendNotice('The "/usegrouptips" command is for use with the Tip Sequence app, and that feature is not running.', u, appNoticeColor); } break; } //********* Tip Jar Commands case '/slower': { cmd = 1; if (whichApp == 'tipjar') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { ratechange = parseInt(message[1]); if(isNaN(ratechange)) { if (drainLevel >= 10) { cb.sendNotice('The Tip Jar Drain rate is already at the slowest setting.', u, appNoticeColor); } else { setDrainRate(drainLevel+1); cb.sendNotice('You have slowed the Drain Rate by 1 level.', u, appNoticeColor); } } else { if ((drainLevel+ratechange) > 10) { cb.sendNotice('Slowing the Drain Rate by ' + ratechange + ' levels would exceed the slowest setting, defaulting to the slowest setting of 1 token every 10 seconds', u, appNoticeColor); setDrainRate(10); } else { setDrainRate(drainLevel+ratechange); cb.sendNotice('You have slowed the Drain Rate by ' + ratechange + ' levels.', u, appNoticeColor); } } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/slower" command is for use with the Tip Jar, and the Tip Jar feature is not running.', u, appNoticeColor); } break; } case '/faster': { cmd = 1; if (whichApp === 'tipjar') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { ratechange = parseInt(message[1]); if(isNaN(ratechange)) { if (drainLevel <= 1) { cb.sendNotice('The Tip Jar Drain rate is already at the fastest setting.', u, appNoticeColor); } else { setDrainRate(drainLevel-1); cb.sendNotice('You have increased the Drain Rate by 1 level.', u, appNoticeColor); } } else { if ((drainLevel-ratechange) < 1) { cb.sendNotice('Speeding up the Drain Rate by ' + ratechange + ' levels would exceed the fastest setting, defaulting to the fastest setting of 5 tokens per second.', u, appNoticeColor); setDrainRate(1); } else { setDrainRate(drainLevel-ratechange); cb.sendNotice('You have increased the Drain Rate by ' + ratechange + ' levels.', u, appNoticeColor); } } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/faster" command is for use with the Tip Jar, and the Tip Jar feature is not running.', u, appNoticeColor); } break; } case '/setjar1': case '/setjar2': case '/setjar3': case '/setjar4': case '/setjar5': case '/setjar6': case '/setjar7': case '/setjar8': case '/setjar9': case '/setjar10': { cmd = 1; if (whichApp == 'tipjar') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = parseInt(message[0].substring(7)); if (isNaN(commandVar1) || commandVar1 < 1 || commandVar1 > 100000) { cb.sendNotice('The first parameter is the amount for tip jar goal #' + goalnum + ' and has be be a number from 1 to 100,000. For example, "/setjar' + goalnum + ' 300 0 Shirt Off" to set goal ' + goalnum + ' to be for "Shirt off" at 300 tokens, and only do the goal once with no recycle.', u, appNoticeColor); } else if (isNaN(commandVar2) || commandVar2 < 0 || commandVar2 > 99) { cb.sendNotice('The second parameter is the recycle count for tip jar goal #' + goalnum + ' and has be be a number from 0 to 99. Note since it is a REcycle count, the value should be "0" to use a goal once (default), "1" to use a goal twice, etc. For example, "/setjar' + goalnum + ' 300 0 Shirt Off" to set goal #' + goalnum + ' to be for "Shirt off" at 300 tokens, and only do the goal once with no recycle.', u, appNoticeColor); } else if (goalnum == currentGoal && commandVar1 < currentGoalTips) { cb.sendNotice('The current tip jar goal cannot be updated to an amount less than what has already been tipped for this goal. The "/restartgoal" command can be used to clear the current goal tip jar goal totals, but this is not recommended.', u, appNoticeColor); } else if (!message[3]) { cb.sendNotice('The third parameter is the description of tip jar goal ' + goalnum + ' (can be multiple words). For example, "/setjar' + goalnum + ' 300 0 give a massage" to set goal ' + goalnum + ' to give a massage at 300 tokens, and only do the goal once with no recycle.', u, appNoticeColor); } else if (goalnum > 1 && !tipjarGoalArray.amt[goalnum-2] >= 1) { cb.sendNotice('You cannot skip goal levels. If setting a value for level ' + goalnum + ', then level ' + (goalnum-1) + ' must already have a goal value defined.', u, appNoticeColor); } else { for (let m3 = 3; m3 < message.length; m3++) { if (m3 == 3) { label = message[m3]; } else { label += " " + message[m3]; } } tipjarGoalArray.amt[goalnum-1] = commandVar1; tipjarGoalArray.recyc[goalnum-1] = commandVar2; tipjarGoalArray.desc[goalnum-1] = label; updateTipjarGoal(goalnum); cb.sendNotice('Tip Jar Goal #' + goalnum + ' was updated to the amount of ' + commandVar1 + ', a description of "' + label + '", and a recycle count of ' + commandVar2 + '.', u, appNoticeColor); cb.sendNotice(u + ' added/updated Tip Jar Goal #' + goalnum + ' to the goal count of ' + commandVar1 + ', a description of "' + label + '", and a recycle count of ' + commandVar2 + '.', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' added/updated Tip Jar Goal #' + goalnum + ' to the goal count of ' + commandVar1 + ', a description of "' + label + '", and a recycle count of ' + commandVar2 + '.', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setjarX" command is for use with the Tip Jar app, and that feature is not running.', u, appNoticeColor); } break; } case '/rmvjar': { cmd = 1; if (whichApp == 'tipjar') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = message[1]; if (isNaN(goalnum) || goalnum < 1 || goalnum > 10) { cb.sendNotice('The first parameter is the Tip Jar goal level being removed, and must be a number from 1 to 10 to indicate the goal level number that should be removed. For example, "/rmvjar 3" will remove the goal and description info for sequence goal level 3.', u, appNoticeColor); } else if (goalnum > tipjarGoalArray.amt.length) { cb.sendNotice('There is no goal entry at level ' + goalnum + ', there are currently only entries up to goal level ' + tipjarGoalArray.amt.length + '.', u, appNoticeColor); } else { tipjarGoalArray.amt.splice((goalnum-1),1); tipjarGoalArray.desc.splice((goalnum-1),1); tipjarGoalArray.recyc.splice((goalnum-1),1); updateTipjarGoal(goalnum); cb.sendNotice('Tip Jar Goal Level #' + goalnum + ' was removed from the goal list', u, appNoticeColor); cb.sendNotice(u + ' removed Tip Jar Goal Level #' + goalnum + ' from the goal list', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' removed Tip Jar Goal Level #' + goalnum + ' from the goal list', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/rmvjar" command is for use with the Tip Jar app, and that feature is not running.', u, appNoticeColor); } break; } case '/setjartext': { cmd = 1; if (whichApp == 'tipjar') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { tipjarSubjectText = msg['m'].substring(12).trim() if (tipjarSubjectText != '' && tipjarSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new Tip Jar room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setjartxt" command is for use with the Tip Jar app, and that feature is not running.', u, appNoticeColor); } break; } case '/pause': { cmd = 1; if (whichApp == 'tipjar') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (tipJarRunning) { if (tipJarCurrentTokens > 0) { if (!tipJarPaused) { pauseTipJar(); cb.sendNotice('UltraApp: You have paused the tip jar. You can resume the draining of the jar with the command "/resume".', u, appNoticeColor); if (u != BC) { cb.sendNotice('UltraApp: ' + u + ' has paused the tip jar. The draining of the jar can be resumed with the command "/resume".', BC, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Tip Jar is already paused.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Tip Jar is empty and cannot be paused.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Tip Jar is not draining, so it cannot be paused.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The "/pause" command is for use with the Tip Jar, and the Tip Jar feature is not running.', u, appNoticeColor); } break; } case '/resume': { cmd = 1; if (whichApp == 'tipjar') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (tipJarPaused) { resumeTipJar(); cb.sendNotice('UltraApp: You have resumed the tip jar.', u, appNoticeColor); if (u != BC) { cb.sendNotice('UltraApp: ' + u + ' has resumed the tip jar.', BC, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Tip Jar is not paused.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The "/resume" command is for use with the Tip Jar, and the Tip Jar feature is not running.', u, appNoticeColor); } break; } //********* Goal Race Commands case '/restartrace': { cmd = 1; if (whichApp == 'goalrace') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { restartRace(); cb.sendNotice('You have restarted the goal race with the same goal choices. You can change the goal choices with the command "/setrace1" or "/setrace2".', u, appNoticeColor); } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/restartrace" command is for use with the Goal Race app, which is not running.', u, appNoticeColor); } break; } case '/setrace1': case '/setrace2': { cmd = 1; if (whichApp == 'goalrace') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { racenum = parseInt(message[0].substring(8)); if (commandVar1 <= 0 || isNaN(commandVar1)) { cb.sendNotice('The first parameter is the new amount for goal ' + racenum + ' and has be be a number greater than 0. For example, "/setrace' + racenum + ' 300 Shirt Off" to set goal ' + racenum + ' to Shirt off at 300 tokens.', u, appNoticeColor); } else if (racenum == 1 && commandVar1 < currentGoalRace1Tips) { cb.sendNotice('The goal 1 amount cannot be updated to a value less than what has already been tipped for this goal. The "/restartrace" command can be used to clear the current race totals, but this is not recommended.', u, appNoticeColor); } else if (racenum == 2 && commandVar1 < currentGoalRace2Tips) { cb.sendNotice('The goal 2 amount cannot be updated to a value less than what has already been tipped for this goal. The "/restartrace" command can be used to clear the current race totals, but this is not recommended.', u, appNoticeColor); } else if (!message[2]) { cb.sendNotice('The second parameter is the description of goal ' + racenum + ' (can be multiple words). For example, "/setrace' + racenum + ' 300 Shirt Off" to set goal ' + racenum + ' to Shirt off at 300 tokens.', u, appNoticeColor); } else { for (let m4 = 2; m4 < message.length; m4++) { if (m4 == 2) { label = message[m4]; } else { label += " " + message[m4]; } } if (racenum == 1) { goalraceAmount1 = commandVar1; goalraceDesc1 = label; } else if (racenum == 2) { goalraceAmount2 = commandVar1; goalraceDesc2 = label; } changeRoomSubject(); cb.drawPanel(); cb.sendNotice('Goal ' + racenum + ' was added/updated to the amount of ' + commandVar1 + ' and a description of "' + label + '".', u, appNoticeColor); cb.sendNotice(u + ' added/updated Goal #' + racenum + ' to the goal amount of ' + commandVar1 + ' and a description of "' + label + '".', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' added/updated Goal #' + racenum + ' to the goal amount of ' + commandVar1 + ' and a description of "' + label + '".', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setraceX" command is for use with the Goal Race app, and that feature is not running.', u, appNoticeColor); } break; } case '/addrace1': case '/addrace2': { cmd = 1; if (whichApp == 'goalrace') { racenum = parseInt(message[0].substring(8)); if (!cbjs.arrayContains(raceUnclaimedVotes.name, u)) { cb.sendNotice('Sorry, you do not have any unclaimed tips.', u, appNoticeColor); } else { index = raceUnclaimedVotes.name.indexOf(u); unclaimedTip = raceUnclaimedVotes.amount[index]; if (unclaimedTip > 0) { if (racenum == 1) { tipNote = goalraceDesc1; } else if (racenum == 2) { tipNote = goalraceDesc2; } else { tipNote = ''; } recordTip(unclaimedTip,'bc',tipNote,isFanMsg,isExtFanMsg,isExtFanMsg2,isVIPMsg); raceUnclaimedVotes.amount[index] = 0; cb.sendNotice(u + ' has claimed previous tips and voted ' + unclaimedTip + ' tokens to goal #' + racenum + '.', '', goalraceBgColor, goalraceTxtColor, 'bold'); cb.drawPanel(); } else { cb.sendNotice('Sorry, you do not have any unclaimed tips.', u, appNoticeColor); } } } else { cb.sendNotice('The "/addrace" commands are for use with the Goal Race app, and that feature is not running.', u, appNoticeColor); } break; } case '/tipnoteon': { cmd = 1; if (whichApp == 'goalrace') { if (cbjs.arrayContains(raceTipNotesOn, u)) { cb.sendNotice('Sorry, you have already enabled Tip Notes for yourself during the Goal Race.', u, appNoticeColor); } else { raceTipNotesOn.push(u); cb.sendNotice('You have enabled Tip Notes for yourself during the Goal Race, you will now be able to enter tip notes rather than vote for the goals. You can switch back to voting for goals using the command /tipnoteoff.', u, appNoticeColor); } } else { cb.sendNotice('The "/tipnote" commands are for use with the Goal Race app, and that feature is not running.', u, appNoticeColor); } break; } case '/tipnoteoff': { cmd = 1; if (whichApp == 'goalrace') { if (cbjs.arrayContains(raceTipNotesOn, u)) { index = raceTipNotesOn.indexOf(u); raceTipNotesOn.splice(index,1); cb.sendNotice('You have disabled Tip Notes for yourself during the Goal Race, you will now be able to vote for the goals. You can switch back to entering tip notes using the command /tipnoteon.', u, appNoticeColor); } else { cb.sendNotice('Sorry, you have already disabled (or never enabled) Tip Notes for yourself during the Goal Race.', u, appNoticeColor); } } else { cb.sendNotice('The "/tipnote" commands are for use with the Goal Race app, and that feature is not running.', u, appNoticeColor); } break; } case '/setracetext': { cmd = 1; if (whichApp == 'goalrace') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalraceSubjectText = msg['m'].substring(13).trim() if (goalraceSubjectText != '' && goalraceSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new Goal Race room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setracetxt" command is for use with the Goal Race app, and that feature is not running.', u, appNoticeColor); } break; } case '/setracepaneltext': { cmd = 1; if (whichApp == 'goalrace') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalracePanelText = msg['m'].substring(18).trim() if (goalracePanelText != '' && goalracePanelText != null) { cb.drawPanel(); } else { cb.sendNotice('No value was specified for the new panel text.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The "/setracepaneltext" command is for use with the Goal Race app, and that feature is not running.', u, appNoticeColor); } break; } //********* Ultra App Hidden Ticket Show Commands case '/tickets': { cmd = 1; if (whichApp == 'ticket') { if (ticketHolderList.length > 0) { if (message[1] == 'a' || message[1] == 'A' || message[1] == 'alpha') { var sortedticketlist = ticketHolderList.slice(); sortedticketlist.sort(); cb.sendNotice('UltraApp: Alphabetic listing of users currently with access to the Hidden Ticket Show (' + countTickets + ' ticket holders) :\n' + cbjs.arrayJoin(sortedticketlist, ', ') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('UltraApp: Users currently with access to the Hidden Ticket Show, in order of when added (' + countTickets + ' ticket holders). Use the "alpha" parameter for a sorted list : \n' + cbjs.arrayJoin(ticketHolderList, ', ') + '\nEnd of List', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: No ticket holders yet.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Ticket Show feature has not yet been started.', u, appNoticeColor); if (enablePresales == true) { cb.sendNotice('You can use the command "/presalelist" to see the list of viewers who have bought a pre-sale ticket', u, appNoticeColor); } } break; } case '/previewers': { cmd = 1; if (whichApp == 'ticket') { if (freePreviewLength > 0) { if (ticketShowPreViewerList.length > 0) { if (message[1] == 'a' || message[1] == 'A' || message[1] == 'alpha') { var sortedpvlist = ticketShowPreViewerList.slice(); sortedpvlist.sort(); cb.sendNotice('UltraApp: Alphabetic listing of users currently seeing a free preview of the Ticket Show (' + sortedpvlist.length + ' previewers) : \n' + cbjs.arrayJoin(sortedpvlist, ', ') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('UltraApp: Users currently seeing a free preview of the Ticket Show, in order of when added (' + ticketShowPreViewerList.length + ' previewers). Use the "alpha" parameter for a sorted list : \n' + cbjs.arrayJoin(ticketShowPreViewerList, ', ') + '\nEnd of List', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: No free preview viewers at this time.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Free Preview is disabled.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Ticket Show feature has not yet been started.', u, appNoticeColor); } break; } case '/backup': { cmd = 1; if (whichApp == 'ticket' || presalesToggle == 1) { if (ticketHolderList.length > 0) { cb.sendNotice('Copy and paste the below command into the chat to backup the current presale or ticket show list to the Fembot:\n/backupfb ' + cbjs.arrayJoin(ticketHolderList, ', ')); } else { cb.sendNotice('No ticket buyers yet.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp is not selling tickets for a show.', u, appNoticeColor); } break; } case '/prepticket': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { numtimer = parseInt(message[1]) if (isNaN(numtimer)) { cb.sendNotice('The value entered for the show countdown timer is not numeric, please try again.', u, appNoticeColor); break; } else if (numtimer < 1 || numtimer > 120) { cb.sendNotice('The value entered for the show countdown timer is outside allowable values from 1 to 120 min, please try again.', u, appNoticeColor); } else { prepTicketShow(u,numtimer); cb.sendNotice('UltraApp Ticket show prep has been completed.', u, appNoticeColor); } } else { prepTicketShow(u,0); cb.sendNotice('UltraApp Ticket show prep has been completed.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/usegift': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { if (message[1].toLowerCase() != 'on' && message[1].toLowerCase() != 'off') { cb.sendNotice('The value ' + message[1] + ' is not a valid option for the "/usegift" command, please try again, valid values are "on" or "off".', u, appNoticeColor); } else if (cb.settings.ticketShowFanAppreciation == 'Yes' && message[1].toLowerCase() == 'on') { cb.sendNotice('Gifting of Tickets is not enabled for a Fan Appreciation show.', u, appNoticeColor); } else { if (message[1].toLowerCase() == 'on') { if (ticketShowAllowGift == 'Yes') { cb.sendNotice('The Gifting of Tickets is already enabled.', u, appNoticeColor); } else { ticketShowAllowGift = 'Yes'; cb.sendNotice('You have enabled the Gifting of Tickets.', u, appNoticeColor); if (u != BC) { cb.sendNotice(u + 'has enabled the Gifting of Tickets.', BC, appNoticeColor); } } } else if (message[1].toLowerCase() == 'off') { if (ticketShowAllowGift == 'No') { cb.sendNotice('The Gifting of Tickets is already disabled.', u, appNoticeColor); } else { ticketShowAllowGift = 'No'; cb.sendNotice('You have disabled the Gifting of Tickets.', u, appNoticeColor); if (u != BC) { cb.sendNotice(u + 'has disabled the Gifting of Tickets.', BC, appNoticeColor); } } } } } else { cb.sendNotice('No parameter was specified for the "/usegift" command, valid values are "on" or "off".', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/useot': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { if (message[1].toLowerCase() != 'on' && message[1].toLowerCase() != 'off') { cb.sendNotice('The value ' + message[1] + ' is not a valid option for the "/useot" command, please try again, valid values are "on" or "off".', u, appNoticeColor); } else if (cb.settings.ticketShowFanAppreciation == 'Yes' && message[1].toLowerCase() == 'on') { cb.sendNotice('Outstanding Tickets are not enabled for a Fan Appreciation show.', u, appNoticeColor); } else { setTicketShowOtToggle(message[1].toLowerCase(),u); } } else { cb.sendNotice('No parameter was specified for the "/usegift" command, valid values are "on" or "off".', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/otlist': { cmd = 1; cb.sendNotice('Users currently on the Outstanding Ticket List: ' + outstandingTicketArray.length, u, appNoticeColor); cb.sendNotice((outstandingTicketArray.length > 0 == true ? cbjs.arrayJoin(outstandingTicketArray, ',') : 'No outstanding ticket holders.'), u); cb.sendNotice('End of List', u, appNoticeColor); break; } case '/otchanges': { cmd = 1; if (isMod || isBC) { if (otChangesArray.name.length > 0) { outString = ''; for (var oti = 0; oti < otChangesArray.name.length; oti++) { if (otChangesArray.name[oti] == null) { break } else { outString += (oti > 0 ? ',' : '') + otChangesArray.name[oti] + '(' + otChangesArray.type[oti] + ')'; } } cb.sendNotice('Listing of Changes to the Outstanding Ticket List : \n' + outString + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('No entries have been added to the Outstanding Ticket Change list.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/ctprice': case '/chgticketprice': case '/ticketprice': { cmd = 1; if (isBC || (isMod && cb.settings.ticketShowModsChgPrice === 'Yes')) { if (message[1]) { numprice = parseInt(message[1]) if (isNaN(numprice)) { cb.sendNotice('UltraApp: The value entered for the ticket price is not numeric, please try again.', u, appNoticeColor); break; } else if (numprice < 1 || numprice > 99999) { cb.sendNotice('UltraApp: The value entered for the ticket price is outside allowable values from 1 to 99999, please try again.', u, appNoticeColor); } else { ticketannounce = 'no'; if (whichApp == 'ticket') { cb.sendNotice('UltraApp: The Ticket Show price has been updated to ' + numprice + ' tokens. You can view the ticket list with the command "/tickets".', u, appNoticeColor); ticketannounce = 'yes'; } else { cb.sendNotice('UltraApp: The Ticket Show price has been updated to ' + numprice + ' tokens, however the UltraApp ticket feature is not yet active.', u, appNoticeColor); } setTicketPrice(numprice,ticketannounce); } } else { cb.sendNotice('UltraApp: No parameter was specified for the new ticket price.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/showstartprice': { cmd = 1; if (isBC || (isMod && cb.settings.ticketShowModsChgPrice === 'Yes')) { if (whichApp == 'ticket' && showStage != 'ticketsales') { cb.sendNotice('UltraApp: The show start ticket price can only be updated while another app feature is running or prior to show start.', u, appNoticeColor); } else { if (message[1]) { numnewprice = parseInt(message[1]) if (isNaN(numnewprice)) { cb.sendNotice('UltraApp: The value entered for the ticket show start price is not numeric, please try again.', u, appNoticeColor); break; } else if (numnewprice < 1 || numnewprice > 99999) { cb.sendNotice('UltraApp: The value entered for the ticket show start price is outside allowable values from 1 to 99999, please try again.', u, appNoticeColor); } else if (numnewprice <= ticketPrice) { cb.sendNotice('UltraApp: The value entered for the ticket show start price is less than or equal to the current ticket price; it must be greater than the ticket price, please try again.', u, appNoticeColor); } else { ticketShowStartPrice = numnewprice; cb.sendNotice('UltraApp: The Ticket Show Start price has been updated to ' + numnewprice + ' tokens. The ticket price will be updated to this amount when the show starts.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: No parameter was specified for the new ticket show start price.', u, appNoticeColor); } } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/previewlength': { cmd = 1; if (whichApp == 'ticket' && showStage != 'ticketsales') { cb.sendNotice('The preview length can only be changed up until the show starts.', u, appNoticeColor); } else { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { if (message[1] != '0' && message[1] != '10sec' && message[1] != '20sec' && message[1] != '30sec' && message[1] != '1min' && message[1] != '2min' && message[1] != '3min' && message[1] != '4min' && message[1] != '5min') { cb.sendNotice('UltraApp: The value entered for the new preview length is not valid, please make sure to use one of the following values: "0", "10sec", "20sec", "30sec", "1min", "2min", "3min", "4min", or "5min".', u, appNoticeColor); } else { switch (message[1]) { case '0': { freePreviewLength = 0; freePreviewLengthText = 'No Preview'; break; } case '10sec': { freePreviewLength = 10; freePreviewLengthText = '10 seconds'; break; } case '20sec': { freePreviewLength = 20; freePreviewLengthText = '20 seconds'; break; } case '30sec': { freePreviewLength = 30; freePreviewLengthText = '30 seconds'; break; } case '1min': { freePreviewLength = 60; freePreviewLengthText = '1 minute'; break; } case '2min': { freePreviewLength = 120; freePreviewLengthText = '2 minutes'; break; } case '3min': { freePreviewLength = 180; freePreviewLengthText = '3 minutes'; break; } case '4min': { freePreviewLength = 240; freePreviewLengthText = '4 minutes'; break; } case '5min': { freePreviewLength = 300; freePreviewLengthText = '5 minutes'; break; } } cb.sendNotice('UltraApp: The Ticket Show Free Preview length has been updated to "' + freePreviewLengthText + '".', u, appNoticeColor); if (u != BC) { cb.sendNotice('UltraApp: The Ticket Show Free Preview length has been updated to "' + freePreviewLengthText + '".', BC, appNoticeColor); } } } else { cb.sendNotice('UltraApp: No parameter was specified for the new preview length.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } break; } case '/starttickettimer': case '/ticketstarttimer': case '/starttimer': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { numtimer = parseInt(message[1]) if(isNaN(numtimer)) { cb.sendNotice('The value entered for the minutes to use for the timer is not numeric, please try again.', u, appNoticeColor); break; } else if (numtimer < 1 || numtimer > 60) { cb.sendNotice('The value entered for the minutes to use for the ticket show timer is outside allowable values from 1 to 60 minutes, please try again.', u, appNoticeColor); } else { startTicketShowTimer(numtimer); } } else { cb.sendNotice('No parameter was specified for the number of minutes to use for the timer.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/addtickettime': case '/ticketaddtime': case '/addtime': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (ticketMinsRemain > 0 || ticketSecsRemain > 0) { if (message[1]) { numtimer = parseInt(message[1]); if(isNaN(numtimer)) { cb.sendNotice('The value entered for the minutes to add to the ticket show start timer is not numeric, please try again.', u, appNoticeColor); } else if(numtimer < -60 || numtimer > 60) { cb.sendNotice('The value entered for the minutes to add to the ticket show start timer is outside allowable values from -60 to 60, please try again. Negative numbers can be used to subtract time.', u, appNoticeColor); } else if(numtimer == 0) { cb.sendNotice('Cannot add zero time.', u, appNoticeColor); } else if(numtimer < 0 && Math.abs(numtimer) > ticketMinsRemain) { cb.sendNotice('The value entered for the minutes to subtract is greater than the remaining time on the timer, please try again. Negative numbers can be used to subtract time.', u, appNoticeColor); } else if(numtimer > 0 && (Math.abs(numtimer) + ticketMinsRemain) > 60) { cb.sendNotice('The value entered for the minutes to add would exceed the maximum countdown time of 60 minutes when added to the current time left.', u, appNoticeColor); } else { ticketAddTime(numtimer, u); } } else { cb.sendNotice('No parameter was specified for the number of minutes to add to the timer.', u, appNoticeColor); } } else { cb.sendNotice('A timer has not been started yet for the ticket show countdown.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/ticketstoptime': case '/ticketstoptimer': case '/stoptimer': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (ticketMinsRemain > 0 || ticketSecsRemain > 0) { stopTicketTimer(u); } else { cb.sendNotice('A ticket 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 UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/add': case '/addticket': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.ticketShowModsAdd == 'Yes')) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { cb.sendNotice('Adding multiple users to the ticket show list.', u, appNoticeColor); for (var i = 0; i < cmdvalsplit.length; i++) { if (cmdvalsplit[i]) { nametoadd = cmdvalsplit[i].toLowerCase(); if (!cb.limitCam_userHasAccess(nametoadd)) { addRmvTicket('add',nametoadd); cb.sendNotice('Added ' + nametoadd + ' to the ticket show list.', u); cb.sendNotice(u + ' has added you to the ticket show list.', nametoadd, appNoticeColor); } else { cb.sendNotice(nametoadd + ' is already on the ticket show list. Skipping.', u); } } else { cb.sendNotice('Skipping null entry.', u); } } cb.sendNotice('All users were added and notified.', u, appNoticeColor) cb.sendNotice(u + ' has added multiple users to the ticket show list.\n' + 'Users added: ' + cbjs.arrayJoin(cmdvalsplit, ', '), '', appNoticeColor, '', 'normal', 'red'); } else { nametoadd = message[1].toLowerCase(); if (!cb.limitCam_userHasAccess(nametoadd)) { addRmvTicket('add',nametoadd); } else { cb.sendNotice('Note: User ' + nametoadd + ' is already in the Ticket Show List.', u, appNoticeColor); } } } else { if (!cb.limitCam_userHasAccess(u)) { addRmvTicket('add',u); } else { cb.sendNotice('Note: User ' + u + ' is already in the Ticket Show List.', u, appNoticeColor); } } } else { cb.sendNotice('You do not have authority to use the /add command.', u, appNoticeColor); } } else { cb.sendNotice('The ticket show feature is not yet active in the UltraApp.', u, appNoticeColor); } break; } case '/rmv': case '/del': case '/delticket': case '/rmvticket': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.ticketShowModsAdd == 'Yes')) { if (message[1]) { nametormv = message[1].toLowerCase(); if (cb.limitCam_userHasAccess(nametormv)) { addRmvTicket('rmv',nametormv); } else { cb.sendNotice('User is not in the UltraApp Ticket Show List.', u, appNoticeColor); } } else { cb.sendNotice('No user was specified for the /rmv command.', u, appNoticeColor); } } else { cb.sendNotice('You do not have authority to use the /rmv command.', u, appNoticeColor); } } else { cb.sendNotice('The ticket show feature is not yet active in the UltraApp.', u, appNoticeColor); } break; } case '/giftticket': { cmd = 1; if (whichApp == 'ticket') { if (cb.settings.ticketShowFanAppreciation != 'Yes') { if (ticketShowAllowGift == 'Yes') { if (cbjs.arrayContains(ticketShowExtraTickets.name,u)) { exttindex = ticketShowExtraTickets.name.indexOf(u); if (ticketShowExtraTickets.count[exttindex] > 0) { giftTicket(u,message[1]); ticketShowExtraTickets.count[exttindex]--; cb.sendNotice('You have gifted a ticket to ' + message[1] + '. Thank you for your generosity.', u, appNoticeColor, '', 'bold'); cb.sendNotice('Moderators: ' + u + ' has gifted a ticket to ' + message[1] + '.', '', appNoticeColor, '', '', 'red'); cb.sendNotice('Broadcaster: ' + u + ' has gifted a ticket to ' + message[1] + '.', BC, appNoticeColor); } else { cb.sendNotice('Sorry, you do not have any extra tickets remaining.', u, appNoticeColor); } } else { cb.sendNotice('Sorry, you have not purchased any extra tickets.', u, appNoticeColor); } } else { cb.sendNotice('Sorry, ' + bctext + ' has not enabled the use of gifting tickets for this show.', u, appNoticeColor); } } else { cb.sendNotice('Tickets cannot be gifted for a Fan Appreciation show.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/givemyticketto': { cmd = 1; if (whichApp == 'ticket') { if (cb.settings.ticketShowFanAppreciation != 'Yes') { if (ticketShowAllowGift == 'Yes') { if (cb.limitCam_userHasAccess(u) && showStage == 'ticketsales' && !cbjs.arrayContains(ticketShowPreViewerList,u)) { giveAwayTicket(u,message[1]); cb.sendNotice('You have gifted your ticket to ' + message[1] + '. You will now be removed from the show. Thank you for your generosity.',u,appNoticeColor,'','bold'); cb.sendNotice('Mods: ' + u + ' has gifted their own ticket to ' + message[1] + '.', '', appNoticeColor, '', '', 'red'); cb.sendNotice('Broadcaster: ' + u + ' has gifted their own ticket to ' + message[1] + '.', BC, appNoticeColor); } else { cb.sendNotice('Sorry, you do not have a ticket purchased or the show has already started.', u, appNoticeColor); } } else { cb.sendNotice('Sorry, ' + bctext + ' has not enabled the gifting of tickets for this show.', u, appNoticeColor); } } else { cb.sendNotice('Tickets cannot be gifted for a Fan Appreciation show.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/chgtktmode': case '/chgticketmode': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newTicketMode = message[1].toLowerCase(); if (newTicketMode != 'manual' && newTicketMode != 'timer' && newTicketMode != 'ticketgoal' && newTicketMode != 'tokengoal') { cb.sendNotice('The value entered for the new mode is not valid, please try again using a value of "manual", "timer", "ticketgoal", or "tokengoal".', u, appNoticeColor); } else { if (newTicketMode == ticketStartMode) { cb.sendNotice('The value entered for the new mode is the same as the existing mode, command ignored.', u, appNoticeColor); } else { setTicketMode(newTicketMode,u); cb.sendNotice(ticketModeMessage, '', ticketBgColor, ticketTxtColor, 'bold'); cb.drawPanel(); } } } else { cb.sendNotice('No parameter was specified for the new ticket show start mode. Valid values are "manual", "timer", "ticketgoal", or "tokengoal".', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/chgtktauto': case '/chgticketauto': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newTicketAuto = message[1].toLowerCase(); if (newTicketAuto != 'bc' && newTicketAuto != 'auto') { cb.sendNotice('The value entered for the new mode is not valid, please try again using a value of "bc" or "auto".', u, appNoticeColor); } else if (newTicketAuto === 'auto' && ticketStartMode === 'manual') { cb.sendNotice('The mode cannot be changed to "auto" unless there is a goal or timer being used to define when the show will start. Show is currently to be started at broadcaster discretion.', u, appNoticeColor); } else if (newTicketAuto === ticketModeAuto) { cb.sendNotice('The value entered for the new mode is the same as the existing mode, command ignored.', u, appNoticeColor); } else { setTicketAuto(newTicketAuto); cb.sendNotice(ticketModeMessage, '', ticketBgColor, ticketTxtColor, 'bold'); cb.drawPanel(); } } else { cb.sendNotice('No parameter was specified for the new autostart mode. Valid values are "bc" or "auto" (broadcaster command or automatic start).', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/tickettimeleft': { cmd = 1; if (whichApp == 'ticket') { if (ticketMinsRemain >= 1 || ticketSecsRemain >= 1) { cb.sendNotice(ticketTimeLeft(), "", appNoticeColor, "", "bold"); } else { cb.sendNotice('A Hidden Ticket Show timer is not running.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/showtime': { cmd = 1; if (whichApp == 'ticket') { if (cb.limitCam_isRunning()) { cb.sendNotice(' \u25B7 \u25B7 \u25B7 Hidden Ticket Show in progress for ' + ((Date.now() - hiddenTime)/60000).toFixed(1) + ' minutes. \u25C1 \u25C1 \u25C1 ', u, ticketBgColor,ticketTxtColor,'bold'); } else { cb.sendNotice('The ticket show is not running, it has not yet started or already finished.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/useticket': { cmd = 1; if (whichApp == 'ticket') { if (cb.settings.ticketShowFanAppreciation != 'Yes') { if (ticketShowOtToggle == 1) { if (cb.limitCam_userHasAccess(u)) { cb.sendNotice('You already have a ticket to the show.', u, appNoticeColor); } else { if (cbjs.arrayContains(outstandingTicketArray,u)) { useTicket(u); cb.sendNotice('Broadcaster: ' + u + ' has used their Outstanding Ticket to join this show. They should be removed from the permanent OT list on the bot start page.', BC, appNoticeColor); cb.sendNotice('Mods: ' + u + ' has used their Outstanding Ticket. ' + bctext + ' has been notified to remove them from the permanent OT list on the bot start page.', '', appNoticeColor, '', '', 'red'); } else { cb.sendNotice('Sorry, you do not have an outstanding ticket available.', u, appNoticeColor); } } } else { cb.sendNotice('Sorry, ' + bctext + ' has not enabled the use of outstanding tickets for this show.', u, appNoticeColor); } } else { cb.sendNotice('Outstanding Ticket features are not enabled for a Fan Appreciation Show.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/saveticket': { cmd = 1; if (whichApp == 'ticket') { if (cb.settings.ticketShowFanAppreciation != 'Yes') { if (ticketShowOtToggle == 1) { if (cb.limitCam_userHasAccess(u) && showStage == 'ticketsales') { saveTicket(u); cb.sendNotice('Your ticket from this show has been saved and you have been removed from the ticket list for this show.', u, appNoticeColor, '', 'bold'); cb.sendNotice('Broadcaster: ' + u + ' has saved their ticket from this show to the outstanding ticket list. They should be added to the permanent OT list on the bot start page upon next restart.', BC, appNoticeColor); cb.sendNotice('Mods: ' + u + ' has saved their ticket from this show to the outstanding ticket list. ' + bctext + ' has been notified to add them to the permanent OT list on the bot start page.', '', appNoticeColor, '', '', 'red'); } else { cb.sendNotice('Sorry, you have no ticket purchase to save, or the show has already started.', u, appNoticeColor); } } else { cb.sendNotice('Sorry, ' + bctext + ' has not enabled the ability to save an outstanding tickets for this show.', u, appNoticeColor); } } else { cb.sendNotice('Outstanding Ticket features are not enabled for a Fan Appreciation Show.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/addot': { cmd = 1; if (whichApp == 'ticket') { if (ticketShowOtToggle == 1) { if (isBC || (isMod && cb.settings.ticketShowModsAdd == 'Yes')) { if(message[1] != '' && message[1] != null) { if (!cbjs.arrayContains(outstandingTicketArray,message[1])) { addRmvOutstandingTicket('add', message[1]); cb.sendNotice('User ' + message[1] + ' has been added to the Outstanding Ticket List.', u, appNoticeColor); } else { cb.sendNotice('Cannot add, user is already in the Outstanding Ticket List.', u, appNoticeColor); } } } } else { cb.sendNotice('The Outstanding Ticket list feature is disabled. It can be enabled with the command "/useot on".', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/rmvot': { cmd = 1; if (whichApp == 'ticket') { if (ticketShowOtToggle == 1) { if (isBC || (isMod && cb.settings.ticketShowModsAdd == 'Yes')) { if (message[1] != '' && message[1] != null) { if (cbjs.arrayContains(outstandingTicketArray,message[1])) { addRmvOutstandingTicket('rmv', message[1]); cb.sendNotice('User ' + message[1] + ' has been removed from the Outstanding Ticket List.', u, appNoticeColor); } else { cb.sendNotice('Cannot remove, user is not in the Outstanding Ticket List.', u, appNoticeColor); } } } } else { cb.sendNotice('The Outstanding Ticket list feature is disabled. It can be enabled with the command "/useot on".', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/startshow': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (isBC) { enteredby = bctext; } else { enteredby = u; } if (whichApp == 'ticket') { if (!cb.limitCam_isRunning() && ticketShowEnded == false) { startTicketShow(enteredby); if (presalesToggle == 1) { setPresalesToggle('off',enteredby); } } else if (!cb.limitCam_isRunning() && ticketShowEnded == true) { cb.sendNotice('The Hidden Cam show was already started and stopped, please use the command "/restartshow" to resume the hidden show.', u, appNoticeColor); } else { cb.sendNotice('The Hidden Cam show is already underway.', u, appNoticeColor); } } else if (whichApp == 'peep') { if (!cb.limitCam_isRunning() && peepshowEnded == false) { startPeepShow(enteredby); } else if (!cb.limitCam_isRunning() && peepshowEnded == true) { cb.sendNotice('The Peep Show was already started and stopped, please use the command "/peeprestart" to resume the hidden show.', u, appNoticeColor); } else { cb.sendNotice('The Peep Show is already underway.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Ticket Show / Peep Show feature is not running.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/showover': case '/showwarn': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (isBC) { enteredby = bctext; } else { enteredby = u; } if (whichApp == 'ticket') { if (cb.limitCam_isRunning()) { if (showStage == 'ticketshow') { warnShowEnding(enteredby); } else if (showStage == 'showwarn') { cb.sendNotice('The /showwarn or /showover command has already been used. To suspend ticket sales, use the /showend command. To end the show and return to a public broadcast, use the /stopshow command.', u, appNoticeColor); } else if (showStage == 'showfinale') { cb.sendNotice('The show has already progressed past the point this command should be used, ticket sales have already been suspended. To end the show and return to a public broadcast, use the /stopshow command.', u, appNoticeColor); } } else { cb.sendNotice('The Hidden Cam show has not been started or has already ended.', u, appNoticeColor); } } else if (whichApp == 'peep') { if (cb.limitCam_isRunning()) { if (showStage === 'peepshow') { peepShowEnding(enteredby); } else { cb.sendNotice('The /showwarn or /showover command is used for a first warning. The show has already progressed past the point this command should be used. To end the show and return to a public broadcast, use the /stopshow command.', u, appNoticeColor); } } else { cb.sendNotice('The Peep Show has not been started or has already ended.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Ticket Show / Peep Show feature is not running.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/showend': case '/stopsales': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (isBC) { enteredby = bctext; } else { enteredby = u; } if (whichApp == 'ticket') { if (cb.limitCam_isRunning()) { if (showStage == 'showfinale') { cb.sendNotice('Ticket Sales have already been suspended.', u, appNoticeColor); } else { stopTicketSales(enteredby); } } else { cb.sendNotice('The Hidden Cam show has not been started or has already ended.', u, appNoticeColor); } } else if (whichApp == 'peep') { if (cb.limitCam_isRunning()) { stopPeepShowSales(enteredby); } else { cb.sendNotice('The Peep Show has not been started or has already ended.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Ticket Show / Peep Show feature is not running.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/stopshow': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (isBC) { enteredby = bctext; } else { enteredby = u; } if (whichApp == 'ticket') { if (cb.limitCam_isRunning()) { stopTicketShow(enteredby); } else { cb.sendNotice('The Hidden Cam show has not been started or has already ended.', u, appNoticeColor); } } else if (whichApp == 'peep') { if (cb.limitCam_isRunning()) { stopPeepShow(enteredby); } else { cb.sendNotice('The Peep Show has not been started or has already ended.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Ticket Show / Peep Show feature is not running.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/ticketsubject': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { ticketSubjectText = msg['m'].substring(15).trim(); if (ticketSubjectText != '' && ticketSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/ctsubject': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { ticketSubjectText = msg['m'].substring(11).trim(); if (ticketSubjectText != '' && ticketSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('No value was specified for the new room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/newticketshow': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (!cb.limitCam_isRunning()) { if (ticketHolderList.length > 0) { cb.sendNotice('In case the ticket show was reset by mistake, the previous ticket list is displayed below so they can be added back to the show using the "/add" command : ', cb.room_slug, appNoticeColor); cb.sendNotice(cbjs.arrayJoin(ticketHolderList, ', '), cb.room_slug); cb.sendNotice('End of List', cb.room_slug, appNoticeColor); if (isMod) { cb.sendNotice('In case the ticket show was reset by mistake, the previous ticket list is displayed below so they can be added back to the show using the "/add" command : ', u, appNoticeColor); cb.sendNotice(cbjs.arrayJoin(ticketHolderList, ', '), u); cb.sendNotice('End of List', u, appNoticeColor); } } else { cb.sendNotice('No ticket buyers in the previous ticket list.', u, appNoticeColor); } initTicketShow(u,ticketPrice); cb.limitCam_removeAllUsers(); ticketHolderList.length = 0; while (ticketShowViewerList.length > 0) viewerList.pop(); } else { cb.sendNotice('A Hidden Cam show is still running. The /newticketshow command can be used to start a brand new ticket show. The ticket list is cleared but the outstanding ticket list and changes list remains intact.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/restartshow': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (!cb.limitCam_isRunning()) { if (isBC) { startedby = bctext; } else { startedby = u; } restartTicketShow(startedby); } else { cb.sendNotice('A Hidden Cam show is already running. The /restartshow command can be used to resume a hidden show that was ended prematurely or accidentally. All settings remain the same and the ticket list stays intact.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/restartsales': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (ticketSalesEnded == true) { restartTicketSales(u); } else { cb.sendNotice('Ticket Sales are already enabled.', u, appNoticeColor); } } else { cb.sendNotice('Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/ctn': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (ntc != null && (ntc != "" || ntc != " " || ntc != "\u00a0")) { sendPublicNotice(ntc, u, ""); } else { cb.sendNotice('You cannot send a blank message. The correct syntax for this command is "/ctn [message]".', u, appNoticeColor); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/ctnh': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (ntc != null && (ntc != '' || ntc != ' ' || ntc != '\u00a0')) { sendPublicNotice(ntc, u, 'h'); } else { cb.sendNotice('You cannot send a blank message. The correct syntax for this command is "/ctnh [message]".', u, appNoticeColor); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/ctnd': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (ntc != null && (ntc != '' || ntc != ' ' || ntc != '\u00a0')) { sendPublicNotice(ntc, u, 'div'); } else { cb.sendNotice('You cannot send a blank message. The correct syntax for this command is "/ctnd [message]".', u, appNoticeColor); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/ctndh': { cmd = 1; if (whichApp == 'ticket') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (ntc != null && (ntc != '' || ntc != ' ' || ntc != '\u00a0')) { sendPublicNotice(ntc, u, 'divh'); } else { cb.sendNotice('You cannot send a blank message. The correct syntax for this command is "/ctndh [message]".', u, appNoticeColor); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Ticket Show feature is not running.', u, appNoticeColor); } break; } case '/chgticketshow': { cmd = 1; if ((whichApp == 'ticket' || enablePresales == true) && (message[1] == 'fembot' || message[1] == 'Fembot')) { cb.sendNotice('*** Warning *** You have enabled the ticket show in the Fembot and the UltraApp simultaneously. Only one app or bot should have the ticket show enabled. Running a ticket show in both will cause the user access to the ticket show to fail.', u, appNoticeColor); } break; } //********* Pre-sales Commands case '/presalelist': { cmd = 1; if (whichApp == 'ticket') { cb.sendNotice('UltraApp: The Hidden Ticket Show feature has been started, you can view ticket holders with the "/tickets" command.', u, appNoticeColor); } else { if (enablePresales == true) { if (ticketHolderList.length > 0) { if (message[1] === 'a' || message[1] === 'A' || message[1] === 'alpha') { var sortedticketlist = ticketHolderList.slice(); sortedticketlist.sort(); cb.sendNotice('UltraApp: Alphabetic listing of users who have purchased a pre-sale ticket (' + sortedticketlist.length + ' ticket holders): \n' + cbjs.arrayJoin(sortedticketlist, ', ') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('UltraApp: Users who have purchased a pre-sale ticket, in order of when added (' + ticketHolderList.length + ' ticket holders). Use the "alpha" parameter (or "a") for a sorted list: \n' + cbjs.arrayJoin(ticketHolderList, ', ') + '\nEnd of List', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: No ticket buyers yet.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Pre-sales feature is not currently enabled to be used in the UltraApp, you can enable it with the command "/uapresale on". Once enabled, you can start selling pre-sale ticekts with the command "/startpresale".', u, appNoticeColor); } } break; } case '/uapresales': case '/uapresale': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if ((message[1] == 'on' || message[1] == 'ON' || message[1] == 'On') && enablePresales == true) { cb.sendNotice('UltraApp pre-sales are already enabled.', u, appNoticeColor); } else if ((message[1] == 'off' || message[1] == 'OFF' || message[1] == 'Off') && enablePresales == false) { cb.sendNotice('UltraApp pre-sales are already disabled.', u, appNoticeColor); } else if ((message[1] == 'on' || message[1] == 'ON' || message[1] == 'On') && enablePresales == false) { enablePresales = true; cb.sendNotice('UltraApp pre-sales have been enabled. Please be sure you are not also configured for Pre-sales in the Fembot. In future shows, UltraApp pre-sales can be enabled automatically by selecting "UltraApp" as the location for Pres-sales on the UltraApp launch page. You can start selling pre-sale tickets with the command "/startpresale".', u, appNoticeColor); } else if ((message[1] == 'off' || message[1] == 'OFF' || message[1] == 'Off') && enablePresales == true) { enablePresales = false; if (presalesToggle == 1) { setPresalesToggle('off',u); } cb.sendNotice('UltraApp pre-sales have been disabled.', u, appNoticeColor); } else { cb.sendNotice('Invalid parameter for this command, valid values are "on" or "off".', u, appNoticeColor); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/startpresales': case '/startpresale': { cmd = 1; if (enablePresales == true) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (whichApp == 'ticket') { cb.sendNotice('UltraApp: Unable to start pre-sales, the actual ticket show feature is already started.', u, appNoticeColor); } else if (message[1] == 'on' && cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice('UltraApp: Unable to start pre-sales since the Ticket Show feature is configured for a Fan Appreciation Show.', u, appNoticeColor); } else { if (presalePrice <= 0) { presalePrice = cb.settings.ticketShowPresalePrice; } if (presalePrice > 0) { if (ticketPrice <= 0) { cb.sendNotice('UltraApp: Unable to start pre-sales, the actual ticket show price must be set first using the command "/ticketprice xx" where xx will be the the Ticket App show price.', u, appNoticeColor); } else if (presalePrice > ticketPrice) { cb.sendNotice('UltraApp: Unable to start pre-sales, the Pre-Sales Price is greater than the ticket show price.', u, appNoticeColor); } else { setPresalesToggle('on', u, presalePrice); } } else { cb.sendNotice('UltraApp: Unable to start pre-sales, a pre-sale ticket price must be set first using the command "/presaleprice xx" where xx is in the initial price to start selling pre-sales tickets at.', u, appNoticeColor); } } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Pre-sales not started as they are disabled in the UltraApp (Note - this is expected if Fembot pre-sales are used).', u, appNoticeColor); } break; } case '/stoppresales': case '/stoppresale': { cmd = 1; if (enablePresales == true) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { setPresalesToggle('off', u, presalePrice); } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Pre-sales not stopped as they are disabled in the UltraApp (Note - this is expected if Fembot pre-sales are used).', u, appNoticeColor); } break; } case '/usepresale': { cmd = 1; if (enablePresales == true) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { cb.sendNotice('UltraApp: Pre-sales not started/stopped. Note that the commands have changed to "/startpresale" and "/stoppresale", please use these commands instead', u, appNoticeColor); } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Pre-sales not started/stopped as they are disabled and the commands have changed. To enable on presales, ensure the UltraApp is selected for where Pre-sales are performed on the launch page (or using the command "/uapresale on"), and then either select a pre-sale mode on the launch page, or start and stop pre-sales with the commands "/startpresale" or "/stoppresale".', u, appNoticeColor); } break; } case '/psprice': case '/presaleprice': { cmd = 1; if (whichApp == 'ticket') { cb.sendNotice('Cannot update pre-sale price, ticket show feature has already been started.', u, appNoticeColor); } else { if (enablePresales == true) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { numprice = parseInt(message[1]) if (isNaN(numprice)) { cb.sendNotice('The value entered for the Ultra-App pre-sale ticket price is not numeric, please try again.', u, appNoticeColor); break; } else if (numprice < 1 || numprice > 1000) { cb.sendNotice('The value entered for the Ultra-App pre-sale ticket price is outside allowable values from 1 to 1000, please try again.', u, appNoticeColor); } else if (numprice > ticketPrice) { cb.sendNotice('The value entered for the Ultra-App pre-sale ticket price is higher than the actual ticket price of ' + ticketPrice + '. Please update the ticket price first using the command "/ticketprice [newprice]".', u, appNoticeColor); } else { if (numprice < presalePrice) { cb.sendNotice('Warning: Value is updated but this price is lower than the previous Ultra-App pre-sale price of ' + presalePrice + '. It is not advisiable to decrease the presale price once tickets have been sold.', u, appNoticeColor); } if (presalesToggle == 1) { presalePriceChange(numprice,u); cb.sendNotice('The Ultra-App Pre-sale Ticket Price has been updated to ' + numprice + ' tokens, all tips of at least this amount will add a user to the Pre-sale Ticket List. You can view the pre-sales list with the command /presalelist. UltraApp Pre-sales are automaticlly added to the UltraApp Ticket Show when the app feature is changed to the ticket show.', u, appNoticeColor); } else { presalePrice = numprice; cb.sendNotice('The Ultra-App Pre-sale Ticket Price has been set to ' + numprice + ' tokens, and the pre-sale can now be started with the command "/startpresale". ', u, appNoticeColor); } } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } } break; } case '/pspt': case '/pspricetimer': { cmd = 1; if (enablePresales == true) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (presalesToggle == 1) { validtimer = 0; numtimer = parseInt(message[1]) if(isNaN(numtimer)) { cb.sendNotice('The timer value entered for the pre-sale price change is not numeric, please try again. The syntax for the command is "/presalepricetimer [t] [p]", where [t] is the number of minutes to use for the timer, and [p] is the new ticket price that will be used when the timer expires.', u, appNoticeColor); } else if (numtimer < 1 || numtimer > 60) { cb.sendNotice('The timer value entered for the pre-sale price change is outside allowable values from 1 to 60 minutes, please try again. The syntax for the command is "/presalepricetimer [t] [p]", where [t] is the number of minutes to use for the timer, and [p] is the new ticket price that will be used when the timer expires.', u, appNoticeColor); } else if (presaleMinsRemain > 0 || presaleSecsRemain > 0) { cb.sendNotice('A timer is already running for the next price change. You can add time to the timer with the command "/presaleaddtime [t]" where [t] is the number of minutes to add, and can be positive to add time or negative to subtract time.', u, appNoticeColor); } else if (presalesToggle == 0) { cb.sendNotice('The Pre-sales function has not been turned on, you can use the command "/startpresale" to enable this function if an initial price has been set.', u, appNoticeColor); } else { validtimer = 1; } numprice = parseInt(message[2]) if(isNaN(numprice)) { cb.sendNotice('The new pre-sales price value entered for the price change timer is not numeric, please try again.', u, appNoticeColor); validtimer = 0; } else if(numprice < 1 || numprice > 1000) { cb.sendNotice('The new pre-sales price value entered for the price change timer is outside allowable values from 1 to 1000, please try again.', u, appNoticeColor); validtimer = 0; } else if(numprice > cb.settings.ticketShowPrice) { cb.sendNotice('The new pre-sales price value entered of ' + numprice + ' should not be greater than the ticket show price of ' + cb.settings.ticketShowPrice + ', please try again. If the ticket show price is incorrect or not set, it can be set using the command "/ticketprice pp", where pp is the planned ticket show price.', u, appNoticeColor); validtimer = 0; } else { if (validtimer = 1) { presaleMinsRemain = numtimer; nextPresalePrice = numprice; presaleAutoTimer(presaleMinsRemain); cb.sendNotice('The timer has been started to update the pre-sale price to ' + numprice + ' tokens in ' + numtimer + ' minutes.', u, appNoticeColor); } } } else { cb.sendNotice('The UltraApp Pre-sales have not been started, you can use the command "/uapresale on" to enable this function if an initial price has been set.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } break; } case '/presalestarttimer': case '/presaletimer': { cmd = 1; if (enablePresales == true) { if (presalesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { numtimer = parseInt(message[1]) if(isNaN(numtimer)) { cb.sendNotice('The value entered for the minutes to use for the pre-sale timer is not numeric, please try again.', u, appNoticeColor); break; } else if(numtimer < 1 || numtimer > 60) { cb.sendNotice('The value entered for the minutes to use for the pre-sale timer is outside allowable values from 1 to 60, please try again.', u, appNoticeColor); } else { presaleAutoTimer(numtimer); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Pre-sales are not active.', u, appNoticeColor); } } break; } case '/psat': case '/presaleaddtime': { cmd = 1; if (enablePresales == true) { if (presalesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { numtimer = parseInt(message[1]) if (!message[1]) { cb.sendNotice('Invalid command, you must specify the amount of time to add to (or subtract from) the Presale timer in minutes. Example: use "/presaleaddtime 3" to add 3 minutes to the timer. A negative number can be used to subtract time.', u, green); } else if (isNaN(numtimer)) { cb.sendNotice('The value entered for the time to add to (or subtract from) the pre-sale timer is not numeric, please try again.', u, appNoticeColor); } else if (numtimer == 0) { cb.sendNotice('The value entered for the time to add to the pre-sale timer cannot be zero, please try again.', u, appNoticeColor); } else if ((presaleMinsRemain + 1) + numtimer <= 0) { cb.sendNotice('The time to subtract is greater than the amount of time left. You can use "/presalestoptimer" to stop the timer.'); } else if ((presaleMinsRemain + 1) + numtimer > 120) { cb.sendNotice('The added time will increase the timer to greater than 2 hours, please use a smaller value.'); } else { presaleAddTime(numtimer, u); } } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Pre-sales are not active.', u, appNoticeColor); } } break; } case '/psstoptime': case '/presalestoptime': case '/presalestoptimer': { cmd = 1; if (enablePresales == true) { if (presalesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { stopPresaleTimer(u); } else { cb.sendNotice('UltraApp - Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('The UltraApp Pre-sales are not active.', u, appNoticeColor); } } break; } case '/addps': case '/addpresale': { cmd = 1; if (enablePresales == true) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (presalesToggle == 1) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { cb.sendNotice('Adding multiple users to the Pre-sale list.', u, appNoticeColor); for (var i = 0; i < cmdvalsplit.length; i++) { if (cmdvalsplit[i] != "") { if (!cb.limitCam_userHasAccess(cmdvalsplit[i])) { addRmvPresale('add', cmdvalsplit[i],'common'); cb.sendNotice('Added ' + cmdvalsplit[i] + ' to the pre-sale list.', u); cb.sendNotice(u + ' has added you to the Pre-sale Ticket Show list.', cmdvalsplit[i], appNoticeColor); } else { cb.sendNotice(cmdvalsplit[i] + ' is already on the ticket list. Skipping.', u); } } } cb.sendNotice('All users were added and notified.', u, appNoticeColor) cb.sendNotice(u + ' has added multiple users to the pre-sale list.\n' + 'Users added: ' + cbjs.arrayJoin(cmdvalsplit, ', '), '', appNoticeColor, '', 'normal', 'red'); } else { if (!cb.limitCam_userHasAccess(message[1])) { addRmvPresale('add',message[1],'common'); } else { cb.sendNotice(message[1] + ' is already on the ticket list.', u); } } } else { cb.sendNotice('You didn\'t specify what user(s) you want to add to the Pre-sale list.', u, appNoticeColor); } } else { cb.sendNotice('Note: User not added to pre-sale ticket list, the UltraApp Pre-sales are not active.', u, appNoticeColor); } } } break; } case '/rmvps': case '/rmvpresale': { cmd = 1; if (enablePresales == true) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (presalesToggle == 1) { if(message[1] != '' && message[1] != null) { if (cb.limitCam_userHasAccess(message[1])) { addRmvPresale('rmv', message[1],'common'); cb.sendNotice('UltraApp: User ' + message[1] + ' has been removed from the Pre-Sale Ticket List.', u, appNoticeColor); } else { cb.sendNotice('UltraApp Note: User is not in the Pre-Sale Ticket List.',u,appNoticeColor); } } } else { cb.sendNotice('UltraApp: The Ticket Show Pre-sales are not active.',u,appNoticeColor); } } } break; } case '/psmode': case '/chgpresalemode': { cmd = 1; if (enablePresales == true) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (presalesToggle == 1) { newPresaleMode = message[1].toLowerCase(); if (newPresaleMode != 'manual' && newPresaleMode != 'timer' && newPresaleMode != 'count') { cb.sendNotice('UltraApp: The value entered for the new mode is not valid, please try again using a value of "manual", "timer", or "count".', u, appNoticeColor); } else { if (newPresaleMode === presaleMode) { cb.sendNotice('UltraApp: The value entered for the new mode is the same as the existing mode, command ignored.', u, appNoticeColor); } else { setPresaleMode(newPresaleMode,u); } } } else { cb.sendNotice('UltraApp: The Ticket Show Pre-sales are not active.',u,appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } break; } case '/pstimeleft': case '/presaletimeleft': { cmd = 1; if (enablePresales == true) { if (presalesToggle == 1) { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (presaleMinsRemain >= 1 || presaleSecsRemain >= 1) { cb.sendNotice(presaleTimeLeft(), "", appNoticeColor, "", "bold"); } else { cb.sendNotice('UltraApp: A pre-sale timer is not running.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Ticket Show Pre-sales are not active.',u,appNoticeColor); } } break; } //********* Spank-a-thon Commands case '/setspanktype1': case '/setspanktype2': case '/setspanktype3': case '/setspanktype4': case '/setspanktype5': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { typenum = parseInt(message[0].substring(13)); if (!message[1]) { cb.sendNotice('UltraApp: The parameter is the "spank type" ' + typenum + ' description (can be multiple words). For example, "/setspanktype' + typenum + ' Hand Spanks".', u, appNoticeColor); } else if (typenum > 1 && typenum > (spankPricesArray.typ.length + 1)) { cb.sendNotice('UltraApp: You cannot skip spank type levels. If adding type ' + typenum + ', then type ' + (typenum-1) + ' must already have been set up.', u, appNoticeColor); } else { for (let m5 = 1; m5 < message.length; m5++) { if (m5 == 1) { label = message[m5]; } else { label += " " + message[m5]; } } if (typenum > spankTotalsArray.typ.length) { spankTotalsArray.typ.push(label); spankTotalsArray.tipped.push(0); spankTotalsArray.completed.push(0); } else { spankTotalsArray.typ[typenum-1] = label; } if (typenum > spankPricesArray.typ.length) { for (let loadindex = 1; loadindex <= 3; loadindex++) { spankPricesArray.typ.push(label); spankPricesArray.number.push(0); spankPricesArray.price.push(0); } } else { spankPricesArray.typ[(typenum-1)*3] = label; spankPricesArray.typ[(typenum-1)*3+1] = label; spankPricesArray.typ[(typenum-1)*3+2] = label; } cb.sendNotice('UltraApp: Spank-a-thon Type ' + typenum + ' was added/updated with a description of "' + label + '".', u, appNoticeColor); cb.sendNotice(u + ' added/updated Spank-a-thon Type ' + typenum + ' with a description of "' + label + '".', '', appNoticeColor, '', '', 'red'); if (u != BC) { cb.sendNotice(u + ' added/updated Spank-a-thon Type ' + typenum + ' with a description of "' + label + '".', cb.room_slug, appNoticeColor); } } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/setspank1p1': case '/setspank1p2': case '/setspank1p3': case '/setspank2p1': case '/setspank2p2': case '/setspank2p3': case '/setspank3p1': case '/setspank3p2': case '/setspank3p3': case '/setspank4p1': case '/setspank4p2': case '/setspank4p3': case '/setspank5p1': case '/setspank5p2': case '/setspank5p3': { cmd = 1; if (whichApp == 'spank') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { typenum = parseInt(message[0].substring(9)); pricenum = parseInt(message[0].substring(11)); if ((typenum*3) > spankPricesArray.typ.length) { cb.sendNotice('UltraApp: Spank type ' + typenum + ' has not yet been defined, please use "/setspanktype' + typenum + ' to define the spank type before setting the spank prices.', u, appNoticeColor); } else if (commandVar1 <= 0 || isNaN(commandVar1)) { cb.sendNotice('UltraApp: The first parameter is the number of spanks in a bundle for spank type ' + typenum + ', price level ' + pricenum + ', and has be be a number greater than 0. For example, "/setspank' + typenum + 'p' + pricenum + ' 10 99 to set spank type ' + typenum + ', price level ' + pricenum + ' to be 10 spanks for 99 tokens. When setting level 1, it is typically the per spank price, so the number fo spanks would be 1, however this is not required.', u, appNoticeColor); } else if (commandVar2 <= 0 || isNaN(commandVar1)) { cb.sendNotice('UltraApp: The second parameter is the tip amount for spank type ' + typenum + ', price level ' + pricenum + ', and has be be a number greater than 0. For example, "/setspank' + typenum + 'p' + pricenum + ' 10 99 to set spank type ' + typenum + ', price level ' + pricenum + ' to be 10 spanks for 99 tokens.', u, appNoticeColor); } else { spankPricesArray.number[(typenum-1)*3+(pricenum-1)] = commandVar1; spankPricesArray.price[(typenum-1)*3+(pricenum-1)] = commandVar2; cb.sendNotice('UltraApp: Spank-a-thon Spank Type ' + typenum + ', price level ' + pricenum + ' was added/updated with the number of spanks as ' + commandVar1 + ' for a price of ' + commandVar2 + '.', u, appNoticeColor); cb.sendNotice('UltraApp: ' + u + ' added/updated Spank-a-thon Spank Type ' + typenum + ', price level ' + pricenum + ' with the number of spanks as ' + commandVar1 + ' for a price of ' + commandVar2 + '.', '', appNoticeColor, '', '', 'red'); if (u != BC) { cb.sendNotice('UltraApp: ' + u + ' added/updated Spank-a-thon Spank Type ' + typenum + ', price level ' + pricenum + ' with the number of spanks as ' + commandVar1 + ' for a price of ' + commandVar2 + '.', cb.room_slug, appNoticeColor); } } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The command for setting spank prices is for use with the Spank-a-thon app, and that feature is not running.', u, appNoticeColor); } break; } case '/setspankgoal1': case '/setspankgoal2': case '/setspankgoal3': case '/setspankgoal4': case '/setspankgoal5': { cmd = 1; if (whichApp == 'spank') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = parseInt(message[0].substring(13)); if (commandVar1 <= 0 || isNaN(commandVar1)) { cb.sendNotice('UltraApp: The first parameter is the new amount for goal ' + goalnum + ' and has be be a number greater than 0. For example, "/setspankgoal' + goalnum + ' 300 Spanking Round 1" to set goal ' + goalnum + ' to the first round of spanking at 300 tokens.', u, appNoticeColor); } else if (goalnum == currentGoal && commandVar1 < currentGoalTips) { cb.sendNotice('UltraApp: The current goal cannot be updated to an amount less than what has already been tipped for this goal.', u, appNoticeColor); } else if (!message[2]) { cb.sendNotice('UltraApp: The second parameter is the description of goal ' + goalnum + ' (can be multiple words). For example, "/setgoal' + goalnum + ' 300 Spanking Round 1" to set goal ' + goalnum + ' to the first round of spanking at 300 tokens.', u, appNoticeColor); } else if (goalnum > 1 && !spankGoalArray.amt[goalnum-2] >= 1) { cb.sendNotice('UltraApp: You cannot skip goal levels. If setting a goal for level ' + goalnum + ', then level ' + (goalnum-1) + ' must already have a goal defined.', u, appNoticeColor); } else { for (let m5 = 2; m5 < message.length; m5++) { if (m5 == 2) { label = message[m5]; } else { label += " " + message[m5]; } } spankGoalArray.amt[goalnum-1] = commandVar1; spankGoalArray.desc[goalnum-1] = label; updateSpankGoal(goalnum); cb.sendNotice('UltraApp: Spank-a-thon Goal ' + goalnum + ' was added/updated to the amount of ' + commandVar1 + ' and a description of "' + label + '".', u, appNoticeColor); cb.sendNotice(u + ' added/updated Spank-a-thon Goal #' + goalnum + ' to the goal amount of ' + commandVar1 + ' and a description of "' + label + '".', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' added/updated Spank-a-thon Goal #' + goalnum + ' to the goal amount of ' + commandVar1 + ' and a description of "' + label + '".', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The "/setspankgoalX" command is for use with the Spank-a-thon app, and that feature is not running.', u, appNoticeColor); } break; } case '/rmvspankgoal': { cmd = 1; if (whichApp == 'spank') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { goalnum = message[1]; if (isNaN(goalnum) || goalnum < 1 || goalnum > 20) { cb.sendNotice('UltraApp: The first parameter is the goal level being removed, and must be a number from 1 to 5 to indicate the goal level number that should be removed. For example, "/rmvspankgoal 3" will remove the goal and description info for level 3.', u, appNoticeColor); } else if (goalnum > spankGoalArray.amt.length) { cb.sendNotice('UltraApp: There is no goal entry at level ' + goalnum + ', there are currently only entries up to goal level ' + progGoalArray.amt.length + '.', u, appNoticeColor); } else { spankGoalArray.amt.splice((goalnum-1),1); spankGoalArray.desc.splice((goalnum-1),1); updateSpankGoal(goalnum); cb.sendNotice('UltraApp: Spank-a-thon Goal #' + goalnum + ' was removed from the goal list', u, appNoticeColor); cb.sendNotice(u + ' removed Spank-a-thon Goal #' + goalnum + ' from the goal list', '', appNoticeColor, '', '', 'red'); cb.sendNotice(u + ' removed Spank-a-thon Goal #' + goalnum + ' from the goal list', cb.room_slug, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The "/rmvspankgoal" command is for use with the Spank-a-thon Goals app, and that feature is not running.', u, appNoticeColor); } break; } case '/setspanktext': { cmd = 1; if (whichApp == 'spank') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { spankSubjectText = msg['m'].substring(14).trim() if (spankSubjectText != '' && spankSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('UltraApp: No value was specified for the new room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The "/setspanktext" command is for use with the Spank-a-thon Goals app, and that feature is not running.', u, appNoticeColor); } break; } case '/spankmenu': { cmd = 1; if (whichApp == 'spank') { cb.sendNotice(spankMenu(), '', spankBgColor, spankTextColor, 'bold'); } else { cb.sendNotice('UltraApp: The "/spankmenu" command is for use with the Spank-a-thon Goals app, and that feature is not running.', u, appNoticeColor); } break; } case '/spanktips': { cmd = 1; if (whichApp == 'spank') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { spankTips(); } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The "/spanktips" command is for use with the Spank-a-thon Goals app, and that feature is not running.', u, appNoticeColor); } break; } case '/spanktotals': { cmd = 1; if (whichApp == 'spank') { spankTotals(); } else { cb.sendNotice('UltraApp: The "/spanktotals" command is for use with the Spank-a-thon Goals app, and that feature is not running.', u, appNoticeColor); } break; } case '/spanked': { cmd = 1; if (whichApp == 'spank') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { spanktype = parseInt(message[1]); spanknumber = parseInt(message[2]); if (isNaN(spanktype) || spanktype < 1 || spanktype > 5) { cb.sendNotice('UltraApp: The first parameter is the Spank Type being counted, and must be a number from 1 to 5. For example, "/spanked 3 20" will add 20 spanks to the total completed for spank type 3.', u, appNoticeColor); } else if (isNaN(spanknumber) || spanktype < 1) { cb.sendNotice('UltraApp: The second parameter is the Number of Spanks being counted as complete, and must be a number greater than zero. For example, "/spanked 3 20" will add 20 spanks to the total completed for spank type 3.', u, appNoticeColor); } else if (spanktype > spankTotalsArray.typ.length) { cb.sendNotice('UltraApp: There is no Spank Type configured for type ' + spanktype + ', there are currently only entries configured up to type ' + spankTotalsArray.typ.length + '.', u, appNoticeColor); } else { completedindex = spanktype - 1; if (spankTotalsArray.tipped[completedindex] < spanknumber) { cb.sendNotice('UltraApp: The number of spanks entered (' + spanknumber + ') is greater than the number tipped for so far (' + spankTotalsArray.tipped[completedindex] + ') for level ' + spanktype + '.', u, appNoticeColor); } else { spanksCompleted(completedindex,spanknumber); } } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The "/spanked" command is for use with the Spank-a-thon Goals app, and that feature is not running.', u, appNoticeColor); } break; } case '/spankall': { cmd = 1; if (whichApp == 'spank') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { spanksdone = false; for (let totindex = 0; totindex < spankTotalsArray.tipped.length; totindex++) { spankstoadd = spankTotalsArray.tipped[totindex] - spankTotalsArray.completed[totindex]; if (spankstoadd > 0) { spanksCompleted(totindex,spankstoadd); spanksdone = true; } } if (spanksdone) { cb.sendNotice('UltraApp: All incomplete spank types were marked as complete.', u, appNoticeColor); spankTotals(); } else { cb.sendNotice('UltraApp: There were no incomplete spank types found, no updates made. You can use the command /spanktotals to see the current number of spanks tipped for and completed.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The "/spankall" command is for use with the Spank-a-thon Goals app, and that feature is not running.', u, appNoticeColor); } break; } //********* Peep Show Commands case '/pv': case '/peepviewers': { cmd = 1; if (whichApp == 'peep') { var peepshowlist = cb.limitCam_allUsersWithAccess().slice(); if (peepshowlist.length > 0) { if (message[1] == 'a' || message[1] == 'A' || message[1] == 'alpha') { var sortedpeepshowlist = peepshowlist.slice(); sortedpeepshowlist.sort(); cb.sendNotice('UltraApp: Alphabetic listing of users currently with access to the Peep Show (' + sortedpeepshowlist.length + ' viewers) : \n' + cbjs.arrayJoin(sortedpeepshowlist, ', ') + '\nEnd of List\nNote this does not viewers who have purchased time before the show starts (use /pb to see a list of people who have bought time for the show and how much time they have left).', u, appNoticeColor); } else { cb.sendNotice('UltraApp: Users currently with access to the Peep Show, in order of when added (' + peepshowlist.length + ' viewers). Use the "alpha" qualifier for a sorted list: \n' + cbjs.arrayJoin(peepshowlist, ', ') + '\nEnd of List\nNote that prior to the show starting, this will only show the "free" viewers. Use the "/pb" command to see a list of people who have bought time for the show and how much time they have left, before or during the show.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: No Peep Show viewers at this time.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature has not yet been started.', u, appNoticeColor); } break; } case '/pb': case '/peepbuyers': { cmd = 1; if (whichApp == 'peep') { if (peepshowPurchasers.length > 0) { buyerlist = ''; for (var i = 0; i < peepshowPurchasers.length; i++) { buyerlist += '\n' + [i+1] + '. ' + peepshowPurchasers[i] + ' (' + peepshowPurchasedTime[i] + ' secs)'; } cb.sendNotice('UltraApp: Users who have purchased time for the Peep Show (and time remaining): ' + buyerlist + '\nEnd of List\nNote this does not include members given free access (use /pv to see everyone viewing the show).', u, appNoticeColor); } else { cb.sendNotice('UltraApp: No Peep Show buyers at this time.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature has not yet been started.', u, appNoticeColor); } break; } case '/peepprice': { cmd = 1; if (isBC || (isMod && cb.settings.peepshowModsChgPrice === 'Yes')) { numprice = parseInt(message[1]) if (isNaN(numprice)) { cb.sendNotice('UltraApp: The value entered for the peep show price is not numeric, please try again.', u, appNoticeColor); break; } else if (numprice < 1 || numprice > 9999) { cb.sendNotice('UltraApp: The value entered for the peep show price is outside allowable values from 1 to 9999, please try again.', u, appNoticeColor); } else { announce = 'no'; if (whichApp == 'peep') { cb.sendNotice('UltraApp: The Peep Show price has been updated to ' + numprice + ' tokens/min.', u, appNoticeColor); announce = 'yes'; } else { cb.sendNotice('UltraApp: The Peep Show price has been updated to ' + numprice + ' tokens/min, however the UltraApp Peep Show feature is not yet active.', u, appNoticeColor); } setPeepShowPrice(numprice,announce); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/peeplength': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { numlength = parseInt(message[1]) if (isNaN(numlength)) { cb.sendNotice('UltraApp: The value entered for the peep show length is not numeric, please try again.', u, appNoticeColor); break; } else if (numlength < 1 || numlength > 300) { cb.sendNotice('UltraApp: The value entered for the peep show length is outside allowable values from 1 to 300, please try again.', u, appNoticeColor); } else { announce = 'no'; if (whichApp == 'peep') { cb.sendNotice('UltraApp: The Peep Show Length has been updated to ' + numlength + ' minutes.', u, appNoticeColor); announce = 'yes'; } else { cb.sendNotice('UltraApp: The Peep Show Length has been updated to ' + numlength + ' minutes, however the Peep Show feature is not yet active.', u, appNoticeColor); } setPeepShowLength(numlength,announce); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } case '/peepstarttimer': case '/peeptimer': { cmd = 1; if (whichApp == 'peep') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { numtimer = parseInt(message[1]) if(isNaN(numtimer)) { cb.sendNotice('UltraApp: The value entered for the minutes to use for the peep show start timer is not numeric, please try again.', u, appNoticeColor); break; } else if (numtimer < 1 || numtimer > 60) { cb.sendNotice('UltraApp: The value entered for the minutes to use for the peep show start timer is outside allowable values from 1 to 60 minutes, please try again.', u, appNoticeColor); } else { startPeepShowStartTimer(numtimer); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } case '/peepaddtime': { cmd = 1; if (whichApp == 'peep') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { numtimer = parseInt(message[1]); if(isNaN(numtimer)) { cb.sendNotice('UltraApp: The value entered for the minutes to add to the peep show start timer is not numeric, please try again.', u, appNoticeColor); } else if(numtimer < -60 || numtimer > 60) { cb.sendNotice('UltraApp: The value entered for the minutes to add to the peep show start timer is outside allowable values from -60 to 60, please try again. Negative numbers can be used to subtract time.', u, appNoticeColor); } else if(numtimer == 0) { cb.sendNotice('UltraApp: Cannot add zero time.', u, appNoticeColor); } else if(numtimer < 0 && Math.abs(numtimer) > peepshowStartMinsRemain) { cb.sendNotice('UltraApp: The value entered for the minutes to subtract is greater than the remaining time on the timer, please try again. Negative numbers can be used to subtract time.', u, appNoticeColor); } else if(numtimer > 0 && (Math.abs(numtimer) + peepshowStartMinsRemain) > 60) { cb.sendNotice('UltraApp: The value entered for the minutes to add would exceed the maximum countdown time of 60 minutes when added to the current time left.', u, appNoticeColor); } else { peepshowStartAddTime(numtimer, u); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } case '/peepstoptimer': { cmd = 1; if (whichApp == 'peep') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (peepshowStartMinsRemain > 0 || peepshowStartSecsRemain > 0) { stopPeepShowStartTimer(u); } else { cb.sendNotice('UltraApp: A Peep Show timer is not currently running.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } case '/peepadd': { cmd = 1; if (whichApp == 'peep') { if (isBC || (isMod && cb.settings.ticketShowModsAdd == 'Yes')) { if (message[1]) { peepshowAddRmvTime('addfree',message[1].toLowerCase(),'common',0); } else { cb.sendNotice('UltraApp: A parameter is required to specify the user that is to be given additional time. The command should be in the format "/peepadduser username"', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: You do not have authority to use the /peepadd command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature is not yet active in the UltraApp.', u, appNoticeColor); } break; } case '/peeprmv': { cmd = 1; if (whichApp == 'peep') { if (isBC || (isMod && cb.settings.peepshowModsAdd === 'Yes')) { if(message[1] != '' && message[1] != null) { peepshowAddRmvTime('remove', message[1].toLowerCase(),'',0); } else { cb.sendNotice('UltraApp: No user was specified for the /peeprmv command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: You do not have authority to use the /peeprmv command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } case '/peeptimeleft': { cmd = 1; if (whichApp == 'peep') { if (showStage == 'peepaftershow') { cb.sendNotice('UltraApp: The Peep Show has finished.', u, appNoticeColor); } else if (showStage == 'peepsales') { cb.sendNotice('UltraApp: The Peep Show has not yet started.', u, appNoticeColor); } else { if (monitorMinsRem > 0) { cb.sendNotice('UltraApp: There are approximately ' + monitorMinsRem + ' minutes remaining in the planned show time.', '', appNoticeColor, '', 'bold'); } else if (monitorSecsRem > 0) { cb.sendNotice('UltraApp: There is less than a minute remaining in the planned show time.', '', appNoticeColor, '', 'bold'); } else { cb.sendNotice('UltraApp: The planned show time has expired.', u, appNoticeColor); } } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } case '/mytime': { cmd = 1; if (whichApp == 'peep') { if (cbjs.arrayContains(peepshowFreeViewers,u)) { cb.sendNotice('You have free access to the full show, you do not need to purchase time.', u, peepBgColor, peepTxtColor, 'bold'); } else { timeleftliteral = peepshowMyTimeLeft(u); if (timeleftliteral == 'none') { cb.sendNotice('You have not purchased any time for this show, you can tip to buy time for the show.', u, peepBgColor, peepTxtColor, 'bold'); } else if (timeleftliteral == 'expired') { cb.sendNotice('The time you have purchased has run out, you can tip to buy more time for the show.', u, peepBgColor, peepTxtColor, 'bold'); } else { if (showStage == 'peepaftershow') { cb.sendNotice('The Peep Show has finished. You have ' + timeleftliteral + ' remaining that can be used if ' + bctext + ' starts another Peep Show.', u, peepBgColor, peepTxtColor, 'bold'); } else if (showStage == 'peepsales') { cb.sendNotice('The Peep Show has not yet started. You have purchased ' + timeleftliteral + ' that will be applied toward the show once ' + bctext + ' starts the Peep Show.', u, peepBgColor, peepTxtColor, 'bold'); } else { cb.sendNotice('You have ' + timeleftliteral + ' remaining that you have purchased. There are approximately ' + monitorMinsRem + ' minutes remaining in the show. You can add more time at the rate of ' + peepshowPrice + ' tokens/min.', u, peepBgColor, peepTxtColor, 'bold'); } } } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } case '/peepsubject': { cmd = 1; if (whichApp == 'peep') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { peepshowSubjectText = msg['m'].substring(13).trim(); if (peepshowSubjectText != '' && peepshowSubjectText != null) { changeRoomSubject(); } else { cb.sendNotice('UltraApp: No value was specified for the new room subject suffix.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } case '/peeprestart': { cmd = 1; if (whichApp == 'peep') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (!cb.limitCam_isRunning()) { if (isBC) { startedby = bctext; } else { startedby = u; } restartPeepShow(startedby); } else { cb.sendNotice('UltraApp: A Peep Show is already running.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } case '/peepautoend': { cmd = 1; if (whichApp == 'peep') { if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { if (message[1]) { newmode = message[1].toLowerCase(); if (newmode == 'on') { if (peepshowAutoEnd == 'Yes') { cb.sendNotice('UltraApp: The Peep Show is already configured to end automatically after the planned show length.', u, appNoticeColor); } else { peepshowAutoEnd = 'Yes'; cb.sendNotice('UltraApp: The "Auto-end" setting has been changed to end automatically after the planned show length.', u, appNoticeColor); } } else if (newmode == 'off') { if (peepshowAutoEnd == 'No') { cb.sendNotice('UltraApp: The Peep Show is already configured to NOT end automatically after the planned show length.', u, appNoticeColor); } else { peepshowAutoEnd = 'No'; cb.sendNotice('UltraApp: The "Auto-end" setting has been changed to NOT end automatically after the planned show length.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: An invalid parameter was entered, a parameter of "on" or "off" is required for this command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: No parameter was entered, a parameter of "on" or "off" is required for this command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: The Peep Show feature is not running.', u, appNoticeColor); } break; } //******** VIP Commands *********** case '/addvip': { cmd = 1; if (isBC) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { addnotice = 'UltraApp: Adding multiple users to the UltraApp ' + VIPname + '.'; addnotice += '\nNote this is only applied during this session, permanent ' + VIPname + ' changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.'; for (var vipi = 0; vipi < cmdvalsplit.length; vipi++) { if (cmdvalsplit[vipi] != '') { nametoadd = cmdvalsplit[vipi].toLowerCase(); if (!cbjs.arrayContains(VIPListArray, nametoadd)) { addRmvVIP(nametoadd,'a'); addnotice += '\nAdded ' + nametoadd + ' to the UltraApp ' + VIPname + '.'; cb.sendNotice('UltraApp: ' + u + ' has added you to the UltraApp ' + VIPname + '.', nametoadd, appNoticeColor); } else { addnotice += '\n' + nametoadd + ' is already on the UltraApp ' + VIPname + '. Skipping.'; } } } addnotice += '\nAll users were added and notified.'; cb.sendNotice(addnotice, u, appNoticeColor); cb.sendNotice(u + ' has added multiple users to the UltraApp ' + VIPname + '.\n' + 'Users added: ' + cbjs.arrayJoin(cmdvalsplit, ', '), '', appNoticeColor, '', 'normal', 'red'); } else { nametoadd = message[1].toLowerCase(); if (cbjs.arrayContains(VIPListArray,nametoadd)) { cb.sendNotice('UltraApp: ' + nametoadd + ' is already on the ' + VIPname + '.', u, appNoticeColor); } else { addRmvVIP(nametoadd,'a'); cb.sendNotice('UltraApp: You have added ' + nametoadd + ' to the ' + VIPname + '.\nNote this is only applied during this session, permanent ' + VIPname + ' changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.', u, appNoticeColor); cb.sendNotice('UltraApp: Congratulations! You have been added to the ' + VIPname + '!', nametoadd, appNoticeColor); } } } else { cb.sendNotice('UltraApp: You did not specify the username you want to add to the ' + VIPname + '.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: 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('UltraApp: You have removed ' + nametormv + ' from the ' + VIPname + '.\nNote this is only applied during this session, permanent ' + VIPname + ' changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.', u, appNoticeColor); } else { cb.sendNotice('UltraApp: ' + nametormv + ' is not on the ' + VIPname + '.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: You did not specify the username you want to remove from the ' + VIPname + '.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/viplist': { cmd = 1; if (isMod || isBC) { cb.sendNotice('UltraApp: Users currently on the ' + VIPname + ': ' + VIPListArray.length + '\n' + (VIPListArray.length > 0 == true ? cbjs.arrayJoin(VIPListArray, ', ') : 'No users.') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('UltraApp: Only moderators and broadcasters 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 UltraApp ' + EFCname + ' list.'; addnotice += '\nNote this is only applied during this session, permanent ' + EFCname + ' list changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.'; for (var efci = 0; efci < cmdvalsplit.length; efci++) { if (cmdvalsplit[efci] != '') { nametoadd = cmdvalsplit[efci].toLowerCase(); if (!cbjs.arrayContains(extFanListArray, nametoadd)) { addRmvExtFan(nametoadd,'a'); addnotice += '\nAdded ' + nametoadd + ' to the UltraApp ' + EFCname + ' list.'; cb.sendNotice(u + ' has added you to the UltraApp ' + EFCname + ' list.', nametoadd, appNoticeColor); } else { addnotice += '\n' + nametoadd + ' is already on the UltraApp ' + EFCname + ' list. Skipping.'; } } } addnotice += '\nAll users were added and notified.'; cb.sendNotice(addnotice, u, appNoticeColor); cb.sendNotice(u + ' has added multiple users to the UltraApp ' + EFCname + ' list.\n' + 'Users added: ' + cbjs.arrayJoin(cmdvalsplit, ', '), '', appNoticeColor, '', 'normal', 'red'); } else { nametoadd = message[1].toLowerCase(); if (cbjs.arrayContains(extFanListArray,nametoadd)) { cb.sendNotice('UltraApp: ' + nametoadd + ' is already on the ' + EFCname + ' list.', u, appNoticeColor); } else { addRmvExtFan(nametoadd,'a'); cb.sendNotice('UltraApp: You have added ' + nametoadd + ' to the ' + EFCname + ' list.\nNote this is only applied during this session, permanent ' + EFCname + ' changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.', u, appNoticeColor); cb.sendNotice('UltraApp: Congratulations! You have been added to the ' + EFCname + ' list!', nametoadd, appNoticeColor); } } } else { cb.sendNotice('UltraApp: You did not specify the username you want to add to the ' + EFCname + ' list.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/addfan2': { cmd = 1; if (isBC) { if (cmdval != null) { var cmdvalsplit = cmdval.split(listRegExp); if (cmdvalsplit.length > 1) { addnotice = 'Adding multiple users to the UltraApp ' + EFCname2 + ' list.'; addnotice += '\nNote this is only applied during this session, permanent ' + EFCname2 + ' list changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.'; for (var efci = 0; efci < cmdvalsplit.length; efci++) { if (cmdvalsplit[efci] != '') { nametoadd = cmdvalsplit[efci].toLowerCase(); if (!cbjs.arrayContains(extFanList2Array, nametoadd)) { addRmvExtFan2(nametoadd,'a'); addnotice += '\nAdded ' + nametoadd + ' to the UltraApp ' + EFCname2 + ' list.'; cb.sendNotice(u + ' has added you to the UltraApp ' + EFCname2 + ' list.', nametoadd, appNoticeColor); } else { addnotice += '\n' + nametoadd + ' is already on the UltraApp ' + EFCname2 + ' list. Skipping.'; } } } addnotice += '\nAll users were added and notified.'; cb.sendNotice(addnotice, u, appNoticeColor); cb.sendNotice(u + ' has added multiple users to the UltraApp ' + EFCname2 + ' list.\n' + 'Users added: ' + cbjs.arrayJoin(cmdvalsplit, ', '), '', appNoticeColor, '', 'normal', 'red'); } else { nametoadd = message[1].toLowerCase(); if (cbjs.arrayContains(extFanList2Array,nametoadd)) { cb.sendNotice('UltraApp: ' + nametoadd + ' is already on the ' + EFCname2 + ' list.', u, appNoticeColor); } else { addRmvExtFan2(nametoadd,'a'); cb.sendNotice('UltraApp: You have added ' + nametoadd + ' to the ' + EFCname2 + ' list.\nNote this is only applied during this session, permanent ' + EFCname2 + ' changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.', u, appNoticeColor); cb.sendNotice('UltraApp: Congratulations! You have been added to the ' + EFCname2 + ' list!', nametoadd, appNoticeColor); } } } else { cb.sendNotice('UltraApp: You did not specify the username you want to add to the ' + EFCname2 + ' list.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/rmvfan': { cmd = 1; if (isBC) { if (message[1]) { nametormv = message[1].toLowerCase(); if (cbjs.arrayContains(extFanListArray,nametormv)) { addRmvExtFan(nametormv,'r'); cb.sendNotice('UltraApp: You have removed ' + nametormv + ' from the ' + EFCname + ' list.\nNote this is only applied during this session, permanent ' + EFCname + ' changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.', u, appNoticeColor); } else { cb.sendNotice('UltraApp: ' + nametormv + ' is not on the ' + EFCname + ' list.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: You did not specify the username you want to remove from the ' + EFCname + ' list.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/rmvfan2': { cmd = 1; if (isBC) { if (message[1]) { nametormv = message[1].toLowerCase(); if (cbjs.arrayContains(extFanList2Array,nametormv)) { addRmvExtFan2(nametormv,'r'); cb.sendNotice('UltraApp: You have removed ' + nametormv + ' from the ' + EFCname2 + ' list.\nNote this is only applied during this session, permanent ' + EFCname2 + ' changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.', u, appNoticeColor); } else { cb.sendNotice('UltraApp: ' + nametormv + ' is not on the ' + EFCname2 + ' list.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: You did not specify the username you want to remove from the ' + EFCname2 + ' list.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/fanlist': { cmd = 1; if (isMod || isBC) { cb.sendNotice('UltraApp: Users currently in the ' + EFCname + ' List: ' + extFanListArray.length + '\n' + (extFanListArray.length > 0 == true ? cbjs.arrayJoin(extFanListArray, ', ') : 'No users.') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('UltraApp: Only moderators and broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/fanlist2': { cmd = 1; if (isMod || isBC) { cb.sendNotice('UltraApp: Users currently in the ' + EFCname2 + ' List: ' + extFanList2Array.length + '\n' + (extFanList2Array.length > 0 == true ? cbjs.arrayJoin(extFanList2Array, ', ') : 'No users.') + '\nEnd of List', u, appNoticeColor); } else { cb.sendNotice('UltraApp: Only moderators and broadcasters 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 UltraApp 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 UltraApp. This list should also be saved to a separate document.'; for (var modi = 0; modi < cmdvalsplit.length; modi++) { if (cmdvalsplit[modi] != '') { nametoadd = cmdvalsplit[modi].toLowerCase(); if (!cbjs.arrayContains(moderatorList.name, nametoadd)) { populateModeratorArray(nametoadd,'botmod','a'); addnotice += '\nAdded ' + nametoadd + ' to the UltraApp Moderator list.'; cb.sendNotice(u + ' has added you to the UltraApp 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 UltraApp Moderator list. Skipping.'; } } } addnotice += '\nAll users were added and notified.'; cb.sendNotice(addnotice, u, appNoticeColor); cb.sendNotice(u + ' has added multiple users to the UltraApp 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('UltraApp: You have added ' + nametoadd + ' to the moderator list.', u, appNoticeColor); cb.sendNotice('Note this is only applied during this session, permanent moderator list changes must be made to the list defined when starting the UltraApp. This list should also be saved to a separate document.', u, appNoticeColor); cb.sendNotice(u + ' has added you to the UltraApp moderator list. You now have all moderator privileges, you can view the full command list with the "/uahelp" command.', nametoadd, appNoticeColor); } else { cb.sendNotice('UltraApp: ' + nametoadd + ' is already on the UltraApp moderator list.', u, appNoticeColor); } } } else { cb.sendNotice('UltraApp: You did not specify the username you want to add to the moderator list.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: 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('UltraApp: You have removed ' + nametormv + ' from the Moderator list.', u, appNoticeColor); } else { cb.sendNotice('UltraApp: ' + nametormv + ' is not in the Moderator list.', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: A parameter is required for this command to specify the user to remove from the Moderator list, such as "/rmvmod username".', u, appNoticeColor); } } else { cb.sendNotice('UltraApp: Only broadcasters are able to use that command.', u, appNoticeColor); } break; } case '/modlist': { cmd = 1; if (isBC || (isMod && cb.settings.allowModsAuthority == 'Yes')) { message = 'UltraApp: '; message += 'Users currently on the UltraApp Moderator List: '; if (moderatorList.name.length > 0) { for (var modli = 0; modli < moderatorList.name.length; modli++) { message += '\n' + (modli+1) + '. ' + moderatorList.name[modli] + ' (' + moderatorList.type[modli] + ')'; } } else { message += '\nNo moderators currently assigned.'; } message += '\nEnd of List'; cb.sendNotice(message, u, appNoticeColor); } else { cb.sendNotice('UltraApp: Only broadcasters and moderators with sufficient authority are able to use that command.', u, appNoticeColor); } break; } //********* Help Menu case '/uahelp': { cmd = 1; if (isMod || isBC) { helpModBC(message[1],u); } else { helpCommon(message[1],u); } break; } //********* End of Expected commands } if (message[0] == '/chscoreboard' || message[0] == '/chs' || message[0] == '/chfixscore' || message[0] == '/chlength' || message[0] == '/chclearlist' || message[0] == '/chskip' || message[0] == '/chwin' || message[0] == '/chend' || message[0] == '/chstoptimer' || message[0] == '/chfree' || message[0] == '/chword' || message[0] == '/chprice' || message[0] == '/chplay' || message[0] == '/chh' || message[0] == '/chq' || message[0] == '/chlist' || message[0] == '/chi' || message[0] == '/charades' || message[0] == '/randomfree' || message[0] == '/random' || message[0] == '/ri' || message[0] == '/rw' || message[0] == '/badfree' || message[0] == '/badlibs' || message[0] == '/bli' || message[0] == '/blc' || message[0] == '/badprice' || message[0] == '/blw' || message[0] == '/addwho' || message[0] == '/addwhat' || message[0] == '/addwhere' || message[0] == '/addhowlong' || message[0] == '/uapresale' || message[0] == '/uapresales' || message[0] == '/backup' || message[0] == '/ki' || message[0] == '/gbhelp' || message[0] == '/whs' || message[0] == '/rri' || message[0] == '/whi' || message[0] == '/di' || message[0] == '/setusercolor' || message[0] == '/setusernn' || message[0] == '/setusericon' || message[0] == '/pt' || message[0] == '/gbstats' || message[0] == '/wi' || message[0] == '/wf' || message[0] == '/warfree' || message[0] == '/pi' || message[0] == '/pf' || message[0] == '/pressfree' || message[0] == '/pw' || message[0] == '/presswinners' || message[0] == '/ww' || message[0] == '/warwinners' || message[0] == '/cpd' || message[0] == '/chgprizedesc' || message[0] == '/addprize' || message[0] == '/cpp' || message[0] == '/changeprizeprice' || message[0] == '/mpl' || message[0] == '/masterprizelist' || message[0] == '/ap' || message[0] == '/pq' || message[0] == '/pressq' || message[0] == '/pressqueue' || message[0] == '/stoppress' || message[0] == '/press' || message[0] == '/pp' || message[0] == '/pressprizes' || message[0] == '/war' || message[0] == '/waragain' || message[0] == '/stopwar' || message[0] == '/warprizes' || message[0] == '/wl' || message[0] == '/warlist' || message[0] == '/wd' || message[0] == '/wardraw' || message[0] == '/wp' || message[0] == '/kb' || message[0] == '/freekeno' || message[0] == '/wargame' || message[0] == '/keno' || message[0] == '/kp' || message[0] == '/kpbc' || message[0] == '/rrprice' || message[0] == '/chambers' || message[0] == '/rrp' || message[0] == '/rr' || message[0] == '/rrs' || message[0] == '/shooters' || message[0] == '/wheelspins' || message[0] == '/wheelprice' || message[0] == '/freespin' || message[0] == '/freeroll' || message[0] == '/wheel' || message[0] == '/wheelprizes' || message[0] == '/dice' || message[0] == '/diceprizes' || message[0] == '/diceprice' || message[0] == '/usegraylock' || message[0] == '/chggraytime' || message[0] == '/fbhelp' || message[0] == '/expps' || message[0] == '/pslist' || message[0] == '/subject' || message[0] == '/check' || message[0] == '/pass' || message[0] == '/plist' || message[0] == '/plistw' || message[0] == '/email' || message[0] == '/newshow' || message[0] == '/useraffle' || message[0] == '/uselushmenu' || message[0] == '/usemedia' || message[0] == '/pm' || message[0] == '/reply' || message[0] == '/bc' || message[0] == '/tm' || message[0] == '/tbm' || message[0] == '/silencelevel' || message[0] == '/graphiclevel' || message[0] == '/ninja' || message[0] == '/unninja' || message[0] == '/ninjalist' || message[0] == '/silence' || message[0] == '/unsilence' || message[0] == '/silencelist' || message[0] == '/tipmenu' || message[0] == '/tipmenurequests' || message[0] == '/tipmenuadd' || message[0] == '/tipmenurmv' || message[0] == '/usemenu' || message[0] == '/posmenu' || message[0] == '/posmenurequests' || message[0] == '/posmenuadd' || message[0] == '/posmenurmv' || message[0] == '/useposmenu' || message[0] == '/startclock' || message[0] == '/addtoclock' || message[0] == '/timeleft' || message[0] == '/stopclock' || message[0] == '/cn' || message[0] == '/cnh' || message[0] == '/cnd' || message[0] == '/cndh' || message[0] == '/usenotifier' || message[0] == '/chgmsg1' || message[0] == '/chgmsg2' || message[0] == '/chgmsg3' || message[0] == '/chgmsg4' || message[0] == '/chgmsg5' || message[0] == '/dspmsg' || message[0] == '/leaders' || message[0] == '/useleaderboard' || message[0] == '/usetipcount' || message[0] == '/tippers' || message[0] == '/poll' || message[0] == '/usepoll' || message[0] == '/endpoll' || message[0] == '/restartpoll' || message[0] == '/addvote' || message[0] == '/polloptadd' || message[0] == '/polloptrmv' || message[0] == '/pollstarttimer' || message[0] == '/polladdtime' || message[0] == '/pollstoptimer' || message[0] == '/pl' || message[0] == '/polllead' || message[0] == '/addnice' || message[0] == '/rmvnice' || message[0] == '/nicelist' || message[0] == '/exportvip' || message[0] == '/exportfans' || message[0] == '/addword' || message[0] == '/rmvword' || message[0] == '/wordlist' || message[0] == '/newsubject' || message[0] == '/dumpsettings' || message[0] == '/checkcolor' || message[0] == '/dsptlist' || message[0] == '/usetlist' || message[0] == '/exptlist' || message[0] == '/addlbtop' || message[0] == '/addlbamt' || message[0] == '/useticketshow' || message[0] == '/exppresale' || message[0] == '/addpresale' || message[0] == '/rmvpresale' || message[0] == '/chgpresalemode' || message[0] == '/lushmenu' || message[0] == '/uselushmenu' || message[0] == '/chgtoy' || message[0] == '/uselush' || message[0] == '/usedomi' || message[0] == '/usenora' || message[0] == '/media' || message[0] == '/usemedia' || message[0] == '/prizes' || message[0] == '/usedice' || message[0] == '/chgdiceprice' || message[0] == '/dicerolls' || message[0] == '/usealltime' || message[0] == '/top10' || message[0] == '/alltime' || message[0] == '/startprivate' || message[0] == '/stopprivate' || message[0] == '/useraffle' || message[0] == '/entries' || message[0] == '/raffletickets' || message[0] == '/raffleentries' || message[0] == '/previousentries' || message[0] == '/resetraffle' || message[0] == '/clearraffle' || message[0] == '/addraffletkt' || message[0] == '/rmvraffletkt' || message[0] == '/addraffleprize' || message[0] == '/rmvraffleprize' || message[0] == '/raffleprizes' || message[0] == '/setraffleprice' || message[0] == '/raffledrawing' || message[0] == '/rafflestarttimer' || message[0] == '/startraffletimer' || message[0] == '/raffleaddtime' || message[0] == '/addraffletime' || message[0] == '/rafflestoptimer' || message[0] == '/stopraffletimer' || message[0] == '/raffletimeleft' || message[0] == '/chgrafflemode') { cmd = 1; } if (cb.settings.fembotRunning != 'Yes') { if (cmd == 0) { cb.sendNotice(message[0] + ' is not a recognized UltraApp, Fembot, or Gamebot command.\nType "/uahelp" to see a full list of the available UltraApp commands.', u, appNoticeColor); } } } // Highlight background for Ticket show and Peep show users if (whichApp == 'ticket' || presalesToggle == 1) { if (cb.limitCam_userHasAccess(u) && showStage != 'aftershow' && !cbjs.arrayContains(ticketShowPreViewerList, u)) { msg['background'] = ticketHolderBgColor; if (cb.settings.ticketshowEnableIcon == 'Yes') { msg.m = ':uaticketsmall ' + msg.m; } } if (cbjs.arrayContains(ticketShowPreViewerList, u)) { msg['background'] = freePreviewerBgColor; } } else if (whichApp == 'peep') { if (cb.limitCam_userHasAccess(u) && showStage != 'peepaftershow') { msg['background'] = peepshowViewerBgColor; } } return msg; }); } // *********************************** Tip Options ********************************** { cb.tipOptions(function(user) { if (cbjs.arrayContains(ninjaTipsOn, user)) { return {options:[{label: '--NOGOAL-- Do not count tips toward goal'}, {label: 'Regular tipping'}], label: 'Choose if you would like your tips to count toward goal :'}; } else { if (whichApp == 'goalrace') { if (cbjs.arrayContains(raceTipNotesOn, user)) { return; } else { return {options:[{label: goalraceDesc1}, {label: goalraceDesc2}], label: 'Select a Goal to Vote for :'}; } } else { return; } } }); } // **************************** Actions on user entering ***************************** { cb.onEnter(function(user) { var u = user.user; var isModEnter = user.is_mod; var isBCEnter = (u === cb.room_slug); var isFanEnter = user.in_fanclub; var isExtFanEnter = cbjs.arrayContains(extFanListArray,u); var isExtFanEnter2 = cbjs.arrayContains(extFanList2Array,u); var isVIPEnter = cbjs.arrayContains(VIPListArray,u); var isNotGray = user.has_tokens; isBotMod = false; if (isModEnter) { populateModeratorArray(u,'cbmod','a'); } else { if (cbjs.arrayContains(moderatorList.name,u)) { nameIndex = moderatorList.name.indexOf(u); if (moderatorList.type[nameIndex] == 'botmod') { isBotMod = true; isModEnter = true; } } } if (isModEnter) { addRmvModsInShow(u,'a'); } if (isFanEnter) { populateFanClubArray(u); } if (isVIPEnter) { addRmvVIPInShow(u,'a'); } if (isExtFanEnter) { addRmvExtFanInShow(u,'a'); } if (isExtFanEnter2) { addRmvExtFanInShow2(u,'a'); } if (whichApp == 'ticket' || presalesToggle == 1) { if (cb.limitCam_userHasAccess(u)) { addViewer(u); if (cbjs.arrayContains(freePreviewUserArray,u)) { addPreViewer(u); } cb.drawPanel(); } } if (whichApp == 'peep') { if(cb.limitCam_userHasAccess(u)) { if (!cbjs.arrayContains(peepshowViewers,u)) { peepshowViewers.push(u); } } } // **** General Entry Message if (cb.settings.enableEntryMessage == 'Yes') { var entrymessage = cb.settings.entryMessage; switch (whichApp) { case 'goals': { entrymessage += '\n* The Progressive Goal Feature is currently active.'; if (progGoalArray.desc.length <= 1) { entrymessage += '\n* There is a single goal for the show.'; } else { entrymessage += '\n* There are ' + totalProgGoals + ' goals set up for the show.'; } cb.sendNotice(entrymessage, u, progGoalBgColor, progGoalTxtColor, 'bold'); break; } case 'goalcount': { entrymessage += '\n* The Goal Counter Feature is currently active.'; entrymessage += '\n* There are prizes at specifc goal levels (' + (cbjs.arrayJoin(goalCounterArray.amt, 'g, ')) + 'g).'; cb.sendNotice(entrymessage, u, goalCountBgColor, goalCountTxtColor, 'bold'); break; } case 'sequence': { entrymessage += '\n* The Tip Sequence Feature is currently active.'; entrymessage += '\n* You can tip in ' + (tipSequenceDirection == 'up' ? 'Ascending' : 'Descending') + ' Sequence to the final goal.'; entrymessage += '\n* There are prizes at specifc count sequence levels (' + (cbjs.arrayJoin(sequenceArray.amt, ', ')) + ').'; cb.sendNotice(entrymessage, u, sequenceBgColor, sequenceTxtColor, 'bold'); break; } case 'tipjar': { if (tipJarRunning) { entrymessage += '\n* The Tip Jar Feature is currently active and the jar has started draining.'; entrymessage += '\n* You can tip to keep the jar full and the prize will be performed until the tip jar is empty.'; } else { entrymessage += '\n* The Tip Jar Feature is currently active.'; entrymessage += '\n* Once the goal is met, the prize will be performed until the tip jar is empty.'; } cb.sendNotice(entrymessage, u, tipjarBgColor, tipjarTxtColor, 'bold'); break; } case 'goalrace': { entrymessage += '\n* The Goal Race Feature is currently active. \n* You can tip to vote for one of the goals.'; entrymessage += '\n* When tipping, a selection list will show in the tip pop-up, select the goal the vote for.'; entrymessage += '\n* If you would like to send ' + bctext + ' tip notes rather than voting,'; entrymessage += '\n* you can use the command /tipnoteon to change your personal setting to allow tipnotes.'; entrymessage += '\n* You can then use /tipnoteoff to switch back to voting with your tips.'; if (cb.settings.goalraceAllowClaim == 'Yes') { entrymessage += '\n* If you do not choose a goal to vote for at the time of tipping, you can use'; entrymessage += '\n* the commands "/addrace1" or "/addrace2" to assign your tips to goal 1 or 2 later.'; } cb.sendNotice(entrymessage, u, goalraceBgColor, goalraceTxtColor, 'bold'); break; } case 'spank': { entrymessage += '\n* The Spank-a-thon Feature is currently active!'; entrymessage += '\n* You can tip for different types of spanks to fill up the Spank Bank.'; entrymessage += '\n* Use the command /spankmenu to see the tip menu for spanks.'; cb.sendNotice(entrymessage, u, spankBgColor, spankTextColor, 'bold'); break; } case 'none': { cb.sendNotice(entrymessage, u, '', '', 'bold'); break; } } if (presalesToggle == 1) { cb.sendNotice('\u21E8 Ticket Show Pre-sales are active. \nYou can now buy advance tickets to the show at a price of ' + presalePrice + ' tokens. \nYou will automatically be added to the ticket show when the Ticket Show app is started later. \nBuy now before the price goes up! Ticket show price will be ' + ticketPrice + ' tokens.', u, ticketBgColor, ticketTxtColor, 'bold'); } } // **** Ticket Show functions and message if (!isBCEnter) { if (whichApp == 'ticket' || presalesToggle == 1) { if (isModEnter || isFanEnter || isExtFanEnter || isExtFanEnter2 || isVIPEnter) { checkFreeTickets(u,isModEnter,isFanEnter,isExtFanEnter,isExtFanEnter2,isVIPEnter,'enter'); } if (cb.limitCam_isRunning()) { if (!cb.limitCam_userHasAccess(u)) { if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice(dashLine80 + '\nToday\'s Ticket Show is a Fan Appreciation Show!\nOnly configured Fan Club Members will be admitted to the show!\nPlease consider joining the Fan Club!\n' + dashLine80, u, ticketBgColor, ticketTxtColor, "bold"); } else { if (freePreviewLength > 0 && (showStage == 'ticketshow' || showStage == 'showwarn')) { if (!cbjs.arrayContains(freePreviewUserArray,u)) { if ((cb.settings.ticketShowPreviewGrays == 'No' && isNotGray) || cb.settings.ticketShowPreviewGrays == 'Yes') { addRmvPreview('add',u); cb.sendNotice(dashLine80 + '\n' + bctext + ' has enabled a Free Preview of the Ticket Show.\n You will be able to see the show for ' + freePreviewLengthText + '. \n After that you must buy a ticket to continue.\n' + dashLine80, u, ticketBgColor,ticketTxtColor,'bold'); } } } if (showStage == 'ticketshow') { cb.sendNotice(dashLine80 + '\n \u25B7 Hidden Ticket Show in progress for ' + ((Date.now() - hiddenTime)/60000).toFixed(1) + ' minutes. \u25C1 \nThe ticket price is ' + ticketPrice + ' tokens.\n' + dashLine80, u, ticketBgColor,ticketTxtColor,'bold'); if (ticketShowOtToggle == 1) { cb.sendNotice(dashLine80 + '\n* ' + bctext + ' has enabled the Outstanding Ticket Feature. \n* You can use the command "/otlist" to see if you have an outstanding ticket. \n* You can use a saved outstanding ticket with the command "/useticket". \n* You can also save your ticket for a future show using the command "/saveticket" if the show has not staretd yet.\n' + dashLine80, u, ticketBgColor, ticketTxtColor, 'bold'); } } else if (showStage == 'showwarn') { cb.sendNotice(dashLine90 + '\n \u25B7 Hidden Ticket Show in progress for ' + ((Date.now() - hiddenTime)/60000).toFixed(1) + ' minutes. \u25C1 \n ' + bctext + ' has indicated show is nearly over. \nBuying a ticket is not recommended, but you may still buy one for ' + ticketPrice + ' tokens.\n' + dashLine90, u, ticketBgColor,ticketTxtColor,'bold'); } else if (showStage == 'showfinale') { cb.sendNotice(dashLine90 + '\n \u25B7 Hidden Ticket Show in progress for ' + ((Date.now() - hiddenTime)/60000).toFixed(1) + ' minutes. \u25C1 \n ' + bctext + ' has indicated show is nearly over. \nTicket Sales have been suspended, you can no longer buy a ticket. \n' + bctext + ' may be returning to public chat shortly.\n' + dashLine90, u, ticketBgColor,ticketTxtColor,'bold'); } } } else { if (cbjs.arrayContains(ticketShowPreViewerList,u)) { cb.sendNotice(dashLine80 + '\nYou are currently in your free preview period. \n Once it ends, you must buy a ticket to continue watching the show.\n' + dashLine80, u, ticketBgColor,ticketTxtColor,'bold'); } } } else { if (showStage == 'ticketsales') { if (cb.settings.ticketShowFanAppreciation == 'Yes') { if (cb.limitCam_userHasAccess(u)) { cb.sendNotice(dashLine90 + '\nWelcome! You have a ticket to the Fan Appreciation show and the show has not yet started.\n' + dashLine90, u, ticketBgColor, ticketTxtColor, "bold"); } else { cb.sendNotice(dashLine80 + '\nToday\'s Ticket Show is a Fan Appreciation Show!\nOnly configured Fan Club Members will be admitted to the show!\nPlease consider joining the Fan Club!\n' + dashLine80, u, ticketBgColor, ticketTxtColor, "bold"); } } else { if (cb.limitCam_userHasAccess(u)) { cb.sendNotice(dashLine80 + '\nWelcome! You have a ticket to the show and the show has not yet started.\n' + dashLine80, u, ticketBgColor, ticketTxtColor, "bold"); } else { msg = dashLine80 + '\nTicket Show sales are active and the show has not yet started. \nThe ticket price is ' + ticketPrice + ' tokens.'; if (ticketShowStartPrice > 0) { msg += '\nThe ticket price will increase to ' + ticketShowStartPrice + ' tokens when the show is started.'; msg += '\nGet your ticket before the price goes up!'; } msg += '\n' + dashLine80; cb.sendNotice(msg, u, ticketBgColor, ticketTxtColor, "bold"); } if (ticketShowAllowGift == 'Yes') { cb.sendNotice(dashLine80 + '\n* ' + bctext + ' has enabled the the gifting of tickets. \n* You can buy extra tickets and gift them to others.\n* See help text for info using the "/uahelp" command. \n' + dashLine80, u, ticketBgColor, ticketTxtColor, 'bold'); } if (ticketShowOtToggle == 1) { cb.sendNotice(dashLine80 + '\n* ' + bctext + ' has enabled the Outstanding Ticket Feature. \n* You can use the command "/otlist" to see if you have an outstanding ticket. \n* You can use a saved outstanding ticket with the command "/useticket". \n* You can also save your ticket for a future show using the command "/saveticket" if the show has not started yet.\n' + dashLine80, u, ticketBgColor, ticketTxtColor, 'bold'); } } } else if (showStage == 'aftershow' || ticketShowEnded === true) { cb.sendNotice(dashLine60 + '\nThe Ticket Show is over.\n' + dashLine60, u, ticketBgColor, ticketTxtColor, 'bold'); } } } } // **** Peep Show functions and message if (!isBCEnter && whichApp == 'peep') { if (isModEnter || isFanEnter || isExtFanEnter || isExtFanEnter2 || isVIPEnter) { if (!cbjs.arrayContains(peepshowFreeViewers,u) && showStage != 'peepaftershow') { checkFreePeepShow(u,isModEnter,isFanEnter,isExtFanEnter,isExtFanEnter2,isVIPEnter); } } if (!cbjs.arrayContains(peepshowFreeViewers,u)) { if (cb.limitCam_isRunning()) { message = dashLine90 + '\nThe Peep Show has been in progress for ' + timeMinSecLiteral((Date.now() - peepshowStartHiddenTime)/1000); message += '\nApproximately ' + timeMinSecLiteral((peepShowEndTime - Date.now())/1000) + ' remain until planned end of show.'; if (!cb.limitCam_userHasAccess(u)) { if (showStage == 'peepshow') { message += '\nYou can buy time during the show for ' + peepshowPrice + ' tokens/min.\nTime is added in 10 second increments based on tip amount.\nThe minimum tip amount to buy time is ' + minimumPeepShowTip + ' tokens.\nBased on the planned end time, tipping ' + ((monitorMinsRem-1)*peepshowPrice + Math.floor((monitorSecsRem)*(peepshowPrice/6))) + ' tokens would buy time for\nthe remainder of the show.\n' + dashLine90; } else if (showStage == 'peepshowwarn') { message += '\n' + bctext + ' has indicated the show is nearly over. \nBuying time is not recommended, but you may buy for ' + peepshowPrice + ' tokens per minute.\nThe minimum tip amount to buy time is ' + minimumPeepShowTip + ' tokens.\n' + dashLine90; } else if (showStage == 'peepshowfinale') { message += '\n' + bctext + ' has indicated the show is nearly over. \nPeep Show time purchases are suspended. \n' + bctext + ' may be returning to public chat shortly.\n' + dashLine90; } } else { message += dashLine90; } cb.sendNotice(message,u, peepBgColor, peepTxtColor, 'bold'); } else { if (showStage == 'peepsales') { if (cbjs.arrayContains(peepshowPurchasers,u)) { index = peepshowPurchasers.indexOf(u); purchasedTimeRemaining = peepshowPurchasedTime[index]; if (purchasedTimeRemaining > 0) { purchasetime = timeMinSecLiteral(purchasedTimeRemaining); } else { return '0 minutes'; } cb.sendNotice(dashLine80 + '\nWelcome back! You have purchased ' + purchasetime + ' for the show and the show has not yet started.\n' + dashLine80, u, peepBgColor, peepTxtColor, "bold"); } else { cb.sendNotice(dashLine90 + '\n' + bctext + ' will be doing a Peep Show today. \nYou can buy time before or during the show for ' + peepshowPrice + ' tokens/min.\nTime is added in 10 second increments based on tip amount.\nBased on the planned show length, tipping ' + (monitorMinsRem*peepshowPrice) + ' tokens would buy time for\nthe entire show.\n' + dashLine90, u, peepBgColor, peepTxtColor, "bold"); } } else if (showStage == 'aftershow' || peepshowEnded == true) { cb.sendNotice(dashLine60 + '\nThe Peep Show has finished.\n' + dashLine60, u, peepBgColor, peepTxtColor, 'bold'); } } } } }); } // *********************************** Actions upon leaving ************************************** { cb.onLeave(function(user) { var u = user.user; if (u != cb.room_slug) { if (whichApp == 'ticket' || presalesToggle == 1) { removeViewer(u); removePreViewer(u); } if (whichApp == 'peep') { if (cbjs.arrayContains(peepshowViewers,u)) { cbjs.arrayRemove(peepshowViewers,u); } } } }); } // *********************************** Actions upon Draw Panel ************************************** cb.onDrawPanel(function (user) { var panel = {}; if (customPanel) { panel.template = 'image_template'; panel.row1_label = "row1_label"; panel.row1_value = "row1_value"; panel.row2_label = "row2_label"; panel.row2_value = "row2_value"; panel.row3_label = "row3_label"; panel.row3_value = "row3_value"; } else { panel.template = '3_rows_11_21_31'; } if (whichApp == 'ticket') { if (cb.settings.ticketShowFanAppreciation == 'Yes') { panel.row1_value = 'Fan Appreciation Ticket Show'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Only Fan Club and ' + VIPname + ' Admitted'; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Join the Fanclub Today to See the Show!'; leftjust3 = leftJustify(panel.row3_value,3); } else if (showStage == 'ticketsales') { if (ticketStartMode == 'ticketgoal') { panel.row1_value = 'Start Mode: Ticket Goal \u25FE ' + ticketShowTotalTicketsBought + ' / ' + ticketShowGoalTickets + ' tickets'; leftjust1 = leftJustify(panel.row1_value+'..',1); panel.row2_value = 'Ticket Holders: ' + countTickets + ' \u25FE Viewers: ' + ticketShowViewerList.length; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Ticket Price: ' + ticketPrice + ' tokens ' + (cb.settings.showTotals == 'Yes' ? (' \u25FE Total Tips: ' + currentAppTotalTicket) : ''); leftjust3 = leftJustify(panel.row3_value,3); } else if (ticketStartMode == 'tokengoal') { panel.row1_value = 'Start Mode: Token Goal \u25FE ' + ticketShowTotalTips + ' / ' + ticketShowGoalTokens + ' tokens'; leftjust1 = leftJustify(panel.row1_value+'...',1); panel.row2_value = 'Ticket Holders: ' + countTickets + ' \u25FE Viewers: ' + ticketShowViewerList.length; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Ticket Price: ' + ticketPrice + ' tokens ' + (cb.settings.showTotals == 'Yes' ? (' \u25FE Total Tips: ' + currentAppTotalTicket) : ''); leftjust3 = leftJustify(panel.row3_value,3); } else if (ticketStartMode == 'timer') { panel.row1_value = 'Start Mode: Timer (' + ((ticketSecsRemain > 0 || ticketMinsRemain > 0) ? ticketTimeLeftPanel() : 'Timer not yet started') + ')'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Ticket Holders: ' + countTickets + ' \u25FE Viewers: ' + ticketShowViewerList.length; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Ticket Price: ' + ticketPrice + ' tokens ' + (cb.settings.showTotals == 'Yes' ? (' \u25FE Total Tips: ' + currentAppTotalTicket) : ''); leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'Start Mode: Manual'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Ticket Holders: ' + countTickets; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Ticket Price: ' + ticketPrice + ' tokens ' + (cb.settings.showTotals == 'Yes' ? (' \u25FE Total Tips: ' + currentAppTotalTicket) : ''); leftjust3 = leftJustify(panel.row3_value,3); } } else if (showStage == 'showfinale') { panel.row1_value = 'Ticket Holders: ' + countTickets; leftjust1 = leftJustify(panel.row1_value,1); if (freePreviewLength > 0 && ticketShowPreViewerList.length > 0) { panel.row2_value = 'Viewers: ' + ticketShowViewerList.length + ' (' + ticketShowPreViewerList.length + ' previewer' + (ticketShowPreViewerList.length == 1 ? '' : 's') + ' included)'; } else { panel.row2_value = 'Viewers: ' + ticketShowViewerList.length; } leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Show ending soon, no more ticket sales!'; leftjust3 = leftJustify(panel.row3_value,3); } else if (showStage == 'aftershow') { panel.row1_value = 'Ticket Show is Over!'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Thank you so much everyone for joining!'; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = ticketAppPanelText3; leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'Ticket Holders: ' + countTickets; leftjust1 = leftJustify(panel.row1_value,1); if (freePreviewLength > 0 && ticketShowPreViewerList.length > 0) { panel.row2_value = 'Viewers: ' + ticketShowViewerList.length + ' (' + ticketShowPreViewerList.length + ' previewer' + (ticketShowPreViewerList.length == 1 ? '' : 's') + ' included)'; } else { panel.row2_value = 'Viewers: ' + ticketShowViewerList.length; } leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Ticket Price: ' + ticketPrice + ' tokens ' + (cb.settings.showTotals == 'Yes' ? (' \u25FE Total Tips: ' + currentAppTotalTicket) : ''); leftjust3 = leftJustify(panel.row3_value,3); } } else if (whichApp == 'goals') { if (!finalGoalMet) { if (cb.settings.progressiveUpDown == 'Count Up To Goal') { panel.row1_value = 'Current Goal (#' + (currentGoal) + ') : ' + (currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips) + ' / ' + currentGoalTotal + ' \u25FE (' + (currentGoalTotal-(currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)) + ' left)'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips),currentGoalTotal) + ' (' + Math.floor((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)/currentGoalTotal*100) + ' %)'; leftjust2 = 42; if (cb.settings.showTotals == 'Yes') { panel.row3_value = 'Total Goal Show Tips: ' + currentAppTotalGoal; } else { panel.row3_value = 'At Goal: ' + currentGoalDesc; } leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'To Goal: ' + (currentGoalTips <= 0 ? '0 \u25FE Goal Reached!' : currentGoalTips + ' \u25FE Countdown to 0') ; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar((currentGoalTips <= 0 ? currentGoalTotal : (currentGoalTotal-currentGoalTips)),currentGoalTotal) + ' (' + Math.floor((currentGoalTips <= 0 ? currentGoalTotal : (currentGoalTotal-currentGoalTips))/currentGoalTotal*100) + ' %)'; leftjust2 = 42; if (cb.settings.showTotals == 'Yes') { panel.row3_value = 'Total Goal Show Tips: ' + currentAppTotalGoal; } else { panel.row3_value = 'At Goal: ' + currentGoalDesc; } leftjust3 = leftJustify(panel.row3_value,3); } } else { panel.row1_value = 'All Goals Completed!'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar(100,100) + ' (100 %)'; leftjust2 = 42; if (cb.settings.showTotals == 'Yes') { panel.row3_value = 'Total Goal Show Tips: ' + currentAppTotalGoal; } else { panel.row3_value = ''; } leftjust3 = leftJustify(panel.row3_value,3); } } else if (whichApp == 'autoreset') { if (!finalGoalMet) { if (resetShowCount) { panel.row1_value = 'Current Goal (#' + (currentGoal) + ') : ' + (currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips) + ' / ' + currentGoalTotal + ' \u25FE (' + (currentGoalTotal-(currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)) + ' left)'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips),currentGoalTotal) + ' (' + Math.floor((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)/currentGoalTotal*100) + ' %)'; leftjust2 = 42; if (autoresetEndAfter > 0) { panel.row3_value = 'Goals Completed: ' + (currentGoal-1) + ' / ' + autoresetEndAfter; } else { panel.row3_value = 'Goals Completed: ' + (currentGoal-1); } leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'Current Goal: ' + (currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips) + ' / ' + currentGoalTotal + ' \u25FE (' + (currentGoalTotal-(currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)) + ' left)'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips),currentGoalTotal) + ' (' + Math.floor((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)/currentGoalTotal*100) + ' %)'; leftjust2 = 42; panel.row3_value = 'Last Tipper: ' + resetLastTip; leftjust3 = leftJustify(panel.row3_value,3); } } else { panel.row1_value = 'All Goals Completed!'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar(100,100) + ' (100 %)'; leftjust2 = 42; if (cb.settings.showTotals == 'Yes') { panel.row3_value = 'Total Auto-Reset Goal Tips: ' + currentAppTotalAutoreset; } else { panel.row3_value = ''; } leftjust3 = leftJustify(panel.row3_value,3); } } else if (whichApp == 'goalcount') { if (!finalGoalMet) { panel.row1_value = 'Current Goal (#' + (currentGoalCountAmt + 1) + '): ' + (currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips) + ' / ' + currentGoalTotal + ' \u25FE (' + (currentGoalTotal-(currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)) + ' left)'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips),currentGoalTotal) + ' (' + Math.floor((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)/currentGoalTotal*100) + ' %)'; leftjust2 = 42; panel.row3_value = 'Completed: ' + currentGoalCountAmt + ' \u25FE Next Prize Level: ' + goalCounterArray.amt[currentGoalLevel-1]; leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'All Goals Completed!'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar(100,100) + ' (100 %)'; leftjust2 = 42; if (cb.settings.showTotals == 'Yes') { panel.row3_value = 'Total Goal Count Tips: ' + currentAppTotalCounter; } else { panel.row3_value = ' '; } leftjust3 = leftJustify(panel.row3_value,3); } } else if (whichApp == 'sequence') { if (!finalGoalMet) { panel.row1_value = 'Next Tip Needed: ' + nextSequence + ' \u25FE Counting ' + tipSequenceDirection + ' to ' + endSequence; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Next Prize at: ' + currentGoalSequence + ' (' + currentGoalDesc + ')'; leftjust2 = leftJustify(panel.row2_value,2); if (cb.settings.showTotals == 'Yes') { panel.row3_value = 'Group Tipping: ' + (groupTipToggle == 1 ? ('ON (' + currentGroupTipAmt + '/' + nextSequence + ')') : 'OFF') + ' \u25FE Seq Tips: ' + currentAppTotalSequence + (cb.settings.tipsequenceShowTotal == 'Yes' ? (' / ' + sequenceTotalTipsGoal) : ''); } else { panel.row3_value = 'Group Tipping: ' + (groupTipToggle == 1 ? ('ON (' + currentGroupTipAmt + '/' + nextSequence + ')') : 'OFF'); } leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'Tip Sequence Completed!'; leftjust1 = leftJustify(panel.row1_value,1); if (cb.settings.showTotals == 'Yes') { panel.row2_value = 'Total Sequence Goal Tips: ' + currentAppTotalSequence; } else { panel.row2_value = ' '; } leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = ' '; leftjust3 = leftJustify(panel.row3_value,3); } } else if (whichApp == 'tipjar') { if (!finalGoalMet) { if (!tipJarRunning) { panel.row1_value = 'Tip Jar Start Goal #' + currentGoalLevel + ' : ' + (currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips) + ' / ' + currentGoalTotal + ' \u25FE (' + (currentGoalTotal-(currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)) + ' rem)'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips),currentGoalTotal) + ' (' + Math.floor((currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)/currentGoalTotal*100) + ' %)'; leftjust2 = 42; panel.row3_value = 'Cycle: ' + (currentGoalRecycleCount+1) + ' / ' + (currentGoalRecycleTotal+1) + ' \u25FE At Goal: ' + currentGoalDesc; leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'Tokens in Jar: ' + tipJarCurrentTokens + ' \u25FE Drain Rate: ' + drainRateText(); leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'While full: ' + currentGoalDesc; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'When Empty: ' + (cb.settings.tipjarWhenEmpty == 'Tip to continue current goal' ? 'Keep tipping to fill the jar' : 'Start Next Goal/Cycle'); leftjust3 = leftJustify(panel.row3_value,3); } } else { panel.row1_value = 'All Goals Completed!'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Progress: ' + goalBar(100,100) + ' (100 %)'; leftjust2 = 42; if (cb.settings.showTotals == 'Yes') { panel.row3_value = 'Total Tip Jar Tips: ' + currentAppTotalTipJar; } else { panel.row3_value = ' '; } leftjust3 = leftJustify(panel.row3_value,3); } } else if (whichApp == 'goalrace') { if (!finalGoalMet) { panel.row1_value = 'Goal Race! ' + goalracePanelText; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = goalraceDesc1.substring(0,12) + ': ' + goalBar((currentGoalRace1Tips > goalraceAmount1 ? goalraceAmount1 : currentGoalRace1Tips),goalraceAmount1) + ' (' + Math.floor((currentGoalRace1Tips > goalraceAmount1 ? goalraceAmount1 : currentGoalRace1Tips)/goalraceAmount1*100) + '%) \u25FE ' + (currentGoalRace1Tips > goalraceAmount1 ? goalraceAmount1 : currentGoalRace1Tips) + '/' + goalraceAmount1; leftjust2 = 15; panel.row3_value = goalraceDesc2.substring(0,12) + ': ' + goalBar((currentGoalRace2Tips > goalraceAmount2 ? goalraceAmount2 : currentGoalRace2Tips),goalraceAmount2) + ' (' + Math.floor((currentGoalRace2Tips > goalraceAmount2 ? goalraceAmount2 : currentGoalRace2Tips)/goalraceAmount2*100) + '%) \u25FE ' + (currentGoalRace2Tips > goalraceAmount2 ? goalraceAmount2 : currentGoalRace2Tips) + '/' + goalraceAmount2; leftjust3 = 15; } else { panel.row1_value = 'Goal Race Completed!'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Winning Goal: ' + goalRaceWinner; leftjust2 = leftJustify(panel.row2_value,2); if (cb.settings.showTotals == 'Yes') { panel.row3_value = 'Total Goal Race Tips: ' + currentAppTotalGoalRace; } else { panel.row3_value = ' '; } leftjust3 = leftJustify(panel.row3_value,3); } } else if (whichApp == 'spank') { panel.row1_value = 'Total Spanks Banked: ' + totalSpanksTipped; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Total Spanks Spanked: ' + totalSpanksCompleted + ' (' + (totalSpanksTipped-totalSpanksCompleted) + ' left)'; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Current Goal (#' + (currentGoal) + ') : ' + (currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips) + ' / ' + currentGoalTotal + ' \u25FE (' + (currentGoalTotal-(currentGoalTips > currentGoalTotal ? currentGoalTotal : currentGoalTips)) + ' left)'; leftjust3 = leftJustify(panel.row3_value,3); } else if (whichApp == 'peep') { if (showStage == 'peepsales') { if (peepshowStartMode == 'timer') { panel.row1_value = 'Start Mode: Timer (' + ((peepshowStartSecsRemain > 0 || peepshowStartMinsRemain > 0) ? peepshowStartTimeLeftPanel() : 'Timer not yet started') + ')'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Buy time before the show starts'; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Price: ' + peepshowPrice + ' tokens/min \u25FE Est length: ' + peepshowLengthOfShow + ' min' + (peepshowLengthOfShow > 1 ? 's' : ''); leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'Peep Show Start Mode: Manual'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Buy time before the show starts'; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Price: ' + peepshowPrice + ' tokens/min \u25FE Est length: ' + peepshowLengthOfShow + ' min' + (peepshowLengthOfShow > 1 ? 's' : ''); leftjust3 = leftJustify(panel.row3_value,3); } } else if (showStage == 'peepfinale') { if (monitorMinsRem > 0) { panel.row1_value = 'Peep Show! Approx ' + monitorMinsRem + ' min' + (monitorMinsRem == 1 ? '' : 's') + ' left in show'; } else { panel.row1_value = 'Peep Show! Planned time complete' } leftjust1 = leftJustify(panel.row1_value,1); var peepshowlist = cb.limitCam_allUsersWithAccess().slice(); numberPeepViewers = peepshowlist.length; panel.row2_value = 'Viewers: ' + numberPeepViewers; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Show ending soon!'; leftjust3 = leftJustify(panel.row3_value,3); } else if (showStage == 'peepaftershow') { panel.row1_value = 'Peep Show is Over!'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Thank you so much everyone for joining!'; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = ' '; leftjust3 = leftJustify(panel.row3_value,3); } else { if (monitorMinsRem > 0) { panel.row1_value = 'Peep Show! Approx ' + monitorMinsRem + ' min' + (monitorMinsRem == 1 ? '' : 's') + ' left in show'; } else { panel.row1_value = 'Peep Show! Planned time complete' } var peepshowlist = cb.limitCam_allUsersWithAccess().slice(); numberPeepViewers = peepshowlist.length; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Viewers: ' + numberPeepViewers; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = 'Tip to join! Price: ' + peepshowPrice + ' tokens/min'; leftjust3 = leftJustify(panel.row3_value,3); } } else if (whichApp == 'none') { if (cb.settings.noAppRunningDisplay == 'No App Running') { panel.row1_value = noAppPanelText1; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = noAppPanelText2; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = noAppPanelText3; leftjust3 = leftJustify(panel.row3_value,3); } else { panel.row1_value = 'Highest Tip: ' + highestTipper + ' (' + highestTip + ')'; leftjust1 = leftJustify(panel.row1_value,1); panel.row2_value = 'Most Recent Tip: ' + mostRecentTipper + ' (' + mostRecentTip + ')'; leftjust2 = leftJustify(panel.row2_value,2); panel.row3_value = noAppPanelText3; leftjust3 = leftJustify(panel.row3_value,3); } } panel.layers = [ {'type': 'image', 'fileID': backgroundImage}, { 'type': 'text', 'text': panel.row1_value, 'top': topjust1, 'left': leftjust1, 'font-size': fontSize, 'font-weight': 'bold', 'color': textColor, }, { 'type': 'text', 'text': panel.row2_value, 'top': topjust2, 'left': leftjust2, 'font-size': fontSize, 'color': textColor, }, { 'type': 'text', 'text': panel.row3_value, 'top': topjust3, 'left': leftjust3, 'font-size': fontSize, 'color': textColor, }, ] return panel; }); // *********************************** Actions upon tipping ************************************** { cb.onTip (function (tip) { var tipAmount = Number.parseInt(tip.amount, 10); var tipNote = tip.message; var tipFromUser = tip.from_user var isFanTip = tip.from_user_in_fanclub; var isExtFanTip = cbjs.arrayContains(extFanListArray,tipFromUser); var isExtFanTip2 = cbjs.arrayContains(extFanList2Array,tipFromUser); var isVIPTip = cbjs.arrayContains(VIPListArray,tipFromUser); // ***** Tip Count Array if (!cbjs.arrayContains(tipCountArray.name, tipFromUser)) { tipCountArray.name.push(tipFromUser); tipCountArray.amount.push(tipAmount); } else { tipCountArray.amount[findTipper(tipFromUser)] += tipAmount; } if (tipAmount >= highestTip) { highestTip = tipAmount; highestTipper = tipFromUser; } mostRecentTip = tipAmount; mostRecentTipper = tipFromUser; // ***** Record tip for goal progress and track total stats countTip = true; tipNoteMessageArray = tipNote.split(' '); if (whichApp != 'ticket' && whichApp != 'peep' && cbjs.arrayContains(tipNoteMessageArray,'--NOGOAL--')) { countTip = false; } if (countTip) { recordTip(tipAmount,tipFromUser,tipNote,isFanTip,isExtFanTip,isExtFanTip2,isVIPTip); } else { cb.sendNotice('UltraApp: ' + tipFromUser + ' tipped with Ninja Tipping enabled, their tip was not counted toward any goals.', cb.room_slug, appNoticeColor); cb.sendNotice('UltraApp: ' + tipFromUser + ' tipped with Ninja Tipping enabled, their tip was not counted toward any goals.', '', appNoticeColor, '', '', 'red'); } // ***** Add to Pre-Sale Ticket List if (presalesToggle == 1 && !cb.limitCam_userHasAccess(tipFromUser) && cb.settings.ticketShowFanAppreciation != 'Yes') { if (tipAmount >= presalePrice) { addRmvPresale('addtip',tipFromUser,'common'); } else { checkCumulative(tipFromUser,tipAmount,presalePrice,'common','presale'); } } }); } // *********************************** Initialize ************************************** { if (initialize == 0) { var BC = cb.room_slug; cb.sendNotice(' :DorothysUltraApp v2.14 '); cb.sendNotice('** Version 2.14 of the UltraApp was released on 1/4/2020, please see the change log at the bottom of the app description page for a list of added features in the current release.', cb.room_slug, appNoticeColor); noAppPanelText1 = 'No App Running'; noAppPanelText2 = 'Use /chgapp to start an UltraApp feature'; if (cb.settings.showTotals == 'Yes') { noAppPanelText3 = 'Total Show Tips: ' + currentSessionTotal; } // *** Initialize variables once at beginning genericInit(); if (cb.settings.EFCname != '' && cb.settings.EFCname != null) { EFCname = cb.settings.EFCname; } else { EFCname = 'External Fan Club'; } if (cb.settings.EFCname2 != '' && cb.settings.EFCname2 != null) { EFCname2 = cb.settings.EFCname2; } else { EFCname2 = 'External Fan Club 2'; } if (cb.settings.VIPname != '' && cb.settings.VIPname != null) { VIPname = cb.settings.VIPname; } else { VIPname = 'VIP List'; } if (cb.settings.bctext != '' && cb.settings.bctext != null) { bctext = cb.settings.bctext; } else { bctext = 'The Broadcaster'; } // *** Load Array for Progressive Goals for (let loadindex = 1; loadindex <= 20; loadindex++) { goalDesc = this["progressiveGoalDescription"+loadindex]; goalAmt = this["progressiveGoalAmount"+loadindex]; goalRecyc = this["progressiveGoalRecycle"+loadindex]; if (goalDesc != '' && goalDesc != null && goalAmt != '' && goalAmt != null) { progGoalArray.desc.push(goalDesc); progGoalArray.amt.push(goalAmt); progGoalArray.recyc.push(goalRecyc); } } // *** Load Array for Goal Counter for (let loadindex = 1; loadindex <= 15; loadindex++) { goalDesc = this["goalCounterDescription"+loadindex]; goalAmt = this["goalCounterAmount"+loadindex]; if (goalDesc != '' && goalDesc != null && goalAmt != '' && goalAmt != null) { goalCounterArray.desc.push(goalDesc); goalCounterArray.amt.push(goalAmt); } } // *** Load Array for Tip Seqeunce for (let loadindex = 1; loadindex <= 10; loadindex++) { goalDesc = this["sequenceDescription"+loadindex]; goalAmt = this["sequenceAmount"+loadindex]; if (goalDesc != '' && goalDesc != null && goalAmt != '' && goalAmt != null) { sequenceArray.desc.push(goalDesc); sequenceArray.amt.push(goalAmt); } } // *** Load Array for Tip Jar for (let loadindex = 1; loadindex <= 10; loadindex++) { goalDesc = this["tipjarDescription"+loadindex]; goalAmt = this["tipjarAmount"+loadindex]; goalRecyc = this["tipjarRecycle"+loadindex]; if (goalDesc != '' && goalDesc != null && goalAmt != '' && goalAmt != null) { tipjarGoalArray.desc.push(goalDesc); tipjarGoalArray.amt.push(goalAmt); tipjarGoalArray.recyc.push(goalRecyc); } } // *** Init Sequence switch (cb.settings.tipsequenceDirection) { case 'Ascending': { tipSequenceDirection = 'up'; break; } case 'Descending': { tipSequenceDirection = 'down'; break; } } // *** Auto-reset parms if (cb.settings.resetShowCount == 'No') { resetShowCount = false; } else { resetShowCount = true; } // *** Init Tip Jar Drain Rate switch (cb.settings.tipjarStartDrainRate) { case '5 tokens per second (fastest)': { setDrainRate(1); break; } case '4 tokens per second': { setDrainRate(2); break; } case '3 tokens per second': { setDrainRate(3); break; } case '2 tokens per second': { setDrainRate(4); break; } case '1 token per second': { setDrainRate(5); break; } case '1 token every 2 seconds': { setDrainRate(6); break; } case '1 token every 3 seconds': { setDrainRate(7); break; } case '1 token every 4 seconds': { setDrainRate(8); break; } case '1 token every 5 seconds': { setDrainRate(9); break; } case '1 token every 10 seconds (slowest)': { setDrainRate(10); break; } } // *** Init Free Preview Length freePreviewLengthText = cb.settings.ticketShowPreviewLength; switch (freePreviewLengthText) { case 'No Preview': { freePreviewLength = 0; break; } case '10 seconds': { freePreviewLength = 10; break; } case '20 seconds': { freePreviewLength = 20; break; } case '30 seconds': { freePreviewLength = 30; break; } case '1 minute': { freePreviewLength = 60; break; } case '2 minutes': { freePreviewLength = 120; break; } case '3 minutes': { freePreviewLength = 180; break; } case '4 minutes': { freePreviewLength = 240; break; } case '5 minutes': { freePreviewLength = 300; break; } } // *** Load Arrays for Spank-a-thon for (let loadindex = 1; loadindex <= 5; loadindex++) { goalDesc = this["spankGoalDescription"+loadindex]; goalAmt = this["spankGoalAmount"+loadindex]; if(goalDesc != '' && goalDesc != null && goalAmt != '' && goalAmt != null) { spankGoalArray.desc.push(goalDesc); spankGoalArray.amt.push(goalAmt); } } for (let j = 1; j <= 5; j++) { menuType = this["spankMenuType"+j]; if (menuType) { spankTotalsArray.typ.push(menuType); spankTotalsArray.tipped.push(0); spankTotalsArray.completed.push(0); for (let loadindex = 1; loadindex <= 3; loadindex++) { menuAmt = this["spankMenuType"+j+"Amount"+loadindex]; menuPrc = this["spankMenuType"+j+"Price"+loadindex]; if (menuAmt && menuPrc) { spankPricesArray.typ.push(menuType); spankPricesArray.number.push(menuAmt); spankPricesArray.price.push(menuPrc); } else { spankPricesArray.typ.push(menuType); spankPricesArray.number.push(0); spankPricesArray.price.push(0); } } } } // *** Init Feature switch (cb.settings.whichApp) { case 'Single/Progressive Goals': { if (validateFeature('goals')) { setAppFeature('goals', BC); } else { setAppFeature('none', BC); } break; } case 'Goal Counter': { if (validateFeature('goalcount')) { setAppFeature('goalcount', BC); } else { setAppFeature('none', BC); } break; } case 'UltraApp Ticket Show': { if (validateFeature('ticket')) { setAppFeature('ticket', BC); } else { setAppFeature('none', BC); } break; } case 'Asc/Desc Tip Sequence Goals': { if (validateFeature('sequence')) { setAppFeature('sequence', BC); } else { setAppFeature('none', BC); } break; } case 'Tip Jar': { if (validateFeature('tipjar')) { setAppFeature('tipjar', BC); } else { setAppFeature('none', BC); } break; } case 'Goal Race': { if (validateFeature('goalrace')) { setAppFeature('goalrace', BC); } else { setAppFeature('none', BC); } break; } case 'Spank-a-thon': { if (validateFeature('spank')) { setAppFeature('spank', BC); } else { setAppFeature('none', BC); } break; } case 'Peep Show': { if (validateFeature('peep')) { setAppFeature('peep', BC); } else { setAppFeature('none', BC); } break; } case 'Auto-Reset Goal': { if (validateFeature('autoreset')) { setAppFeature('autoreset', BC); } else { setAppFeature('none', BC); } break; } case 'None': { setAppFeature('none', BC); break; } default : { setAppFeature('none', BC); break; } } //*** Init Presales for Ticket Show if (cb.settings.ticketShowEnablePresales == 'UltraApp' && cb.settings.ticketShowPresalesMode != 'No Pre-sales') { if (whichApp == 'ticket') { cb.sendNotice('Note: Cannot enable ticket show pre-sales, the Hidden Ticket Show feature was started.', BC, appNoticeColor); enablePresales = false; } else if (whichApp == 'peep' ) { cb.sendNotice('Note: Cannot enable ticket show pre-sales, the Peep Show feature has been started.', BC, appNoticeColor); enablePresales = false; } else { enablePresales = true; } } else { enablePresales = false; } if (enablePresales == true) { if (cb.settings.ticketShowPresalesMode != 'No Pre-sales') { if (cb.settings.ticketShowFanAppreciation == 'Yes') { cb.sendNotice('Unable to start pre-sales since the Ticket Show feature is configured for a Fan Appreciation Show.', BC, appNoticeColor); } else { if (cb.settings.ticketShowPresalePrice > 0) { if (cb.settings.ticketShowPresalePrice > ticketPrice && ticketPrice > 0) { cb.sendNotice('Unable to start pre-sales, the pre-sales price (' + cb.settings.ticketShowPresalePrice + ' tokens) is greater than the planned ticket show price (' + cb.settings.ticketShowPrice + ' tokens).\n Use the command "/presaleprice xx", where xx is in the initial price, to update and then start pre-sales with the command "/startpresale".', BC, appNoticeColor); } else if (ticketPrice <= 0) { cb.sendNotice('Unable to start pre-sales, the Ticket Price for the actual show is not yet defined. You can use the command "/ticketprice [amt]" to update the price, where [amt] is the planned price. The price can be changed later but is required now for pre-sales.', BC, appNoticeColor); } else { setPresalesToggle('on', cb.room_slug,cb.settings.ticketShowPresalePrice); } } else { cb.sendNotice('Unable to start pre-sales, a pre-sale ticket price must be set first using the command "/presaleprice [p]" where [p] is in the initial price. Pre-sales can then be started using the command "/startpresale". ', BC, appNoticeColor); } } } } if (cb.settings.ticketShowStartPrice > 0) { if (cb.settings.ticketShowStartPrice > ticketPrice) { ticketShowStartPrice = cb.settings.ticketShowStartPrice; } else { cb.sendNotice('Unable to set new price for start of Ticket Show as it is not greater than the initial price. Ticket Show Start price change is disabled. You can use the command "/showstartprice xx" to update the price to a value greater than the initial price of ' + ticketPrice + '.', BC, appNoticeColor); ticketShowStartPrice = 0; } } else { ticketShowStartPrice = 0; } //*** Init OT List for Ticket Show if (cb.settings.ticketShowOTList != '' && cb.settings.ticketShowOTList != null) { var n = cb.settings.ticketShowOTList.toLowerCase(); outstandingTicketArray = n.split(','); for (var i = 0; i < outstandingTicketArray.length; i++) { outstandingTicketArray[i] = outstandingTicketArray[i].trim(); } } //*** Init External Fan Club 1 List if (cb.settings.extFanList != '' && cb.settings.extFanList != null) { var n = cb.settings.extFanList.toLowerCase(); extFanListArray = n.split(','); for (var i = 0; i < extFanListArray.length; i++) { extFanListArray[i] = extFanListArray[i].trim(); } } //*** Init External Fan Club 2 List if (cb.settings.extFanList2 != '' && cb.settings.extFanList2 != null) { var n = cb.settings.extFanList2.toLowerCase(); extFanList2Array = n.split(','); for (var i = 0; i < extFanList2Array.length; i++) { extFanList2Array[i] = extFanList2Array[i].trim(); } } //*** Init VIP List if (cb.settings.VIPList != '' && cb.settings.VIPList != null) { var n = cb.settings.VIPList.toLowerCase(); VIPListArray = n.split(','); for (var i = 0; i < VIPListArray.length; i++) { VIPListArray[i] = VIPListArray[i].trim(); } } //*** Init App Mod List if (cb.settings.botModList != '' && cb.settings.botModList != null) { var n = cb.settings.botModList; botModListArray = n.split(','); for (var i = 0; i < botModListArray.length; i++) { usertoadd = botModListArray[i].toLowerCase().trim(); if (usertoadd.length < 3 || usertoadd.includes(' ')) { cb.sendNotice('Cannot load bot moderator list entry ' + usertoadd + ', it is improperly formatted (either contains a blank or is less than 3 characters).', cb.room_slug, appWarningColor); } else { populateModeratorArray(usertoadd,'botmod','a'); } } } //*** Initialize panel if (cb.settings.panelBackground != 'default - no image') { if (cbjs.arrayContains(backgroundArray.menu,cb.settings.panelBackground)) { newbackground = backgroundArray.command[backgroundArray.menu.indexOf(cb.settings.panelBackground)]; customizePanelBackground(newbackground,BC); customizePanelText('',BC); } else { customPanel = false; cb.sendNotice('A custom panel background was chosen but it does not exist, using the default panel background.', BC, appNoticeColor); } } else { customPanel = false; } ultraAppStartTime = new Date(); populateModeratorArray(BC,'broadcaster','a'); initialize = 1; } }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.