Apps Home
|
Create an App
Wheel of Punishment
Author:
pinsub
Description
Source Code
Launch App
Current Users
Created by:
Pinsub
/* * Title: Wheel of Punishment * Based on Dare Wheel by Backsies20, again based on Wheel of Fortune by SweetDann * Version: 2.0 (25/07/14 */ cb.settings_choices = [ {name:'cost_per_spin', type:'int', minValue:0, maxValue:999, defaultValue:0, label: 'Cost Per Spin Of The Wheel (0-999): '}, {name:'advertise_in_chat', type:'int', minValue:1, maxValue:999, defaultValue:60, label: 'How Often To Advertise The Plugin: (min)'}, {name:'pos1', type:'str', minLength: 1, maxLength: 255, label: 'Punishment #1 '}, {name:'pos2', type:'str', minLength: 1, maxLength: 255, label: 'Punishment #2 '}, {name:'pos3', type:'str', minLength: 1, maxLength: 255, label: 'Punishment #3 '}, {name:'pos4', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #4 ', required: false}, {name:'pos5', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #5 ', required: false}, {name:'pos6', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #6 ', required: false}, {name:'pos7', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #7 ', required: false}, {name:'pos8', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #8 ', required: false}, {name:'pos9', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #9 ', required: false}, {name:'pos10', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #10 ', required: false}, {name:'pos11', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #11 ', required: false}, {name:'pos12', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #12 ', required: false}, {name:'pos13', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #13 ', required: false}, {name:'pos14', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #14 ', required: false}, {name:'pos15', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #15 ', required: false}, {name:'pos16', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #16 ', required: false}, {name:'pos17', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #17 ', required: false}, {name:'pos18', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #18 ', required: false}, {name:'pos19', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #19 ', required: false}, {name:'pos20', type:'str', minLength: 0, maxLength: 255, label: 'Punishment #20 ', required: false}, ]; var reminderCount = 100; var temp = new Array(cb.settings.pos1,cb.settings.pos2,cb.settings.pos3,cb.settings.pos4,cb.settings.pos5,cb.settings.pos6,cb.settings.pos7,cb.settings.pos8,cb.settings.pos9,cb.settings.pos10,cb.settings.pos11,cb.settings.pos12,cb.settings.pos13,cb.settings.pos14,cb.settings.pos15,cb.settings.pos16,cb.settings.pos17,cb.settings.pos18,cb.settings.pos19,cb.settings.pos20); var rewards = new Array(); for(var i = 0; i<temp.length; i++) { if(temp[i] != '') { rewards.push(temp[i]); } } function spinWheel() { cb.chatNotice('*** Spinning the Wheel of Punishment! ***'); var randomnumber = Math.floor(Math.random()*(rewards.length)); cb.chatNotice('The Wheel Stopped On: ' + rewards[randomnumber] + ''); cb.chatNotice('****************************'); } cb.onTip(function (tip) { var tipJar = tip['amount']; var spinCount = 0; //While the Tip Jar Has More In it Then The Spin Cost... while(tipJar >= cb.settings.cost_per_spin) { //And If We Have A SpinCount Left... if(spinCount <= (cb.settings.multispin_count)) { //Spin The Wheel. if(spinCount > 0) { cb.chatNotice('! Multi-Spin Bonus Activated !'); } //Spin The Wheel in 3 seconds. //cb.setTimeout(spinWheel, 3000); spinWheel(); } //Remove The Spin Amount From The Tip Jar. tipJar -= cb.settings.cost_per_spin; //And Increase The SpinCount. spinCount++; } total_tipped += parseInt(tip['amount']) cb.drawPanel(); }); cb.onMessage(function (msg) { var userName = msg['user']; if(msg['m'] == '/spin') { spinWheel(); } if(msg['m'] == '/dares') { for(var x = 0; x < rewards.length; x++) { cb.chatNotice('Dare ' + x + ': ' + rewards[x], userName); } } return msg; }); cb.onDrawPanel(function(user) { return { 'template': '3_rows_12_21_31', 'row1_label': 'Spin Cost :', 'row1_value': cb.settings.cost_per_spin + ' tokens.', 'row2_value': 'Type /spin to spin the wheel', 'row3_value': '0' }; }); function advert() { cb.chatNotice('The Wheel of Punishment is ACTIVE! Type /spin and make the broadcaster do what it says!'); cb.setTimeout(advert, (cb.settings.advertise_in_chat * 60000)); } cb.setTimeout(advert, (cb.settings.advertise_in_chat * 60000));
© Copyright Chaturbate 2011- 2026. All Rights Reserved.