Bots Home
|
Create an App
RCD TruthOrDare Bot
Author:
randomchancedraw
Description
Source Code
Launch Bot
Current Users
Created by:
Randomchancedraw
/* Application: TruthOrDare Developer: randomchancedraw Version: 1.0 (26/03/2014) Version: 2.0 (26/06/2022 - Turn into bot, add customisation settings) Description: Truth Or Dare game with randomized questions/dares and increasing stakes Thanks to https://yyanx.github.io/CB-TestBed/ for providing the useful testbed tool! */ var possibleQuestions = [ ['Are you a morning person or a night owl?', 'Are you generally shy, or quite outgoing?', 'Are you more artistic or more mathematical?'], ['Do you play any sports?', 'Do you have any creative/artistic hobbies such as writing, photography, painting, etc?', 'Do you have any entrepreneurial ambitions? If so, what sort of business/company do you want to start?'], ['Which types of music do you prefer: electronic; rock; pop; metal; classical; jazz; something else?', 'What sort of books do you have on your bookshelf: textbooks; biographies; history; fiction; something else?', 'What genre of film do you like to watch: romantic comedy; action blockbuster; suspense thriller; horror; something else?'], ['What is the funniest thing which you\'ve noticed this year?', 'What is the most spontaneous thing you\'ve done this year?', 'What is the weirdest thing which you\'ve witnessed happen this year?'], ['When you go out, do you prefer going to clubs or to pubs?', 'What is your favourite drink: beer; wine; spirits (neat or mixed?); if it has alcohol I\'ll drink it?', 'When you go out to clubs, are you more likely to be found on the dance-floor or near the bar?'], ['Would your favourite dessert involve lots of: chocolate; caramel; strawberry; apple; maple syrup; something else?', 'In your opinion, which of the following is more cute: baby rabbit; kit fox; duckling; little lamb; none of the above?', 'Which is more relaxing: a long, hot shower; a long, steamy bath; a long, firm massage; a long, restful sleep?'], ['Disregarding price, the car you would love to own is: Jaguar E-Type; Aston Martin DB5; Shelby Mustang; Porsche 911; Range Rover Evoque; something else?', 'What sort of house would you prefer to live in: a huge mansion; a romantic chalet; a castle of course! something else?', 'If you got to choose, would you prefer to own: a private jet; a super-yacht; an island?'], ['Your lover takes you out to a romantic restaurant. You hope it\'s: French; Italian; Japanese; something else?', 'Your idea of a romantic holiday destination is: Paris; Prague; Hawaii; Machu Pichu; something else?', 'Your idea of a romantic night out would be going to: ballet; opera; symphony orchestra; fashion show; art exhibition; something else?'], ['Which do you think is sexier: high heels; stockings; corset; red lipstick; handcuffs; all of the above?', 'Do you often walk around your house (not just your bedroom) completely naked?', 'How much lingerie do you own? What is the sexiest lingerie you own?'], ['Have you ever played strip-poker?', 'Have you ever played strip-twister?', 'Have you ever played strip-blackjack?'], ['Describe your three biggest turn-ons?', 'What is your favourite sex position, and why?', 'Do you prefer giving or receiving oral sex?'], ['Have you ever had sex in a public place?', 'Have you ever had sex with another woman?', 'Have you ever had anal sex?'], ['When it comes to sex, do you prefer to be dominant or submissive?', 'How many times have you had group sex or threesomes?', 'On a scale of 1 to 10, with 1 being very gentle and 10 being extremely rough, how rough do you like sex to be?'], ['What is your wildest sexual fantasy?'] ]; cb.settings_choices = [ {name: 'descriptiondummy', label: 'This is a game of "Truth Or Dare" which is played between the broadcaster and one or more players. There are pre-defined questions (truth questions), and dares (prizes). The tipper can either tip for "Truth" i.e. the broadcaster must answer a question, or a "Dare" i.e. the broadcaster must give a prize. If the tipper tips for a "Truth" but the broadcaster does not want to answer the question, they must give a prize instead.', type: 'choice', required: false, choice1: 'Ok', defaultValue: 'Ok'}, {name: 'truth_price', label: 'Initial price for tipper to ask truth question', type: 'int', minValue: 1, maxValue: 501, defaultValue: 11}, {name: 'dare_price', label: 'Initial price for tipper to request dare', type: 'int', minValue: 1, maxValue: 501, defaultValue: 12}, {name: 'stakes', type: 'int', minValue: 1, maxValue: 100, label: 'How much the stakes go up by each round (in tokens)', defaultValue: 3}, {name: 'd1_prize', label: 'Prize given for Dare #1', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Blow kiss'}, {name: 'd2_prize', label: 'Prize given for Dare #2', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Suck finger'}, {name: 'd3_prize', label: 'Prize given for Dare #3', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Stand and turn around'}, {name: 'd4_prize', label: 'Prize given for Dare #4', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Quick sexy dance'}, {name: 'd5_prize', label: 'Prize given for Dare #4', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Spank ass x4'}, {name: 'd6_prize', label: 'Prize given for Dare #5', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Play with nipple under shirt'}, {name: 'd7_prize', label: 'Prize given for Dare #6', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Flash tits'}, {name: 'd8_prize', label: 'Prize given for Dare #7', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Pinch nipples hard'}, {name: 'd9_prize', label: 'Prize given for Dare #8', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Flash ass'}, {name: 'd10_prize', label: 'Prize given for Dare #9', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Lick dildo'}, {name: 'd11_prize', label: 'Prize given for Dare #10', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Suck dildo and pull hair'}, {name: 'd12_prize', label: 'Prize given for Dare #11', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Whip naked ass'}, {name: 'd13_prize', label: 'Prize given for Dare #12', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Flash pussy'}, {name: 'd14_prize', label: 'Prize given for Dare #13', type: 'str', minLength: 1, maxLength: 100, defaultValue: 'Quick naked dance'}, ]; var questionsAsked = 0; var daresAsked = 0; var questioners = []; // Name, NumberQuestions, TipCount var darers = []; // Name, NumberDares, TipCount var players = []; // Name, NumberQD, TipCount var dares = []; // populated on first tip var questions = []; // populated via randomization on first tip. var broadcaster_name = ""; cb.onEnter(function (user) { initialiseData(); var currQPrice = Number(cb.settings.truth_price) + (questionsAsked*cb.settings.stakes); var currDPrice = Number(cb.settings.dare_price) + (daresAsked*cb.settings.stakes); var notices = ""; notices += "Welcome, " + user['user'] + "! We are playing Truth Or Dare.\n"; notices += "The current stakes are:"; if (questionsAsked < questions.length) { notices += "\nTruth: " + currQPrice + " tokens to ask: " + questions[questionsAsked]; } else { notices += "\nTruth: all Truth questions have been answered already!"; } if (daresAsked < dares.length) { notices += "\nDare: " + currDPrice + " tokens to dare: " + dares[daresAsked]; } else { notices += "\nDare: all Dare challenges have been accepted already!"; } notices += "\nType /truths to see the list of truths."; notices += "\nType /dares to see the list of dares."; cb.sendNotice(notices, user['user'], '', '#FF6600', 'bold'); }); cb.onMessage(function(msg) { initialiseData(); if(msg['m'].match(/\/truths/i)) { msg['X-Spam'] = true; showTruths(msg['user']); } else if(msg['m'].match(/\/dares/i)) { msg['X-Spam'] = true; showDares(msg['user']); } return msg; }); function showTruths(username) { initialiseData(); var currQPrice = Number(cb.settings.truth_price) + Number(questionsAsked*cb.settings.stakes); var notices = ""; notices += "** Truths (next one costs: " + currQPrice + " tokens) **"; for (var i = 0; i < questions.length; ++i) { notices += "\n" + questions[i]; } notices += "\n** Type /dares to see dares!\n"; cb.sendNotice(notices, username, '#F0FAFF'); } function showDares(username) { initialiseData(); var currDPrice = Number(cb.settings.dare_price) + (daresAsked*cb.settings.stakes); var notices = ""; notices += "** Dares (next one costs: " + currDPrice + " tokens) **"; for (var i = 0; i < dares.length; ++i) { notices += "\n" + dares[i]; } notices += "\n** Type /truths to see truths!\n"; cb.sendNotice(notices, username, '#F0FAFF'); } function initialiseData() { if (broadcaster_name.length == 0) { broadcaster_name = cb.room_slug; for (var pqi = 0; pqi < possibleQuestions.length; ++pqi) { var pqiidx = Math.floor(Math.random() * possibleQuestions[pqi].length); questions[pqi] = possibleQuestions[pqi][pqiidx]; } dares[0] = cb.settings.d1_prize; dares[1] = cb.settings.d2_prize; dares[2] = cb.settings.d3_prize; dares[3] = cb.settings.d4_prize; dares[4] = cb.settings.d5_prize; dares[5] = cb.settings.d6_prize; dares[6] = cb.settings.d7_prize; dares[7] = cb.settings.d8_prize; dares[8] = cb.settings.d9_prize; dares[9] = cb.settings.d10_prize; dares[10] = cb.settings.d11_prize; dares[11] = cb.settings.d12_prize; dares[12] = cb.settings.d13_prize; dares[13] = cb.settings.d14_prize; } } cb.onTip(function (tip) { initialiseData(); var thisTip = parseInt(tip['amount']); var i = 0; var foundPlayer = false; var player = null; var currQPrice = Number(cb.settings.truth_price) + (questionsAsked*cb.settings.stakes); var currDPrice = Number(cb.settings.dare_price) + (daresAsked*cb.settings.stakes); if (questionsAsked < questions.length && thisTip == currQPrice) { // this is a truth. var foundQuestioner = false; for (i = 0; i < questioners.length; ++i) { if (questioners[i].Name == tip['from_user']) { foundQuestioner = true; questioners[i].NumberQuestions = questioners[i].NumberQuestions + 1; questioners[i].TipCount = questioners[i].TipCount + thisTip; break; } } if (foundQuestioner == false) { // new truth tipper. var questioner = { 'Name': tip['from_user'], 'NumberQuestions': 1, 'TipCount': thisTip }; questioners.push(questioner); } foundPlayer = false; for (i = 0; i < players.length; ++i) { if (players[i].Name == tip['from_user']) { foundPlayer = true; players[i].NumberQD = players[i].NumberQD + 1; players[i].TipCount = players[i].TipCount + thisTip; } } if (foundPlayer == false) { // new game player. player = { 'Name': tip['from_user'], 'NumberQD': 1, 'TipCount': thisTip }; players.push(player); } var questionNotice = "NEW TRUTH!!! " + tip['from_user'] + " asked " + broadcaster_name + ": " + questions[questionsAsked]; questionNotice += "\n" + broadcaster_name + " may refuse to answer, and do the dare instead: " + dares[questionsAsked]; cb.sendNotice(questionNotice, '', '#CCFFCC', '#000000', 'bold'); questions[questionsAsked] = questions[questionsAsked] + ' -- ASKED (' + thisTip + ' tokens) by ' + tip['from_user']; questionsAsked = questionsAsked + 1; //cb.drawPanel(); // not for bots. cb.setTimeout(function() { var notices = ""; var nextQPrice = Number(cb.settings.truth_price) + (questionsAsked*cb.settings.stakes); if (questionsAsked < questions.length) { notices = "The next TRUTH (for " + nextQPrice + " tokens): " + questions[questionsAsked]; } else { notices = "All TRUTHS have been asked!"; for (var j = 0; j < questions.length; ++j) { notices += "\n" + questions[j]; } } cb.sendNotice(notices, '', '#CCFFCC', '#000000', 'bold'); }, 3000); // wait three seconds, then advertise the next TRUTH stake } else if (daresAsked < dares.length && thisTip == currDPrice) { // this is a dare. var foundDarer = false; for (i = 0; i < darers.length; ++i) { if (darers[i].Name == tip['from_user']) { foundDarer = true; darers[i].NumberDares = darers[i].NumberDares + 1; darers[i].TipCount = darers[i].TipCount + thisTip; break; } } if (foundDarer == false) { // new dare tipper. var darer = { 'Name': tip['from_user'], 'NumberDares': 1, 'TipCount': thisTip }; darers.push(darer); } foundPlayer = false; for (i = 0; i < players.length; ++i) { if (players[i].Name == tip['from_user']) { foundPlayer = true; players[i].NumberQD = players[i].NumberQD + 1; players[i].TipCount = players[i].TipCount + thisTip; } } if (foundPlayer == false) { // new game player. player = { 'Name': tip['from_user'], 'NumberQD': 1, 'TipCount': thisTip }; players.push(player); } var dareNotice = "NEW DARE!!! " + tip['from_user'] + " dared " + broadcaster_name + ": " + dares[daresAsked]; cb.sendNotice(dareNotice, '', '#CCFFCC', '#000000', 'bold'); dares[daresAsked] = dares[daresAsked] + ' -- DARED (' + thisTip + ' tokens) by ' + tip['from_user']; daresAsked = daresAsked + 1; //cb.drawPanel(); // not for bots cb.setTimeout(function() { var notices = ""; var nextDPrice = Number(cb.settings.dare_price) + Number(daresAsked*cb.settings.stakes); if (daresAsked < dares.length) { notices = "The next DARE (for " + nextDPrice + " tokens): " + dares[daresAsked]; } else { notices = "All DARES have been asked!"; for (var j = 0; j < dares.length; ++j) { notices += "\n" + dares[j]; } } cb.sendNotice(notices, '', '#CCFFCC', '#000000', 'bold'); }, 3000); // wait three seconds, then advertise the next DARE stake } else { // unrelated to the game. ignore this tip. } }); /* not for bots. function mostValuableQuestioner() { var mvq = ""; var mvqIdx = -1; var biggestTip = 0; for (var i = 0; i < questioners.length; ++i) { if (questioners[i].TipCount > biggestTip) { biggestTip = questioners[i].TipCount; mvqIdx = i; } } if (mvqIdx >= 0) { mvq = "" + questioners[mvqIdx].Name + " - " + questioners[mvqIdx].NumberQuestions + " truths - " + questioners[mvqIdx].TipCount + " tokens!"; } else { mvq = "No questioners, yet!"; } return mvq; } function mostValuableDarer() { var mvd = ""; var mvdIdx = -1; var biggestTip = 0; for (var i = 0; i < darers.length; ++i) { if (darers[i].TipCount > biggestTip) { biggestTip = darers[i].TipCount; mvdIdx = i; } } if (mvdIdx >= 0) { mvd = "" + darers[mvdIdx].Name + " - " + darers[mvdIdx].NumberDares + " dares - " + darers[mvdIdx].TipCount + " tokens!"; } else { mvd = "No darers, yet!"; } return mvd; } function mostValuablePlayer() { var mvp = ""; var mvpIdx = -1; var biggestTip = 0; for (var i = 0; i < players.length; ++i) { if (players[i].TipCount > biggestTip) { biggestTip = players[i].TipCount; mvpIdx = i; } } if (mvpIdx >= 0) { mvp = "" + players[mvpIdx].Name + " - " + players[mvpIdx].NumberQD + " questions+dares - " + players[mvpIdx].TipCount + " tokens!"; } else { mvp = "No players, yet!"; } return mvp; } cb.onDrawPanel(function (user) { return { 'template': '3_rows_11_21_31', 'row1_value': 'MVP: ' + mostValuablePlayer(), 'row2_value': 'Most curious: ' + mostValuableQuestioner(), 'row3_value': 'Most daring: ' + mostValuableDarer() }; }); */
© Copyright Chaturbate 2011- 2026. All Rights Reserved.