Apps Home
|
Create an App
barf
Author:
goingnutz
Description
Source Code
Launch App
Current Users
Created by:
Goingnutz
// Peep Show v.3 // cb.settings_choices = [ {name:'roomTopic', type:'str', minLength:1, maxLength:99, label: 'Room Topic / Goal Description : '}, {name:'showGoal', type:'int', minValue:1, maxValue:9999, label: 'Topic Goal (0-9999):'}, {name:'minTip', type:'int', minValue:1, maxValue:999, label: 'Minimum Ticket Price (Single Tip) (0-999):'}, {name:'showAd', type:'int', minValue:5, maxValue:60, defaultValue:10, label: 'Advertise Show In Room How Often? (in minutes: 5-60):'}, {name:'goalPassword', type:'str', minLength:1, maxLength:99, label: 'Goal Password: '}, {name:'startShowTime', type:'int', minValue:0, maxValue:5, defaultValue:2, label: 'Warning Time Before Start (0-5 min)'}, ]; cb.changeRoomSubject(cb.settings.roomTopic); var host = null; var activated = false; var remainingGoal = parseInt(cb.settings.showGoal); var u = new Array(); function removeDup(array) { var index = {}; // traverse array from end to start so removing the current item from the array // doesn't mess up the traversal for (var i = array.length - 1; i >= 0; i--) { if (array[i] in index) { // remove this item array.splice(i, 1); } else { // add this value index index[array[i]] = true; } } } function advert() { //cb.chatNotice('PeepShow Is Running.'); if(activated == false) { cb.chatNotice('**************************************************************'); cb.chatNotice('******* PeepShow v.3 by @AL3X009'); cb.chatNotice('******* Notice: The room will lock when the show goal is met.'); cb.chatNotice('******* Show Ticket Cost: ' + cb.settings.minTip); cb.chatNotice('******* Tip the minimum amount to receive the show password!'); cb.chatNotice('**************************************************************'); cb.setTimeout(advert, (cb.settings.showAd * 60000)) // Advert Every x Minutes. } } cb.setTimeout(advert, (cb.settings.showAd * 60000)) // Advert Every x Minutes. cb.onTip(function (tip) { remainingGoal = remainingGoal - tip['amount']; //cb.chatNotice('Tipped: ' + parseInt(tip['amount'])); if(tip['amount'] >= cb.settings.minTip) { var c_user = tip['from_user']; u.push(tip['from_user']); cb.chatNotice('Peepshow Activated! You will be sent a password when the show begins!', c_user); host = tip['to_user']; cb.chatNotice('Goal Remaining: ' + remainingGoal); } //Lets Update The Panel cb.drawPanel(); //Did We Meet The Goal? if(remainingGoal <= 0) { //Lets Start Er Up If Were Done! if(activated == false) { sendWarning(); activated = true; } } }); cb.onDrawPanel(function(user) { return { 'template': '3_rows_of_labels', 'row1_label': 'Remaining Goal : ' + remainingGoal, 'row1_value': '', 'row2_label': 'Show Ticket Price', 'row2_value': cb.settings.minTip + ' tokens.', 'row3_label': 'PeepShow Running', 'row3_value': ' ;)' }; }); cb.onMessage(function (msg) { if(activated == true) { for (var i = 0; i < u.length; i++) { if (msg['user'] == u[i] && msg['m'] == '/pass') { // Re-send Password msg['X-Spam'] = true; cb.chatNotice('Room Password: ' + cb.settings.goalPassword, u[i]); } } } return msg; }); function sendWarning() { if(cb.settings.startShowTime >= 1) { cb.chatNotice('The Show Is About To Get Started.'); cb.chatNotice('*************************************'); cb.chatNotice('The room will be locked shortly. '); cb.chatNotice('*************************************'); cb.chatNotice('If you do not have a password, '); cb.chatNotice('you have a few minutes to tip the'); cb.chatNotice('show amount, ' + cb.settings.minTip + ' tokens.'); cb.chatNotice('*************************************'); cb.chatNotice('Passwords will be sent in '+ cb.settings.startShowTime +' min. '); cb.chatNotice('*************************************'); } if(cb.settings.startShowTime == 0) { cb.chatNotice('*************************************'); cb.chatNotice('The Show Is About To Get Started.'); cb.chatNotice('The room will be locked NOW. '); cb.chatNotice('If you do not have a password, its '); cb.chatNotice('most likely too late!!'); cb.chatNotice('*************************************'); cb.chatNotice('!!! Passwords will be sent NOW... !!!'); cb.chatNotice('*************************************'); } cb.chatNotice('---------------------------------', cb.room_slug); cb.chatNotice('-TIP LIST--------------------', cb.room_slug); cb.chatNotice('---------------------------------', cb.room_slug); var length = u.length, element = null; for (var i = 0; i < length; i++) { element = u[i]; cb.chatNotice(i + ". " + element, cb.room_slug); } cb.setTimeout(sendLogins, (cb.settings.startShowTime * 60000)); } function sendLogins() { removeDup(u); element = null; for (var i = 0; i < u.length; i++) { element = u[i]; cb.chatNotice('*************************', element); cb.chatNotice('*************************', element); cb.chatNotice('*************************', element); cb.chatNotice('*************************', element); cb.chatNotice(' :) ENJOY THE SHOW! :) ', element); cb.chatNotice('*************************', element); cb.chatNotice('Room Password: ' + cb.settings.goalPassword, element); cb.chatNotice('Room Password: ' + cb.settings.goalPassword, element); cb.chatNotice('Room Password: ' + cb.settings.goalPassword, element); cb.chatNotice('*************************', element); cb.chatNotice(' Refresh May Be Requred. ', element); cb.chatNotice('*************************', element); cb.chatNotice('*************************', element); cb.chatNotice('*************************', element); cb.chatNotice('*************************', element); } cb.chatNotice('NOTICE TO BROADCASTER - PASSWORDS HAVE BEEN SENT.', host); cb.chatNotice('NOTICE TO BROADCASTER - **********************************', host); cb.chatNotice('NOTICE TO BROADCASTER - Please Set Your Room Password To: \' '+ cb.settings.goalPassword + '\' ', host); cb.chatNotice('NOTICE TO BROADCASTER - Case Sensitve! Watch For CAPS', host); cb.chatNotice('NOTICE TO BROADCASTER - **********************************', host); }
© Copyright Chaturbate 2011- 2026. All Rights Reserved.