Bots Home
|
Create an App
truth or dare TEST
Author:
anunregardedsun
Description
Source Code
Launch Bot
Current Users
Created by:
Anunregardedsun
var emmaDareCost; var emmaTruthCost; var customDareCost; var customTruthCost; var rulesText; var quickRules; var textFG; var textBG; var totalTipped = 0; var prices = ''; var completeRules = ''; var useQuickRules; cb.settings_choices = [ {name: 'rules', type: 'str', label: "Enter your rules here! This is shown when you start the game", minLength: 1, maxLength: 500}, {name: 'quick_rules', type: 'str', label: "Enter a brief rules description/welcome here! This is sent privately to people who join the chat during the game", minLength: 1, maxLength: 500}, {name:'use_quick_rules', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Use the quick rules feature? If set to no, people who join the chat get sent the complete rules and price list instead."}, {name:'emma_truth_cost', type:'int', minValue:1, maxValue:99, defaultValue:10, label: "Token cost for Emma's Truth"}, {name:'emma_dare_cost', type:'int', minValue:1, maxValue:99, defaultValue:10, label: "Token cost for Emma's Dare"}, {name:'custom_truth_cost', type:'int', minValue:1, maxValue:99, defaultValue:20, label: "Token cost for Custom Truth"}, {name:'custom_dare_cost', type:'int', minValue:1, maxValue:99, defaultValue:20, label: "Token cost for Custom Dare"}, {name: 'notice_fg_colour', type: 'str', label: 'Text colour settings (in hex code, make sure to include the # in front!)', defaultValue: '#15A6B0', required: false}, {name: 'notice_bg_colour', type: 'str', label: 'Text background colour settings (in hex code, make sure to include the # in front!)', defaultValue: '', required: false} ]; function getSettings(){ emmaTruthCost = cb.settings.emma_truth_cost; emmaDareCost = cb.settings.emma_dare_cost; customTruthCost = cb.settings.custom_truth_cost; customDareCost = cb.settings.custom_dare_cost; rulesText = cb.settings.rules; quickRules = cb.settings.quick_rules; textFG = cb.settings.notice_fg_colour; textBG = cb.settings.notice_bg_colour; useQuickRules = cb.settings.use_quick_rules; } cb.onEnter(function(user) { if (useQuickRules == "Yes"){ cb.sendNotice(quickRules, user.user, textBG, textFG, 'bold'); } else{ cb.sendNotice(completeRules, user.user, textBG, textFG, 'bold'); } }); cb.onTip(function (tip) { totalTipped += parseInt(tip['amount']); tipCheck(parseInt(tip['amount']), tip['message'], tip['from_user']); }); cb.onMessage(function (msg){ switch(msg['m']){ case "/tod_rules": if((msg['is_mod']) || (msg['user'] == cb.room_slug)){ cb.sendNotice(completeRules, '', textBG, textFG, 'bold'); } break; default: } }); function tipCheck(amount, message, user){ switch(amount){ case(emmaTruthCost): cb.sendNotice(user + " wants to hear a TRUTH from Emma!", '', textBG, textFG, 'bold' ); break; case(emmaDareCost): cb.sendNotice(user + " wants to see a DARE from Emma!", '', textBG, textFG, 'bold'); break; case(customTruthCost): cb.sendNotice(user + " has asked Emma a TRUTH: " + message, '', textBG, textFG, 'bold'); break; case(customDareCost): cb.sendNotice(user + " has challenged Emma with a DARE: " + message, '', textBG, textFG, 'bold'); break; default: cb.sendNotice("Thank you " + user + " for your generous tip!", '', textBG, textFG, 'bold'); } } function init(){ cb.changeRoomSubject("Truth or Dare with Emma!"); getSettings(); prices = "Emma's Truth: " + emmaTruthCost + "\n" + "Emma's Dare: " + emmaDareCost + " \n" + "Custom Truth: " + customTruthCost + " \n" + "Custom Dare: " + customDareCost; completeRules = rulesText + '\n' + '------PRICES------\n' + prices; cb.sendNotice(completeRules, '', textBG, textFG, 'bold'); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.