Apps Home
|
Create an App
camera1
Author:
philwhelp
Description
Source Code
Launch App
Current Users
Created by:
Philwhelp
//--patches cbjs.arrayContains = (haystack, needle) => Array.prototype.includes.call(haystack, needle); if (!Object.entries) Object.entries = function( obj ){ var ownProps = Object.keys( obj ), i = ownProps.length, resArray = new Array(i); // preallocate the Array while (i--) resArray[i] = [ownProps[i], obj[ownProps[i]]]; return resArray; }; //-- cb.settings_choices = [ {name:'exclude_mods', type:'choice', choice1:'yes', choice2:'no', defaultValue: 'yes', label: "allow mods to see at all times"}, {name:'exclude_fan', type:'choice', choice1:'yes', choice2:'no', defaultValue: 'yes', label: "allow fan club members to see at all times"}, {name: 'exclude_members', label: 'allowed members to see at all times (seperate with ",")', type: 'str', minLength: 1, maxLength: 256, required: false, defaultValue: 'playfull_mike, sex_machine' }, {name: 'min_tokens', type: 'int', minValue: 0, maxValue: 1000, defaultValue: 100, label: "minimum tipped to see the show (when active)"}, {name: 'hide_message', label: 'Cam Message (# = tokens needed)', type: 'str', minLength: 1, maxLength: 256, defaultValue: 'Im naked at the moment tip min # to see me.' },{name:'remove_min', type:'choice', choice1:'yes', choice2:'no', defaultValue: 'yes', label: "remove minimum tokens when the show starts"}, {name: 'add_timer', type: 'int', minValue: 1, maxValue: 1000, defaultValue: 3, label: "add display in minutes "}, {name:'theme', type:'choice', choice1:'purple', choice2:'red', choice3:'blue', choice4:'black', choice5:'pink', defaultValue: 'purple', label: "colour theme"}, ]; colour_theme=[]; colour_theme['purple'] = ['#f0e6ff', '#6600ff']; colour_theme['red'] = ['#ffe6e6', '#e60000']; colour_theme['blue'] = ['#e6e6ff', '#0000b3']; colour_theme['black'] = ['#f2f2f2', '#000000']; colour_theme['pink']= [ '#ffccff','#e600e6']; // tippers settings var total_tipped = 0; // total tips var total_tippers = 0; // total Users that have tipped TSA = 0 // total single individual tips. var HTU = "----"; // high tipper Username var HTA = 0; // high tip[er Amount var LTU = "----"; // last tipper Username var LTA = 0; // last tipper Amount var KTU = "----"; // King tipper Username var KTA = 0; // King tipper Amount tipper_s =[]; //tippers for show tipper = []; exclude_mods = cb.settings.exclude_mods; exclude_fan = cb.settings.exclude_fan; min_tokens = cb.settings.min_tokens; remove_min = cb.settings.remove_min; exc_mem = cb.settings.exclude_members ? cb.settings.exclude_members.split(",") : []; add_color = cb.settings.add_color? cb.settings.add_color: "#fd0000"; add_timer = cb.settings.add_timer? cb.settings.add_timer: 3; hide_message = cb.settings.hide_message ? cb.settings.hide_message.replace("#", min_tokens): "Hidden show active. Tip minimum of "+ min_tokens + "to see the show!" ; cb.onMessage(function (msg) { chk_exclude(msg.user, msg.is_mod, msg.in_fanclub); if (cbjs.arrayContains(exc_mem, msg.user)) { add_user(msg.user); if (tipper_s[msg.user] == null) {tipper_s[msg.user] = [0, "no"]; output(msg.user + " you are allowed to see all my shows", msg.user, 1); } } var message = msg.m; var user = msg.user; var username = ""; if (cb.room_slug === user && message == '/start' && !cb.limitCam_isRunning()) { const arr = tipper_s; for (const [key, value] of Object.entries(arr)) { if (!cbjs.arrayContains(exc_mem, key) && (tipper_s[key][1] == "no")) { if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), key)) { tipper_s[key][0] -= min_tokens; tipper_s[key][1] = "yes"; }} } output(cb.room_slug + ' has started the show!', '' , 1); cb.limitCam_start(hide_message, exc_mem); } if (cb.room_slug === user && message == '/stop' && cb.limitCam_isRunning()) { const arr = tipper_s; for (const [key, value] of Object.entries(arr)) { if (!cbjs.arrayContains(exc_mem, key) && (tipper_s[key][1] == "yes")) {tipper_s[key][1] = "no"; if (tipper_s[key][0] < min_tokens) { remove_user(key); output("Thank you for watching "+ key +". please tip " + (min_tokens - tipper_s[key][0]) + " tokens to see the next show", key , 2); } else { output("Thank you for watching "+ key +". You can see the next show", key, 2); } } } output(cb.room_slug + ' has stopped the show!' , '', 1); cb.limitCam_stop(); } if (message === '/cmds' ) { cmds(msg.user); } if (message === '/chk' ) { if (cbjs.arrayContains(exc_mem, msg.user) == true) { tk = (tipper_s[msg.user] != null) ? tipper_s[msg.user][0] : 0; note = "you are excluded for paying in the show. your current tips are: "+ tk;} else if (tipper_s[msg.user] == null) {note = "you have not tipped";} else { shows = Math.floor(tipper_s[msg.user][0] / min_tokens); note = "You have " +tipper_s[msg.user][0] + " tokens in your tip jar (good for " + shows + " shows )"; } output(note, msg.user, 1); } if (cb.room_slug === user && message.substring(0, 7) == '/remove' && cb.limitCam_allUsersWithAccess().length > 0 && cb.limitCam_isRunning()) { username = message.substring(8, message.length); if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), username)) { tipper_s[username] = [ 0 ,'no']; cb.limitCam_removeUsers([username]); output(cb.room_slug + ' has removed ' + username + ' from the show!', 1); } } 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!", cb.room_slug, 1); } else { output(username + " is not in the show!", cb.room_slug, 1); } } 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, ", "), cb.room_slug); } else { output("No users in show.", cb.room_slug, 1 ); } } if (message[0] == '/') { msg['X-Spam'] = true; } return msg; }); cb.onTip(function(tip) { if(tipper[tip.from_user] == null) {tipper[tip.from_user] = tip.amount;} else {tipper[tip.from_user] += tip.amount;} total_tipped += tip['amount']; TSA ++; total_tippers = Object.keys(tipper).length; if (tipper[tip['from_user']] > KTA) { KTA = tipper[tip.from_user]; KTU = tip['from_user']; } if (total_tipped > cb.settings.tokens) { total_tipped = cb.settings.tokens; } LTA = tip['amount']; LTA = tip['from_user']; if (tip['amount'] > HTA) { HTA = tip['amount']; HTU = tip['from_user']; } chk_exclude(tip.from_user, tip.from_user_is_mod, tip.from_user_in_fanclub); //-- exclude check if (cbjs.arrayContains(exc_mem, tip.from_user)) { add_user(tip.from_user); if (tipper_s[tip.from_user] == null) {tipper_s[tip.from_user] = [tip.amount, "no"]; output("welcome "+ tip.from_user + " you are allowed to see all my shows", tip.from_user); } } // show settings else if(tipper_s[tip.from_user] == null) {tipper_s[tip.from_user] = [tip.amount, "no"];} else {tipper_s[tip.from_user][0] += tip.amount;} if ((remove_min == "no") && (parseInt(tipper_s[tip.from_user][0]) >= min_tokens)) { if (!cbjs.arrayContains(exc_mem, tip.from_user)) {exc_mem.push(tip.from_user); add_user(tip.from_user); output(tip.from_user +" You are now allowed to watch all shows.", tip.from_user) } } if (!cbjs.arrayContains(exc_mem, tip.from_user)) { if (!cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), tip.from_user)) { if(!cb.limitCam_isRunning() && parseInt(tipper_s[tip.from_user][0]) >= min_tokens) { output('Added '+ tip.from_user + ' to the show!', cb.room_slug); output('the payment of '+ min_tokens + ' tokens will be deducted when the show starts.', tip.from_user); tipper_s[tip.from_user][1] = "no"; add_user(tip.from_user); } else if(cb.limitCam_isRunning() && parseInt(tipper_s[tip.from_user][0]) >= min_tokens) { output('Added '+ tip.from_user + ' to the show!'); tipper_s[tip.from_user][1] = "yes"; tipper_s[tip.from_user][0] -= min_tokens; add_user(tip.from_user); } } } cb.drawPanel() }); //-- new on enter cb.onEnter(function(U) { chk_exclude(U.user, U.is_mod, U.in_fanclub); if (cbjs.arrayContains(exc_mem, U.user)) { add_user(U.user); if (tipper_s[U.user] == null) {tipper_s[U.user] = [0, "yes"]; output("welcome "+ U.user + " you are allowed to see all my shows", U.user); } else {output("welcome back "+ U.user + " you are allowed to see all my shows", U.user);} } else if (tipper_s[U.user] != null){ if (!cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), U.user)) { if ((tipper_s[U.user][0] >= min_tokens) || (tipper_s[U.user][1] == "yes")){add_user(U.user); if (!cb.limitCam_isRunning()) {output("Welcome back " +U.user + " Your current ballance is :"+tipper_s[U.user][0]+". you are still in the next show. ", U.user);} else if(tipper_s[U.user][1] == "no"){tipper_s[U.user][0] -= min_tokens; tipper_s[U.user][1] = "yes"; output("Welcome back. Please enjoy the show. you have " +tipper_s[U.user][0]+ "Tokens left")} else {output("welcome back " +U.user+ " Please enjoy the show...", U.user)} } } } startup(U.user); cb.drawPanel() }); cb.onLeave(function(U) { remove_user(U.user); cb.drawPanel(); }) function add_user(U) { if (!cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), U)) {cb.limitCam_addUsers([U]);} } function remove_user(U) { if (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), U)) {cb.limitCam_removeUsers([U]);} } function chk_exclude(U, M, F) { if (((M == true) && (exclude_mods == "yes")) || ((exclude_fan == "Yes") && (F == true))){ if (!cbjs.arrayContains(exc_mem, U)) {exc_mem.push(U); } return true; } else {return false;} } function app_adds() { ad_list =""; ad_list += "---------------------- Spy Shows ----------------------\n"; ad_list +="Tip minimum of "+ min_tokens + ((remove_min == "no") ? " tokens to see all my shows" : " tokens to see my next show") +"\n" ; ad_list += "Accumulative Tips are accepted.\n" ad_list += '-----------------------------------------------------------'; output(ad_list,'', 2); cb.setTimeout(app_adds, add_timer*60000); } function output(message, U, T) { if (!colour_theme[cb.settings.theme]) {colour_theme[cb.settings.theme] = ['#000000' , '#ffffdd'];} if (T == 1) {txt_c ='#ffffff'; txt_bk = colour_theme[cb.settings.theme][1];} // title section else if (T == 2) {txt_c = colour_theme[cb.settings.theme][1]; txt_bk = colour_theme[cb.settings.theme][0];} //main colors else {txt_c = colour_theme[cb.settings.theme][1]; txt_bk = "";} cb.chatNotice(message, U, txt_bk , txt_c, 'bold'); } // needs work cb.onDrawPanel(function(user) { Uname = (user.user != '')? user.user : "guest"; var userlist = cb.limitCam_allUsersWithAccess(); T_tipers = total_tippers != 1 ? ' Tippers' : ' Tipper'; T_tips = (TSA != 1 ? ' Tips' : ' Tip'); T_tipped = total_tipped != 1 ? ' Tokens' : ' Token'; if (total_tipped == 0) { line_1 = "Welcome " + user.user; line_2 = "Are You Ready and horny..."; line_3 = "Tip to start the show" } else { line_1 = total_tippers + T_tipers + ' | '+ TSA + T_tips + ' | ' + total_tipped + T_tipped; line_2 = 'Best tipper :' +HTU+ ' with '+ HTA +' Tokens'; line_3 = (user.user == cb.room_slug) ? 'Current Ticket holders : ' +userlist.length + (userlist.length != 1 ? " users" : " user") : (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user.user)) ? "You are in the show" : "You are not in the show"; } return { 'template': '3_rows_11_21_31', 'row1_value': line_1, 'row2_value': line_2, 'row3_value': line_3, }; }); function startup(U) { User = U ? U : ''; var startmsg = ''; startmsg += '---------------------------------------------------- \n'; startmsg += " \u25CF Type /cmds. to see all commands. \n"; startmsg += '----------------------------------------------------'; output (startmsg,User, 2) } function cmds(U) { output( ' \uD83D\uDD75 Spy Shows commands \uD83D\uDD75 ', U, 1); var cmds = ""; if (U == cb.room_slug) { cmds += 'To start the show type /start \n'; cmds +=' To stop the show type /stop \n'; cmds += 'To see the viewers in the show type /list \n' cmds += 'To remove a member from show type /remove {members name}\n'; cmds += 'To check a member is in the show type /check {members name}' } else { cmds += ' Type /chk to see your current balance '; } output(cmds, U, 2); } // -- end app_adds(); startup();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.