Bots Home
|
Create an App
Password Show clone
Author:
cursencum
Description
Source Code
Launch Bot
Current Users
Created by:
Cursencum
//Base from limitCam example then chainsawed by fritoxbandito //http://chaturbate.com/apps/edit_app/secret-show-control-with-groups/?slot=1 //original limitCam code from http://chaturbate.com/apps/docs/api/cb.limitCam.html cb.settings_choices = [ {name: 'min_start_tokens', type: 'int', minValue: 1, maxValue: 1000, defaultValue: 100, label: "Cost to Join Before Show Starts"}, {name: 'min_join_tokens', type: 'int', minValue: 0, maxValue: 1000, defaultValue: 150, label: "Cost to Join During Show. Set to 0 to Disable Joining During Show."}, {name: 'hide_message', label: 'Cam Message', type: 'str', minLength: 1, maxLength: 256, defaultValue: 'Secret Show in progress! Tip at least 150 tokens to join in on the fun! Pony Pets just need to say Hi' }, {name: 'label_watch', label: 'Words to watch for (separate with comma)', type: 'str', minLength: 1, maxLength: 256, defaultValue: 'AwesomeDude' } ]; cb.onTip(function(tip) { if (!cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), tip['from_user'])) { if(!cb.limitCam_isRunning() && parseInt(tip['amount']) >= cb.settings.min_start_tokens) { output('Added '+ tip['from_user'] + ' to secret show!'); cb.limitCam_addUsers([tip['from_user']]); } if(cb.limitCam_isRunning() && parseInt(tip['amount']) >= cb.settings.min_join_tokens && cb.settings.min_join_tokens > 0) { output('Added '+ tip['from_user'] + ' to secret show!'); cb.limitCam_addUsers([tip['from_user']]); } } }); cb.onMessage(function (msg) { var message = msg['m']; var user = msg['user']; var username = ""; var labels = cb.settings.label_watch.split(","); if (cb.room_slug === user && message == '/start' && !cb.limitCam_isRunning()) { output(cb.room_slug + ' has started the show!'); // cb.changeRoomSubject(cb.settings.hide_message); cb.limitCam_start(cb.settings.hide_message); } //label check for (var i=0; i < labels.length; i++){ if (message.indexOf(labels[i]) > -1) { if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user)) { } else { cb.limitCam_addUsers([user]); cb.chatNotice('Added ' + user + ' to secret show', user); cb.chatNotice('Added ' + user + ' to secret show', cb.room_slug); } } } // if (cb.room_slug === user && message == '/stop' && cb.limitCam_isRunning()) { output(cb.room_slug + ' has stopped the show!'); cb.limitCam_stop(); } if (cb.room_slug === user && message.substring(0, 7) == '/remove' && cb.limitCam_allUsersWithAccess().length > 0 ) { username = message.substring(8, message.length); if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), username)) { cb.limitCam_removeUsers([username]); output(cb.room_slug + ' has removed ' + username + ' from the show!'); } } if (cb.room_slug === user && message.substring(0, 4) == '/add' ) { username = message.substring(5, message.length); cb.limitCam_addUsers([username]); output(cb.room_slug + ' has added ' + username + ' to the show!'); } if (cb.room_slug === user && message.substring(0, 6) == '/check') { username = message.substring(7, message.length); if (cb.limitCam_userHasAccess(username)) { output(username + " is in the show!"); } else { output(username + " is not in the show!"); } } if (cb.room_slug === user && message === '/list') { var userlist = cb.limitCam_allUsersWithAccess(); if (userlist.length > 0) { output("" + userlist.length + (userlist.length > 1 ? " users" : " user") + " in show: " + cbjs.arrayJoin(userlist, ", ")); } else { output("No users in show."); } } if (message[0] == '/') { msg['X-Spam'] = true; } return msg; }); function output(message) { cb.chatNotice(message); cb.chatNotice.length; }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.