Bots Home
|
Create an App
Dorothy's Tip Menu Pro
Author:
dorothy
Description
Source Code
Launch Bot
Current Users
Created by:
Dorothy
/** Name: Dorothy's Tip Menu Pro Author: chelsea2950 Created: 8/3/2019 See Change Log on bot description page for revision history **/ {cb.settings_choices = [ {name: 'dummy0', label: '******************* Introduction ******************** Latest Updt: 1/10/2020 (version 1.3) See Change Log. **************************************************** Welcome to Dorothy\'s Tip Menu Pro. This Bot Contains two regular tip menus that you can save and swap out based on the type of show you are doing, plus a positions menu that you can start in addition the regular menu when it may be needed during a sex show. I\'ve defined a default tip menu and positions menu using prices that I find to be common, but please update these per your preference, the defaults are only suggestions! You do not have to list the prize in order of price, the bot will sort them automatically when displaying the menu. Also, you can see the full list of commands for the bot by typing "/menuhelp" in the chat (no quotes). Please enjoy using the Tip Menu bot and feel free to DM me on twitter @thechelsea2950 if you have questions. Thank you! - chelsea', type: 'choice',required: false}, // *** Tip Menu 1: 50 slots {name: 'dummymenu1', label: '****************** Tip Menu 1 *************************', type: 'choice',required: false}, {name: 'enableTipMenu', label: 'Enable Menu 1 -- Start Tip Menu 1 when you launch the bot? Only menu 1 or menu 2 can be started when the bot is launched, so if both are set to start, only menu 1 will start. Note you can also turn the tip menu on and off during the show using the "/startmenu" and "/stopmenu" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'tipMenuSalePct',label: 'Use Sale Prices? -- If you would like to run a sale on your normal tip menu prices, define the percentage off of normal prices here. For example, if a menu item is normally 90 tokens, putting a value of 10 here (for 10%) would make the price 81 tokens (90 minus 9). Leave the value as zero to use regular prices. Note that using a sale may make some menu item amounts duplicated with other tip prices used elsewhere, or duplicated within the menu if items are close in price, so make sure to check the resulting amounts.', type: 'int',minValue: 0,maxValue: 99, defaultValue: 0}, {name: 'tipMenuNoticeType',label: 'Menu Notice Format -- What format should be used for displaying the tip menu in the chat? Paragraph form is recommended as it uses the fewest lines, and it is recommended if you use more than 15-20 tip menu items to also split the menu into two halves that are displayed on a rotating basis. There must be at least 8 tip menu items for the split to occur. A list format is also available, where each tip menu item is on one line, but this is not recommended as it takes up too many lines in the chat.',type: 'choice',choice1: 'Full Menu - Paragraph Form',choice2: 'Split Menu - Paragraph Form',choice3: 'Full Menu - List Form',choice4: 'Notice only',defaultValue: 'Full Menu - Paragraph Form'}, {name: 'tipMenuDisplayInterval',type: 'str',defaultValue: 3,required: false,label: 'Tip Menu display interval. Decimals are ok as long as they are greater than 1. For example, 1.5 = one minute 30 second intervals.'}, {name: 'listSort',type: 'choice',choice1: 'Do not sort the list',choice2: 'Ascending',choice3: 'Descending',defaultValue: 'Ascending',label: 'Sort the items in the tip menu by price?'}, {name: 'sepChar', type: 'choice',choice1: 'Vertical Bar',choice2: 'Hearts',choice3: 'Glitter',choice4: 'Flowers',choice5: 'Bow',choice6: 'Hearts2',choice7: 'Smiley',choice8: 'Text Heart',choice9: 'Text Diamond',choice10: 'Text Star',choice11: 'Custom',defaultValue: 'Vertical Bar',label: 'Choose your separator character to appear between menu items. You can also use a specific gif by entering one in the next setting below, which will override this setting'}, {name: 'sepCharCustom',type: 'str',defaultValue: ':heart2',required: false,label: 'Choose your custom separator (optional). 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'}, {name: 'sepCharInPrize', label: 'Separator in Chat Response Message? -- Set to "Yes" to have the separator also show at the beginning and end of the chat reponse message that notifies when someone tips for a menu item. Set to "No" to have the Chat Response as text only', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'menuTextColor1',type: 'choice',label: 'Choose your text color for the single menu or part 1 of the split menu',required: false,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 Orange'}, {name: 'menuCustTxtColor1',type: 'str',minLength: 1,maxLength: 7,label: 'If you picked a custom text color in the previous setting, enter the hex color (6 character hex color codes plus the # prefix):',required: false}, {name: 'menuBgColor1',label: 'Choose the background color for the above',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Custom',defaultValue: 'White/No Color'}, {name: 'menuCustBgColor1',type: 'str',minLength: 1,maxLength: 7,label: 'If you picked a custom background highlight color in the previous setting, enter the hex color (6 character hex color codes plus the # prefix)',required: false}, {name: 'menuTextColor2',type: 'choice',label: 'Choose your text color for part 2 of the split menu',required: false,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: 'menuCustTxtColor2',type: 'str',minLength: 1,maxLength: 7,label: 'If you picked a custom text color in the previous setting, enter the hex color (6 character hex color codes plus the # prefix):',required: false}, {name: 'menuBgColor2',label: 'Choose the background color for the above',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Custom',defaultValue: 'White/No Color'}, {name: 'menuCustBgColor2',type: 'str',minLength: 1,maxLength: 7,label: 'If you picked a custom background highlight color in the previous setting, enter the hex color (6 character hex color codes plus the # prefix)',required: false}, {name: 'menuitem1',type: 'str',required: false,defaultValue: 'If you like the show',label: 'Tip Menu Item 1'}, {name: 'menuitemprice1',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 3,required: false,label: 'Item 1 price'}, {name: 'menuitem2',type: 'str',required: false,defaultValue: 'Kiss',label: 'Tip Menu Item 2'}, {name: 'menuitemprice2',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 9,required: false,label: 'Item 2 price'}, {name: 'menuitem3',type: 'str',required: false,defaultValue: 'Makeout',label: 'Tip Menu Item 3'}, {name: 'menuitemprice3',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 21,required: false,label: 'Item 3 price'}, {name: 'menuitem4',type: 'str',required: false,defaultValue: 'Show Feet',label: 'Tip Menu Item 4'}, {name: 'menuitemprice4',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 23,required: false,label: 'Item 4 price'}, {name: 'menuitem5',type: 'str',required: false,defaultValue: '10 Jumping Jacks',label: 'Tip Menu Item 5'}, {name: 'menuitemprice5',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 27,required: false,label: 'Item 5 price'}, {name: 'menuitem6',type: 'str',required: false,defaultValue: '10 Squats',label: 'Tip Menu Item 6'}, {name: 'menuitemprice6',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 31,required: false,label: 'Item 6 price'}, {name: 'menuitem7',type: 'str',required: false,defaultValue: 'Flash Boobs',label: 'Tip Menu Item 7'}, {name: 'menuitemprice7',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 36,required: false,label: 'Item 7 price'}, {name: 'menuitem8',type: 'str',required: false,defaultValue: 'Flash Butt',label: 'Tip Menu Item 8'}, {name: 'menuitemprice8',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 38,required: false,label: 'Item 8 price'}, {name: 'menuitem9',type: 'str',required: false,defaultValue: '5 bare ass hand spanks',label: 'Tip Menu Item 9'}, {name: 'menuitemprice9',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 41,required: false,label: 'Item 9 price'}, {name: 'menuitem10',type: 'str',required: false,defaultValue: '5 paddle spanks',label: 'Tip Menu Item 10'}, {name: 'menuitemprice10',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 43,required: false,label: 'Item 10 price'}, {name: 'menuitem11',type: 'str',required: false,defaultValue: 'PM',label: 'Tip Menu Item 11'}, {name: 'menuitemprice11',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 47,required: false,label: 'Item 11 price'}, {name: 'menuitem12',type: 'str',required: false,defaultValue: 'Flash cock/pussy',label: 'Tip Menu Item 12'}, {name: 'menuitemprice12',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 56,required: false,label: 'Item 12 price'}, {name: 'menuitem13',type: 'str',required: false,defaultValue: 'Tickling',label: 'Tip Menu Item 13'}, {name: 'menuitemprice13',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 62,required: false,label: 'Item 13 price'}, {name: 'menuitem14',type: 'str',required: false,defaultValue: '1 Minute Handjob Tease',label: 'Tip Menu Item 14'}, {name: 'menuitemprice14',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 103,required: false,label: 'Item 14 price'}, {name: 'menuitem15',type: 'str',required: false,defaultValue: '1 Minute BJ Tease',label: 'Tip Menu Item 15'}, {name: 'menuitemprice15',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 115,required: false,label: 'Item 15 price'}, {name: 'menuitem16',type: 'str',required: false,defaultValue: '1 Minute Fingering Tease',label: 'Tip Menu Item 16'}, {name: 'menuitemprice16',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 127,required: false,label: 'Item 16 price'}, {name: 'menuitem17',type: 'str',required: false,defaultValue: 'Tip Menu Item 17',label: 'Tip Menu Item 17'}, {name: 'menuitemprice17',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 17 price'}, {name: 'menuitem18',type: 'str',required: false,label: 'Tip Menu Item 18'}, {name: 'menuitemprice18',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 18 price'}, {name: 'menuitem19',type: 'str',required: false,label: 'Tip Menu Item 19'}, {name: 'menuitemprice19',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 19 price'}, {name: 'menuitem20',type: 'str',required: false,label: 'Tip Menu Item 20'}, {name: 'menuitemprice20',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 20 price'}, {name: 'menuitem21',type: 'str',required: false,label: 'Tip Menu Item 21'}, {name: 'menuitemprice21',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 21 price'}, {name: 'menuitem22',type: 'str',required: false,label: 'Tip Menu Item 22'}, {name: 'menuitemprice22',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 22 price'}, {name: 'menuitem23',type: 'str',required: false,label: 'Tip Menu Item 23'}, {name: 'menuitemprice23',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 23 price'}, {name: 'menuitem24',type: 'str',required: false,label: 'Tip Menu Item 24'}, {name: 'menuitemprice24',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 24 price'}, {name: 'menuitem25',type: 'str',required: false,label: 'Tip Menu Item 25'}, {name: 'menuitemprice25',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 25 price'}, {name: 'menuitem26',type: 'str',required: false,label: 'Tip Menu Item 26'}, {name: 'menuitemprice26',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 26 price'}, {name: 'menuitem27',type: 'str',required: false,label: 'Tip Menu Item 27'}, {name: 'menuitemprice27',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 27 price'}, {name: 'menuitem28',type: 'str',required: false,label: 'Tip Menu Item 28'}, {name: 'menuitemprice28',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 28 price'}, {name: 'menuitem29',type: 'str',required: false,label: 'Tip Menu Item 29'}, {name: 'menuitemprice29',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 29 price'}, {name: 'menuitem30',type: 'str',required: false,label: 'Tip Menu Item 30'}, {name: 'menuitemprice30',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 30 price'}, {name: 'menuitem31',type: 'str',required: false,label: 'Tip Menu Item 31'}, {name: 'menuitemprice31',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 31 price'}, {name: 'menuitem32',type: 'str',required: false,label: 'Tip Menu Item 32'}, {name: 'menuitemprice32',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 32 price'}, {name: 'menuitem33',type: 'str',required: false,label: 'Tip Menu Item 33'}, {name: 'menuitemprice33',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 33 price'}, {name: 'menuitem34',type: 'str',required: false,label: 'Tip Menu Item 34'}, {name: 'menuitemprice34',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 34 price'}, {name: 'menuitem35',type: 'str',required: false,label: 'Tip Menu Item 35'}, {name: 'menuitemprice35',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 35 price'}, {name: 'menuitem36',type: 'str',required: false,label: 'Tip Menu Item 36'}, {name: 'menuitemprice36',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 36 price'}, {name: 'menuitem37',type: 'str',required: false,label: 'Tip Menu Item 37'}, {name: 'menuitemprice37',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 37 price'}, {name: 'menuitem38',type: 'str',required: false,label: 'Tip Menu Item 38'}, {name: 'menuitemprice38',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 38 price'}, {name: 'menuitem39',type: 'str',required: false,label: 'Tip Menu Item 39'}, {name: 'menuitemprice39',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 39 price'}, {name: 'menuitem40',type: 'str',required: false,label: 'Tip Menu Item 40'}, {name: 'menuitemprice40',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 40 price'}, {name: 'menuitem41',type: 'str',required: false,label: 'Tip Menu Item 41'}, {name: 'menuitemprice41',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 41 price'}, {name: 'menuitem42',type: 'str',required: false,label: 'Tip Menu Item 42'}, {name: 'menuitemprice42',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 42 price'}, {name: 'menuitem43',type: 'str',required: false,label: 'Tip Menu Item 43'}, {name: 'menuitemprice43',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 43 price'}, {name: 'menuitem44',type: 'str',required: false,label: 'Tip Menu Item 44'}, {name: 'menuitemprice44',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 44 price'}, {name: 'menuitem45',type: 'str',required: false,label: 'Tip Menu Item 45'}, {name: 'menuitemprice45',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 45 price'}, {name: 'menuitem46',type: 'str',required: false,label: 'Tip Menu Item 46'}, {name: 'menuitemprice46',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 46 price'}, {name: 'menuitem47',type: 'str',required: false,label: 'Tip Menu Item 47'}, {name: 'menuitemprice47',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 47 price'}, {name: 'menuitem48',type: 'str',required: false,label: 'Tip Menu Item 48'}, {name: 'menuitemprice48',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 48 price'}, {name: 'menuitem49',type: 'str',required: false,label: 'Tip Menu Item 49'}, {name: 'menuitemprice49',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 49 price'}, {name: 'menuitem50',type: 'str',required: false,label: 'Tip Menu Item 50'}, {name: 'menuitemprice50',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 0,required: false,label: 'Item 50 price'}, // *** Tip Menu 2: 20 slots {name: 'dummymenu2', label: '***************** Tip Menu 2 ***********************', type: 'choice',required: false}, {name: 'enableTipMenu2', label: 'Enable Menu 2 -- Start Tip Menu 2 when you launch the bot? ? Note you can also turn the tip menu on and off during the show using the "/usemenu2 on" and "/usemenu2 off" commands, or you can switch between menu 1 and menu 2 with the /swapmenu command. Menu 2 uses the same general settings defined above for Menu 1 (interval, color, separator), it is the menu options that are unique.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'tipMenu2SalePct', type: 'int',minValue: -99999,maxValue: 99,label: 'Use Sale Prices? -- If you would like to run a sale on your normal tip menu 2 prices, define the percentage off of normal prices here. For example, put a value of 10 here for 10% off normal prices. Leave the value as zero to use regular prices.', defaultValue: 0}, {name: 'menu2item1',type: 'str',required: false,label: 'Tip Menu 2 Item 1'}, {name: 'menu2itemprice1',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 1 price'}, {name: 'menu2item2',type: 'str',required: false,label: 'Tip Menu 2 Item 2'}, {name: 'menu2itemprice2',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 2 price'}, {name: 'menu2item3',type: 'str',required: false,label: 'Tip Menu 2 Item 3'}, {name: 'menu2itemprice3',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 3 price'}, {name: 'menu2item4',type: 'str',required: false,label: 'Tip Menu 2 Item 4'}, {name: 'menu2itemprice4',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 4 price'}, {name: 'menu2item5',type: 'str',required: false,label: 'Tip Menu 2 Item 5'}, {name: 'menu2itemprice5',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 5 price'}, {name: 'menu2item6',type: 'str',required: false,label: 'Tip Menu 2 Item 6'}, {name: 'menu2itemprice6',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 6 price'}, {name: 'menu2item7',type: 'str',required: false,label: 'Tip Menu 2 Item 7'}, {name: 'menu2itemprice7',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 7 price'}, {name: 'menu2item8',type: 'str',required: false,label: 'Tip Menu 2 Item 8'}, {name: 'menu2itemprice8',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 8 price'}, {name: 'menu2item9',type: 'str',required: false,label: 'Tip Menu 2 Item 9'}, {name: 'menu2itemprice9',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 9 price'}, {name: 'menu2item10',type: 'str',required: false,label: 'Tip Menu 2 Item 10'}, {name: 'menu2itemprice10',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 10 price'}, {name: 'menu2item11',type: 'str',required: false,label: 'Tip Menu 2 Item 11'}, {name: 'menu2itemprice11',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 11 price'}, {name: 'menu2item12',type: 'str',required: false,label: 'Tip Menu 2 Item 12'}, {name: 'menu2itemprice12',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 12 price'}, {name: 'menu2item13',type: 'str',required: false,label: 'Tip Menu 2 Item 13'}, {name: 'menu2itemprice13',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 13 price'}, {name: 'menu2item14',type: 'str',required: false,label: 'Tip Menu 2 Item 14'}, {name: 'menu2itemprice14',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 14 price'}, {name: 'menu2item15',type: 'str',required: false,label: 'Tip Menu 2 Item 15'}, {name: 'menu2itemprice15',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 15 price'}, {name: 'menu2item16',type: 'str',required: false,label: 'Tip Menu 2 Item 16'}, {name: 'menu2itemprice16',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 16 price'}, {name: 'menu2item17',type: 'str',required: false,label: 'Tip Menu 2 Item 17'}, {name: 'menu2itemprice17',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 17 price'}, {name: 'menu2item18',type: 'str',required: false,label: 'Tip Menu 2 Item 18'}, {name: 'menu2itemprice18',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 18 price'}, {name: 'menu2item19',type: 'str',required: false,label: 'Tip Menu 2 Item 19'}, {name: 'menu2itemprice19',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 19 price'}, {name: 'menu2item20',type: 'str',required: false,label: 'Tip Menu 2 Item 20'}, {name: 'menu2itemprice20',type: 'int',minValue: -99999,maxValue: 99999,required: false,label: 'Item 20 price'}, // *** Positions Tip Menu {name: 'dummy9', label: '**************** Positions Menu *********************', type: 'choice',required: false}, {name: 'enablePosTipMenu', label: 'Enable the Positions Tip Menu at the start of the show? Note you can also turn the positions tip menu on and off during the show using the "/useposmenu on" and "/useposmenu off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'posMenuInterval',type: 'str',defaultValue: 3,required: false,label: 'Positions Tip Menu display interval. Decimals are ok as long as they are greater than 1. For example, 1.5 = one minute 30 second intervals.'}, {name: 'posListSort',type: 'choice',choice1: 'Do not sort the list',choice2: 'Ascending',choice3: 'Descending',defaultValue: 'Ascending',label: 'Sort the items in the positions menu by price?'}, {name: 'posSepChar', type: 'choice',choice1: 'Vertical Bar',choice2: 'Hearts',choice3: 'Glitter',choice4: 'Flowers',choice5: 'Bow',choice6: 'Hearts2',choice7: 'Smiley',choice8: 'Text Heart',choice9: 'Text Diamond',choice10: 'Text Star',choice11: 'Custom',defaultValue: 'Vertical Bar',label: 'Choose your separator character to appear between menu items. You can also use a specific gif by entering one in the next setting below, which will override this setting.'}, {name: 'posSepCharCustom',type: 'str',defaultValue: ':heart2',required: false,label: 'Choose your custom separator (optional). 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'}, {name: 'posMenuTxtColor',type: 'choice',label: 'Choose your text color for the positions menu',required: false,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: 'posMenuCustTxtColor',type: 'str',minLength: 1,maxLength: 7,label: 'If you picked a custom text color in the previous setting, enter the hex color (6 character hex color codes plus the # prefix):',required: false}, {name: 'posMenuBgColor',label: 'Choose your background color for the positions menu',required: false,type: 'choice', choice1: 'White/No Color',choice2: 'Light Yellow',choice3: 'Light Blue',choice4: 'Light Pink',choice5: 'Light Red',choice6: 'Light Green',choice7: 'Light Purple',choice8: 'Light Orange',choice9: 'Light Grey',choice10: 'Light Aqua',choice11: 'Custom',defaultValue: 'Light Pink'}, {name: 'posMenuCustBgColor',type: 'str',minLength: 1,maxLength: 7,label: 'If you picked a custom background highlight color in the previous setting, enter the hex color (6 character hex color codes plus the # prefix):',required: false}, {name: 'posMenuItem1',type: 'str',required: false,defaultValue: 'Missionary',label: 'Positions Tip Menu Item 1 '}, {name: 'posMenuItemPrice1',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 101,required: false,label: 'Positions Item 1 price'}, {name: 'posMenuItem2',type: 'str',required: false,defaultValue: 'Doggy Style',label: 'Positions Tip Menu Item 2'}, {name: 'posMenuItemPrice2',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 107,required: false,label: 'Positions Item 2 price'}, {name: 'posMenuItem3',type: 'str',required: false,defaultValue: 'Doggy Style POV',label: 'Positions Tip Menu Item 3'}, {name: 'posMenuItemPrice3',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 109,required: false,label: 'Positions Item 3 price'}, {name: 'posMenuItem4',type: 'str',required: false,defaultValue: 'Cowgirl facing cam',label: 'Positions Tip Menu Item 4'}, {name: 'posMenuItemPrice4',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 112,required: false,label: 'Positions Item 4 price'}, {name: 'posMenuItem5',type: 'str',required: false,defaultValue: 'Cowgirl, back to cam',label: 'Positions Tip Menu Item 5'}, {name: 'posMenuItemPrice5',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 104,required: false,label: 'Positions Item 5 price'}, {name: 'posMenuItem6',type: 'str',required: false,defaultValue: 'Reverse cowgirl facing cam',label: 'Positions Tip Menu Item 6'}, {name: 'posMenuItemPrice6',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 115,required: false,label: 'Positions Item 6 price'}, {name: 'posMenuItem7',type: 'str',required: false,defaultValue: 'Spooning',label: 'Positions Tip Menu Item 7'}, {name: 'posMenuItemPrice7',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 106,required: false,label: 'Positions Item 7 price'}, {name: 'posMenuItem8',type: 'str',required: false,defaultValue: 'Prone Bone (face down from behind)',label: 'Positions Tip Menu Item 8'}, {name: 'posMenuItemPrice8',type: 'int',minValue: -99999,maxValue: 99999,defaultValue: 108,required: false,label: 'Positions Item 8 price'} ]; } { // *********************************** Variables and Arrays ************************************** var initialize = 0; // Used to run initialization once var tipMenuToggle = 0; var tipMenu2Toggle = 0; var posTipMenuToggle = 0; var BC = cb.room_slug; var appNoticeColor = '#a2dfac'; // green highlight var appAlertColor = '#f4c1bc'; // red highlight var dashLine60 = new Array(60).join('-'); var dashLine70 = new Array(70).join('-'); var dashLine80 = new Array(80).join('-'); var dashLine90 = new Array(90).join('-'); var priceCheckArray = {amount: [], name: []}; var TIPMENU = { menuDspIntTime: 0, sepChar: '| ', tipMenu: '', menuPart1: '', menuPart2: '', menuToken: 1, tipMenuPrice: [], tipMenuItem: [], initToken: true, txtColor1: '', bgColor1: '', txtColor2: '', bgColor2: '', menuLength: 0, requesters: [], request: [], }; var TIPMENU2 = { menuDspIntTime: 0, sepChar: '| ', tipMenu: '', menuPart1: '', menuPart2: '', menuToken: 1, tipMenuPrice: [], tipMenuItem: [], initToken: true, txtColor1: '', bgColor1: '', txtColor2: '', bgColor2: '', menuLength: 0, requesters: [], request: [], }; var POSTIPMENU = { posMenuDspIntTime: 0, posSepChar: '| ', posTipMenu: '', posTipMenuPrice: [], posTipMenuItem: [], posInitToken: true, posTxtColor: '', posBgColor: '', posMenuLength: 0, posRequesters: [], posRequest: [], }; } { // *********************************** 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'; 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' 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 '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'; default: return ('|'); } } //********** Price Check Function ************** function priceChecker(mode, name, price, sendto) { if (price != 0 && price !=null) { if (mode === 'add') { if (cbjs.arrayContains(priceCheckArray.name,name)) { nameIndex = priceCheckArray.name.indexOf(name); priceCheckArray.name.splice(nameIndex,1); priceCheckArray.amount.splice(nameIndex,1); } if (cbjs.arrayContains(priceCheckArray.amount,price)) { priceIndex = priceCheckArray.amount.indexOf(price); cb.sendNotice('Warning! There is a duplicate price entry. When adding ' + name + ', the configured price of ' + price + ' was found already in use for ' + priceCheckArray.name[priceIndex] + '.',sendto,appNoticeColor); } if (price == 1 || price == 5 || price == 10 || price == 15 || price == 20 || price == 25 || price == 50 || price == 100) { cb.sendNotice('Warning! When adding ' + name + ', the configured price of ' + price + ' is a common tip amount (1,5,10,15,20,25,50,100) and not recommended for any specific feature price. It is recommended to use uncommon tip amounts for all prices.',sendto,appNoticeColor); } priceCheckArray.name.push(name); priceCheckArray.amount.push(price); } else if (mode === 'rmv') { if (cbjs.arrayContains(priceCheckArray.name,name)) { nameIndex = priceCheckArray.name.indexOf(name); priceCheckArray.name.splice(nameIndex,1); priceCheckArray.amount.splice(nameIndex,1); } } } } // *************************** Tip Menu Functions ************************ function setTipMenuToggle(option, mod) { if(option == 'on') { if(tipMenuToggle == 1) { cb.sendNotice('Tip Menu 1 is already turned on.',mod,appNoticeColor); } else { tipMenuToggle = 1; initMenu(mod); cb.sendNotice(' ' + mod + ' has enabled Tip Menu 1. You control the action by tipping for selections from the menu!','',appNoticeColor,'','bold'); } } else if(option == 'off') { if(tipMenuToggle == 0) { cb.sendNotice('Tip Menu 1 is already turned off.',mod,appNoticeColor); } else { tipMenuToggle = 0; TIPMENU.tipMenuPrice = []; TIPMENU.tipMenuItem = []; cb.sendNotice(' ' + mod + ' has disabled Tip Menu 1. You can no longer tip for selections from Menu 1.','',appNoticeColor,'','bold'); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /usemenu.',mod,appNoticeColor); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /usemenu.',mod,appNoticeColor); } } function setTipMenu2Toggle(option, mod) { if(option == 'on') { if(tipMenu2Toggle == 1) { cb.sendNotice('Tip Menu 2 is already turned on.',mod,appNoticeColor); } else { tipMenu2Toggle = 1; initMenu2(mod); cb.sendNotice(' ' + mod + ' has enabled Tip Menu 2. You control the action by tipping for selections from the menu!','',appNoticeColor,'','bold'); } } else if(option == 'off') { if(tipMenu2Toggle == 0) { cb.sendNotice('Tip Menu 2 is already turned off.',mod,appNoticeColor); } else { tipMenu2Toggle = 0; TIPMENU2.tipMenuPrice = []; TIPMENU2.tipMenuItem = []; cb.sendNotice(' ' + mod + ' has disabled Tip Menu 2. You can no longer tip for selections from Menu 2.','',appNoticeColor,'','bold'); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /usemenu2.',mod,appNoticeColor); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /usemenu2.',mod,appNoticeColor); } } function initMenu(mod) { if (cb.settings.menuTextColor1 == 'Custom') { TIPMENU.txtColor1 = checkTextColor(cb.settings.menuCustTxtColor1); if (TIPMENU.txtColor1 == 'default') { cb.sendNotice('Tip Menu - Error while setting the text color, it has to be in a HEX format, such as #0629AC. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); TIPMENU.txtColor1 = '#0629AC'; } } else { TIPMENU.txtColor1 = checkTextColor(cb.settings.menuTextColor1); } if (cb.settings.menuBgColor1 == 'Custom') { TIPMENU.bgColor1 = checkBgColor(cb.settings.menuCustBgColor1); if (TIPMENU.bgColor1 == 'default') { cb.sendNotice('Tip Menu - Error while setting the background color. It has to be in a HEX format, such as #FFFFFF. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); TIPMENU.bgColor1 = '#FFFFFF'; } } else { TIPMENU.bgColor1 = checkBgColor(cb.settings.menuBgColor1); } if (cb.settings.tipMenuNoticeType == 'Split Menu - Paragraph Form') { if (cb.settings.menuTextColor2 === 'Custom') { TIPMENU.txtColor2 = checkTextColor(cb.settings.menuCustTxtColor2); if (TIPMENU.txtColor2 == 'default') { cb.sendNotice('Tip Menu part 2 - Error while setting the text color for second half of menu, it has to be in a HEX format, such as #0629AC. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); TIPMENU.txtColor2 = '#0629AC'; } } else { TIPMENU.txtColor2 = checkTextColor(cb.settings.menuTextColor2); } if (cb.settings.menuBgColor2 == 'Custom') { TIPMENU.bgColor2 = checkBgColor(cb.settings.menuCustBgColor2); if (TIPMENU.bgColor2 == 'default') { cb.sendNotice('Tip Menu part 2 - Error while setting the background color for second half of menu, it has to be in a HEX format, such as #FFFFFF. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); TIPMENU.bgColor2 = '#FFFFFF'; } } else { TIPMENU.bgColor2 = checkBgColor(cb.settings.menuBgColor2); } } displayMenuTimer(); setSepChar(); let maxItems = 50; for (let j = 0; j <= maxItems; j++) { if (cb.settings['menuitem' + j] !== '' && cb.settings['menuitemprice' + j] > 0) { if (cbjs.arrayContains(TIPMENU.tipMenuPrice, cb.settings['menuitemprice' + j])) { cb.sendNotice('Tip Menu - ' + cb.settings['menuitemprice' + j] + ' is already on the menu. It is recommended to have different price for each item.', cb.room_slug, '#FFFFFF', '#FF0000'); } if (cb.settings.tipMenuSalePct > 0) { regularprice = cb.settings['menuitemprice' + j]; saleprice = Math.round(regularprice - (cb.settings.tipMenuSalePct/100*regularprice)); if (saleprice <= 0) { saleprice = 1; } TIPMENU.tipMenuPrice.push(saleprice.toString()); priceused = saleprice.toString(); } else { TIPMENU.tipMenuPrice.push(cb.settings['menuitemprice' + j]); priceused = cb.settings['menuitemprice' + j]; } TIPMENU.tipMenuItem.push(cb.settings['menuitem' + j]); priceChecker('add','Tip Menu Option: '+(cb.settings['menuitem' + j]), priceused, mod); } } buildMenu(); displayMenu(); } function displayMenuTimer() { let timer = parseFloat(cb.settings.tipMenuDisplayInterval); if (timer < 1) { cb.sendNotice('Tip Menu - Time lapse is too short. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); timer = 3; } timer *= 60000; timer = parseInt(timer); TIPMENU.menuDspIntTime = timer; } function buildMenu() { TIPMENU.tipMenu = 'Tip Menu: '; TIPMENU.menuPart1 = 'Tip Menu 1 Part 1:'; TIPMENU.menuPart2 = 'Tip Menu 1 Part 2:'; let menuArray = []; let menuArray1 = []; let menuArray2 = []; let sorted = []; let menuL = TIPMENU.tipMenuPrice.length; for (let i = 0; i < menuL; i++) { sorted.push({ 'prices': TIPMENU.tipMenuPrice[i], 'id': i }); } if (cb.settings.listSort !== 'Do not sort the list') { sorted.sort(function(a, b) { return a.prices - b.prices; }); if (cb.settings.listSort === 'Descending') { sorted.reverse(); } } if (cb.settings.tipMenuNoticeType == 'Full Menu - List Form') { for (let j = 0; j < sorted.length; j++) { if (TIPMENU.tipMenuPrice[sorted[j].id] !== 0) { menuArray.push(TIPMENU.tipMenuPrice[sorted[j].id] + ' - ' + TIPMENU.tipMenuItem[sorted[j].id]); } } tempsepchar = '\n' + TIPMENU.sepChar; TIPMENU.tipMenu += tempsepchar; TIPMENU.tipMenu += menuArray.join(tempsepchar); } else { for (let j = 0; j < sorted.length; j++) { if (TIPMENU.tipMenuPrice[sorted[j].id] !== 0) { menuArray.push(TIPMENU.tipMenuItem[sorted[j].id] + ' (' + TIPMENU.tipMenuPrice[sorted[j].id] + ') '); } } TIPMENU.tipMenu += menuArray.join(TIPMENU.sepChar); if (cb.settings.tipMenuNoticeType == 'Split Menu - Paragraph Form') { if (menuArray.length < 10) { cb.sendNotice('Tip Menu - Error - The menu has less than 10 items, it will not be split.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); } else { let msglength1 = 0; let msgHalf = (TIPMENU.tipMenu.length - 9) / 2; for (let k = 0; k < sorted.length; k++) { if (TIPMENU.tipMenuPrice[sorted[k].id] !== 0) { if (msglength1 < msgHalf) { menuArray1.push(TIPMENU.tipMenuItem[sorted[k].id] + ' (' + TIPMENU.tipMenuPrice[sorted[k].id] + ') '); msglength1 = menuArray1.join(TIPMENU.sepChar).length; } else { menuArray2.push(TIPMENU.tipMenuItem[sorted[k].id] + ' (' + TIPMENU.tipMenuPrice[sorted[k].id] + ') '); } } } TIPMENU.menuPart1 += '\n' + menuArray1.join(TIPMENU.sepChar) + '\n To see the full menu type /menu.'; TIPMENU.menuPart2 += '\n' + menuArray2.join(TIPMENU.sepChar) + '\n To see the full menu type /menu.'; } } } TIPMENU.menuLength = TIPMENU.tipMenuPrice.length; if (TIPMENU.menuLength <= 0) { cb.sendNotice('Error - No menu items found', '', '', TIPMENU.txtColor1, 'bold'); } } function displayMenu() { if(tipMenuToggle == 1) { if (cb.settings.tipMenuNoticeType === 'Notice only' && !TIPMENU.initToken) { cb.sendNotice('Dorothy\'s Tip Menu Pro is active, but menu is not automatically posted to the chat.\n To see the full tip menu type /menu', '', TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); if (cb.settings.tipMenuSalePct > 0) { cb.sendNotice('There is a Tip Menu sale today! Tip Menu prices have been discounted ' + cb.settings.tipMenuSalePct + '% off normal prices!', '', TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); } } else if (TIPMENU.menuLength > 0 && !TIPMENU.initToken && cb.settings.tipMenuNoticeType == 'Split Menu - Paragraph Form') { if (TIPMENU.menuToken === 1) { cb.sendNotice(TIPMENU.menuPart1,'', TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); if (cb.settings.tipMenuSalePct > 0) { cb.sendNotice('There is a Tip Menu sale today! Tip Menu prices are discounted ' + cb.settings.tipMenuSalePct + '% off normal prices!', '', TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); } TIPMENU.menuToken = 2; } else if (TIPMENU.menuToken === 2) { cb.sendNotice(TIPMENU.menuPart2, '', TIPMENU.bgColor2, TIPMENU.txtColor2, 'bold'); if (cb.settings.tipMenuSalePct > 0) { cb.sendNotice('There is a Tip Menu sale today! Tip Menu prices have been discounted ' + cb.settings.tipMenuSalePct + '% off normal prices!', '', TIPMENU.bgColor2, TIPMENU.txtColor2, 'bold'); } TIPMENU.menuToken = 1; } } else if (TIPMENU.menuLength > 0) { cb.sendNotice(TIPMENU.tipMenu,'', TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); if (cb.settings.tipMenuSalePct > 0) { cb.sendNotice('There is a Tip Menu sale today! Tip Menu prices are discounted ' + cb.settings.tipMenuSalePct + '% off normal prices!', '', TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); } if (TIPMENU.initToken) { TIPMENU.initToken = false; } } else { cb.sendNotice('Tip Menu setup error - there are no entries in the menu.', '', '#FFFFFF', '#FF0000', 'bold'); } cb.setTimeout(displayMenu, TIPMENU.menuDspIntTime); } } function initMenu2(mod) { if (cb.settings.menuTextColor1 == 'Custom') { TIPMENU2.txtColor1 = checkTextColor(cb.settings.menuCustTxtColor1); if (TIPMENU2.txtColor1 == 'default') { cb.sendNotice('Tip Menu 2 - Error while setting the text color, it has to be in a HEX format, such as #0629AC. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); TIPMENU2.txtColor1 = '#0629AC'; } } else { TIPMENU2.txtColor1 = checkTextColor(cb.settings.menuTextColor1); } if (cb.settings.menuBgColor1 == 'Custom') { TIPMENU2.bgColor1 = checkBgColor(cb.settings.menuCustBgColor1); if (TIPMENU2.bgColor1 == 'default') { cb.sendNotice('Tip Menu 2 - Error while setting the background color. It has to be in a HEX format, such as #FFFFFF. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); TIPMENU2.bgColor1 = '#FFFFFF'; } } else { TIPMENU2.bgColor1 = checkBgColor(cb.settings.menuBgColor1); } if (cb.settings.tipMenuNoticeType == 'Split Menu - Paragraph Form') { if (cb.settings.menuTextColor2 === 'Custom') { TIPMENU2.txtColor2 = checkTextColor(cb.settings.menuCustTxtColor2); if (TIPMENU2.txtColor2 == 'default') { cb.sendNotice('Tip Menu part 2 - Error while setting the text color for second half of menu, it has to be in a HEX format, such as #0629AC. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); TIPMENU2.txtColor2 = '#0629AC'; } } else { TIPMENU2.txtColor2 = checkTextColor(cb.settings.menuTextColor2); } if (cb.settings.menuBgColor2 == 'Custom') { TIPMENU2.bgColor2 = checkBgColor(cb.settings.menuCustBgColor2); if (TIPMENU2.bgColor2 == 'default') { cb.sendNotice('Tip Menu part 2 - Error while setting the background color for second half of menu, it has to be in a HEX format, such as #FFFFFF. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); TIPMENU2.bgColor2 = '#FFFFFF'; } } else { TIPMENU2.bgColor2 = checkBgColor(cb.settings.menuBgColor2); } } displayMenuTimer2(); setSepChar2(); let maxItems = 20; for (let j = 0; j <= maxItems; j++) { if (cb.settings['menu2item' + j] !== '' && cb.settings['menu2itemprice' + j] > 0) { if (cbjs.arrayContains(TIPMENU2.tipMenuPrice, cb.settings['menu2itemprice' + j])) { cb.sendNotice('Tip Menu 2 - ' + cb.settings['menu2itemprice' + j] + ' is already on the menu. It is recommended to have different price for each item.', cb.room_slug, '#FFFFFF', '#FF0000'); } if (cb.settings.tipMenu2SalePct > 0) { regularprice = cb.settings['menu2itemprice' + j]; saleprice = Math.round(regularprice - (cb.settings.tipMenu2SalePct/100*regularprice)); if (saleprice <= 0) { saleprice = 1; } TIPMENU2.tipMenuPrice.push(saleprice.toString()); priceused = saleprice.toString(); } else { TIPMENU2.tipMenuPrice.push(cb.settings['menu2itemprice' + j]); priceused = cb.settings['menu2itemprice' + j]; } TIPMENU2.tipMenuItem.push(cb.settings['menu2item' + j]); priceChecker('add','Tip Menu 2 Option: '+(cb.settings['menu2item' + j]), priceused, mod); } } buildMenu2(); displayMenu2(); } function displayMenuTimer2() { let timer = parseFloat(cb.settings.tipMenuDisplayInterval); if (timer < 1) { cb.sendNotice('Tip Menu 2 - Time lapse is too short. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); timer = 3; } timer *= 60000; timer = parseInt(timer); TIPMENU2.menuDspIntTime = timer; } function buildMenu2() { TIPMENU2.tipMenu = 'Tip Menu #2: '; TIPMENU2.menuPart1 = 'Tip Menu #2 Part 1:'; TIPMENU2.menuPart2 = 'Tip Menu #2 Part 2:'; let menu2Array = []; let menu2Array1 = []; let menu2Array2 = []; let sorted2 = []; let menuL = TIPMENU2.tipMenuPrice.length; for (let i = 0; i < menuL; i++) { sorted2.push({ 'prices': TIPMENU2.tipMenuPrice[i], 'id': i }); } if (cb.settings.listSort !== 'Do not sort the list') { sorted2.sort(function(a, b) { return a.prices - b.prices; }); if (cb.settings.listSort === 'Descending') { sorted2.reverse(); } } if (cb.settings.tipMenuNoticeType == 'Full Menu - List Form') { for (let j = 0; j < sorted2.length; j++) { if (TIPMENU2.tipMenuPrice[sorted2[j].id] !== 0) { menu2Array.push(TIPMENU2.tipMenuPrice[sorted2[j].id] + ' - ' + TIPMENU2.tipMenuItem[sorted2[j].id]); } } tempsepchar = '\n' + TIPMENU2.sepChar; TIPMENU2.tipMenu += tempsepchar; TIPMENU2.tipMenu += menu2Array.join(tempsepchar); } else { for (let j = 0; j < sorted2.length; j++) { if (TIPMENU2.tipMenuPrice[sorted2[j].id] !== 0) { menu2Array.push(TIPMENU2.tipMenuItem[sorted2[j].id] + ' (' + TIPMENU2.tipMenuPrice[sorted2[j].id] + ') '); } } TIPMENU2.tipMenu += '\n' + menu2Array.join(TIPMENU2.sepChar); if (cb.settings.tipMenuNoticeType == 'Split Menu - Paragraph Form') { if (menu2Array.length < 10) { cb.sendNotice('Tip Menu - Error - The menu has less than 10 items, it will not be split.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); } else { let msglength1 = 0; let msgHalf = (TIPMENU2.tipMenu.length - 9) / 2; for (let k = 0; k < sorted2.length; k++) { if (TIPMENU2.tipMenuPrice[sorted2[k].id] !== 0) { if (msglength1 < msgHalf) { menu2Array1.push(TIPMENU2.tipMenuItem[sorted2[k].id] + ' (' + TIPMENU2.tipMenuPrice[sorted2[k].id] + ') '); msglength1 = menu2Array1.join(TIPMENU2.sepChar).length; } else { menu2Array2.push(TIPMENU2.tipMenuItem[sorted2[k].id] + ' (' + TIPMENU2.tipMenuPrice[sorted2[k].id] + ') '); } } } TIPMENU2.menuPart1 += '\n' + menu2Array1.join(TIPMENU2.sepChar) + '\n To see the full menu type /menu.'; TIPMENU2.menuPart2 += '\n' + menu2Array2.join(TIPMENU2.sepChar) + '\n To see the full menu type /menu.'; } } } TIPMENU2.menuLength = TIPMENU2.tipMenuPrice.length; if (TIPMENU2.menuLength <= 0) { cb.sendNotice('Error - No menu items found', '', '', TIPMENU2.txtColor1, 'bold'); } } function displayMenu2() { if(tipMenu2Toggle == 1) { if (cb.settings.tipMenuNoticeType === 'Notice only' && !TIPMENU2.initToken) { cb.sendNotice('Tip Menu 2 is active, but is not automatically posted to the chat.\n To see the full tip menu type: /menu', '', TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); if (cb.settings.tipMenu2SalePct > 0) { cb.sendNotice('There is a Tip Menu sale today! Tip Menu prices have been discounted ' + cb.settings.tipMenu2SalePct + '% off normal prices!', '', TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); } } else if (TIPMENU2.menuLength > 0 && !TIPMENU2.initToken && cb.settings.tipMenuNoticeType == 'Split Menu - Paragraph Form') { if (TIPMENU2.menuToken === 1) { cb.sendNotice(TIPMENU2.menuPart1, '', TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); if (cb.settings.tipMenu2SalePct > 0) { cb.sendNotice('There is a Tip Menu sale today! Tip Menu 2 prices are discounted ' + cb.settings.tipMenu2SalePct + '% off normal prices!', '', TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); } TIPMENU2.menuToken = 2; } else if (TIPMENU2.menuToken === 2) { cb.sendNotice(TIPMENU2.menuPart2, '', TIPMENU2.bgColor2, TIPMENU2.txtColor2, 'bold'); if (cb.settings.tipMenu2SalePct > 0) { cb.sendNotice('There is a Tip Menu sale today! Tip Menu prices have been discounted ' + cb.settings.tipMenu2SalePct + '% off normal prices!', '', TIPMENU2.bgColor2, TIPMENU2.txtColor2, 'bold'); } TIPMENU2.menuToken = 1; } } else if (TIPMENU2.tipMenu !== 'Tip Menu 2: ') { cb.sendNotice(TIPMENU2.tipMenu,'', TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); if (cb.settings.tipMenu2SalePct > 0) { cb.sendNotice('There is a Tip Menu sale today! Tip Menu 2 prices are discounted ' + cb.settings.tipMenu2SalePct + '% off normal prices!', '', TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); } if (TIPMENU2.initToken) { TIPMENU2.initToken = false; } } else { cb.sendNotice('Something went wrong with menu 2.', '', '#FFFFFF', '#FF0000', 'bold'); } cb.setTimeout(displayMenu2, TIPMENU2.menuDspIntTime); } } function setSepChar() { if (cb.settings.sepChar == 'Custom') { if (cb.settings.sepCharCustom) { TIPMENU.sepChar = cb.settings.sepCharCustom; } else { TIPMENU.sepChar = '|'; } } else { TIPMENU.sepChar = checkSepChar(cb.settings.sepChar) } TIPMENU.sepChar += ' '; } function setSepChar2() { if (cb.settings.sepChar == 'Custom') { if (cb.settings.sepCharCustom) { TIPMENU2.sepChar = cb.settings.sepCharCustom; } else { TIPMENU2.sepChar = '|'; } } else { TIPMENU2.sepChar = checkSepChar(cb.settings.sepChar) } TIPMENU2.sepChar += ' '; } // *************************** Positions Tip Menu Functions ************************ function setPosTipMenuToggle(option, mod) { if(option == 'on') { if(posTipMenuToggle == 1) { cb.sendNotice('The Positions Tip Menu is already enabled.',mod,appNoticeColor); } else { posTipMenuToggle = 1; cb.sendNotice(' ' + mod + ' has enabled the Positions Tip Menu. You control the action by tipping for your favorite position!','',appNoticeColor,'','bold'); initPosMenu(); } } else if(option == 'off') { if(posTipMenuToggle == 0) { cb.sendNotice('The Positions Tip Menu is already disabled.',mod,appNoticeColor); } else { posTipMenuToggle = 0; POSTIPMENU.posTipMenuPrice = []; POSTIPMENU.posTipMenuItem = []; cb.sendNotice(' ' + mod + ' has disabled the Positions Tip Menu. You can no longer tip for positions.','',appNoticeColor,'','bold'); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /useposmenu.',mod,appNoticeColor); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /useposmenu.',mod,appNoticeColor); } } function initPosMenu(mod) { let maxItems = 8; if (cb.settings.posMenuTxtColor === 'Custom') { POSTIPMENU.posTxtColor = checkTextColor(cb.settings.posMenuCustTxtColor); if (POSTIPMENU.posTxtColor === 'default') { cb.sendNotice('Positions Menu - Error while setting the text color. It has to be in a HEX format. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); POSTIPMENU.posTxtColor = '#FFFFFF'; } } else { POSTIPMENU.posTxtColor = checkTextColor(cb.settings.posMenuTxtColor); } if (cb.settings.posMenuBgColor === 'Custom') { POSTIPMENU.posBgColor = checkBgColor(cb.settings.posMenuCustBgColor); if (POSTIPMENU.posBgColor === 'default') { cb.sendNotice('Positions Menu - Error while setting the background color. It has to be in a HEX format. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); POSTIPMENU.posBgColor = '#0629AC'; } } else { POSTIPMENU.posBgColor = checkBgColor(cb.settings.posMenuBgColor); } displayPosMenuTimer(); setPosSepChar(); for (let j = 0; j <= maxItems; j++) { if (cb.settings['posMenuItem' + j] !== '' && cb.settings['posMenuItemPrice' + j] > 0) { if (cbjs.arrayContains(POSTIPMENU.posTipMenuPrice, cb.settings['posMenuItemPrice' + j])) { cb.sendNotice('Positions Tip Menu - ' + cb.settings['posMenuItemPrice' + j] + ' is already on the menu. It is recommended to have different price for each item.', cb.room_slug, '#FFFFFF', '#FF0000'); } POSTIPMENU.posTipMenuPrice.push(cb.settings['posMenuItemPrice' + j]); POSTIPMENU.posTipMenuItem.push(cb.settings['posMenuItem' + j]); priceChecker('add','Positions Menu Option: '+(cb.settings['posMenuItem' + j]), (cb.settings['posMenuItemPrice' + j]),mod); } } cb.sendNotice('Type /menuhelp tipmenu to see all the Tip Menu Pro commands.', '', '', '', 'bold'); posMenuSanitize(); displayPosMenu(); } function displayPosMenu() { if(posTipMenuToggle == 1) { if (cb.settings.posChatNotice === 'Only display the short notice' && !POSTIPMENU.posInitToken) { cb.sendNotice('Positions Tip menu is active. To see the full tip menu type: /posmenu', '', POSTIPMENU.posBgColor, POSTIPMENU.posTxtColor, 'bold'); } else if (POSTIPMENU.posTipMenu !== 'Positions Tip Menu: \n' && !POSTIPMENU.posInitToken) { cb.sendNotice(POSTIPMENU.posTipMenu, '', POSTIPMENU.posBgColor, POSTIPMENU.posTxtColor, 'bold'); } else if (POSTIPMENU.posTipMenu !== 'Positions Tip Menu: ') { cb.sendNotice(POSTIPMENU.posTipMenu, '', POSTIPMENU.posBgColor, POSTIPMENU.posTxtColor, 'bold'); if (POSTIPMENU.posInitToken) { POSTIPMENU.posInitToken = false; } } else { cb.sendNotice('Something went wrong with the positions menu.', '', '#FFFFFF', '#FF0000', 'bold'); } cb.setTimeout(displayPosMenu, POSTIPMENU.posMenuDspIntTime); } } function displayPosMenuTimer() { let postimer = parseFloat(cb.settings.posMenuInterval); if (postimer < 1) { cb.sendNotice('Positions Tip Menu - Time interval is less than 1 minute. Using default value.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); postimer = 3; } postimer *= 60000; postimer = parseInt(postimer); POSTIPMENU.posMenuDspIntTime = postimer; } function posMenuSanitize() { POSTIPMENU.posTipMenu = 'Positions Tip Menu: '; let posMenuArray = []; let posSorted = []; let posMenuL = POSTIPMENU.posTipMenuPrice.length; for (let i = 0; i < posMenuL; i++) { posSorted.push({ 'posprices': POSTIPMENU.posTipMenuPrice[i], 'posid': i }); } if (cb.settings.posListSort !== 'Do not sort the list') { posSorted.sort(function(a, b) { return a.posprices - b.posprices; }); if (cb.settings.posListSort === 'Descending') { posSorted.reverse(); } } for (let j = 0; j < posSorted.length; j++) { if (POSTIPMENU.posTipMenuPrice[posSorted[j].posid] !== 0) { posMenuArray.push(POSTIPMENU.posTipMenuItem[posSorted[j].posid] + ' (' + POSTIPMENU.posTipMenuPrice[posSorted[j].posid] + ') '); } } POSTIPMENU.posTipMenu += posMenuArray.join(POSTIPMENU.posSepChar); POSTIPMENU.posMenuLength = POSTIPMENU.posTipMenuPrice.length; if (POSTIPMENU.posTipMenu === 'Positions Tip Menu: ') { cb.sendNotice('Error - No positions menu items found', '', '', POSTIPMENU.posTxtColor, 'bold'); } } function setPosSepChar() { if (cb.settings.posSepChar == 'Custom') { if (cb.settings.posSepCharCustom) { POSTIPMENU.posSepChar = cb.settings.posSepCharCustom; } else { POSTIPMENU.posSepChar = '|'; } } else { POSTIPMENU.posSepChar = checkSepChar(cb.settings.posSepChar) } POSTIPMENU.posSepChar += ' '; } // *********************************** Help Function ************************************** function helpModBC(from) { cb.sendNotice('Dorothy\'s Tip Menu Pro Menu for Broadcasters and Moderators', from, appNoticeColor); cb.sendNotice('',from,appNoticeColor); cb.sendNotice( '\nTIP MENU 1 & 2:' + '\n/menu: (all users) Display the Tip Menu in the chat. Available to any user, menu only shown to the user that requests it.' + '\n/startmenu: Turn on Tip Menu 1 if it was not started on the launch page.' + '\n/stopmenu: Turn off Tip Menu 1, the notice will no longer display, and tips will no longer select a menu item.' + '\n/startmenu2: Turn on Tip Menu 2 if it was not started on the launch page.' + '\n/stopmenu2: Turn off Tip Menu 2, the notice will no longer display, and tips will no longer select a menu item.' + '\n/swapmenu: Swaps between Tip Menu 1 and Tip Menu 2 within the show without having to restart the Tip Menu Bot.' + '\n/menurequests: Show recent Tip Menu requests, defaults to a maximum of the 10 most recent when no quantity is entered.' + '\n/menurequests X: Show the last "X" Tip Menu requests.' + '\n/menurequests all: Show all the Tip Menu requests, maximum of 50.' + '\n/menuadd X Y: Add an item name "Y" with a price of "X" tokens to the menu.' + '\n/menurmv X: Removes every item with a price of "X" tokens from the Tip Menu.' + '\n/menurmv Y: Will remove any item labeled "Y" regardless of price from the Tip Menu.' + '\n/menuprice X Y: Updates a menu item with description of "Y" to "X" tokens. Description entered for "Y" must be an exact match of the text in the menu.' + '\nPOSITIONS MENU:' + '\n/posmenu: (all users) Display the Positions Menu in the chat. Available to any user, menu only shown to the user that requests it.' + '\n/startposmenu: Turn on the Positions Menu if it was not started on the launch page.' + '\n/stopposmenu: Turn off the Positions Menu, the notice will no longer display, and tips will no longer select a menu item.' + '\n/posmenurequests: Show recent Positions Menu requests, defaults to a maximum of the 10 most recent.' + '\n/posmenuadd X Y: Add an item name "Y" with a price of "X" tokens to the positions menu.' + '\n/posmenurmv X: Removes every item from the Positions Menu with a price of "X" tokens from the positions menu.' + '\n/posmenurmv Y: Will remove any item labeled "Y" regardless of price from the Positions Menu.' ,from); cb.sendNotice('',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 isBC = (u === cb.room_slug); var BC = cb.room_slug; var command = message[0] var commandVar1 = parseInt(message[1]); var commandVar2 = parseInt(message[2]); if(message[0].charAt(0) == '/') { msg['X-Spam'] = true; var ntc = null; for (var i = 1; i < message.length; i++) { if (i == 1) ntc = message[i]; else ntc += ' ' + message[i]; } var ntc2 = null; for (var i = 2; i < message.length; i++) { if (i == 2) ntc2 = message[i]; else ntc2 += ' ' + message[i]; } var cmdval = null; for (var i = 1; i < message.length; i++) { if (i == 1) cmdval = message[i]; else cmdval += ' ' + message[i]; } switch(command) { //********* Tip Menu Commands case '/menu': { cmd = 1; if (tipMenuToggle == 1) { if (isMod || isBC) { u = ''; } cb.sendNotice(TIPMENU.tipMenu, u, TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); } else if (tipMenu2Toggle == 1) { if (isMod || isBC) { u = ''; } cb.sendNotice(TIPMENU2.tipMenu, u, TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); } else { cb.sendNotice('The Tip Menu has not been enabled.', u, appNoticeColor); } break; } case '/swapmenu': { cmd = 1; if (isMod || isBC) { if (tipMenuToggle == 1 && tipMenu2Toggle == 0) { setTipMenuToggle('off',u) setTipMenu2Toggle('on',u) } else if (tipMenu2Toggle == 1 && tipMenuToggle == 0) { setTipMenu2Toggle('off',u) setTipMenuToggle('on',u) } else if (tipMenu2Toggle == 0 && tipMenuToggle == 0) { cb.sendNotice('Both menus are currently disabled, they cannot be swapped. You can turn one of the menus on using either /usemenu on or /usemenu2 on', u, appNoticeColor); } else { cb.sendNotice('Invalid definition, both menus are already active.', u, appNoticeColor); } } break; } case '/startmenu': { cmd = 1; if (isMod || isBC) { if (tipMenu2Toggle == 1) { cb.sendNotice('Cannot enable Tip Menu 1 while Tip Menu 2 is active. You can use the "/swapmenu" command to switch from Menu 2 to Menu 1.', u, appNoticeColor); } else { setTipMenuToggle('on',u) } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.',u,appNoticeColor); } break; } case '/stopmenu': { cmd = 1; if (isMod || isBC) { setTipMenuToggle('off',u) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.',u,appNoticeColor); } break; } case '/startmenu2': { cmd = 1; if (isMod || isBC) { if (tipMenuToggle == 1) { cb.sendNotice('Cannot enable Tip Menu 2 while Tip Menu 1 is active. You can use the "/swapmenu" command to switch from Menu 1 to Menu 2.', u, appNoticeColor); } else { setTipMenu2Toggle('on',u) } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.',u,appNoticeColor); } break; } case '/stopmenu2': { cmd = 1; if (isMod || isBC) { setTipMenu2Toggle('off',u) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.',u,appNoticeColor); } break; } case '/menurequests': { cmd = 1; touser = u; if (isMod) { touser = ''; } if (tipMenuToggle == 1) { let rL = TIPMENU.request.length; if (rL === 0) { cb.sendNotice('There have been no Tip Menu requests.', u, TIPMENU.bgColor1, TIPMENU.txtColor1); } else { let cmdInt1 = parseInt(message['1']); if (cmdInt1 <= 0) { cb.sendNotice('There have been no Tip Menu requests.', u, TIPMENU.bgColor1, TIPMENU.txtColor1); } else { let noticeMsg; let rS = 0; if (message['1'] === 'all' || message['1'] === 'All') { cmdInt1 = rL; } else if (cmdInt1 === undefined || isNaN(cmdInt1)) { cmdInt1 = 10; rS = rL - 10; } if (rL <= cmdInt1) { noticeMsg = '**** Here is the list of all the requests! ****\n'; cmdInt1 = rL; rS = 0; } else if (rL > 50) { noticeMsg = '**** Here is are the last 50 requests! ****\n'; rS = rL - 50; } else { noticeMsg = '**** Here ' + (cmdInt1 === 1 ? 'is the last' : 'are the last ' + cmdInt1) + ' request' + (cmdInt1 === 1 ? '' : 's') + '! **** \n'; rS = rL - cmdInt1; } for (let i = rS; i < rL; i++) { noticeMsg += 'Request #' + (i + 1) + ': ' + TIPMENU.requesters[i] + ' requested ' + TIPMENU.request[i] + '\n'; } noticeMsg += '**************************************'; cb.sendNotice(noticeMsg, touser, TIPMENU.bgColor1, TIPMENU.txtColor1); } } } else if (tipMenu2Toggle == 1) { let rL = TIPMENU2.request.length; if (rL === 0) { cb.sendNotice('There have been no Tip Menu 2 requests.', u, TIPMENU2.bgColor1, TIPMENU2.txtColor1); } else { let cmdInt1 = parseInt(message['1']); if (cmdInt1 <= 0) { cb.sendNotice('There have been no Tip Menu 2 requests.', u, TIPMENU2.bgColor1, TIPMENU2.txtColor1); } else { let noticeMsg; let rS = 0; if (message['1'] === 'all' || message['1'] === 'All') { cmdInt1 = rL; } else if (cmdInt1 === undefined || isNaN(cmdInt1)) { cmdInt1 = 10; rS = rL - 10; } if (rL <= cmdInt1) { noticeMsg = '**** Here is the list of all the requests! ****\n'; cmdInt1 = rL; rS = 0; } else if (rL > 50) { noticeMsg = '**** Here is are the last 50 requests! ****\n'; rS = rL - 50; } else { noticeMsg = '**** Here ' + (cmdInt1 === 1 ? 'is the last' : 'are the last ' + cmdInt1) + ' request' + (cmdInt1 === 1 ? '' : 's') + '! **** \n'; rS = rL - cmdInt1; } for (let i = rS; i < rL; i++) { noticeMsg += 'Request #' + (i + 1) + ': ' + TIPMENU2.requesters[i] + ' requested ' + TIPMENU2.request[i] + '\n'; } noticeMsg += '**************************************'; cb.sendNotice(noticeMsg, touser, TIPMENU2.bgColor1, TIPMENU2.txtColor1); } } } break; } case '/menuadd': { cmd = 1; if (!isMod && !isBC) { cb.sendNotice('Only mods and broadcasters can use this command.', u, '#FFFFFF', '#FF0000'); } else { let label; let newItemPrice = parseInt(message['1']); if (newItemPrice <= 0 || isNaN(newItemPrice)) { cb.sendNotice('The correct format is "/menuadd X item" where X has to be a number over 0. This is the amount the viewers will tip for it.', u, '#FFFFFF', '#FF0000'); return; } if (!message[2]) { cb.sendNotice('You need to include a label for that option.', u, '#FFFFFF', '#FF0000'); return; } for (let j = 2; j < message.length; j++) { if (j === 2) { label = message[j]; } else { label += ' ' + message[j]; } } if (tipMenuToggle == 1) { cb.sendNotice('Tip menu to Broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' added the option "' + label + '" for ' + newItemPrice + ' tokens to the menu.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Tip menu to mods - ' + u + ' added the option "' + label + '" for ' + newItemPrice + ' tokens the menu.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); if (cbjs.arrayContains(TIPMENU.tipMenuPrice, newItemPrice)) { cb.sendNotice('Tip Menu - ' + newItemPrice + ' is already on the menu. It is recommended to have different price for each item.', u, '#FFFFFF', '#FF0000'); } TIPMENU.tipMenuPrice.push(newItemPrice); TIPMENU.tipMenuItem.push(label); priceChecker('add','Tip Menu Option: '+label, newItemPrice); buildMenu(); } else if (tipMenu2Toggle == 1) { cb.sendNotice('Tip menu to Broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' added the option "' + label + '" for ' + newItemPrice + ' tokens to Menu 2.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Tip menu to mods - ' + u + ' added the option "' + label + '" for ' + newItemPrice + ' tokens to Menu 2.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); if (cbjs.arrayContains(TIPMENU2.tipMenuPrice, newItemPrice)) { cb.sendNotice('Tip Menu - ' + newItemPrice + ' is already on Menu 2. It is recommended to have different price for each item.', u, '#FFFFFF', '#FF0000'); } TIPMENU2.tipMenuPrice.push(newItemPrice); TIPMENU2.tipMenuItem.push(label); priceChecker('add','Tip Menu 2 Option: '+label, newItemPrice); buildMenu2(); } } break; } case '/menurmv': { cmd = 1; if (!isMod && !isBC) { cb.sendNotice('Only mods and broadcasters can use this command.', u, '#FFFFFF', '#FF0000'); } else { let itemPrice = parseInt(message['1']); let label; let s = 2; if (isNaN(itemPrice)) { s = 1; } for (let i = s; i < message.length; i++) { if (i === s) { label = message[i]; } else { label += ' ' + message[i]; } } if (itemPrice <= 0) { cb.sendNotice('Error! Price must be greater than 0.', '', '#FFFFFF', '#FF0000', 'bold'); return; } if (tipMenuToggle == 1) { if (itemPrice > 0) { if (cbjs.arrayContains(TIPMENU.tipMenuPrice, itemPrice)) { if (!message[2]) { cb.sendNotice('Tip menu - No item label was given with the command, so all menu items that match the price of "' + itemPrice + '" will be removed from the menu.', u, '#FFFFFF', '#FF0000', 'bold'); for (let i = 0; i < TIPMENU.menuLength; i++) { if (itemPrice === TIPMENU.tipMenuPrice[i]) { priceChecker('rmv','Tip Menu Option: '+TIPMENU.tipMenuItem[i], TIPMENU.tipMenuPrice[i],u); TIPMENU.tipMenuPrice[i] = 0; cb.sendNotice('Tip menu to Broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + TIPMENU.tipMenuItem[i] + '" from the menu.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Tip menu to mods - ' + u + ' removed the option "' + TIPMENU.tipMenuItem[i] + '" from the menu.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); } } buildMenu(); } else { let labelFound = false; for (let i = 0; i < TIPMENU.menuLength; i++) { if (itemPrice === TIPMENU.tipMenuPrice[i] && label === TIPMENU.tipMenuItem[i]) { labelFound = true; priceChecker('rmv','Tip Menu Option: '+TIPMENU.tipMenuItem[i], TIPMENU.tipMenuPrice[i],u); TIPMENU.tipMenuPrice[i] = 0; cb.sendNotice('Tip menu to Broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + TIPMENU.tipMenuItem[i] + '" from the menu.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Tip menu to mods - ' + u + ' removed the option "' + TIPMENU.tipMenuItem[i] + '" from the menu.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); buildMenu(); } } if (!labelFound) { cb.sendNotice('Tip menu - Unable find item ' + label + '(' + itemPrice + ') on the menu. Skipping.', u, '#FFFFFF', '#FF0000', 'bold'); } } } else { cb.sendNotice('Tip menu - Unable find any item at ' + itemPrice + ' tokens on the menu.', u, '#FFFFFF', '#FF0000', 'bold'); } } else { if (!label) { cb.sendNotice('Tip menu - Unable to process. Use "/menurmv X Label". Where X is the amount of tokens and label is the name of the item.', u, '#FFFFFF', '#FF0000', 'bold'); } else if (cbjs.arrayContains(TIPMENU.tipMenuItem, label)) { for (let i = 0; i < TIPMENU.menuLength; i++) { if (label === TIPMENU.tipMenuItem[i]) { priceChecker('rmv','Tip Menu Option: '+TIPMENU.tipMenuItem[i], TIPMENU.tipMenuPrice[i],u); TIPMENU.tipMenuPrice[i] = 0; cb.sendNotice('Tip menu to Broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + TIPMENU.tipMenuItem[i] + '" from the menu.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Tip menu to mods - ' + u + ' removed the option "' + TIPMENU.tipMenuItem[i] + '" from the menu.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); } } buildMenu(); } else { cb.sendNotice('Tip menu - Unable find item ' + label + ' on the menu. Skipping.', u, '#FFFFFF', '#FF0000', 'bold'); } } } else if (tipMenu2Toggle == 1) { if (itemPrice > 0) { if (cbjs.arrayContains(TIPMENU2.tipMenuPrice, itemPrice)) { if (!message[2]) { cb.sendNotice('Tip menu 2 - No label was found! Every options that match "' + itemPrice + '" will be removed from menu 2.', u, '#FFFFFF', '#FF0000', 'bold'); for (let i = 0; i < TIPMENU2.menuLength; i++) { if (itemPrice === TIPMENU2.tipMenuPrice[i]) { priceChecker('rmv','Tip Menu 2 Option: '+TIPMENU2.tipMenuItem[i], TIPMENU2.tipMenuPrice[i],u); TIPMENU2.tipMenuPrice[i] = 0; cb.sendNotice('Tip menu 2 to Broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + TIPMENU2.tipMenuItem[i] + '" from menu 2.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Tip menu 2 to mods - ' + u + ' removed the option "' + TIPMENU2.tipMenuItem[i] + '" from menu 2.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); } } buildMenu2(); } else { let labelFound = false; for (let i = 0; i < TIPMENU2.menuLength; i++) { if (itemPrice === TIPMENU2.tipMenuPrice[i] && label === TIPMENU2.tipMenuItem[i]) { labelFound = true; priceChecker('rmv','Tip Menu 2 Option: '+TIPMENU2.tipMenuItem[i], TIPMENU2.tipMenuPrice[i],u); TIPMENU2.tipMenuPrice[i] = 0; cb.sendNotice('Tip menu 2 to Broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + TIPMENU2.tipMenuItem[i] + '" from menu 2.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Tip menu 2 to mods - ' + u + ' removed the option "' + TIPMENU2.tipMenuItem[i] + '" from menu 2.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); buildMenu2(); } } if (!labelFound) { cb.sendNotice('Tip menu 2 - Unable find item ' + label + '(' + itemPrice + ') on menu 2. Skipping.', u, '#FFFFFF', '#FF0000', 'bold'); } } } else { cb.sendNotice('Tip menu 2 - Unable find any item at ' + itemPrice + ' tokens on menu 2.', u, '#FFFFFF', '#FF0000', 'bold'); } } else { if (!label) { cb.sendNotice('Tip menu - Unable to process. Use "/menurmv X Label". Where X is the amount of tokens and label is the name of the item.', u, '#FFFFFF', '#FF0000', 'bold'); } else if (cbjs.arrayContains(TIPMENU2.tipMenuItem, label)) { for (let i = 0; i < TIPMENU2.menuLength; i++) { if (label === TIPMENU2.tipMenuItem[i]) { priceChecker('rmv','Tip Menu 2 Option: '+TIPMENU2.tipMenuItem[i], TIPMENU2.tipMenuPrice[i],u); TIPMENU2.tipMenuPrice[i] = 0; cb.sendNotice('Tip menu 2 to Broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + TIPMENU2.tipMenuItem[i] + '" from menu 2.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Tip menu 2 to mods - ' + u + ' removed the option "' + TIPMENU2.tipMenuItem[i] + '" from menu 2.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); } } buildMenu(); } else { cb.sendNotice('Tip menu 2 - Unable find item ' + label + ' on menu 2. Skipping.', u, '#FFFFFF', '#FF0000', 'bold'); } } } } break; } case '/menuprice': { cmd = 1; if (!isMod && !isBC) { cb.sendNotice('Tip Menu Pro: Only mods and broadcasters can use this command.', u, appNoticeColor); } else { let label; let newItemPrice = parseInt(message[1]); if (newItemPrice <= 0 || isNaN(newItemPrice)) { cb.sendNotice('Tip Menu Pro: The correct command format is "/menuprice X Y" where "X" is the new price and must be a number over 0, and "Y" is the exact match of the current description of the item.', u, appNoticeColor); return; } if (!message[2]) { cb.sendNotice('Tip Menu Pro: The second parameter for menu item description is missing. The correct command format is "/menuprice X Y" where "X" is the new price and must be a number over 0, and "Y" is the exact match of the current description of the item.', u, appNoticeColor); return; } for (let j = 2; j < message.length; j++) { if (j === 2) { label = message[j]; } else { label += ' ' + message[j]; } } if (tipMenuToggle == 1) { if (!cbjs.arrayContains(TIPMENU.tipMenuItem, label)) { cb.sendNotice('Tip Menu Pro: Tip Menu item with description "' + label + '" was not found. Make sure you are entering an exact match of the menu item description, including upper and lower case.', u, appNoticeColor); } else { menuitemindex = TIPMENU.tipMenuItem.indexOf(label); priceChecker('rmv','Tip Menu Option: '+label, TIPMENU.tipMenuPrice[menuitemindex]); TIPMENU.tipMenuPrice[menuitemindex] = newItemPrice; priceChecker('add','Tip Menu Option: '+label, newItemPrice); cb.sendNotice('Tip menu to broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' updated the price of "' + label + '" to ' + newItemPrice + ' tokens.', cb.room_slug, appNoticeColor); cb.sendNotice('Tip menu to mods - ' + u + ' updated the price of "' + label + '" to ' + newItemPrice + ' tokens.', '', appNoticeColor, '', '', 'red'); buildMenu(); } } else if (tipMenu2Toggle == 1) { if (!cbjs.arrayContains(TIPMENU2.tipMenuItem, label)) { cb.sendNotice('Tip Menu Pro: Tip Menu item with description "' + label + '" was not found. Make sure you are entering an exact match of the menu item description, including upper and lower case.', u, appNoticeColor); } else { menuitemindex = TIPMENU2.tipMenuItem.indexOf(label); priceChecker('rmv','Tip Menu 2 Option: '+label, TIPMENU2.tipMenuPrice[menuitemindex]); TIPMENU2.tipMenuPrice[menuitemindex] = newItemPrice; priceChecker('add','Tip Menu 2 Option: '+label, newItemPrice); cb.sendNotice('Tip menu to broadcaster - ' + (u === cb.room_slug ? 'You' : u) + ' updated the price of "' + label + '" to ' + newItemPrice + ' tokens.', cb.room_slug, appNoticeColor); cb.sendNotice('Tip menu to mods - ' + u + ' updated the price of "' + label + '" to ' + newItemPrice + ' tokens.', '', appNoticeColor, '', '', 'red'); buildMenu2(); } } } break; } //********* Positions Tip Menu Commands case '/posmenu': { cmd = 1; if (posTipMenuToggle == 1) { if (isMod) { u = ''; } cb.sendNotice(POSTIPMENU.posTipMenu, u, POSTIPMENU.posBgColor, POSTIPMENU.posTxtColor, 'bold'); } else { cb.sendNotice('The Positions Tip Menu has not been enabled.', u, appNoticeColor); } break; } case '/startposmenu': { cmd = 1; if (isMod || isBC) { setPosTipMenuToggle('on', u) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u,appNoticeColor); } break; } case '/stopposmenu': { cmd = 1; if (isMod || isBC) { setPosTipMenuToggle('off', u) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u,appNoticeColor); } break; } case '/posmenurequests': { cmd = 1; m.background = '#d9d9d9'; if (isMod) { u = ''; } let posrL = POSTIPMENU.posRequest.length; if (posrL === 0) { cb.sendNotice('There is no request at the moment.', u, POSTIPMENU.posBgColor, POSTIPMENU.posTxtColor); } else { let cmdInt1 = 10; let posNoticeMsg; let posrS = 0; if (posrL <= cmdInt1) { posNoticeMsg = '**** Here is the list of the requests! ****\n'; cmdInt1 = posrL; posrS = 0; } else if (posrL > 10) { posNoticeMsg = '**** Here is are the last 10 requests! ****\n'; posrS = posrL - 10; } for (let i = posrS; i < posrL; i++) { posNoticeMsg += 'Position Request #' + (i + 1) + ': ' + POSTIPMENU.posRequesters[i] + ' requested ' + POSTIPMENU.posRequest[i] + '\n'; } posNoticeMsg += '**************************************'; cb.sendNotice(posNoticeMsg, u, POSTIPMENU.posBgColor, POSTIPMENU.posTxtColor); } break; } case '/posmenuadd': { cmd = 1; m.background = '#d9d9d9'; if (!isMod && !isBC) { cb.sendNotice('Only mods and broadcasters can use this command.', u, '#FFFFFF', '#FF0000'); } else { let poslabel; let newPosItemPrice = parseInt(message['1']); if (newPosItemPrice <= 0 || isNaN(newPosItemPrice)) { cb.sendNotice('No price was given. The correct format is "/posmenuadd X Y" where X has to be a number greater than 0. This is the amount the viewers will tip for item.', u, '#FFFFFF', '#FF0000'); return; } if (!message[2]) { cb.sendNotice('No position was given. The correct format is "/posmenuadd X Y" where Y has to be the name of the position being added.', u, '#FFFFFF', '#FF0000'); return; } for (let j = 2; j < message.length; j++) { if (j === 2) { poslabel = message[j]; } else { poslabel += ' ' + message[j]; } } cb.sendNotice('Position Tip menu notification - ' + (u === cb.room_slug ? 'You' : u) + ' added the option "' + poslabel + '" for ' + newPosItemPrice + ' tokens to the positions menu.', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Position Tip menu notification - The option "' + poslabel + '" for ' + newPosItemPrice + ' tokens was added to the Positions Tip Menu.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); if (cbjs.arrayContains(POSTIPMENU.posTipMenuPrice, newPosItemPrice)) { cb.sendNotice('Positions Tip Menu - ' + newPosItemPrice + ' is already on the positions menu. It is recommended to have different price for each item.', u, '#FFFFFF', '#FF0000'); } POSTIPMENU.posTipMenuPrice.push(newPosItemPrice); POSTIPMENU.posTipMenuItem.push(poslabel); priceChecker('add','Positions Menu Option: '+poslabel, newPosItemPrice,u); posMenuSanitize(); } break; } case '/posmenurmv': { cmd = 1; m.background = '#d9d9d9'; if (!isMod && !isBC) { cb.sendNotice('Only mods and broadcasters can use this command.', u, '#FFFFFF', '#FF0000'); } else { let posItemPrice = parseInt(message['1']); let poslabel; let s = 2; if (isNaN(posItemPrice)) { s = 1; } for (let i = s; i < message.length; i++) { if (i === s) { poslabel = message[i]; } else { poslabel += ' ' + message[i]; } } if (posItemPrice <= 0) { cb.sendNotice('Positions Tip menu - Error! Price to be removed must be greater than 0.', '', '#FFFFFF', '#FF0000', 'bold'); } if (posItemPrice > 0) { if (cbjs.arrayContains(POSTIPMENU.posTipMenuPrice, posItemPrice)) { if (!message[2]) { cb.sendNotice('Positions Tip Menu - No position name was provided, all options that match the "' + posItemPrice + '" token price will be removed.', u, '#FFFFFF', '#FF0000', 'bold'); for (let i = 0; i < POSTIPMENU.posMenuLength; i++) { if (posItemPrice === POSTIPMENU.posTipMenuPrice[i]) { priceChecker('rmv','Positions Menu Option: '+POSTIPMENU.posTipMenuItem[i], POSTIPMENU.posTipMenuPrice[i],u); POSTIPMENU.posTipMenuPrice[i] = 0; cb.sendNotice('Positions Tip Menu - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + POSTIPMENU.posTipMenuItem[i] + '".', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Positions Tip Menu - The option "' + POSTIPMENU.posTipMenuItem[i] + '" was removed.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); } } posMenuSanitize(); } else { let poslabelFound = false; for (let i = 0; i < POSTIPMENU.posMenuLength; i++) { if (posItemPrice === POSTIPMENU.posTipMenuPrice[i] && label === POSTIPMENU.posTipMenuItem[i]) { poslabelFound = true; priceChecker('rmv','Positions Menu Option: '+POSTIPMENU.posTipMenuItem[i], POSTIPMENU.posTipMenuPrice[i],u); POSTIPMENU.posTipMenuPrice[i] = 0; cb.sendNotice('Positions Tip Menu - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + POSTIPMENU.posTipMenuItem[i] + '".', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Positions Tip Menu - The option "' + POSTIPMENU.posTipMenuItem[i] + '" was removed.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); buildMenu(); } } if (!poslabelFound) { cb.sendNotice('Positions Tip Menu - Unable find item ' + poslabel + '(' + posItemPrice + ') on the menu. Skipping.', u, '#FFFFFF', '#FF0000', 'bold'); } } } else { cb.sendNotice('Positions Tip Menu - Unable find any item at ' + posItemPrice + ' tokens on the positions menu.', u, '#FFFFFF', '#FF0000', 'bold'); } } else { if (!poslabel) { cb.sendNotice('Positions Tip Menu - Unable to process command. Use "/posmenurmv X Y". Where X is the tip amount and Y is the name of the position.', u, '#FFFFFF', '#FF0000', 'bold'); } else if (cbjs.arrayContains(POSTIPMENU.posTipMenuItem, poslabel)) { for (let i = 0; i < POSTIPMENU.posMenuLength; i++) { if (poslabel === POSTIPMENU.posTipMenuItem[i]) { priceChecker('rmv','Positions Menu Option: '+POSTIPMENU.posTipMenuItem[i], POSTIPMENU.posTipMenuPrice[i],u); POSTIPMENU.posTipMenuPrice[i] = 0; cb.sendNotice('Positions Tip Menu - ' + (u === cb.room_slug ? 'You' : u) + ' removed the option "' + POSTIPMENU.posTipMenuItem[i] + '".', cb.room_slug, '#FFFFFF', '#FF0000', 'bold'); cb.sendNotice('Positions Tip Menu - The option "' + POSTIPMENU.posTipMenuItem[i] + '" was removed.', '', '#FFFFFF', '#FF0000', 'bold', 'red'); } } posMenuSanitize(); } else { cb.sendNotice('Positions Tip Menu - Unable find item ' + poslabel + ' on the positions menu. Skipping.', u, '#FFFFFF', '#FF0000', 'bold'); } } } break; } //********* Price Check List case '/pricechecklist': { cmd = 1; if (isMod || isBC) { if (priceCheckArray.name.length > 0) { cb.sendNotice('Alphabetic listing of Price Check Array entries : ', u, appNoticeColor); var outString = ''; for (var i = 0; i < priceCheckArray.name.length; i++) { if (priceCheckArray.name[i] == null) outString += ' ' + i + '. empty' + '\n'; else outString += ' ' + (i+1) + '. ' + '"' + priceCheckArray.name[i] + '"' + ': ' + priceCheckArray.amount[i] + '\n'; } cb.sendNotice(outString,u); cb.sendNotice('End of List', u, appNoticeColor); } else { cb.sendNotice('No entries yet.', u, appNoticeColor); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.', u, appNoticeColor); } break; } //********* Help Menu case '/menuhelp': { cmd = 1; if (isMod || isBC) { helpModBC(u); } else { cb.sendNotice('There is no help text for users, the commands "/menu" and "/posmenu" can be used to display the currently active menu or positions menu on demand.', u, appNoticeColor); } break; } //********* End of Expected commands } } return msg; }); } // *********************************** Actions on user entering ************************************** { cb.onEnter(function(user) { // Variables var u = user.user; var isMod = user.is_mod; var isCBMod = user.is_mod; var isBC = (u === cb.room_slug); var isFan = user.in_fanclub; // **** General Entry Message var entryMessage = ''; if (tipMenuToggle == 1 || tipMenu2Toggle == 1) { entryMessage += '\u21E8 A Tip Menu is available. The menu may display periodically if enabled by the broadcaster, or you can see the menu at anytime by typing "/menu".'; } if (posTipMenuToggle == 1) { if (tipMenuToggle == 1 || tipMenu2Toggle == 1) { entryMessage += '\n'; } entryMessage += '\u21E8 The Positions Tip Menu is active. The menu may display periodically if enabled by the broadcaster, or you can see the menu at anytime by typing "/posmenu".'; } temptextcolor = checkTextColor('Dark Green'); tempbgcolor = checkBgColor('Cream'); cb.sendNotice(entryMessage, u, tempbgcolor, temptextcolor, 'bold'); }); } // *********************************** Actions upon leaving ************************************** { cb.onLeave(function(user) { }); } // *********************************** Actions upon tipping ************************************** { cb.onTip(function (tip) { var tipAmount = Number.parseInt(tip.amount, 10); var u = tip.from_user // ***** Tip Menu if (tipMenuToggle == 1) { for (let i = 0; i < TIPMENU.menuLength; i++) { if (tipAmount == TIPMENU.tipMenuPrice[i]) { TIPMENU.requesters.push(tip.from_user); TIPMENU.request.push(TIPMENU.tipMenuItem[i]); if (cb.settings.sepCharInPrize == 'Yes') { cb.sendNotice(TIPMENU.sepChar + ' ' + u + ' tipped for ' + TIPMENU.tipMenuItem[i] + ' ' + TIPMENU.sepChar, '', TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); } else { cb.sendNotice(u + ' tipped for ' + TIPMENU.tipMenuItem[i], '', TIPMENU.bgColor1, TIPMENU.txtColor1, 'bold'); } } } } if (tipMenu2Toggle == 1) { for (let i = 0; i < TIPMENU2.menuLength; i++) { if (tipAmount == TIPMENU2.tipMenuPrice[i]) { TIPMENU2.requesters.push(tip.from_user); TIPMENU2.request.push(TIPMENU2.tipMenuItem[i]); if (cb.settings.sepCharInPrize == 'Yes') { cb.sendNotice(TIPMENU2.sepChar + ' ' + u + ' tipped for ' + TIPMENU2.tipMenuItem[i] + ' ' + TIPMENU2.sepChar, '', TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); } else { cb.sendNotice(u + ' tipped for ' + TIPMENU2.tipMenuItem[i], '', TIPMENU2.bgColor1, TIPMENU2.txtColor1, 'bold'); } } } } if (posTipMenuToggle == 1) { for (let i = 0; i < POSTIPMENU.posMenuLength; i++) { if (tipAmount == POSTIPMENU.posTipMenuPrice[i]) { POSTIPMENU.posRequesters.push(tip.from_user); POSTIPMENU.posRequest.push(POSTIPMENU.posTipMenuItem[i]); if (cb.settings.sepCharInPrize == 'Yes') { cb.sendNotice(POSTIPMENU.posSepChar + ' ' + u + ' tipped for ' + POSTIPMENU.posTipMenuItem[i] + ' ' + POSTIPMENU.posSepChar, '', POSTIPMENU.posBgColor, POSTIPMENU.posTxtColor, 'bold'); } else { cb.sendNotice(u + ' tipped for ' + POSTIPMENU.posTipMenuItem[i], '', POSTIPMENU.posBgColor, POSTIPMENU.posTxtColor, 'bold'); } } } } }); } // *********************************** Initialize ************************************** { if (initialize == 0) { cb.sendNotice('Dorothy\'s Tip Menu Pro v1.3'); intromessage = '** Version 1.3 released on 1/10/2020, please see the change log at the bottom of the bot description page for a list of added features in the current release.'; intromessage += '\nYou can type "/menuhelp" to display the command list summary.'; cb.sendNotice(intromessage, cb.room_slug, appAlertColor); if (cb.settings.enableTipMenu == 'Yes') { setTipMenuToggle('on',cb.room_slug); if (cb.settings.enableTipMenu2 == 'Yes') { cb.sendNotice('Unable to start Tip Menu 2, since Tip Menu 1 is already enabled. To switch to Tip Menu 2, use the command "/swapmenu".', cb.room_slug, appNoticeColor); } } if (cb.settings.enableTipMenu2 == 'Yes' && cb.settings.enableTipMenu == 'No') { setTipMenu2Toggle('on',cb.room_slug); } if (cb.settings.enablePosTipMenu == 'Yes') { setPosTipMenuToggle('on',cb.room_slug); } initialize = 1; } }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.