Apps Home
|
Create an App
Spin20
Author:
test01
Description
Source Code
Launch App
Current Users
Created by:
Test01
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ // Free Dare Wheel! // by OldTymHockey based on Backsies20 version of Wheel of Fortune by SweetDann 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:1, label: 'How Often To Advertise The Plugin: (min)'}, {name:'multispin_count', type:'int', minValue:0, maxValue:1, defaultValue:0, label: 'How Many Multi-Spins To Allow? (0-1)'}, {name:'pos1', type:'str', minLength: 1, maxLength: 255, label: 'Dare #1 '}, {name:'pos2', type:'str', minLength: 1, maxLength: 255, label: 'Dare #2 '}, {name:'pos3', type:'str', minLength: 1, maxLength: 255, label: 'Dare #3 '}, {name:'pos4', type:'str', minLength: 0, maxLength: 255, label: 'Dare #4 ', required: false}, {name:'pos5', type:'str', minLength: 0, maxLength: 255, label: 'Dare #5 ', required: false}, {name:'pos6', type:'str', minLength: 0, maxLength: 255, label: 'Dare #6 ', required: false}, {name:'pos7', type:'str', minLength: 0, maxLength: 255, label: 'Dare #7 ', required: false}, {name:'pos8', type:'str', minLength: 0, maxLength: 255, label: 'Dare #8 ', required: false}, {name:'pos9', type:'str', minLength: 0, maxLength: 255, label: 'Dare #9 ', required: false}, {name:'pos10', type:'str', minLength: 0, maxLength: 255, label: 'Dare #10 ', required: false}, {name:'pos11', type:'str', minLength: 0, maxLength: 255, label: 'Dare #11 ', required: false}, {name:'pos12', type:'str', minLength: 0, maxLength: 255, label: 'Dare #12 ', required: false}, {name:'pos13', type:'str', minLength: 0, maxLength: 255, label: 'Dare #13 ', required: false}, {name:'pos14', type:'str', minLength: 0, maxLength: 255, label: 'Dare #14 ', required: false}, {name:'pos15', type:'str', minLength: 0, maxLength: 255, label: 'Dare #15 ', required: false}, {name:'pos16', type:'str', minLength: 0, maxLength: 255, label: 'Dare #16 ', required: false}, {name:'pos17', type:'str', minLength: 0, maxLength: 255, label: 'Dare #17 ', required: false}, {name:'pos18', type:'str', minLength: 0, maxLength: 255, label: 'Dare #18 ', required: false}, {name:'pos19', type:'str', minLength: 0, maxLength: 255, label: 'Dare #19 ', required: false}, {name:'pos20', type:'str', minLength: 0, maxLength: 255, label: 'Dare #20 ', required: false}, ]; var total_tipped = 0; var reminderCount = 100; var multiMessage = 'Disabled!'; 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]); } } if(cb.settings.multispin_count > 0) { multiMessage = 'Enabled! x ' + cb.settings.multispin_count; } cb.chatNotice(' FREE DARE WHEEL!'); cb.chatNotice('--------------------------------'); cb.chatNotice('Wheel Value Set To : ' + cb.settings.cost_per_spin + ' tokens.'); cb.chatNotice('--------------------------------'); cb.chatNotice(' -= Dares Active =- '); for(var x = 0; x < rewards.length; x++) { cb.chatNotice(rewards[x]); } cb.chatNotice('--------------------------------'); cb.chatNotice(' Good Luck, don\'t chicken out! '); cb.chatNotice('--------------------------------'); function spinWheel() { cb.chatNotice('********* Spinning the Wheel! ********'); var randomnumber = Math.floor(Math.random()*(rewards.length)); cb.chatNotice('The Wheel Stopped On: ' + rewards[randomnumber] + ''); cb.chatNotice('****************************'); new_subject='Current DARE:'+rewards[randomnumber]; cb.changeRoomSubject(new_subject); } 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(); cb.chatNotice('--------------------------------', userName); cb.chatNotice(' The OldTymHockey must now do it! ', userName); cb.chatNotice('--------------------------------', userName); } 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_of_labels', 'row1_label': 'Type /spin to spin the wheel: ', 'row1_value': '', 'row2_label': 'Spin Cost', 'row2_value': cb.settings.cost_per_spin + ' tokens.', 'row3_label': 'Multi-Spin:', 'row3_value': multiMessage }; }); function advert() { cb.chatNotice('Free Dare Wheel is ACTIVE! Type /spin and make OldTymHockey do what it says! Type \'/dares\' to get the dare listing'); cb.setTimeout(advert, (cb.settings.advertise_in_chat * 60000)); } cb.setTimeout(advert, (cb.settings.advertise_in_chat * 60000));
© Copyright Chaturbate 2011- 2024. All Rights Reserved.