Apps Home
|
Create an App
sophintricate-secret-cam
Author:
adriandev
Description
Source Code
Launch App
Current Users
Created by:
Adriandev
cb.settings_choices = [ { name: 'seconds_per_token', type: 'int', minValue: 1, maxValue: 60, defaultValue: 5, label: "Viewing seconds for each token received" }, { name: 'hide_message', label: 'Cam Message', type: 'str', minLength: 1, maxLength: 256, defaultValue: "Sophintricate's Secret Show in Progress. Tip to join in on the fun! Each token gives you more seconds!" } ]; cb.limitCam_start(cb.settings.hide_message); cb.limitCam_removeAllUsers() var customers = []; var seconds_per_token = cb.settings.seconds_per_token; function output(msg) { cb.chatNotice(msg); } function message_member(member, message) { cb.sendNotice(message, member, "#31a616", "#ffffff", "bold"); } function message_self(message) { cb.sendNotice(message, cb.room_slug, "#ffc21e", "#000000", "bold"); } function demote(tipper) { if(customers[tipper] >= 1) { customers[tipper]--; if(customers[tipper] == 5) { message_member(tipper, "Only 5 more seconds to enjoy! Would you renew?"); } } else { customers.splice(tipper); cb.limitCam_removeUsers(tipper); message_self(tipper + ' has been lost :('); } } function timer() { customers.forEach(demote); cb.setTimeout(timer, 1000); } cb.setTimeout(timer, 1000); cb.onTip(function(tip) { var tipper = tip['from_user']; var amount = parseInt(tip['amount']); if(cb.limitCam_isRunning() && amount >= 0) { if(customers.includes(tipper)) { customers[tipper] += amount * cb.settings.seconds_per_token; message_member(tipper, tipper + " you are now allowed to continue to view my secret cam for " + customers[tipper] + " seconds. Continue to enjoy!"); message_self(tipper + " has renewed. Here for " + customers[tipper] + " more seconds."); } else { customers.push(tipper); customers[tipper] = amount * cb.settings.seconds_per_token; cb.limitCam_addUsers(tipper); message_member(tipper, tipper + " you are now allowed to view my secret cam for " + customers[tipper] + " seconds. Welcome & Enjoy!"); message_self(tipper + " has joined. Here for " + customers[tipper] + " seconds."); } } }); cb.onMessage(function(msg) { var message = msg['m']; var user = msg['user']; var username = ""; if (cb.room_slug === user && message === '/list') { var userlist = cb.limitCam_allUsersWithAccess(); if (userlist.length > 0) { message_self("" + userlist.length + (userlist.length > 1 ? " users" : " user") + " in show: " + cbjs.arrayJoin(userlist, ", ")); } else { message_self("No users in show."); } } if (message[0] == '/') { msg['X-Spam'] = true; } return msg; });
© Copyright Chaturbate 2011- 2025. All Rights Reserved.