Bots Home
|
Create an App
Jess Truth or Dare bot
Author:
nick_mulder
Description
Source Code
Launch Bot
Current Users
Created by:
Nick_Mulder
/*________________________________________________________ Activity: Chaturbate Truth or Dare Description: Truth or Dare game - Chaturbate style ________________________________________________________*/ var current_player = null; var current_type = null; var total_tipped = 0; var dareCost; var truthCost; var theRules; var row1Label = "Current Player : "; var row2Label = "Choice : "; var truthHighlightColor = '#CCFFFF'; var dareHighlightColor = '#FFCCCC'; var currentHighlight = null; var repeatNotice = true; var repeatNoticeText; var reminderTime = 60000; cb.settings_choices = [ {name: 'rules', type: 'str', label: "Enter your rules here: ", minLength: 1, maxLength: 500}, {name:'truth_cost', type:'int', minValue:1, maxValue:99, defaultValue:10, label: "Token cost for TRUTH"}, {name:'dare_cost', type:'int', minValue:1, maxValue:99, defaultValue:20, label: "Token cost for DARE"}, {name:'reminder', type:'choice', choice1:'Every minute', choice2:'Every five minutes', choice3:'Every ten minutes', choice4:'Never', defaultValue:'Every minute', label: "How often should the token prices be announced?"}, ]; function getSettings() { cb.log("getSettings()"); truthCost = cb.settings.truth_cost; dareCost = cb.settings.dare_cost; cb.log("dareCost = " + dareCost); cb.log("truthCost = " + truthCost); switch(cb.settings.reminder) { case "Never": repeatNotice = false; break; case "Every minute": reminderTime = 60000;//60 seconds break; case "Every five minutes": reminderTime = 300000;//300 seconds break; case "Every ten minutes": reminderTime = 600000;//600 seconds break; } //cb.log("reminderTime = " + reminderTime); theRules = cb.settings.rules; repeatNoticeText = "This is a game of TRUTH or DARE with " + cb.room_slug + ". To ask a TRUTH question please tip " + truthCost + " tokens. DARES cost " + dareCost + " tokens. Submit your question or dare with your tip! Let's have fun!"; } function handleTipAmount(tipAmount, msg, tipper) { cb.drawPanel(); //cb.log("handleTipAmount(tipAmount: " + tipAmount + ", msg: " + msg + ", user: " + tipper); switch(tipAmount) { case(truthCost): cb.changeRoomSubject(tipper + ' has chosen TRUTH!'); current_player = tipper; current_type = "TRUTH"; currentHighlight = truthHighlightColor; cb.chatNotice("The current player is: " + current_player + "! " + "The question is: " + msg); cb.onDrawPanel(function(user) { if(user == cb.room_slug) { //cb.log("the user is the room slug"); return { 'template': '3_rows_12_22_31', 'row1_label': row1Label, 'row1_value': current_player, 'row2_label': "Total tokens earned: ", 'row2_value': total_tipped, 'row3_value': 'Truth Cost: ' + truthCost + " | Dare Cost: " + dareCost }; } else { return { 'template': '3_rows_12_22_31', 'row1_label': row1Label, 'row1_value': current_player, 'row2_label': row2Label, 'row2_value': current_type, 'row3_value': 'Truth Cost: ' + truthCost + " | Dare Cost: " + dareCost }; } }); break; case(dareCost): //cb.changeRoomSubject("DARE: " + msg); cb.changeRoomSubject(tipper + ' has chosen DARE!'); current_player = tipper; current_type = "DARE"; currentHighlight = dareHighlightColor; cb.chatNotice("The current player is: " + current_player + "! " + "The DARE is: " + msg); cb.onDrawPanel(function(user) { if(user == cb.room_slug) { //cb.log("the user is the room slug"); return { 'template': '3_rows_12_22_31', 'row1_label': row1Label, 'row1_value': current_player, 'row2_label': "Total tokens earned: ", 'row2_value': total_tipped, 'row3_value': 'Truth Cost: ' + truthCost + " | Dare Cost: " + dareCost }; } else { return { 'template': '3_rows_12_22_31', 'row1_label': row1Label, 'row1_value': current_player, 'row2_label': row2Label, 'row2_value': current_type, 'row3_value': 'Truth Cost: ' + truthCost + " | Dare Cost: " + dareCost }; } }); break; default: cb.chatNotice("Thank you " + tipper + " for the generous tip!"); cb.onDrawPanel(function(user) { if(user == cb.room_slug) { //cb.log("the user is the room slug"); return { 'template': '3_rows_12_22_31', 'row1_label': row1Label, 'row1_value': current_player, 'row2_label': "Total tokens earned: ", 'row2_value': total_tipped, 'row3_value': 'Truth Cost: ' + truthCost + " | Dare Cost: " + dareCost }; } else { return { 'template': '3_rows_12_22_31', 'row1_label': row1Label, 'row1_value': current_player, 'row2_label': row2Label, 'row2_value': current_type, 'row3_value': 'Truth Cost: ' + truthCost + " | Dare Cost: " + dareCost }; } }); break; } } cb.onTip(function (tip) { total_tipped += parseInt(tip['amount']) //cb.log("Total Tipped: " + total_tipped); //cb.log("Amount Tipped: " + tip['amount']); //cb.log("Tipper: " + tip['from_user']); handleTipAmount(parseInt(tip['amount']), tip['message'], tip['from_user']); }); //filter messages cb.onMessage(function (msg) { switch(msg['m']) { case "/prices": if((msg['is_mod']) || (msg['user'] == cb.room_slug)) { //if the user is a moderator or the broadcaster... msg['m'] = "PRICES: " + repeatNoticeText; msg['background'] = "#000000"; msg['c'] = "#FFFFFF"; return msg; } break; case "/rules": if((msg['is_mod']) || (msg['user'] == cb.room_slug)) { //if the user is a moderator or the broadcaster... msg['m'] = "THE RULES: " + theRules; msg['background'] = "#000000"; msg['c'] = "#FFFFFF"; return msg; } break; default: if (msg['user'] == current_player) { msg['background'] = currentHighlight; } return msg; break; } }); function reminder() { cb.chatNotice(repeatNoticeText); cb.setTimeout(reminder, reminderTime) } function init() { cb.changeRoomSubject("Welcome to Truth Or Dare!"); getSettings(); if(repeatNotice==true) { cb.setTimeout(reminder, reminderTime) } cb.chatNotice(repeatNoticeText); // make the initial announcement about game prices } init();
© Copyright Freesexcam 2011- 2024. All Rights Reserved.