Apps Home
|
Create an App
Secret Show Tipper
Author:
seattlescarletjojo
Description
Source Code
Launch App
Current Users
Created by:
Seattlescarletjojo
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: 100, 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 100 tokens to join in on the fun!' }, {name: 'tip_goal', type: 'int', minValue: 1, maxValue: 10000, defaultValue: 500, label: 'Tip Goal for Special Event'} ]; let currentTips = 0; let goalReached = false; 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) { cb.sendNotice('🎉 ' + tip['from_user'] + ' joined the secret show by tipping ' + tip['amount'] + ' tokens!'); cb.limitCam_addUsers([tip['from_user']]); } if (cb.limitCam_isRunning() && parseInt(tip['amount']) >= cb.settings.min_join_tokens && cb.settings.min_join_tokens > 0) { cb.sendNotice('🎉 ' + tip['from_user'] + ' joined the ongoing secret show!'); cb.limitCam_addUsers([tip['from_user']]); } } currentTips += parseInt(tip['amount']); if (currentTips >= cb.settings.tip_goal && !goalReached) { cb.sendNotice("🎊 Tip goal of " + cb.settings.tip_goal + " tokens reached! Special show coming up! 🎊"); goalReached = true; } }); cb.onMessage(function (msg) { var message = msg['m']; var user = msg['user']; var username = ""; if (cb.room_slug === user && message == '/start' && !cb.limitCam_isRunning()) { cb.sendNotice(cb.room_slug + ' has started the secret show!'); cb.limitCam_start(cb.settings.hide_message); } if (cb.room_slug === user && message == '/stop' && cb.limitCam_isRunning()) { cb.sendNotice(cb.room_slug + ' has stopped the secret show!'); cb.limitCam_stop(); } 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)) { cb.limitCam_removeUsers([username]); cb.sendNotice(cb.room_slug + ' has removed ' + username + ' from the show!'); } } if (cb.room_slug === user && message.substring(0, 6) == '/check') { username = message.substring(7, message.length); if (cb.limitCam_userHasAccess(username)) { cb.sendNotice(username + " is in the show!"); } else { cb.sendNotice(username + " is not in the show!"); } } if (cb.room_slug === user && message === '/list') { var userlist = cb.limitCam_allUsersWithAccess(); if (userlist.length > 0) { cb.sendNotice("" + userlist.length + " user(s) in show: " + cbjs.arrayJoin(userlist, ", ")); } else { cb.sendNotice("No users in the show."); } } if (message[0] == '/') { msg['X-Spam'] = true; // Hide commands from chat } return msg; });
© Copyright Freesexcam 2011- 2024. All Rights Reserved.