Apps Home
|
Create an App
Tasks & Punishment Dice
Author:
pluckysub
Description
Source Code
Launch App
Current Users
Created by:
Pluckysub
/*~~~~~~~~~~~~~~~~~ ~~Tasks & Punishment Dice ~~Version: 0.8.0 ~~Author: Pluckysub ~~Date: 2020-07-15 ~~~~~~~~~~~~~~~~~~~ */ cb.settings_choices = [ { name: 'theme', type: 'choice', label: 'Colour theme', choice1: 'Red', choice2: 'Gradient Red', choice3: 'Blue', choice4: 'Gradient Blue', choice5: 'Pink', choice6: 'Gradient Pink', choice7: 'Lilac', choice8: 'Gradient Lilac', choice9: 'Purple', choice10: 'Gradient Purple', choice11: 'Green', choice12: 'Gradient Green', choice13: 'Black', choice14: 'Gradient Black' }, { name: 'grad_dir', type: 'choice', label: 'If using a gradient, which direction would you like it? (dark to light)', choice1: 'to right', choice2: 'to right bottom', choice3: 'to right top', choice4: 'to top', choice5: 'to bottom', choice6: 'to left', choice7: 'to left bottom', choice8: 'to left top' }, { name: 'host_name', type: 'str', label: 'How would you like the app to refer to YOU?', default: 'Mistress' }, { name: 'p_tokens', type: 'int', minValue: 0, label: 'How much do you want to charge per punishment (0 to disable punishments)', defaultValue: 30 }, { name: 't_tokens', type: 'int', minValue: 0, label: 'How much do you want to charge per task (0 to disable tasks)', defaultValue: 35 }, { name: 'r_tokens', type: 'int', minValue: 0, label: 'How much do you want to charge per reward (0 to disable rewards)', defaultValue: 50 }, { name: 'c_tokens', type: 'int', minValue: 0, label: 'How much do you want to charge per coin flip (0 to disable coin flips)', defaultValue: 75 }, { name: 'App_add_time', type: 'choice', label: 'How often should the app advertise itself?', choice1: 2, choice2: 5, choice3: 10, choice4: 15, choice5: 20, choice6: 30, choice7: 45, choice8: 60, defaultValue: 10 }, { name: 'Rare_rolls', type: 'choice', label: 'Rare rolls enabled? (Make sure to set your own Rare options)', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'rare_percent', type: 'int', label: 'What percentage of rolls should be rare (using all 20 options, each roll is 5% chance)', minValue: 0, maxValue: 20, defaultValue: 2 }, { name: 'p_number', type: 'int', minValue: 0, maxValue: 20, label: 'How many punishments - all fields required, will only roll up to specified number', defaultValue: 20 }, {name: 'punishment_1', type: 'str', label: 'Punishment for rolling 1', default: 'Pinch Nipples'}, {name: 'punishment_2', type: 'str', label: 'Punishment for rolling 2', default: 'Pegs on Nipples'}, {name: 'punishment_3', type: 'str', label: 'Punishment for rolling 3', default: '2 Pegs on Balls'}, {name: 'punishment_4', type: 'str', label: 'Punishment for rolling 4', default: 'Peg on Glans'}, {name: 'punishment_5', type: 'str', label: 'Punishment for rolling 5', default: 'Slap Your Cock'}, {name: 'punishment_6', type: 'str', label: 'Punishment for rolling 6', default: 'Slap Your Glans'}, {name: 'punishment_7', type: 'str', label: 'Punishment for rolling 7', default: 'Slap Your Balls'}, {name: 'punishment_8', type: 'str', label: 'Punishment for rolling 8', default: 'Punch Your Balls'}, {name: 'punishment_9', type: 'str', label: 'Punishment for rolling 9', default: 'On Your Knees For 5 Minutes'}, {name: 'punishment_10', type: 'str', label: 'Punishment for rolling 10', default: 'On All Fours For 5 Minutes'}, {name: 'punishment_11', type: 'str', label: 'Punishment for rolling 11', default: 'Kneel In The Corner For 5 Minutes'}, {name: 'punishment_12', type: 'str', label: 'Punishment for rolling 12', default: 'Slap Your Face'}, {name: 'punishment_13', type: 'str', label: 'Punishment for rolling 13', default: 'Ass Spanks x10 Each Cheek'}, {name: 'punishment_14', type: 'str', label: 'Punishment for rolling 14', default: 'Ass Whipping/Paddling x10 Each Cheek'}, {name: 'punishment_15', type: 'str', label: 'Punishment for rolling 15', default: 'Inner Thigh Slaps x10 Each Leg'}, {name: 'punishment_16', type: 'str', label: 'Punishment for rolling 16', default: 'Inner Thigh Whipping/Paddling x10 Each Leg'}, {name: 'punishment_17', type: 'str', label: 'Punishment for rolling 17', default: 'Hot Wax on Nipples'}, {name: 'punishment_18', type: 'str', label: 'Punishment for rolling 18', default: 'Hot Wax on Balls/Labia!'}, {name: 'punishment_19', type: 'str', label: 'Punishment for rolling 19', default: 'Un-fucking-lucky, Whip That Cock, HARD!'}, {name: 'punishment_20', type: 'str', label: 'Punishment for rolling 20', default: 'Lucky You! 30 Seconds To Try And Cum! Punch Your Balls If You Fail!'}, { name: 'rare_p_number', type: 'int', minValue: 0, maxValue: 5, label: 'How many RARE punishments - all fields required, will only roll up to specified number', defaultValue: 5 }, {name: 'punishment_rare_1', type: 'str', label: 'Rare Punishment', default: '**RARE PUNISHMENT** 100 BALL SWATS'}, {name: 'punishment_rare_2', type: 'str', label: 'Rare Punishment', default: '**RARE PUNISHMENT** 100 ASS SPANKS'}, {name: 'punishment_rare_3', type: 'str', label: 'Rare Punishment', default: '**RARE PUNISHMENT** 20 PEGS ON BALLS'}, {name: 'punishment_rare_4', type: 'str', label: 'Rare Punishment', default: '**RARE PUNISHMENT** TIE BALLS TIGHTLY'}, {name: 'punishment_rare_5', type: 'str', label: 'Rare Punishment', default: '**RARE PUNISHMENT** ICY HOT/TOOTHPASTE OVER COCK AND BALLS'}, { name: 't_number', type: 'int', minValue: 0, maxValue: 20, label: 'How many tasks? (all fields required, will only roll up to specified number)', defaultValue: 20 }, {name: 'task_1', type: 'str', label: 'task for rolling 1', default: 'Embarrassing Confession In Chat'}, {name: 'task_2', type: 'str', label: 'task for rolling 2', default: 'Put On Something Girly, Tell Us What It Is'}, {name: 'task_3', type: 'str', label: 'task for rolling 3', default: 'Wear A Chastity Cage Until Mistress Says So'}, {name: 'task_4', type: 'str', label: 'task for rolling 4', default: 'Stroke With 2 Fingers (No Thumb) for 5 Minutes'}, {name: 'task_5', type: 'str', label: 'task for rolling 5', default: 'Edge Then Go Soft'}, {name: 'task_6', type: 'str', label: 'task for rolling 6', default: 'Edge Twice Then Go Soft'}, {name: 'task_7', type: 'str', label: 'task for rolling 7', default: 'Edge 5 Times Then Go Soft'}, {name: 'task_8', type: 'str', label: 'task for rolling 8', default: 'Edge For 20 Times Then Go Soft'}, {name: 'task_9', type: 'str', label: 'task for rolling 9', default: 'Body Writing Mistress Chooses Wording: Chest'}, {name: 'task_10', type: 'str', label: 'task for rolling 10', default: 'Body Writing Mistress Chooses Wording: Ass'}, {name: 'task_11', type: 'str', label: 'task for rolling 11', default: 'Body Writing Mistress Chooses Wording: Cock'}, {name: 'task_12', type: 'str', label: 'task for rolling 12', default: 'Suck A Dildo For 5 Minutes'}, {name: 'task_13', type: 'str', label: 'task for rolling 13', default: 'Deephthroat A Dildo 5 Times'}, {name: 'task_14', type: 'str', label: 'task for rolling 14', default: 'Deephthroat A Dildo 20 Times'}, {name: 'task_15', type: 'str', label: 'task for rolling 15', default: 'Deephthroat A Dildo For 20 Seconds (Keep Trying!)'}, {name: 'task_16', type: 'str', label: 'task for rolling 16', default: 'Tease Your Boi-Pussy'}, {name: 'task_17', type: 'str', label: 'task for rolling 17', default: 'Finger Your Ass, 2 Fingers'}, {name: 'task_18', type: 'str', label: 'task for rolling 18', default: 'Fuck Your Ass With A Dildo Slow'}, {name: 'task_19', type: 'str', label: 'task for rolling 19', default: 'Fuck Your Ass With A Dildo Fast'}, {name: 'task_20', type: 'str', label: 'task for rolling 20', default: 'Super Unlucky, Mistress Will Give You 2 Tasks & A Punishment!'}, { name: 'rare_t_number', type: 'int', minValue: 0, maxValue: 5, label: 'How many RARE tasks - all fields required, will only roll up to specified number', defaultValue: 5 }, {name: 'task_rare_1', type: 'str', label: 'Rare Task', default: '**RARE TASK** GET SISSIFIED - SHOW MISTRESS'}, {name: 'task_rare_2', type: 'str', label: 'Rare Task', default: '**RARE TASK** 1000 WORD ESSAY ON WHY YOU LOVE MISTRESS - SHARE HOWEVER MISTRESS REQUESTS'}, {name: 'task_rare_3', type: 'str', label: 'Rare Task', default: '**RARE TASK** 10 MINUTES SAT ON DILDO'}, {name: 'task_rare_4', type: 'str', label: 'Rare Task', default: '**RARE TASK** 5 MINUTE THROAT FUCK'}, {name: 'task_rare_5', type: 'str', label: 'Rare Task', default: '**RARE TASK** ONE WEEK CHASTITY'}, { name: 'r_number', type: 'int', minValue: 0, maxValue: 20, label: 'How many rewards? (all fields required, will only roll up to specified number)', defaultValue: 20 }, {name: 'reward_1', type: 'str', label: 'reward for rolling 1', default: 'Stroking Privileges'}, {name: 'reward_2', type: 'str', label: 'reward for rolling 2', default: 'Worship Mistresses Feet'}, {name: 'reward_3', type: 'str', label: 'reward for rolling 3', default: 'Worship Mistresses Armpits'}, {name: 'reward_4', type: 'str', label: 'reward for rolling 4', default: 'Worship Mistresses Strapon'}, {name: 'reward_5', type: 'str', label: 'reward for rolling 5', default: 'One Kiss From Mistress'}, {name: 'reward_6', type: 'str', label: 'reward for rolling 6', default: 'One Compliment from Mistress'}, {name: 'reward_7', type: 'str', label: 'reward for rolling 7', default: 'One Flash from Mistress (Mistresses Choice)'}, {name: 'reward_8', type: 'str', label: 'reward for rolling 8', default: 'PM Privileges'}, {name: 'reward_9', type: 'str', label: 'reward for rolling 9', default: 'Permission To Any One Question'}, {name: 'reward_10', type: 'str', label: 'reward for rolling 10', default: 'One Minute Public JOI'}, {name: 'reward_11', type: 'str', label: 'reward for rolling 11', default: 'Five Minutes Public JOI'}, {name: 'reward_12', type: 'str', label: 'reward for rolling 12', default: 'Five Minutes JOI via PM'}, {name: 'reward_13', type: 'str', label: 'reward for rolling 13', default: 'One Flash Request'}, {name: 'reward_14', type: 'str', label: 'reward for rolling 14', default: 'Permission To Ruin An Orgasm'}, {name: 'reward_15', type: 'str', label: 'reward for rolling 15', default: 'Permission To Ruin Two Orgasms'}, {name: 'reward_16', type: 'str', label: 'reward for rolling 16', default: 'Permission To Cum With Your Mouth Filled'}, {name: 'reward_17', type: 'str', label: 'reward for rolling 17', default: 'Permission To Cum With Your Ass Filled'}, {name: 'reward_18', type: 'str', label: 'reward for rolling 18', default: 'Permission To Cum With Mistresses Direction'}, {name: 'reward_19', type: 'str', label: 'reward for rolling 19', default: 'Permission To Cum With Full Countdown'}, {name: 'reward_20', type: 'str', label: 'reward for rolling 20', default: 'Booby Prize! Public CBT/SPH From Mistress'}, { name: 'rare_r_number', type: 'int', minValue: 0, maxValue: 5, label: 'How many RARE rewards - all fields required, will only roll up to specified number', defaultValue: 5 }, {name: 'reward_rare_1', type: 'str', label: 'Rare Reward', default: '**RARE REWARD** 10 MINUTE PASSWORD SHOW'}, {name: 'reward_rare_2', type: 'str', label: 'Rare Reward', default: '**RARE REWARD** 10 MINUTE C2C'}, {name: 'reward_rare_3', type: 'str', label: 'Rare Reward', default: '**RARE REWARD** 10 MINUTE FULLY NUDE'}, {name: 'reward_rare_4', type: 'str', label: 'Rare Reward', default: '**RARE REWARD** PERMISSION TO CUM FREELY - ONE WEEK'}, {name: 'reward_rare_5', type: 'str', label: 'Rare Reward', default: '**RARE REWARD** 10 MINUTE POV FUCK'}, { name: 'rare_c_number', type: 'choice', label: 'Rare coin flip? (edge/side)', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'rare_c_chance', type: 'int', label: 'Rare coin flip chance? (%)', minValue: 1, maxValue: 33, defaultValue: '10' }, {name: 'coin_h', type: 'str', label: 'Coin Flip - Heads', default: 'Ruined'}, {name: 'coin_t', type: 'str', label: 'Coin Flip - Tails', default: 'Plugged Ass Full Orgasm!'}, {name: 'coin_s', type: 'str', label: 'Coin Flip - Rare (side)', default: 'Sorry Slave, try again in 24 hours!'}, {name: 'subject_change', type: 'choice', label: 'Would you like the app to change your subject', choice1: 'Yes', choice2: 'No', default: 'No'}, {name: 'subject_words', type: 'str', label: 'Subject (max 105 Characters)', maxLength: 105, default: 'Rolling for tasks, punishments, or rewards with Mistress!'}, {name: 'tag_1', type: 'str', label: 'Tags (Optional) #', maxLength: 20, default: 'Mistress'}, {name: 'tag_2', type: 'str', label: 'Tags (Optional) #', maxLength: 20, default: 'Femdom'}, {name: 'tag_3', type: 'str', label: 'Tags (Optional) #', maxLength: 20, default: 'CBT'}, {name: 'tag_4', type: 'str', label: 'Tags (Optional) #', maxLength: 20, default: 'CEI'}, {name: 'tag_5', type: 'str', label: 'Tags (Optional) #', maxLength: 20, default: 'JOI'}, { name: 'socials', type: 'choice', label: 'Socials notifications?', choice1: 'Yes', choice2: 'No', default: 'No' }, { name: 'social_twitter', type: 'str', label: 'Twitter? (if none, just put a ".")', default: 'null' }, { name: 'social_insta', type: 'str', label: 'Instagram? (if none, just put a ".")', default: 'null' }, { name: 'social_of', type: 'str', label: 'OnlyFans? (if none, just put a ".")', default: 'null' }, { name: 'social_snap', type: 'str', label: 'Snapchat? (if none, just put a ".")', default: 'null' }, { name: 'social_kik', type: 'str', label: 'Kik? (if none, just put a ".")', default: 'null' }, { name: 'social_wa', type: 'str', label: 'Whatsapp? (if none, just put a ".")', default: 'null' } ]; 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 lastPunishmentWon = '--'; var lastTaskWon = '--'; var rollCounter = 0; var tipCounter = 0; var winners = []; var punishment = []; var task = []; var reward = []; var minimumRollsToGetRareDice = parseInt(cb.settings.minimum_rolls); var maxOutcome = (cb.settings.die_type == 'Traditional') ? 12 : 20; 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 total_tokens = 0; var msg = '--'; var font_size, font_weight, font_colour, light_colour, dark_colour; if (cb.settings.theme == "Red") { font_size = 11; font_weight = "bold"; font_colour = "#CE0000"; light_colour = "#FF5454"; dark_colour = "#990000"; } else if (cb.settings.theme == "Gradient Red") { font_size = 11; font_weight = "bold"; font_colour = "#CE0000"; light_colour = "linear-gradient(" + cb.settings.grad_dir + ",#FF4D4D,#FF9999)"; dark_colour = "#990000"; } else if (cb.settings.theme == "Blue") { font_size = 11; font_weight = "bold"; font_colour = "#0013CE"; light_colour = "#b8beff"; dark_colour = "#000D89"; } else if (cb.settings.theme == "Gradient Blue") { font_size = 11; font_weight = "bold"; font_colour = "#0013CE"; light_colour = "linear-gradient(" + cb.settings.grad_dir + ",#6470F7,#CCD0FF)"; dark_colour = "#000D89"; } else if (cb.settings.theme == "Pink") { font_size = 11; font_weight = "bold"; font_colour = "#ff61ab"; light_colour = "#ffdbec"; dark_colour = "#fa0578"; } else if (cb.settings.theme == "Gradient Pink") { font_size = 11; font_weight = "bold"; font_colour = "#ff61ab"; light_colour = "linear-gradient(" + cb.settings.grad_dir + ",#FF70B8,#FFD1E8)"; dark_colour = "#fa0578"; } else if (cb.settings.theme == "Lilac") { font_size = 11; font_weight = "bold"; font_colour = "#472e47"; light_colour = "#C8A2C8"; dark_colour = "#472e47"; } else if (cb.settings.theme == "Gradient Lilac") { font_size = 11; font_weight = "bold"; font_colour = "#472e47"; light_colour = "linear-gradient(" + cb.settings.grad_dir + ",#e6bee6,#ab78ab)"; dark_colour = "#472e47"; } else if (cb.settings.theme == "Purple") { font_size = 11; font_weight = "bold"; font_colour = "#8a0ac9"; light_colour = "#e0a1ff"; dark_colour = "#3a0057"; } else if (cb.settings.theme == "Gradient Purple") { font_size = 11; font_weight = "bold"; font_colour = "#8a0ac9"; light_colour = "linear-gradient(" + cb.settings.grad_dir + ",#C757FF,#F0D1FF)"; dark_colour = "#3a0057"; } else if (cb.settings.theme == "Green") { font_size = 11; font_weight = "bold"; font_colour = "#06c90d"; light_colour = "#abffae"; dark_colour = "#005203"; } else if (cb.settings.theme == "Gradient Green") { font_size = 11; font_weight = "bold"; font_colour = "#06c90d"; light_colour = "linear-gradient(" + cb.settings.grad_dir + ",#64B967,#D6F0D7)"; dark_colour = "#005203"; } else if (cb.settings.theme == "Black") { font_size = 11; font_weight = "bold"; font_colour = "#292929"; light_colour = "#b5b5b5"; dark_colour = "#000000"; } else if (cb.settings.theme == "Gradient Black") { font_size = 11; font_weight = "bold"; font_colour = "#292929"; light_colour = "linear-gradient(" + cb.settings.grad_dir + ",#919191,#EBEBEB)"; dark_colour = "#000000"; } cb.onTip(function (tip) { var roll_1 = Math.floor(Math.random() * cb.settings.p_number + 1) var roll_2 = Math.floor(Math.random() * cb.settings.t_number + 1) var roll_3 = Math.floor(Math.random() * cb.settings.r_number + 1) var roll_A = Math.floor(Math.random() * 100 + 1) var roll_4 = Math.floor(Math.random() * cb.settings.rare_p_number + 1) var roll_5 = Math.floor(Math.random() * cb.settings.rare_t_number + 1) var roll_6 = Math.floor(Math.random() * cb.settings.rare_r_number + 1) var roll_7 = Math.floor(Math.random() * 2 + 1) var roll_8 = Math.floor(Math.random() * 3 + 1) var msg = " " if (tip['amount'] === cb.settings.p_tokens) { if (roll_A >= (100 - cb.settings.rare_percent) && cb.settings.Rare_rolls === 'Yes') { msg += ("Punishment! But shiny! " + cb.settings['punishment_rare_' + roll_4]); } else { msg += ("Punishment! You rolled a " + roll_1 + "! " + cb.settings['punishment_' + roll_1]); } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } if (tip['amount'] === cb.settings.t_tokens) { if (roll_A >= (100 - cb.settings.rare_percent) && cb.settings.Rare_rolls === 'Yes') { msg += ("Task! But shiny! " + cb.settings['task_rare_' + roll_5]); } else { msg += (" Task! You rolled a " + roll_2 + "! " + cb.settings['task_' + roll_2]); } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } if (tip['amount'] === cb.settings.r_tokens) { if (roll_A >= (100 - cb.settings.rare_percent) && cb.settings.Rare_rolls === 'Yes') { msg += ("Reward! But shiny! " + cb.settings['reward_rare_' + roll_6]); } else { msg += (" Reward! You rolled a " + roll_3 + "! " + cb.settings['reward_' + roll_3]); } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } if (tip['amount'] === cb.settings.c_tokens) { if (cb.settings.rare_c_number === 'No' && tip['amount'] === cb.settings.c_tokens) { if (roll_7 === 1) { msg += ("Coin Flip... :quartercointoss \n"); cb.setTimeout(parseInt(1) * 3000); msg += ("HEADS! " + cb.settings.coin_h); } else { msg += ("Coin Flip... :quartercointoss \n"); cb.setTimeout(parseInt(1) * 3000); msg += ("TAILS! " + cb.settings.coin_t); } } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } if (cb.settings.rare_c_number === 'Yes' && tip['amount'] === cb.settings.c_tokens) { if (roll_8 === 1) { msg += ("Coin Flip... :quartercointoss \n"); cb.setTimeout(parseInt(1) * 3000); msg += ("HEADS! " + cb.settings.coin_h); } if (roll_8 === 2) { msg += ("Coin Flip... :quartercointoss \n"); cb.setTimeout(parseInt(1) * 3000); msg += ("HEADS! " + cb.settings.coin_h); } if (roll_8 === 3) { msg += ("Coin Flip... :quartercointoss \n"); cb.setTimeout(parseInt(1) * 3000); msg += ("Unlucky! " + cb.settings.coin_s); } cb.setTimeout(3000); cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } { cb.drawPanel(); } }); cb.onDrawPanel(function (user) { if (cb.settings.p_tokens != 0 && cb.settings.t_tokens != 0 && cb.settings.r_tokens != 0) { return { 'template': '3_rows_of_labels', 'row1_label': 'Punishments:', 'row1_value': cb.settings.p_tokens + ' tokens', 'row2_label': 'Tasks:', 'row2_value': cb.settings.t_tokens + ' tokens', 'row3_label': 'Rewards:', 'row3_value': cb.settings.r_tokens + ' tokens', } }; if (cb.settings.p_tokens != 0 && cb.settings.t_tokens != 0 && cb.settings.r_tokens === 0) { return { 'template': '3_rows_of_labels', 'row1_label': 'Punishments:', 'row1_value': cb.settings.p_tokens + ' tokens', 'row2_label': 'Tasks:', 'row2_value': cb.settings.t_tokens + ' tokens', 'row3_label': 'Rewards:', 'row3_value': 'Disabled', } }; if (cb.settings.p_tokens != 0 && cb.settings.t_tokens === 0 && cb.settings.r_tokens != 0) { return { 'template': '3_rows_of_labels', 'row1_label': 'Punishments:', 'row1_value': cb.settings.p_tokens + ' tokens', 'row2_label': 'Tasks:', 'row2_value': 'Disabled', 'row3_label': 'Rewards:', 'row3_value': cb.settings.r_tokens + ' tokens', } }; if (cb.settings.p_tokens != 0 && cb.settings.t_tokens === 0 && cb.settings.r_tokens === 0) { return { 'template': '3_rows_of_labels', 'row1_label': 'Punishments:', 'row1_value': cb.settings.p_tokens + ' tokens', 'row2_label': 'Tasks:', 'row2_value': 'Disabled', 'row3_label': 'Rewards:', 'row3_value': 'Disabled', } }; if (cb.settings.p_tokens === 0 && cb.settings.t_tokens != 0 && cb.settings.r_tokens != 0) { return { 'template': '3_rows_of_labels', 'row1_label': 'Punishments:', 'row1_value': 'Disabled', 'row2_label': 'Tasks:', 'row2_value': cb.settings.t_tokens + ' tokens', 'row3_label': 'Rewards:', 'row3_value': cb.settings.r_tokens + ' tokens', } }; if (cb.settings.p_tokens === 0 && cb.settings.t_tokens != 0 && cb.settings.r_tokens === 0) { return { 'template': '3_rows_of_labels', 'row1_label': 'Punishments:', 'row1_value': 'Disabled', 'row2_label': 'Tasks:', 'row2_value': cb.settings.t_tokens + ' tokens', 'row3_label': 'Rewards:', 'row3_value': 'Disabled', } }; if (cb.settings.p_tokens === 0 && cb.settings.t_tokens === 0 && cb.settings.r_tokens != 0) { return { 'template': '3_rows_of_labels', 'row1_label': 'Punishments:', 'row1_value': 'Disabled', 'row2_label': 'Tasks:', 'row2_value': 'Disabled', 'row3_label': 'Rewards:', 'row3_value': cb.settings.r_tokens + ' tokens', } }; if (cb.settings.p_tokens === 0 && cb.settings.t_tokens === 0 && cb.settings.r_tokens === 0) { return { 'template': '3_rows_of_labels', 'row1_label': 'Punishments:', 'row1_value': 'Disabled', 'row2_label': 'Tasks:', 'row2_value': 'Disabled', 'row3_label': 'Rewards:', 'row3_value': 'Disabled', } }; }); cb.onEnter(function (user) { showAppAd(user['user']); }); cb.onMessage (function (msg) { var m = msg.m; var user = msg.user; var isMod = msg.is_mod; var isHost = user === cb.room_slug; var roll_1 = Math.floor(Math.random() * cb.settings.p_number + 1) var roll_2 = Math.floor(Math.random() * cb.settings.t_number + 1) var roll_3 = Math.floor(Math.random() * cb.settings.r_number + 1) var roll_A = Math.floor(Math.random() * 100 + 1) var roll_B = Math.floor(Math.random() * 100 + 1) var roll_C = Math.floor(Math.random() * 100 + 1) var roll_4 = Math.floor(Math.random() * cb.settings.rare_p_number + 1) var roll_5 = Math.floor(Math.random() * cb.settings.rare_t_number + 1) var roll_6 = Math.floor(Math.random() * cb.settings.rare_r_number + 1) var roll_7 = Math.floor(Math.random() * 2 + 1) var roll_8 = Math.floor(Math.random() * 3 + 1) // just check once if (m.charAt(0) === '/') { msg['X-Spam'] = true; } if (m === '*punishments' && cb.settings.p_tokens != 0) { if (isHost || isMod) { showPunishments(); } else { showPunishments(user); } } if (m === '*tasks' && cb.settings.t_tokens != 0) { if (isHost || isMod) { showTasks(); } else { showTasks(user); } } if (m === '*rewards' && cb.settings.r_tokens != 0) { if (isHost || isMod) { showRewards(); } else { showRewards(user); } } if (isHost || isMod) { if (m == '<3punishment') { if (roll_A >= (100 - cb.settings.rare_percent) && cb.settings.Rare_rolls === 'Yes') { msg = (cb.settings.host_name + " has rolled you a Punishemnt! " + cb.settings['punishment_rare_' + roll_4]); } else { msg = cb.settings.host_name + " has rolled you a Punishment! " + cb.settings['punishment_' + Math.floor(Math.random() * cb.settings.p_number + 1)]; } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } } if (isHost || isMod) { if (m == '<3task') { if (roll_B >= (100 - cb.settings.rare_percent) && cb.settings.Rare_rolls === 'Yes') { msg = (cb.settings.host_name + " has rolled you a Task! " + cb.settings['task_rare_' + roll_5]); } else { msg = cb.settings.host_name + " has rolled you a Task! " + cb.settings['task_' + Math.floor(Math.random() * cb.settings.t_number + 1)]; } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } } if (isHost || isMod) { if (m == '<3reward') { if (roll_C >= (100 - cb.settings.rare_percent) && cb.settings.Rare_rolls === 'Yes') { msg = (cb.settings.host_name + " has rolled you a Reward! " + cb.settings['reward_rare_' + roll_6]); } else { msg = cb.settings.host_name + " has rolled you a Reward! " + cb.settings['reward_' + Math.floor(Math.random() * cb.settings.t_number + 1)]; } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } } if (m === '<3flip') { if (isHost) { if ((roll_7 === 1) && cb.settings.rare_c_number === 'No') { msg = "Coin Flip... :quartercointoss \n"; msg += "HEADS! " + cb.settings.coin_h; } else { msg = "Coin Flip... :quartercointoss \n"; msg += "TAILS! " + cb.settings.coin_t; } } if (isHost) { if ((roll_7 === 1) && cb.settings.rare_c_number === 'Yes') { msg = "Coin Flip... :quartercointoss \n"; msg += "HEADS! " + cb.settings.coin_h; } if ((roll_7 === 2) && cb.settings.rare_c_number === 'Yes'){ msg = "Coin Flip... :quartercointoss \n"; msg += "TAILS! " + cb.settings.coin_t; } if (roll_A <= cb.settings.rare_c_chance && cb.settings.rare_c_number === 'Yes'){ msg = "Coin Flip... :quartercointoss \n"; msg += "Unlucky! " + cb.settings.coin_s; } } else { msg = "Don't push your luck, Pig!" } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } if (m === '*help') { if (isHost) { msg = "*punishments - a full list of punishments. \n"; msg += "<3punishment - to roll a punishment as host. \n"; msg += "*tasks - a full list of tasks. \n"; msg += "<3task - to roll a task as host. \n"; msg += "*rewards - a full list of rewards. \n"; msg += "<3reward - to roll a reward as host. \n"; msg += "<3flip - to flip a coin as host."; } else { msg += "*punishments - a full list of punishments. \n"; msg += "*tasks - a full list of tasks. \n"; msg += "*rewards - a full list of rewards."; } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } return msg; }); function setPunishments() { for (var i = 1; i <= 20; i++) { punishment.push(cb.settings['punishment_' + i]); } } function setTasks() { for (var i = 1; i <= 20; i++) { task.push(cb.settings['task_' + i]); } } function setRewards() { for (var i = 1; i <= 20; i++) { reward.push(cb.settings['reward_' + i]); } } function showPunishments(username) { if (punishment.length) { var msg = "~~~ POSSIBLE PUNISHMENTS ~~~"; for (var i = 1; i <= cb.settings.p_number; i++) { if (punishment.indexOf(cb.settings['punishment_' + i]) >= 0) msg += "\nRoll " + i + " - " + cb.settings['punishment_' + i]; } } cb.sendNotice(msg, username, light_colour, dark_colour, 'bold'); } function showTasks(username) { if (task.length) { var msg = "~~~ POSSIBLE TASKS ~~~"; for (var i = 1; i <= cb.settings.t_number; i++) { if (task.indexOf(cb.settings['task_' + i]) >= 0) msg += "\nRoll " + i + " - " + cb.settings['task_' + i]; } } cb.sendNotice(msg, username, light_colour, dark_colour, 'bold'); } function showRewards(username) { if (reward.length) { var msg = "~~~ POSSIBLE REWARDS ~~~"; for (var i = 1; i <= cb.settings.r_number; i++) { if (reward.indexOf(cb.settings['reward_' + i]) >= 0) msg += "\nRoll " + i + " - " + cb.settings['reward_' + i]; } } cb.sendNotice(msg, username, light_colour, dark_colour, 'bold'); } function advertise() { showAppAd(); cb.setTimeout(advertise, parseInt(cb.settings.App_add_time) * 60000); } function showAppAd(username) { var msg = ""; if (username != undefined) { msg += "Welcome, " + username + ", come and be punished, or ask for a task! If you are lucky you may even be rewarded! \n"; } else { msg += "Tasks & Punishment Dice by xPluckySubx \n"; msg += "Come and be a good pet for " + cb.settings.host_name + "\n"; msg += "Each roll requests a punishment, task, or reward! \n"; if (cb.settings.p_tokens != 0) { msg += "Tip " + cb.settings.p_tokens + " for a punishment. Type \"*punishments\" for a full list of punishments. \n"; } if (cb.settings.t_tokens != 0) { msg += "Tip " + cb.settings.t_tokens + " for a task. Type \"*tasks\" for a full list of tasks. \n"; } if (cb.settings.r_tokens != 0) { msg += "Tip " + cb.settings.r_tokens + " for a reward. Type \"*rewards\" for a full list of rewards. \n"; } if (cb.settings.c_tokens != 0) { msg += "Tip " + cb.settings.c_tokens + " to flip a coin. \n"; } msg += "Type \"*help\" for all commands."; if (cb.settings.social_twitter != 'null' && cb.settings.social_twitter != '.' && cb.settings.socials === 'Yes') { msg += "\n"; msg += ":twitterlogo - " + cb.settings.social_twitter; } if (cb.settings.social_insta != 'null' && cb.settings.social_insta != '.' && cb.settings.socials === 'Yes') { msg += "\n"; msg += ":instagram30 - " + cb.settings.social_insta; } if (cb.settings.social_of != 'null' && cb.settings.social_of != '.' && cb.settings.socials === 'Yes') { msg += "\n"; msg += ":onlyfanssm - " + cb.settings.social_of; } if (cb.settings.social_snap != 'null' && cb.settings.social_snap != '.' && cb.settings.socials === 'Yes') { msg += "\n"; msg += ":snapchat_30x30 - " + cb.settings.social_snap; } if (cb.settings.social_kik != 'null' && cb.settings.social_kik != '.' && cb.settings.socials === 'Yes') { msg += "\n"; msg += ":kik1 - " + cb.settings.social_kik; } if (cb.settings.social_wa != 'null' && cb.settings.social_wa != '.' && cb.settings.socials === 'Yes') { msg += "\n"; msg += ":whatsapp_25 - " + cb.settings.social_wa; } cb.sendNotice(msg, light_colour, light_colour, dark_colour, 'bold'); } } function update_subject() { if (cb.settings.subject_change === 'Yes') { var new_subject = cb.settings.subject_words + " " var subject_p = "Punishments: " + cb.settings.p_tokens + " - " var subject_t = "Tasks: " + cb.settings.t_tokens + " - " var subject_r = "Rewards: " + cb.settings.r_tokens + " - " var tags = "#" + cb.settings.tag_1 + " #" + cb.settings.tag_2 + " #" + cb.settings.tag_3 + " #" + cb.settings.tag_4 + " #" + cb.settings.tag_5 if (cb.settings.p_tokens != 0 && cb.settings.t_tokens != 0 && cb.settings.r_tokens != 0) { cb.changeRoomSubject(new_subject + subject_p + subject_t + subject_r + tags); }; if (cb.settings.p_tokens != 0 && cb.settings.t_tokens != 0 && cb.settings.r_tokens === 0) { cb.changeRoomSubject(new_subject + subject_p + subject_t + tags); }; if (cb.settings.p_tokens != 0 && cb.settings.t_tokens === 0 && cb.settings.r_tokens != 0) { cb.changeRoomSubject(new_subject + subject_p + subject_r + tags); }; if (cb.settings.p_tokens != 0 && cb.settings.t_tokens === 0 && cb.settings.r_tokens === 0) { cb.changeRoomSubject(new_subject + subject_p + tags); }; if (cb.settings.p_tokens === 0 && cb.settings.t_tokens != 0 && cb.settings.r_tokens != 0) { cb.changeRoomSubject(new_subject + subject_t + subject_r + tags); }; if (cb.settings.p_tokens === 0 && cb.settings.t_tokens != 0 && cb.settings.r_tokens === 0) { cb.changeRoomSubject(new_subject + subject_t + tags); }; if (cb.settings.p_tokens === 0 && cb.settings.t_tokens === 0 && cb.settings.r_tokens != 0) { cb.changeRoomSubject(new_subject + subject_r + tags); }; if (cb.settings.p_tokens === 0 && cb.settings.t_tokens === 0 && cb.settings.r_tokens === 0) { cb.changeRoomSubject(new_subject + tags); }; } } function init() { setPunishments(); setTasks(); setRewards(); advertise(); update_subject(); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.