Apps Home
|
Create an App
Dare or Truth
Author:
bigcattycock
Description
Source Code
Launch App
Current Users
Created by:
Bigcattycock
/** * App: Truth or Dare * Author: bigcattycock * Date: 16/05/2016 */ cb.settings_choices = [ {name: 'tokens', type: 'int', label: 'Cost per try', defaultValue: 20}, {name: 'mvp_prize', type: 'str', label: 'MVP Prize', defaultValue:'a public show'}, {name: 'hashtags', type: 'str', label: 'Hashtags', defaultValue:'#sexy #strip #cock #cumshow #ass #lick lips #stroke #dance #wank'}, {name: 'notice_wait_time', type: 'choice', label: 'Notification Time (in minutes)', choice1: 1, choice2: 2, choice3: 3, choice4: 4, choice5: 5, choice6: 10, choice7: 15, choice8: 20, choice9: 25, choice10: 30, choice11: 45, choice12: 60, defaultValue: 10}, {name: 'dare_weight', type: 'str', label: 'Dare chance %', defaultValue:'50'} ]; var langTokens = (cb.settings.tokens > 1) ? 'tokens' : 'token'; var mvp = '--'; var mvpCount = 0; var lastPlayer = '--'; var tipCounter = 0; var tipCounts = new Object(); cb.onTip(function (tip) { var ammount = parseInt(tip['amount']); var user = tip['from_user']; tipCounter += ammount; if (typeof tipCounts[user] === "undefined") { tipCounts[user] = 0; } tipCounts[user] += ammount; if (tipCounts[user]>mvpCount) { mvp = user; mvpCount = tipCounts[user]; } if (ammount >= cb.settings.tokens) { var numberOfSpins = Math.floor(ammount/cb.settings.tokens); for(var i=1;i<=numberOfSpins;i++) { truthOrDare(user); } } cb.drawPanel(); }); cb.onDrawPanel(function (user) { return { 'template': '3_rows_12_22_31', 'row1_label': 'MVP:', 'row1_value': mvp + ' ('+mvpCount+')', 'row2_label': 'Last player:', 'row2_value': lastPlayer, 'row3_value': tipCounter + ' ' + langTokens + ' received' }; }); cb.onEnter(function (user) { var notices = "Welcome, " + user['user'] + ". We are playing truth or dare!\n"; notices += 'Tip ' + cb.settings.tokens + ' ' + langTokens + ' to play.\n'; notices += 'The MVP (highest tipper) will get ' + cb.settings.mvp_prize + '.'; cb.sendNotice(notices, user['user'], '', '#FF6600', 'bold'); }); cb.onMessage(function(msg) { /*if (msg['m']=='/help') {}*/ return msg; }); function truthOrDare(username) { var prize; if ((Math.random()*100)>cb.settings.dare_weight) { prize = "dare"; } else { prize = "truth"; } lastPlayer = username; cb.sendNotice(username + ' won a prize: ' + prize, '', '#99FF99', '', 'bold'); return prize; } function advertise() { var notices = "Truth or Dare by rowan596!\n"; notices += 'Tip ' + cb.settings.tokens + ' ' + langTokens + ' to play.\n'; notices += 'The MVP (highest tipper) will get ' + cb.settings.mvp_prize + "."; cb.sendNotice(notices, '', '', '#FF6600', 'bold'); cb.setTimeout(advertise, cb.settings.notice_wait_time * 60000); } function init() { advertise(); cb.changeRoomSubject("Let's play truth or dare! MVP will get "+ cb.settings.mvp_prize + ". " + cb.settings.hashtags); } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.