Bots Home
|
Create an App
Cassie's Slave Tasks
Author:
cassie
Description
Source Code
Launch Bot
Current Users
Created by:
Cassie
/** * Cassie's Slave Tasks (Bot) * Author: itscassofcourse * Date: 2021-10-28 * Based on Roll Your Slave Task by aLonso822xx */ cb.settings_choices = [ { name: 'tokens', type: 'int', minValue: 1, label: 'How much do you want to charge per roll?', defaultValue: 4 }, { name: 'remove_winning_prize', type: 'choice', label: 'Remove task from list after each roll?', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'die_type', type: 'choice', label: 'Use the traditional Roll the Dice (two 6-sided dices) or 4 dices? (NOTE: If you choose traditional, you only need 12 prizes.)', choice1: 'Traditional', choice2: 'Four', defaultValue: 'Four' }, { name: 'dieimageprefix', type: 'str', label: 'Choose your prefered dice emoticon for the traditional dices. Write the name of the emoticon in the box, but omit the number at the end.', defaultValue: ':866070200512183216607020051202' }, { name: 'announceOnEnter', type: 'choice', label: 'Announce the bot to users entering the channel?', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'adimage', type: 'str', label: 'Choose your prefered ad emoticon and write the name of it in the box, but omit the number at the end of the name.', required: false, defaultValue: '' }, { 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: 'minimum_rolls', type: 'int', minValue: 0, maxValue: 50, label: 'What is the minimum number of rolls before the rare task can appear? After the rare task has been rolled, the counter will start again.', defaultValue: 0 }, { name: 'rare_chance', type: 'int', minValue: 1, maxValue: 100, label: 'Chance to win the rare task (in percent)', defaultValue: 5 }, { name: 'notice_wait_time', type: 'choice', label: 'In minutes, how often should the app advertise itself?', choice1: 1, choice2: 5, choice3: 10, choice4: 15, choice5: 20, choice6: 30, choice7: 60, defaultValue: 30 }, { 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: '1. Task', defaultValue: 'Your mistress will choose 3 tasks for you!'}, {name: 'prize_2', type: 'str', label: '2. Task', defaultValue: 'Spank your naked ass 20 times with a belt!'}, {name: 'prize_3', type: 'str', label: '3. Task', defaultValue: 'Slap your face 10 times! Hard!'}, {name: 'prize_4', type: 'str', label: '4. Task', defaultValue: 'Deep throat a dildo 10 times!'}, {name: 'prize_5', type: 'str', label: '5. Task', defaultValue: 'Spank your pussy (or balls) 5 times!'}, {name: 'prize_6', type: 'str', label: '6. Task', defaultValue: 'Put clamps or clothespins on your nipples!'}, {name: 'prize_7', type: 'str', label: '7. Task', defaultValue: 'Assume Expose position for 5 minutes! Naked!'}, {name: 'prize_8', type: 'str', label: '8. Task', defaultValue: 'Assume Endure position for 2 minutes! Naked!'}, {name: 'prize_9', type: 'str', label: '9. Task', defaultValue: 'Wear a gag for 15 minutes!'}, {name: 'prize_10', type: 'str', label: '10. Task', defaultValue: 'Wear a large butt plug for 15 minutes!'}, {name: 'prize_11', type: 'str', label: '11. Task', defaultValue: 'Fuck your ass with a dildo for 3 minutes!'}, {name: 'prize_12', type: 'str', label: '12. Task (RARE if using traditional dice)', defaultValue: 'Spank your naked ass 40 times with your hands, a paddle, or a belt!'}, {name: 'prize_13', type: 'str', label: '13. Task (only shown if using 4 dices)', defaultValue: 'Wear handcuffs or ankle cuffs for 30 minutes!'}, {name: 'prize_14', type: 'str', label: '14. Task (only shown if using 4 dices)', defaultValue: 'Wear a collar for 1 hour!'}, {name: 'prize_15', type: 'str', label: '15. Task (only shown if using 4 dices)', defaultValue: 'Masturbate for 5 minutes! You are not allowed to cum!'}, {name: 'prize_16', type: 'str', label: '16. Task (only shown if using 4 dices)', defaultValue: 'Shave your pussy (or balls)!'}, {name: 'prize_17', type: 'str', label: '17. Task (only shown if using 4 dices)', defaultValue: 'Put toothpaste on your pussy or asshole!'}, {name: 'prize_18', type: 'str', label: '18. Task (only shown if using 4 dices)', defaultValue: 'Clean your toilet! No toilet privileges for 1 hour!'}, {name: 'prize_19', type: 'str', label: '19. Task (only shown if using 4 dices)', defaultValue: 'Wash the dishes! Right now, no excuses!'}, {name: 'prize_20', type: 'str', label: '20. Task (only shown if using 4 dices)', defaultValue: 'Spank your naked ass 30 times with a belt!'}, {name: 'prize_21', type: 'str', label: '21. Task (only shown if using 4 dices)', defaultValue: 'Send your mistress some tokens! Don\'t be stingy!'}, {name: 'prize_22', type: 'str', label: '22. Task (RARE if using 4 dices)', defaultValue: 'Congratulations, you have permission to cum!'} ]; var price = cb.settings.tokens; var langTokens = (price > 1) ? 'tokens' : 'token'; var multiRolls = cb.settings.multirolls; var rollCounter = 0; var winners = []; var prizes = []; var minimumRollsToGetRareDice = parseInt(cb.settings.minimum_rolls); var minimumRollsToGetRareDiceSave = minimumRollsToGetRareDice; var maxOutcome = (cb.settings.die_type == 'Traditional') ? 13 : 25; var dieImagePrefix = cb.settings['dieimageprefix']; var AdImage = cb.settings['adimage']; var rareChance = cb.settings.rare_chance; // percent chance of rolling a RARE (minimum rolls must also be met) var currentTimer = null; var uc = { unicorn: '\u{1F984}', eggplant: '\u{1F346}', kiss_mark: '\u{1F48B}', red_heart: '\u{2764}', sparkling_heart: '\u{1F496}', collision: '\u{1F4A5}', raised_hand: '\u{270B}', star: '\u{2B50}', } 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) { numberOfRolls = 0; } for (var i = 0; i < numberOfRolls; i++) { roll(tip['from_user']); } } }); cb.onEnter(function (user) { if (cb.settings.announceOnEnter === 'Yes') { showAppAd(user['user']); } }); cb.onMessage(function (msg) { var command = getCommand(msg) var args = getArgs(msg) if (command === '!slaves') { msg['X-Spam'] = true; showPrizesWon(msg['user']); } else if (command === '!tasks') { msg['X-Spam'] = true; if (args[0] === 'all' && (fromBroadcaster(msg) || fromMod(msg))) { showPrizes(); } else { showPrizes(msg['user']); } } else if (command === '!cstinfo') { msg['X-Spam'] = true; showInfo(msg['user']); } else if (command === '!task' && (fromBroadcaster(msg) || fromMod(msg))) { msg['X-Spam'] = true; var name = (args.length > 0) ? args.join(' ') : 'you'; roll(name, true); } else if (command === '!timer' && (fromBroadcaster(msg) || fromMod(msg))) { msg['X-Spam'] = true; var expiresInMinutes = parseInt(args[0]); if (expiresInMinutes) { startTimer(expiresInMinutes); } } return msg; }); function getCommand(msg) { return msg['m'].trim().split(/\s+/)[0] } function getArgs(msg) { return msg['m'].trim().split(/\s+/).slice(1) } function fromBroadcaster(msg) { return msg['user'] === cb.room_slug } function fromMod(msg) { return msg['is_mod'] === true } function log(args) { cb.sendNotice(args, '', '#000000', '#D9FAD7', 'bold'); } function sendToAll(text) { cb.sendNotice(text, '', '#FFDBF3', '#FF0048', 'bold'); } function startTimer(minutes) { var startingInSeconds = 10; var msgStarting = 'Get ready! ' + minutes + ' minutes timer starting in ' + startingInSeconds + ' seconds ...'; var msgTimerStarted = 'Timer started, ' + minutes + ' minutes to go!'; var msgTimerExpired = minutes + ' minutes are up!'; cancelTimer(); sendToAll(msgStarting); cb.setTimeout(function() { sendToAll(msgTimerStarted); }, startingInSeconds * 1000); currentTimer = cb.setTimeout(function() { sendToAll(msgTimerExpired); }, minutes * 60 * 1000); } function cancelTimer() { if (!currentTimer) { return; } cb.cancelTimeout(currentTimer); currentTimer = null; } function makeHeader(text, emoji) { return `${emoji.repeat(3)} ${text} ${emoji.repeat(3)}`; } function roll(username, isGift) { rollCounter++; var winner = false; if (cb.settings.die_type == 'Traditional') { var dienumber = Math.floor(Math.random() * 10) + 2; if ( dienumber > 6) { var die1 = 6; var die2 = dienumber - 6; } else { var die1 = dienumber - 1; var die2 = 1; } } else if (cb.settings.die_type == 'Four') { var dienumber = Math.floor(Math.random() * 20) + 4; if ( dienumber <= 9) { var die1 = dienumber - 3; var die2 = 1; var die3 = 1; var die4 = 1; } else if (dienumber <= 14){ var die1 = 6; var die2 = dienumber - 8; var die3 = 1; var die4 = 1; } else if (dienumber <= 19){ var die1 = 6; var die2 = 6; var die3 = dienumber - 13; var die4 = 1; } else { var die1 = 6; var die2 = 6; var die3 = 6; var die4 = dienumber - 18; } } // see if there's a chance we can roll a rare die or dividing the random number if (rollCounter > minimumRollsToGetRareDice) { if (Math.random() <= (rareChance / 100)) { minimumRollsToGetRareDice = minimumRollsToGetRareDice + minimumRollsToGetRareDiceSave + 1; if (cb.settings.die_type == 'Traditional') { var dienumber = 13; var die1 = 6; var die2 = 7; } else if (cb.settings.die_type == 'Four') { var dienumber = 25; var die1 = 6; var die2 = 6; var die3 = 6; var die4 = 7; } } } if (cb.settings.die_type == 'Traditional') { if (dienumber>= 2) { winner = true; var prize = cb.settings['prize_' + (dienumber - 1)]; } else { winner = false; var prize = 'A Thank You!'; } } else if (cb.settings.die_type == 'Four') { if (dienumber >= 4) { winner = true; var prize = cb.settings['prize_' + (dienumber - 3)]; } else { winner = false; var prize = 'A Thank You!'; } } var rareText = ''; if (dienumber == 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 = ''; if (cb.settings.die_type == 'Traditional') { msg += dieImagePrefix + die1 + " " + dieImagePrefix + die2 + "\n"; } else if (cb.settings.die_type == 'Four') { msg += dieImagePrefix + die1 + " " + dieImagePrefix + die2 + " " + dieImagePrefix + die3 + " " + dieImagePrefix + die4 +"\n"; } if (isGift) { msg += cb.room_slug + " rolled a " + dienumber + " for " + username + "!\n"; } else { msg += username + " rolled a " + dienumber + "!\n"; } msg += "Roll #" + rollCounter + " | Slave task: " + prize + "\n"; msg += "Do it now, " + (username == 'you' ? 'slave' : username) + "! Your mistress doesn't tolerate tardiness!"; var textColor = '#FF0048'; var bgColor = '#FFDBF3'; if (winner) textColor = '#FF0048'; if (dienumber == maxOutcome) { bgColor = '#FF497D'; textColor = '#000000'; } cb.sendNotice(msg, '', bgColor, textColor, 'bold'); winners.push("Roll #" + rollCounter + " (" + dienumber + "): " + username + " - " + prize); } function setPrizes() { var rareText = ''; if (cb.settings.die_type == 'Traditional'){ for (var i = 1; i <= (maxOutcome - 1); i++) { if (i == maxOutcome - 1) rareText = " (RARE)"; prizes.push(cb.settings['prize_' + i] + rareText); } } else if (cb.settings.die_type == 'Four') { for (var i = 1; i <= (maxOutcome - 3); i++) { if (i == maxOutcome - 3) rareText = " (RARE)"; prizes.push(cb.settings['prize_' + i] + rareText); } } } function showPrizes(username) { if (prizes.length) { var rareText = ''; var msg = makeHeader('Available Slave Tasks', uc.star); if (cb.settings.die_type == 'Traditional'){ for (var i = 1; i <= (maxOutcome - 1); i++) { if (i == (maxOutcome - 1)) rareText = " (RARE)"; if (prizes.indexOf(cb.settings['prize_' + i] + rareText) >= 0) msg += "\nTask " + i + " - " + cb.settings['prize_' + i] + rareText; } } else if (cb.settings.die_type == 'Four') { for (var i = 1; i <= (maxOutcome - 3); i++) { if (i == (maxOutcome - 3)) rareText = " (RARE)"; if (prizes.indexOf(cb.settings['prize_' + i] + rareText) >= 0) msg += "\nTask " + i + " - " + cb.settings['prize_' + i] + rareText; } } } else { var msg = "SORRY! There are no task 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 task can appear." } else { msg += "\n" + (minimumRollsToGetRareDice - rollCounter) + " rolls until the rare task can appear." } } cb.sendNotice(msg, username, '#FFDBF3', '#FF0048', 'bold'); } function showInfo(username) { var msg = makeHeader("Cassie's Slave Tasks", uc.star); msg += "Each roll reveals a task for you, slave. There are " + prizes.length + " possible tasks.\n"; if (cb.settings.remove_winning_prize == 'Yes') { msg += "Each task won will be removed from the list.\n"; } else { msg += "Each task won will stay on the list.\n"; } msg += "Type \"!tasks\" to see the list of the slave tasks. \n"; msg += "Type \"!tasks all\" to send the list to all users (mod/broadcaster only).\n"; msg += "Type \"!task [name]\" to roll a task for that slave.\n"; msg += "Type \"!slaves\" to see a list of the last 20 slaves (mod/broadcaster only)."; cb.sendNotice(msg, username, '#FFDBF3', '#FF0048', 'bold'); } function showPrizesWon(username) { var msg = makeHeader('Last 20 Tasks', uc.star); msg += "\nList sorted in chronological order"; if (winners.length == 0) { cb.sendNotice('No one has won anything yet. Roll the dice to win a task!', username, '', '', 'bold'); } else { var recentWinners = winners.slice(-20); for (var i = 0; i < recentWinners.length; i++) msg += "\n" + recentWinners[i]; cb.sendNotice(msg, username, '#FFDBF3', '#FF0048', 'bold'); } } function advertise() { showAppAd(); cb.setTimeout(advertise, parseInt(cb.settings.notice_wait_time) * 60000); } function showAppAd(username) { var msg = ""; msg += makeHeader("Roll Your Slave Task", uc.star); msg += "\nWelcome, slaves! Your mistress is running this bot to punish and discipline you!"; if (multiRolls > 1) { msg += "\nTip " + price + " tokens to roll the dice and win a task, up to " + multiRolls + " rolls per tip (" + (multiRolls*price) + " tokens)."; } else { msg += "\nTip " + price + " tokens to roll the dice and win a task."; } msg += "\nType \"!tasks\" to see the list of available slave tasks."; if (AdImage) msg += "\n" + AdImage + price + " "; cb.sendNotice(msg, username, '', '#FF0048', 'bold'); } function init() { setPrizes(); advertise(); if (cb.settings.change_room_subject == 'Yes') { cb.changeRoomSubject('Tip ' + price + ' ' + langTokens + ' to roll the dice and win a slave task!'); } } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.