Apps Home
|
Create an App
SpinMyWheelBaby
Author:
iansultan
Description
Source Code
Launch App
Current Users
Created by:
Iansultan
// Variables var spin_cost = 150; var wheelOptions = ['kiss', 'makeout', 'get naked', 'suck dick', 'play with nipple', 'eat ass', 'show dick', 'show ass']; // Commands var spin_command = '!spin'; // Settings cb.settings_choices = [ {name: 'spin_cost', type: 'int', minValue: 1, default: 150}, ]; // Handlers cb.onTip(function(tip) { if(tip['amount'] == cb.settings.spin_cost) { spinWheel(tip['from_user']); cb.drawPanel(); } }); cb.onDrawPanel(function(user) { return { 'template': '2_rows_of_labels', 'row1_label': 'Spin the Wheel:', 'row1_value': 'Cost ' + cb.settings.spin_cost + ' tokens', 'row2_label': 'Last Spin Result:', 'row2_value': getLastSpinResult() }; }); cb.onMessage(function (msg) { if (msg['m'][0] == '!') { if (msg['user'] == cb.room_slug) { if (startsWith(msg['m'], spin_command)) { msg['X-Spam'] = true; if(deductTokensFrom(msg['user'], spin_cost)) { spinWheel(msg['user']); cb.drawPanel(); } else { cb.chatNotice("Not enough tokens!", msg['user']); } } } } return msg; }); // Functions function spinWheel(userName) { const randomIndex = Math.floor(Math.random() * wheelOptions.length); const result = wheelOptions[randomIndex]; cb.chatNotice(userName + ', you spun: ' + result, cb.room_slug); } function getLastSpinResult() { // You'd need to store and fetch the last spin result from somewhere, e.g., a variable or a database. // For now, I'm just returning a placeholder. return "Placeholder result"; } function deductTokensFrom(user, amount) { // Here, you would integrate with an actual system to check and deduct tokens. // For now, I'm returning true as a placeholder, assuming the user has enough tokens. return true; } function startsWith(source, str) { return source.substring(0, str.length) === str; } // Init cb.drawPanel();
© Copyright Freesexcam 2011- 2024. All Rights Reserved.