Bots Home
|
Create an App
fasbcvbz
Author:
mistressadelle
Description
Source Code
Launch Bot
Current Users
Created by:
Mistressadelle
/* Title: "Adele Rotating Notifier" bot Author: Mistress_Adelee Version: 0.0.4 (6/12/2020) A simple rotating notifier bot with 100 notification entries. Only options are to set color and display interval. Messages are rotated in sequence. Message 1 can also be displayed on room entry privately. Messages from broadcaster and users with rainbow background. Version: 0.0.4 (6/12/2020) added rainbow background for messages, gray user text replacement Version: 0.0.3 (18/11/2020) added more notices */ var price = cb.settings.tokens; var langTokens = (price > 1) ? 'tokens' : 'token'; var numberOfSides = (cb.settings.die_type == 'Traditional') ? 6 : 10; var multiRolls = cb.settings.multirolls; var lastRoller = '--'; var lastPrizeWon = '--'; var rollCounter = 0; var tipCounter = 0; var winners = []; var prizes = []; var minimumRollsToGetRareDice = parseInt(cb.settings.minimum_rolls); var maxOutcome = (cb.settings.die_type == 'Traditional') ? 13 : 21; var dieImagePrefix = (cb.settings.die_type == 'Traditional') ? ':reddie' : ':cdie'; var rareChance = 10; // percent chance of rolling a RARE (minimum rolls must also be met) var i=1; cb.settings_choices = [{name: 'msgonentry', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Display Message 1 privately on entry - set to no for busy rooms"}, {name:'msg1', type:'str', required: false, label:'Message 1',}, {name:'msg2', type:'str', required: false, label:'Message 2',}, {name:'msg3', type:'str', required: false, label:'Message 3',}, {name:'msg4', type:'str', required: false, label:'Message 4',}, {name:'msg5', type:'str', required: false, label:'Message 5',}, {name:'msg6', type:'str', required: false, label:'Message 6',}, {name:'msg7', type:'str', required: false, label:'Message 7',}, {name:'msg8', type:'str', required: false, label:'Message 8',}, {name:'msg9', type:'str', required: false, label:'Message 9',}, {name:'msg10', type:'str', required: false, label:'Message 10',}, {name:'msg11', type:'str', required: false, label:'Message 11',}, {name:'msg12', type:'str', required: false, label:'Message 12',}, {name:'msg13', type:'str', required: false, label:'Message 13',}, {name:'msg14', type:'str', required: false, label:'Message 14',}, {name:'msg15', type:'str', required: false, label:'Message 15',}, {name:'msg16', type:'str', required: false, label:'Message 16',}, {name:'msg17', type:'str', required: false, label:'Message 17',}, {name:'msg18', type:'str', required: false, label:'Message 18',}, {name:'msg19', type:'str', required: false, label:'Message 19',}, {name:'msg20', type:'str', required: false, label:'Message 20',}, {name:'msg21', type:'str', required: false, label:'Message 21',}, {name:'msg22', type:'str', required: false, label:'Message 22',}, {name:'msg23', type:'str', required: false, label:'Message 23',}, {name:'msg24', type:'str', required: false, label:'Message 24',}, {name:'msg25', type:'str', required: false, label:'Message 25',}, {name:'msg26', type:'str', required: false, label:'Message 26',}, {name:'msg27', type:'str', required: false, label:'Message 27',}, {name:'msg28', type:'str', required: false, label:'Message 28',}, {name:'msg29', type:'str', required: false, label:'Message 29',}, {name:'msg30', type:'str', required: false, label:'Message 30',}, {name:'msg31', type:'str', required: false, label:'Message 31',}, {name:'msg32', type:'str', required: false, label:'Message 32',}, {name:'msg33', type:'str', required: false, label:'Message 33',}, {name:'msg34', type:'str', required: false, label:'Message 34',}, {name:'msg35', type:'str', required: false, label:'Message 35',}, {name:'msg36', type:'str', required: false, label:'Message 36',}, {name:'msg37', type:'str', required: false, label:'Message 37',}, {name:'msg38', type:'str', required: false, label:'Message 38',}, {name:'msg39', type:'str', required: false, label:'Message 39',}, {name:'msg40', type:'str', required: false, label:'Message 40',}, {name:'msg41', type:'str', required: false, label:'Message 41',}, {name:'msg42', type:'str', required: false, label:'Message 42',}, {name:'msg43', type:'str', required: false, label:'Message 43',}, {name:'msg44', type:'str', required: false, label:'Message 44',}, {name:'msg45', type:'str', required: false, label:'Message 45',}, {name:'msg46', type:'str', required: false, label:'Message 46',}, {name:'msg47', type:'str', required: false, label:'Message 47',}, {name:'msg48', type:'str', required: false, label:'Message 48',}, {name:'msg49', type:'str', required: false, label:'Message 49',}, {name:'msg50', type:'str', required: false, label:'Message 50',}, {name:'msg51', type:'str', required: false, label:'Message 51',}, {name:'msg52', type:'str', required: false, label:'Message 52',}, {name:'msg53', type:'str', required: false, label:'Message 53',}, {name:'msg54', type:'str', required: false, label:'Message 54',}, {name:'msg55', type:'str', required: false, label:'Message 55',}, {name:'msg56', type:'str', required: false, label:'Message 56',}, {name:'msg57', type:'str', required: false, label:'Message 57',}, {name:'msg58', type:'str', required: false, label:'Message 58',}, {name:'msg59', type:'str', required: false, label:'Message 59',}, {name:'msg60', type:'str', required: false, label:'Message 60',}, {name:'msg61', type:'str', required: false, label:'Message 61',}, {name:'msg62', type:'str', required: false, label:'Message 62',}, {name:'msg63', type:'str', required: false, label:'Message 63',}, {name:'msg64', type:'str', required: false, label:'Message 64',}, {name:'msg65', type:'str', required: false, label:'Message 65',}, {name:'msg66', type:'str', required: false, label:'Message 66',}, {name:'msg67', type:'str', required: false, label:'Message 67',}, {name:'msg68', type:'str', required: false, label:'Message 68',}, {name:'msg69', type:'str', required: false, label:'Message 69',}, {name:'msg70', type:'str', required: false, label:'Message 70',}, {name:'msg71', type:'str', required: false, label:'Message 71',}, {name:'msg72', type:'str', required: false, label:'Message 72',}, {name:'msg73', type:'str', required: false, label:'Message 73',}, {name:'msg74', type:'str', required: false, label:'Message 74',}, {name:'msg75', type:'str', required: false, label:'Message 75',}, {name:'msg76', type:'str', required: false, label:'Message 76',}, {name:'msg77', type:'str', required: false, label:'Message 77',}, {name:'msg78', type:'str', required: false, label:'Message 78',}, {name:'msg79', type:'str', required: false, label:'Message 79',}, {name:'msg80', type:'str', required: false, label:'Message 80',}, {name:'msg81', type:'str', required: false, label:'Message 81',}, {name:'msg82', type:'str', required: false, label:'Message 82',}, {name:'msg83', type:'str', required: false, label:'Message 83',}, {name:'msg84', type:'str', required: false, label:'Message 84',}, {name:'msg85', type:'str', required: false, label:'Message 85',}, {name:'msg86', type:'str', required: false, label:'Message 86',}, {name:'msg87', type:'str', required: false, label:'Message 87',}, {name:'msg88', type:'str', required: false, label:'Message 88',}, {name:'msg89', type:'str', required: false, label:'Message 89',}, {name:'msg90', type:'str', required: false, label:'Message 90',}, {name:'msg91', type:'str', required: false, label:'Message 91',}, {name:'msg92', type:'str', required: false, label:'Message 92',}, {name:'msg93', type:'str', required: false, label:'Message 93',}, {name:'msg94', type:'str', required: false, label:'Message 94',}, {name:'msg95', type:'str', required: false, label:'Message 95',}, {name:'msg96', type:'str', required: false, label:'Message 96',}, {name:'msg97', type:'str', required: false, label:'Message 97',}, {name:'msg98', type:'str', required: false, label:'Message 98',}, {name:'msg99', type:'str', required: false, label:'Message 99',}, {name:'msg100', type:'str', required: false, label:'Message 100',}, {name:'msgcolor', type:'str', label:'Notice color (html code default dark red #9F000F)', defaultValue: '#9F000F'}, {name: 'chat_ad', type:'int', minValue: 1, maxValue: 999, defaultValue: 1, label: 'Delay in minutes between notices being displayed (minimum 1)'}, {name: 'InputName1', type: 'str', label: 'Not used for anything', defaultValue: 'SomeText'}, { name: "msg_replace", type: "str", minLength: 1, maxLength: 255, defaultValue: "[message hidden. please purchase tokens to chat and tip.]", label: "Replace messages of users without tokens with this message", required: true }, { name: "msg_control", label: "Show message to all", type: "choice", choice1: "yes", choice2: "no", defaultValue: "no", required: true }, { name: 'tokens', type: 'int', minValue: 1, label: 'How much do you want to charge per roll?', defaultValue: 33 }, { name: 'remove_winning_prize', type: 'choice', label: 'Remove prize from list after each roll?', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'die_type', type: 'choice', label: 'Use Traditional (6-sided) or Chinese (10-sided) dice? (NOTE: If you choose the ' + 'Chinese die, please set all of the 21 prizes. Otherwise, just set the first 13.)', choice1: 'Traditional', choice2: 'Chinese', defaultValue: 'Traditional' }, { name: 'multirolls', type: 'int', minValue: 1, label: 'What is the maximum number of rolls you want a user to be able to make in a single tip? (set to 1 to disable) Example: If you set this to 3 and you charge 33 tokens per roll, a user could tip 66 for 2 rolls or 99 for 3 rolls.', defaultValue: 3 }, { name: 'too_high_multiples', type: 'choice', label: 'What shall happen if a user tips an amount that is a multiple of the roll price but would result in more rolls at once than allowed?', choice1: 'Roll the dice as often as allowed', choice2: 'Do not roll the dice at all', defaultValue: 'Roll the dice as often as allowed' }, { name: 'minimum_rolls', type: 'int', minValue: 0, maxValue: 50, label: 'What is the minimum number of rolls before the rare die can appear? (Will be displayed if not 0)', defaultValue: 0 }, { name: 'notice_wait_time', type: 'choice', label: 'In minutes, how often should the app advertise itself?', choice1: 5, choice2: 10, choice3: 15, choice4: 20, choice5: 25, choice6: 30, choice7: 45, choice8: 60, defaultValue: 10 }, { name: 'change_room_subject', type: 'choice', label: 'Change room subject when using this bot?', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, {name: 'prize_1', type: 'str', label: 'Prize for rolling 1', defaultValue: 'dance'}, {name: 'prize_2', type: 'str', label: 'Prize for rolling 2', defaultValue: 'dance (you choose song)'}, {name: 'prize_3', type: 'str', label: 'Prize for rolling 3', defaultValue: 'flash boobs'}, {name: 'prize_4', type: 'str', label: 'Prize for rolling 4', defaultValue: 'flash pussy'}, {name: 'prize_5', type: 'str', label: 'Prize for rolling 5', defaultValue: 'flash butt'}, {name: 'prize_6', type: 'str', label: 'Prize for rolling 6', defaultValue: 'flash (you choose what)'}, {name: 'prize_7', type: 'str', label: 'Prize for rolling 7', defaultValue: 'suck nipples'}, {name: 'prize_8', type: 'str', label: 'Prize for rolling 8', defaultValue: 'pussy close up'}, {name: 'prize_9', type: 'str', label: 'Prize for rolling 9', defaultValue: 'camel toe'}, {name: 'prize_10', type: 'str', label: 'Prize for rolling 10', defaultValue: 'spank butt'}, {name: 'prize_11', type: 'str', label: 'Prize for rolling 11', defaultValue: 'spank butt both hands'}, {name: 'prize_12', type: 'str', label: 'Prize for rolling 12', defaultValue: 'spank pussy'}, {name: 'prize_13', type: 'str', label: 'Prize for rolling 13 (RARE if using traditional dice)', defaultValue: 'finger pussy 10 mins'}, {name: 'prize_14', type: 'str', label: 'Prize for rolling 14 (only shown if using Chinese dice)', defaultValue: '.'}, {name: 'prize_15', type: 'str', label: 'Prize for rolling 15 (only shown if using Chinese dice)', defaultValue: '.'}, {name: 'prize_16', type: 'str', label: 'Prize for rolling 16 (only shown if using Chinese dice)', defaultValue: '.'}, {name: 'prize_17', type: 'str', label: 'Prize for rolling 17 (only shown if using Chinese dice)', defaultValue: '.'}, {name: 'prize_18', type: 'str', label: 'Prize for rolling 18 (only shown if using Chinese dice)', defaultValue: '.'}, {name: 'prize_19', type: 'str', label: 'Prize for rolling 19 (only shown if using Chinese dice)', defaultValue: '.'}, {name: 'prize_20', type: 'str', label: 'Prize for rolling 20 (only shown if using Chinese dice)', defaultValue: '.'}, {name: 'prize_21', type: 'str', label: 'Prize for rolling 21 (RARE if using Chinese dice)', defaultValue: '.'} ]; cb.onEnter(function(user) { if (cb.settings['msgonentry'] == 'yes') { cb.sendNotice('Welcome ' + user['user'] + '! ' + cb.settings['msg1'],user['user'],'',cb.settings['msgcolor'],'bold'); } }); function chatAd() { var msg; while (cb.settings['msg' + i] == 0) { //skip empty messages i++; if (i > 100) { //loop back to first message i=1; } } msg = cb.settings['msg' + i]; i++; if (i > 100) { //loop back to first message i=1; } cb.sendNotice(msg,'','',cb.settings['msgcolor'],'bold'); cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); } cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); function is_model(message) { return (message.user == cb.room_slug); } cb.onMessage(function (message) {message['background'] = "linear-gradient(to right, rgba(255,50,50,0.3) 0%,rgba(255,255,48,0.3) 26%,rgba(40,255,251,0.3) 60%,rgba(169,40,255,0.3) 99%)"; var msg = cb.settings.msg_replace; if ((!message.has_tokens) && (!message.is_mod) && (!message.in_fanclub) && (!is_model(message))) { message.m = msg; if (cb.settings.msg_control == "no"){ message.m = msg; message['X-Spam'] = true; } } return message; }); cb.onTip(function (tip) { var tipAmount = parseInt(tip['amount']); // check to see if tip was for a dice roll if (tipAmount >= price && (tipAmount % price == 0)) { var numberOfRolls = Math.floor(tipAmount / price); if (numberOfRolls > multiRolls) { if (cb.settings.too_high_multiples == 'Roll the dice as often as allowed'){ numberOfRolls = multiRolls; } else { numberOfRolls = 0; } } for (var i = 0; i < numberOfRolls; i++) { roll(tip['from_user']); lastRoller = tip['from_user']; } } else { // Tip was for something else, don't roll the dice var textColor = '#000000'; var bgColor = '#D9FAD7'; //cb.sendNotice('Tip was not for dice roll.', '', bgColor, textColor, 'bold'); //tipCounter += parseInt(tip['amount']); cb.drawPanel(); } }); cb.onDrawPanel(function (user) { return { 'template': '3_rows_12_22_31', 'row1_label': 'Last prize won:', 'row1_value': lastPrizeWon, 'row2_label': 'Last player:', 'row2_value': lastRoller, 'row3_value': tipCounter + ' ' + langTokens + ' received / rolled ' + rollCounter + ' time(s)' }; }); cb.onEnter(function (user) { showAppAd(user['user']); }); cb.onMessage(function (msg) { if (msg['m'].match(/!winners/i)) { msg['X-Spam'] = true; showPrizesWon(msg['user']); } else if (msg['m'].match(/!lol/i)) { msg['X-Spam'] = true; if (msg['m'].match(/all/i) && ((msg['is_mod'] == true) || (msg['user'] == cb.room_slug))) { showPrizes(); } else { showPrizes(msg['user']); } } if (msg['m'].match(/!info/i)) { msg['X-Spam'] = true; showappinformation(msg['user']); } if (msg['m'].match(/!log/i)) { msg['X-Spam'] = true; showchangelog(msg['user']); } return msg; }); function roll(username) { rollCounter++; var die1 = Math.floor(Math.random() * numberOfSides) + 1; var die2 = Math.floor(Math.random() * numberOfSides) + 1; // see if there's a chance we can roll a rare die if (rollCounter > minimumRollsToGetRareDice) { if (Math.random() <= (rareChance / 100)) { die1 = 7; } } var total = die1 + die2; var winner = false; if (total >= 1) { winner = true; var prize = cb.settings['prize_' + total]; } else { winner = false; var prize = 'A Thank You!'; } var rareText = ''; if (total == maxOutcome) rareText = " (RARE)"; var prizeIndex = prizes.indexOf(prize + rareText); if (prizeIndex >= 0) { if (cb.settings.remove_winning_prize == 'Yes') prizes.splice(prizeIndex, 1); } else { prize = 'A Thank You!'; } var msg = dieImagePrefix + die1 + " " + dieImagePrefix + die2 + "\n"; msg += username + " rolled a " + total + "! \n".toUpperCase(); msg += "Roll #" + rollCounter + " | Prize: " + prize; var textColor = '#000000'; var bgColor = '#D9FAD7'; if (winner) textColor = '#067D00'; if (total == maxOutcome) { bgColor = '#FFDBF3'; textColor = '#A805A6'; } cb.sendNotice(msg, '', bgColor, textColor, 'bold'); lastPrizeWon = prize; winners.push("Roll #" + rollCounter + " (" + total + "): " + username + " - " + prize); cb.drawPanel(); } function setPrizes() { var rareText = ''; for (var i = 1; i <= maxOutcome; i++) { if (i == maxOutcome) rareText = " (RARE)"; prizes.push(cb.settings['prize_' + i] + rareText); } } function showPrizes(username) { if (prizes.length) { var rareText = ''; var msg = "***** POSSIBLE PRIZES *****"; for (var i = 1; i <= maxOutcome; i++) { if (i == maxOutcome) rareText = " (RARE)"; if (prizes.indexOf(cb.settings['prize_' + i] + rareText) >= 0) msg += "\nRoll " + i + " - " + cb.settings['prize_' + i] + rareText; } } else { var msg = "SORRY! There are no prizes left in the list, but thank you for the tip. :thumbsup"; } if (rollCounter < minimumRollsToGetRareDice) { if ((minimumRollsToGetRareDice - rollCounter) == 1) { msg += "\nOnly 1 roll until the rare die can appear." } else { msg += "\n" + (minimumRollsToGetRareDice - rollCounter) + " rolls until the rare die can appear." } } cb.sendNotice(msg, username, '#DBFBFF', '#008596', 'bold'); } function showPrizesWon(username) { var msg = "***** LAST 20 WINNERS *****"; msg += "\nList sorted in chronological order"; if (winners.length == 0) { cb.sendNotice('No one has won anything yet. Roll the dice to win a prize!', username, '#ffff00', '#000000', 'bold'); } else { var recentWinners = winners.slice(-20); for (var i = 0; i < recentWinners.length; i++) msg += "\n" + recentWinners[i]; cb.sendNotice(msg, username, '#000000', '#ffffff', 'bold'); } } function showappinformation(username) { var msg = "***** app information ***** "; msg += "\nRoll the Dice \n"; msg += "made by jeffreyvels1994 \n"; msg += "old version - 10.1.1 \n"; msg += "new version - 10.2.1 \n"; msg += "release date - 2018-03-31 \n"; msg += "update date - 2018-11-24 \n"; msg += "(Tweaked from the original game and its modifications by zingknaat) \n"; msg += "for questions or suggestions you can mail to feedback.chaturbate@gmail.com \n"; msg += "you can leave a feedback via http://www.zencloud.site/feedback.php \n"; msg += "Type \"!log\" to see the changelog history \n"; msg += "Type \"!lol\" to see the list of prizes \n"; msg += "Type \"!lol all\" to send the list to all viewers if you're a mod or the broadcaster\n"; msg += "Type \"!winners\" to see a list of the last 20 winners "; cb.sendNotice(msg, username, '#000000', '#ffffff', 'bold'); } function showchangelog(username) { var msg = "***** changelog information ***** "; msg += "\nchangelog (2018-11-23) \n"; msg += "I have made the text white and the layout black. then people who are color blind can read it well. \n"; msg += "bug fixed \n"; msg += "added a welcome message \n"; msg += "added Remove prize from list after each roll \n\n"; msg += "changelog (2018-11-24) \n"; msg += "remove welcome message \n"; msg += "added What shall happen if a user tips an amount that is a multiple of the roll price but would result in more rolls at once than allowed \n"; msg += "minor bugs fixed \n"; cb.sendNotice(msg, username, '#000000', '#ffffff', 'bold'); } function advertise() { showAppAd(); cb.setTimeout(advertise, parseInt(cb.settings.notice_wait_time) * 60000); } function showAppAd(username) { var msg = ""; msg += "We are playing Roll the Dice - by jeffreyvels1994 \n"; msg += "Each roll reveals a prize. There are " + prizes.length + " possible prizes.\n"; if (cb.settings.remove_winning_prize == 'Yes') { msg += "Each prize won will be removed from the list.\n"; } else { msg += "Each prize won will stay on the list.\n"; } msg += "Tip " + price + " " + langTokens + " to roll the dice. \n"; if (multiRolls > 1) msg += "You can roll a maximum of " + multiRolls + " times in a single tip (" + (multiRolls*price) + " tokens). \n"; msg += "Type \"!info\" to see the (app information)\n"; msg += "Type \"!log\" to see the changelog history \n"; msg += "Type \"!lol\" to see the list of prizes \n"; msg += "Type \"!lol all\" to send the list to all viewers if you're a mod or the broadcaster \n"; msg += "Type \"!winners\" to see a list of the last 20 winners "; cb.sendNotice(msg, username, '#000000', '#ffffff', 'bold'); } function init() { setPrizes(); advertise(); if (cb.settings.change_room_subject == 'Yes') { cb.changeRoomSubject('Tip ' + price + ' ' + langTokens + ' to roll the dice and win a prize!'); } } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.