Bots Home
|
Create an App
Love Dice
Author:
londonrayne
Description
Source Code
Launch Bot
Current Users
Created by:
Londonrayne
//Couples Dice w. Goal // vars var total_tipped = 0; var high_tip_username = null; var high_tip_amount = 0; var last_tip_username = null; var last_tip_amount = 0; var subject_is_set_with_0 = false; var Players = new Array('Guy', 'Girl', 'Guy', 'Guy', 'Girl'); var Die_one = new Array('Blow','Bite','Nip','Lick','Pet','Suck'); var Die_two = new Array('Ass','Thigh','Breast','Below','Navel','Lips'); var Die_three = new Array('15 seconds','30 seconds','45 seconds','1 minute','2 minutes', '3 minutes'); cb.settings_choices = [ {name: 'tokens', type: 'int', minValue: 1, default: 100}, {name: 'goal_description', type: 'str', minLength: 1, maxLength: 255}, {name: 'cost_to_roll', type: 'int', minValue: 1, maxValue:999, default: 25} ]; // handlers cb.onTip(function(tip) { total_tipped += tip['amount'] if (total_tipped > cb.settings.tokens) { total_tipped = cb.settings.tokens; } update_subject(); last_tip_amount = tip['amount'] last_tip_username = tip['from_user'] if (tip['amount'] > high_tip_amount) { high_tip_amount = tip['amount'] high_tip_username = tip['from_user'] } if(tip['amount'] == cb.settings.cost_to_roll) { roll_the_dice(); } cb.drawPanel(); }); cb.onDrawPanel(function(user) { return { 'template': '3_rows_of_labels', 'row1_label': 'Tip Received / Goal :', 'row1_value': '' + total_tipped + ' / ' + cb.settings.tokens, 'row2_label': 'Highest Tip:', 'row2_value': format_username(high_tip_username) + ' (' + high_tip_amount + ')', 'row3_label': 'Roll The Dice For', 'row3_value': ' (' + cb.settings.cost_to_roll + ' Tokens )' }; }); function roll_the_dice() { var genderBender = Math.floor(Math.random()*(Players.length)); var randomOne = Math.floor(Math.random()*(Die_one.length)); var randomTwo = Math.floor(Math.random()*(Die_two.length)); var randomThree = Math.floor(Math.random()*(Die_three.length)); cb.chatNotice('****** ROLLING THE DICE ******'); cb.chatNotice(' '); cb.chatNotice(Players[genderBender] + ' '+ Die_one[randomOne] + '(s) ' + Die_two[randomTwo] + ' for ' + Die_three[randomThree] + ' !!'); cb.chatNotice(' '); cb.chatNotice('******************************'); } // helper functions function update_subject() { if (tips_remaining() == 0) { if (subject_is_set_with_0) { return; } subject_is_set_with_0 = true; } else { subject_is_set_with_0 = false; } var new_subject = cb.settings.goal_description + " [" + tips_remaining() + " tokens remaining]"; cb.log("Changing subject to: " + new_subject); cb.changeRoomSubject(new_subject); } function tips_remaining() { var r = cb.settings.tokens - total_tipped; if (r < 0) { return 0; } else { return r; } } function format_username(val) { if (val === null) { return "--"; } else { return val.substring(0, 12); } } function init() { update_subject(); } init();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.