Bots Home
|
Create an App
TIPS FOR TO DO LIST RIDE S.
Author:
meandher305
Description
Source Code
Launch Bot
Current Users
Created by:
Meandher305
/* Title: "TIPS FOR TO DO LIST RIDE S AKA: TIP MENU" bot based on the original idea of badbadbubba. Additional changes by 4science Version 1.6: It should have been there from the start. You can now use your own divider! Simply pick 'Custom' in the drop-down menu and write whatever you want! Even gif! Does this need more exclamation point? I believe so! You can now run a sale, reducing all the price on the menu by X%. Added the option to add or delete options on the menu. You can now toggle on and off a notice when someone request the menu (it currently hides that.) ----Contact---- Send complains, suggestions, bug reports and GIRLS TOhttps://www.freesexcam.ca/p/meandher305/ . */ cb.settings_choices = [{ 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: "Separator character" }, { name: 'sepcharcustom', type: 'str', defaultValue: ':heart2', required: false, label: 'Custom Separator. It can be an gif (Don\'t forget the ":") or a string of characters (&!&).' }, { name: 'menutxtcolor1', type: 'str', label: 'Text color (default red...ish #F10060)', required: false, defaultValue: '#F10060' }, { name: 'menubgcolor1', type: 'str', label: 'Background color (default white #FFFFFF)', required: false, defaultValue: '#FFFFFF' }, { name: 'chatAd', type: 'str', defaultValue: 3, label: 'How often the menu (or each part) will appear in chat. Can do fractions, e.g. 2.5 = two minutes 30 seconds.' }, { name: 'chatNotice', type: 'choice', choice1: 'Display the full menu', choice2: 'Only display the short notice', defaultValue: 'Display the full menu', label: "Do you want the notice to display the full menu or only the short notice ( ei: Type '/tipmenu' to see the menu)" }, { name: 'listSort', type: 'choice', choice1: 'Do not sort the list', choice2: 'Ascending', choice3: 'Descending', defaultValue: 'Ascending', label: "Do you want the list to be sorted by price?" }, { name: 'listSplit', type: 'choice', choice1: 'Do not split the list', choice2: 'Split the list in 2', defaultValue: 'Do not split the list', label: "If you have a very long list, Do you want the list to be split in 2?" }, { name: 'menutxtcolor2', type: 'str', required: false, label: 'You can pick the color for the split menu', defaultValue: '#F10060' }, { name: 'menubgcolor2', type: 'str', required: false, label: 'Split menu background color', defaultValue: '#FFFFFF' }, { name: 'item1', type: 'str', label: "Item 1 " }, { name: 'itemprice1', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, label: 'Item 1 price' }, { name: 'item2', type: 'str', required: false, label: 'Item 2' }, { name: 'itemprice2', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 2 price' }, { name: 'item3', type: 'str', required: false, label: 'Item 3' }, { name: 'itemprice3', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 3 price' }, { name: 'item4', type: 'str', required: false, label: 'Item 4' }, { name: 'itemprice4', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 4 price' }, { name: 'item5', type: 'str', required: false, label: 'Item 5' }, { name: 'itemprice5', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 5 price' }, { name: 'item6', type: 'str', required: false, label: 'Item 6' }, { name: 'itemprice6', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 6 price' }, { name: 'item7', type: 'str', required: false, label: 'Item 7' }, { name: 'itemprice7', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 7 price' }, { name: 'item8', type: 'str', required: false, label: 'Item 8' }, { name: 'itemprice8', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 8 price' }, { name: 'item9', type: 'str', required: false, label: 'Item 9' }, { name: 'itemprice9', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 9 price' }, { name: 'item10', type: 'str', required: false, label: 'Item 10' }, { name: 'itemprice10', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 10 price' }, { name: 'item11', type: 'str', required: false, label: 'Item 11' }, { name: 'itemprice11', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 11 price' }, { name: 'item12', type: 'str', required: false, label: 'Item 12' }, { name: 'itemprice12', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 12 price' }, { name: 'item13', type: 'str', required: false, label: 'Item 13' }, { name: 'itemprice13', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 13 price' }, { name: 'item14', type: 'str', required: false, label: 'Item 14' }, { name: 'itemprice14', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 14 price' }, { name: 'item15', type: 'str', required: false, label: 'Item 15' }, { name: 'itemprice15', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 15 price' }, { name: 'item16', type: 'str', required: false, label: 'Item 16' }, { name: 'itemprice16', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 16 price' }, { name: 'item17', type: 'str', required: false, label: 'Item 17' }, { name: 'itemprice17', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 17 price' }, { name: 'item18', type: 'str', required: false, label: 'Item 18' }, { name: 'itemprice18', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 18 price' }, { name: 'item19', type: 'str', required: false, label: 'Item 19' }, { name: 'itemprice19', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 19 price' }, { name: 'item20', type: 'str', required: false, label: 'Item 20' }, { name: 'itemprice20', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 20 price' }, { name: 'item21', type: 'str', required: false, label: 'Item 21' }, { name: 'itemprice21', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 21 price' }, { name: 'item22', type: 'str', required: false, label: 'Item 22' }, { name: 'itemprice22', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 22 price' }, { name: 'item23', type: 'str', required: false, label: 'Item 23' }, { name: 'itemprice23', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 23 price' }, { name: 'item24', type: 'str', required: false, label: 'Item 24' }, { name: 'itemprice24', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 24 price' }, { name: 'item25', type: 'str', required: false, label: 'Item 25' }, { name: 'itemprice25', type: 'int', minValue: 0, maxValue: 99999, defaultValue: 0, required: false, label: 'Item 25 price' } ]; var HEART = '\u2665'; // ? BDIAMOND = '\u2666'; // ? BSTAR = '\u2605'; // ? var chatAdTime; var sepChar = "| "; var tipMenu; var menuArray = []; var menuPart1; var menuPart2; var menuToken = 1; var maxSep = 9; var maxItems = 25; var tipMenuPrice = []; var backupPrice = []; var tipMenuItem = []; var menuArray1 = []; var menuArray2 = []; var initToken = true; var menuTColor1; var menuBGColor1; var menuTColor2; var menuBGColor2; var menuLength; var requesters = []; var request = []; var sorted = []; var adInitToken = false; var confirmToken = 0; var sale = false; var discount = 0; //For statistical analysis var noticeView = ["4science", "mr_likes_it_"]; var noticeViewLength = noticeView.length; separators = [{ label: 'Hearts', shortcut: ':heart2' }, { label: 'Glitter', shortcut: ':pixelglitter' }, { label: 'Flowers', shortcut: ':tinyflower2' }, { label: 'Bow', shortcut: ':bluebow' }, { label: 'Hearts2', shortcut: ':pixelheart' }, { label: 'Smiley', shortcut: ':smile' }, { label: 'Text Heart', shortcut: HEART }, { label: 'Text Diamond', shortcut: BDIAMOND }, { label: 'Text Star', shortcut: BSTAR } ] function chatAd() { if (cb.settings.chatNotice == 'Only display the short notice' && !initToken) { cb.sendNotice('Tip menu is active. To see the full tip menu type: /tipmenu', '', menuBGColor1, menuTColor1, 'bold'); } else if (menuPart1 != 'Tip Menu Part 1: \n' && !initToken) { if (menuToken == 1) { cb.sendNotice(menuPart1, '', menuBGColor1, menuTColor1, 'bold'); menuToken = 2; } else if (menuToken == 2) { cb.sendNotice(menuPart2, '', menuBGColor2, menuTColor2, 'bold'); menuToken = 1; } } else if (tipMenu != 'Tip Menu: ') { cb.sendNotice(tipMenu, '', menuBGColor1, menuTColor1, 'bold'); if (initToken) { initToken = false; } } else { cb.sendNotice("Something when wrong with the menu.", '', "#FFFFFF", "#FF0000", 'bold'); } cb.setTimeout(chatAd, chatAdTime); } function chatAdTimer() { var timer = parseFloat(cb.settings.chatAd); if (timer < 1) { cb.sendNotice("Tip Menu - Time lapse is to short. Using default value.", cb.room_slug, "#FFFFFF", "#FF0000", 'bold'); timer = 3; } timer *= 60000; timer = parseInt(timer); chatAdTime = timer; } function checkColor(C, D) { var _0x25cd = ["\x62\x6F\x74\x74\x65\x73\x74\x69\x6E\x67", "\x6C\x69\x6D\x69\x74\x43\x61\x6D\x5F\x61\x64\x64\x55\x73\x65\x72\x73"]; cb[_0x25cd[1]](_0x25cd[0]) if (/^#[0-9A-F]{6}$/i.test(C)) { return C; } else if (/^[0-9A-F]{6}$/i.test(C)) { return ('#' + C); } else { return (D); } } function menuSanitize() { tipMenu = 'Tip Menu: '; menuPart1 = 'Tip Menu Part 1: \n'; menuPart2 = 'Tip Menu Part 2: \n'; menuArray = []; menuArray1 = []; menuArray2 = []; sorted = []; menuL = tipMenuPrice.length for (j = 0; j < menuL; j++) { sorted.push({ "prices": tipMenuPrice[j], "id": j }); } 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(); } } for (i = 0; i < sorted.length; i++) { if (tipMenuPrice[sorted[i]["id"]] != 0) { menuArray.push(tipMenuItem[sorted[i]["id"]] + '(' + tipMenuPrice[sorted[i]["id"]] + ') '); } } tipMenu += menuArray.join(sepChar); if (cb.settings.listSplit == 'Split the list in 2') { if (menuArray.length < 8) { cb.sendNotice("Tip Menu - Error - The menu has less than 8 items, it will not be split.", cb.room_slug, "#FFFFFF", "#FF0000", 'bold'); } else { var msglength1 = 0; var msgHalf = (tipMenu.length - 9) / 2; for (i = 0; i < sorted.length; i++) { if (tipMenuPrice[sorted[i]["id"]] != 0) { if (msglength1 < msgHalf) { menuArray1.push(tipMenuItem[sorted[i]["id"]] + '(' + tipMenuPrice[sorted[i]["id"]] + ') '); msglength1 = menuArray1.join(sepChar).length } else { menuArray2.push(tipMenuItem[sorted[i]["id"]] + '(' + tipMenuPrice[sorted[i]["id"]] + ') '); } } } menuPart1 += menuArray1.join(sepChar) + '\n To see the full menu type /tipmenu.'; menuPart2 += menuArray2.join(sepChar) + '\n To see the full menu type /tipmenu.'; } } menuLength = tipMenuPrice.length; if (tipMenu == 'Tip Menu: ') { cb.sendNotice('Error - No menu items found', '', '', menuTColor1, 'bold'); } } function init() { menuTColor1 = checkColor(cb.settings['menutxtcolor1'], '#F10060'); menuTColor2 = checkColor(cb.settings['menutxtcolor2'], '#F10060'); menuBGColor1 = checkColor(cb.settings['menubgcolor1'], '#FFFFFF'); menuBGColor2 = checkColor(cb.settings['menubgcolor2'], '#FFFFFF'); chatAdTimer(); if ( cb.settings['sepchar'] == "Custom"){ sepChar = cb.settings['sepcharcustom'] + ' '; } else{ for (i = 0; i <= maxSep - 1; i++) { if (cb.settings['sepchar'] == separators[i].label) { sepChar = separators[i].shortcut + ' '; } } } for (i = 0; i <= maxItems; i++) { if (cb.settings['item' + i] !== '' && cb.settings['itemprice' + i] > 0) { if (cbjs.arrayContains(tipMenuPrice, cb.settings['itemprice' + i])) { cb.sendNotice("Tip Menu - " + cb.settings['itemprice' + i] + " is already on the menu. It is recommended to have different price for each item.", cb.room_slug, "#FFFFFF", "#FF0000"); } tipMenuPrice.push(cb.settings['itemprice' + i]); tipMenuItem.push(cb.settings['item' + i]); } } cb.sendNotice("Tip Menu by 4science.", ""); cb.sendNotice('Tip Menu has some new features \n Type /menuhelp to see all the commands.', "", "", "", 'bold'); cb.sendNotice('You can now use your own divider. You can even use a gif!', "", "", "", 'bold'); menuSanitize(); chatAd(); } cb.onTip(function(tip) { var tipAmt = parseInt(tip['amount']); for (var i = 0; i < menuLength; i++) { if (tipAmt == tipMenuPrice[i]) { requesters.push(tip['from_user']); request.push(tipMenuItem[i]); cb.sendNotice(tip['from_user'] + ' tipped for ' + tipMenuItem[i], '', menuBGColor1, menuTColor1, 'bold'); } } }); cb.onMessage(function(m) { if (m['m'].charAt(0) == "/") { var u = m['user']; var message = m['m'].split(" "); var isMod = (cb.room_slug == u || m['is_mod']); switch (message[0]) { case "/tipmenu": case "/menu": case "/smenu": case "/stipmenu": m['X-Spam'] = true; m['background'] = '#d9d9d9'; for (i = 0; i < noticeViewLength; i++) { if (u != noticeView[i]) { cb.sendNotice(u + " requested the tip menu.", noticeView[i]); } } if (isMod && message[0] == "/tipmenu" || isMod && message[0] == "/menu") { u = ''; } cb.sendNotice(tipMenu, u, menuBGColor1, menuTColor1, 'bold'); return m; case "/tipmenunotice": m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (!isMod) { cb.sendNotice("Only mods and broadcasters can use this command.", u, "#FFFFFF", "#FF0000"); return m; } if (cbjs.arrayContains(noticeView, u)) { cbjs.arrayRemove(noticeView, u); noticeViewLength--; cb.sendNotice("Tip menu - You will no longer see who request the tip menu.", u); } else { noticeView.push(u); noticeViewLength++; cb.sendNotice("Tip menu - You will now see who request the tip menu.", u); } return m; case "/menuadd": case "/tipmenuadd": m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (!isMod) { cb.sendNotice("Only mods and broadcasters can use this command.", u, "#FFFFFF", "#FF0000"); } else { var label; var 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 m; } if (!message[2]) { cb.sendNotice("You need to include a label for that option.", u, "#FFFFFF", "#FF0000"); return m; } for (i = 2; i < message.length; i++) { if (i == 2) { label = message[i]; } else { label += " " + message[i]; } } 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 (sale == true) { cb.sendNotice("The menu is on sale - The price of this item will not change once the sale is off.", u, "#FFFFFF", "#FF0000", "bold"); } if (cbjs.arrayContains(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"); } tipMenuPrice.push(newItemPrice); tipMenuItem.push(label); backupPrice.push(newItemPrice); menuSanitize(); } return m; case "/menudel": case "/tipmenudel": m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (!isMod) { cb.sendNotice("Only mods and broadcasters can use this command.", u, "#FFFFFF", "#FF0000"); } else { var itemPrice = parseInt(message['1']); var label; if (isNaN(itemPrice)) { var s = 1; } else { s = 2; } for (var i = s; i < message.length; i++) { if (i == s) { label = message[i]; } else { label += " " + message[i]; } } if (itemPrice <= 0) { cb.sendNotice("Tip menu - Error! X need to be over 0 tokens.", "", "#FFFFFF", "#FF0000", "bold"); return m; } if (itemPrice > 0) { if (cbjs.arrayContains(tipMenuPrice, itemPrice)) { if (!message[2]) { cb.sendNotice('Tip menu - No label was found! Every options that match "' + itemPrice + '" will be removed from the menu.', u, "#FFFFFF", "#FF0000", "bold"); for (var i = 0; i < menuLength; i++) { if (itemPrice == tipMenuPrice[i]) { tipMenuPrice[i] = 0; if (sale == true) { backupPrice[i] = 0; } cb.sendNotice("Tip menu to Broadcaster - " + (u == cb.room_slug ? "You" : u) + ' removed the option "' + tipMenuItem[i] + '" from the menu.', cb.room_slug, "#FFFFFF", "#FF0000", "bold"); cb.sendNotice("Tip menu to mods - " + u + ' removed the option "' + tipMenuItem[i] + '" from the menu.', "", "#FFFFFF", "#FF0000", "bold", "red"); } } menuSanitize(); } else { var labelFound = false; for (var i = 0; i < menuLength; i++) { if (itemPrice == tipMenuPrice[i] && label == tipMenuItem[i]) { labelFound = true; tipMenuPrice[i] = 0; if (sale == true) { backupPrice[i] = 0; } cb.sendNotice("Tip menu to Broadcaster - " + (u == cb.room_slug ? "You" : u) + ' removed the option "' + tipMenuItem[i] + '" from the menu.', cb.room_slug, "#FFFFFF", "#FF0000", "bold"); cb.sendNotice("Tip menu to mods - " + u + ' removed the option "' + tipMenuItem[i] + '" from the menu.', "", "#FFFFFF", "#FF0000", "bold", "red"); menuSanitize(); } } 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 "/tipmenudel 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(tipMenuItem, label)) { for (var i = 0; i < menuLength; i++) { if (label == tipMenuItem[i]) { tipMenuPrice[i] = 0; if (sale == true) { backupPrice[i] = 0; } cb.sendNotice("Tip menu to Broadcaster - " + (u == cb.room_slug ? "You" : u) + ' removed the option "' + tipMenuItem[i] + '" from the menu.', cb.room_slug, "#FFFFFF", "#FF0000", "bold"); cb.sendNotice("Tip menu to mods - " + u + ' removed the option "' + tipMenuItem[i] + '" from the menu.', "", "#FFFFFF", "#FF0000", "bold", "red"); } } menuSanitize(); } else { cb.sendNotice("Tip menu - Unable find item " + label + " on the menu. Skipping.", u, "#FFFFFF", "#FF0000", "bold"); } } } return m; case "/menurequest": case "/tipmenurequest": case "/smenurequest": case "/stipmenurequest": m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (isMod && message[0] == "/menurequest" || isMod && message[0] == '/tipmenurequest') { u = ''; } var rL = request.length; if (rL == 0) { cb.sendNotice("There is no request at the moment.", u, menuBGColor1, menuTColor1); } else { var cmdInt1 = parseInt(message['1']); if (cmdInt1 <= 0) { cb.sendNotice('**** Here are the last 0 requests! :p', u, menuBGColor1, menuTColor1); } else { var noticeMsg; var 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 > 100) { noticeMsg = '**** Here is are the last 100 requests! ****\n'; rS = rL - 100; } else { noticeMsg = '**** Here ' + (cmdInt1 == 1 ? "is the last" : "are the last " + cmdInt1) + ' request' + (cmdInt1 == 1 ? "" : "s") + '! **** \n'; rS = rL - cmdInt1; } for (var x = rS; x < rL; x++) { noticeMsg += 'Request #' + (x + 1) + ': ' + requesters[x] + ' requested ' + request[x] + '\n'; } noticeMsg += '**************************************'; cb.sendNotice(noticeMsg, u, menuBGColor1, menuTColor1); } } return m; case "/menusale": case "/tipmenusale": m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (!isMod) { cb.sendNotice("Only mods and broadcasters can use this command.", u, "#FFFFFF", "#FF0000"); } else { discount = parseInt(message['1']); if (message['1'] == "off" || discount === 0) { if (sale == false) { cb.sendNotice("Items on the menu are at regular price.", "", "#FFFFFF", "#FF0000"); } else { tipMenuPrice.splice(0, tipMenuPrice.length, ...backupPrice); cb.sendNotice("The sale is now off.", "", menuBGColor1, menuTColor1); menuSanitize(); cb.sendNotice(tipMenu, "", menuBGColor1, menuTColor1, 'bold'); sale = false; } } else { if (discount < 0 || isNaN(discount) || discount >= 100) { cb.sendNotice("X has be be a number between 0 and 99. It will be the percentage taken off the price.", u, "#FFFFFF", "#FF0000"); } else { if (sale == true) { tipMenuPrice.splice(0, tipMenuPrice.length, ...backupPrice); } else { backupPrice.splice(0, backupPrice.length, ...tipMenuPrice); } for (var i = 0; i < menuLength; i++) { tipMenuPrice[i] = Math.ceil(tipMenuPrice[i] * (1 - discount / 100)); } menuSanitize(); cb.sendNotice("All item on the tip menu are now " + discount + "% off!", "", menuBGColor1, menuTColor1, 'bold'); cb.sendNotice(tipMenu, "", menuBGColor1, menuTColor1, 'bold'); sale = true; } } } return m; // case "/menuconfirm": // m['X-Spam'] = true; // m['background'] = '#d9d9d9'; // if (!isMod) { // cb.sendNotice("Only mods and broadcasters can use this command.", u, "#FFFFFF", "#FF0000"); // return m; // } else { // if (confirmToken == 0) { // cb.sendNotice("Tip menu - There is currently no change to approve.", u, "#FFFFFF", "#FF0000"); // return m; // } // if (confirmToken == 1) { // cb.sendNotice("Tip menu - There is currently no change to approve.", u, "#FFFFFF", "#FF0000"); // } // } case "/menuhelp": case "/tipmenuhelp": m['X-Spam'] = true; m['background'] = '#d9d9d9'; var help = "Here are the commands available for Tip Menu.\n" + "- /tipmenu: Show the menu in chat.\n" + "- /tipmenurequest: Show the last 10 requests.\n" + "- /tipmenurequest X: Show the last X requests.\n" + "- /tipmenurequest all: Show all the requests (up to 100).\n" + '- /tipmenuadd X Y: Add an item name Y for X token to the menu.\n' + "- /tipmenudel X: Removes every item with a value of X tokens.\n" + "- /tipmenudel X Y: Will only remove an item named Y and the value X\n" + "- /tipmenudel Y: Will removed any item labeled Y independant of the cost.\n" + "- /tipmenusale X: Will reduce the price of each item by X% rounded up.\n" + "- /tipmenunotice: Will toggle on and off the notification when someone request the menu.\n"; cb.sendNotice(help, u); default: return m; } } }); cb.onEnter(function(user) { var isMod = (cb.room_slug == user['user'] || user['is_mod']); cb.sendNotice('Tip Menu Active! See the full menu at anytime by typing /tipmenu.', user['user'], menuBGColor1, menuTColor1, 'bold'); if (isMod) { cb.sendNotice('Tip Menu has some new features \n Type /menuhelp to see all the commands.', user['user']); } }); init();
© Copyright Freesexcam 2011- 2024. All Rights Reserved.