Apps Home
|
Create an App
vipShow
Author:
shinseti
Description
Source Code
Launch App
Current Users
Created by:
Shinseti
cb.settings_choices = [ {name: 'hide_message', label: 'Cam Message', type: 'str', minLength: 1, maxLength: 256, defaultValue: 'Secret Show in progress!' }, ]; cb.onMessage(function (msg) { var message = msg.m.trim(); var user = msg.user; if (msg.m.charAt(0) !== '/') { return msg; } if (cb.room_slug !== user) { return msg; } if (/^\/vip$/.test(message)) { showHelp(); } else { cmd(message.slice(1), msg.user); } }); function cmd(input, user) { var command = input.split(/\s+/); if (cb.room_slug !== user) { return; } switch(command[1].toLowerCase()) { case 'add': add(command[2]); break; case 'remove': remove(command[2]); break; case 'start': start(); break; case 'stop': stop(); break; case 'list': list(); break; case 'clear': clear(); break; case 'message': message(command.slice(2).join(' ')); break; case 'help': showHelp(); break; } } function showHelp() { output('Use "/vip help" to show this message'); output('Use "/vip add username" to add a user to the show'); output('Use "/vip remove username" to remove a user from the show'); output('Use "/vip list" to show all users with access to the show'); output('Use "/vip clear" to remove all users from the show'); output('Use "/vip start" to start the show'); output('Use "/vip stop" to stop the show'); output('Use "/vip message text" to change the hide message'); } function add(user) { if (cb.limitCam_allUsersWithAccess().length > 0 && cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user)) { output(user + ' is already on the list'); return; } output(cb.room_slug + ' has added '+ user + ' to the show!'); cb.limitCam_addUsers(user); } function remove(user) { if (cb.limitCam_allUsersWithAccess().length === 0 || !cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user)) { output(user + ' not found on the list'); return; } output(cb.room_slug + ' has removed ' + user + ' from the show!'); cb.limitCam_removeUsers(user); } function start() { if (cb.limitCam_isRunning()) { output('The show is already running!'); return; } output(cb.room_slug + ' has started the show!'); cb.limitCam_start(cb.settings.hide_message); } function stop() { if (!cb.limitCam_isRunning()) { output('The show has already stopped'); return; } output(cb.room_slug + ' has stopped the show!'); cb.limitCam_stop(); } function list() { var userlist = cb.limitCam_allUsersWithAccess(); if (userlist.length === 0) { output('No users in the show'); return; } output("" + userlist.length + (userlist.length > 1 ? " users" : " user") + " in show: " + cbjs.arrayJoin(userlist, ", ")); } function clear() { if (cb.limitCam_allUsersWithAccess().length === 0) { output('No users in the show'); return; } output(cb.room_slug + ' has removed all user from the show!'); cb.limitCam_removeAllUsers(); } function message(message) { cb.settings.hide_message = message; } function output(message) { cb.sendNotice(message, cb.room_slug, '#ddddaa'); }
© Copyright Chaturbate 2011- 2025. All Rights Reserved.