Apps Home
|
Create an App
shinycontroltest
Author:
shinycontrol
Description
Source Code
Launch App
Current Users
Created by:
Shinycontrol
// ========================= Base Application Section class ShinyControlsApp { constructor() { this.total_tipped = 0 this.variable_tip = 1500 } tipCalc(tip, user) { //let tip_value = parseInt(tip['amount']); let tip_value = "DISABLED_FOR_NOW"; let tipper = tip['from_user'] cb.chatNotice("tip: " + tip_value) this.total_tipped += tip_value; cb.chatNotice("Total Tipped: " + this.total_tipped); if (tip_value == 21) { cb.chatNotice('user: ' + tipper) cb.sendNotice('dm test', tipper) } else if (tip_value > 5) { if (tip_value % 2 == 1) { this.variable_tip = this.variable_tip - tip_value this.variable_tip = Math.max(this.variable_tip, 0) cb.chatNotice("Odd amount tipped, variable tip lowered. Currently: " + this.variable_tip) } else { this.variable_tip = this.variable_tip + tip_value if (this.variable_tip > 500) { cb.chatNotice("Variable tip capped at 500") } this.variable_tip = Math.min(this.variable_tip, 500) cb.chatNotice("Even amount tipped, variable tip increased. Currently: " + this.variable_tip) } } else { cb.chatNotice("small tip") } } displayImpactOptions(tipper) { cb.chatNotice(tipper) return {options:[{label: 'choice1'}, {label: 'choice2'}, {label: 'choice3'}], label:"Select a choice:"} } } // ========================= On Tip Section cb.onTip(function (tip) { app.tipCalc(tip) }); // ========================= Custom Commands Section userMessages = {} cb.onMessage(function (msg) { thisUser = msg['user'] thisMessage = msg['m'] if (thisMessage == "/menu") { msg['X-Spam'] = true; showTipMenu(thisUser) } else if (usersMessages[thisUser] == thisMessage) { msg['X-Spam'] = true cb.sendNotice("Please don't spam, duplicate message has been deleted", thisUser) } else { userMessages[thisUser] = thisMessage } }) // ========================= Admin Commands Section // ========================= App Startup Section app = new ShinyControlsApp cb.setTimeout(lovenseNotifications, 600000) // ========================= Automated Message Section function lovenseNotifications() { cb.chatNotice("YOU can activate my Lovense HUSH with your tips!") cb.chatNotice("[3 Tokens] Activate HUSH for 5 seconds @ Low Vibrations") cb.chatNotice("[6 Tokens] Activate HUSH for 5 seconds @ Medium Vibrations") cb.chatNotice("[9 Tokens] Activate HUSH for 5 seconds @ High Vibrations") cb.chatNotice("[111 Tokens] Activate HUSH for 5 seconds @ Extreme Vibrations (This one goes to 11!)") cb.setTimeout(lovenseNotification, 60000) } function showTipMenu(user) { let options = [ 'Tip 21: Switch impact', 'Tip 31: Switch style', 'Tip 41: Switch style', ] //for (let i = 0; i < options.length; i++) { // cb.sendNotice(options[i], user) //} cb.sendNotice(commandDisabled(), user) } function commandDisabled() { return "This command is disabled for the moment. Please try again later." }
© Copyright Chaturbate 2011- 2025. All Rights Reserved.