Bots Home
|
Create an App
pbTest
Author:
pbchnd
Description
Source Code
Launch Bot
Current Users
Created by:
Pbchnd
var broadCaster = cb.room_slug; var guestName = []; var guestLastAct = []; var fiveSecondCount = 0; var ruptTimer = 0; var ruptFriends = ['donald','mickey','pbchnd']; var ruptDefault = 0; var ruptMsg = ''; cb.settings_choices = [ {name: 'ruptFriends', type: 'str', defaultValue: 'donald,mickey,pbchnd' ,minLength: 0 , maxLength: 4000 , label: 'Friends to always include in private'}, {name: 'ruptMsg' , type: 'str' , defaultValue: 'Enjoy without interruption by sending a tip and enabling Adobe Flash' ,minLength: 1 , maxLength: 255 , label: 'Message for blocked visitors'}, {name: 'ruptDefault', type: 'int', minValue: 10, defaultValue: 30, label: 'Default Timer in Seconds'} ]; function loadSettings() { ruptFriends = (cb.settings.ruptFriends + ',,').split(','); ruptFriends.push(broadCaster); ruptDefault = cb.settings.ruptDefault; ruptMsg = cb.settings.ruptMsg; } cb.onTip(function(tip) { var u = tip.from_user; var i = guestAdd(u); guestLastAct[i] = myGetTime(); if (cb.limitCam_isRunning && !cb.limitCam_userHasAccess()) { cb.limitCam_addUsers([u]); } }); cb.onMessage(function(msg) { var m = msg.m; var u = msg.user; var i = guestAdd(u); guestLastAct[i] = myGetTime(); if (cb.limitCam_isRunning && !cb.limitCam_userHasAccess()) { cb.limitCam_addUsers([u]); } if (m.slice(0,5).toLowerCase() == '/rupt' && u == broadCaster) { msg['X-Spam'] = true; a = parseInt(m.slice(6,255)); if (isNaN(a)) { ruptTimer = myGetTime() + ruptDefault * 1000; } else { ruptTimer = myGetTime() + (a * 1000); } ruptStart(); } if (m.slice(0,6).toLowerCase() == '/ruptl' && u == broadCaster) { msg['X-Spam'] = true; var i; for (i = 0; i < ruptFriends.length; i++) { cb.sendNotice("Friend: " + ruptFriends[i],broadCaster); } for (i = 0; i < guestName.length; i++) { if (guestLastAct[i] > 0 && ruptFriends.indexOf(guestName[i]) == -1) { cb.sendNotice("Helper: " + guestName[i],broadCaster); } } } return msg; }); function guestAdd(u) { var i; i = guestName.indexOf(u); if (i == -1) { i = guestName.length; guestName[i] = u; guestLastAct[i] = 0; } return i; } cb.onEnter(function (user) { var u = user.user; if (ruptFriends.indexOf(u) > -1 && cb.limitCam_isRunning() && !cb.limitCam_userHasAccess(u)) { cb.limitCam_addUsers([u]); } }); function myGetTime() { var dt = new Date(); return dt.getTime(); } function fiveSecondTimer() { cb.setTimeout(fiveSecondTimer, 5000); var ct = myGetTime(); if (cb.limitCam_isRunning() && ct >= ruptTimer) { ruptStop(); } } function ruptStart() { var i; var pl = ruptFriends.slice(0); var ll = cb.limitCam_allUsersWithAccess(); for (i = 0; i < guestName.length; i++) { if (guestLastAct[i] > 0) { pl.push(guestName[i]); } } cb.limitCam_removeUsers(ll); cb.limitCam_addUsers(pl); if (!cb.limitCam_isRunning()) { cb.limitCam_start(ruptMsg); } } function ruptStop() { if (cb.limitCam_isRunning()) { cb.limitCam_stop(); cb.sendNotice('Rupt complete, your room has been moved to the main listing.',broadCaster,'#ff0000','#ffffff'); } } function init() { cb.limitCam_stop(); loadSettings(); fiveSecondTimer(); } init(); /* by pbchnd */
© Copyright Chaturbate 2011- 2024. All Rights Reserved.