Bots Home
|
Create an App
Play that Wheel
Author:
laura_rivers
Description
Source Code
Launch Bot
Current Users
Created by:
Laura_Rivers
// Wheel Of Fortune! // Original idea by SweetDann // Modified by Pippens //Version 1.2 // Made announcement more compact // Added a rare prize // Added a past winners list // Added some color :D // Added more options for Multi-Spins cb.settings_choices = [{ name: 'cost_per_spin', type: 'int', minValue: 1, maxValue: 999, defaultValue: 25, label: 'Cost Per Spin Of The Wheel (1-999): ' }, { name: 'advertise_in_chat', type: 'int', minValue: 1, maxValue: 999, defaultValue: 5, label: 'How Often To Advertise The Bot: (min)' }, { name: 'fontcolor', type: 'choice', choice1: 'White', choice2: 'Black', defaultValue: 'White', label: 'Pick the color of the font:' }, { name: 'multispin_count', type: 'int', minValue: 0, maxValue: 99, defaultValue: 3, label: 'How Many Bonus Spins To Allow Per Tip? (0-99)' }, { name: 'multispin_over', type: 'int', minValue: 0, maxValue: 999, defaultValue: 0, label: 'Prevent the wheel from spinning if the tip amount is over X ( To turn off that feature, leave it at 0)' }, { name: 'multispin_exact', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: 'Only spin if the tip is an exact multiple of cost?' }, { name: 'rarePrize', type: 'str', default: 'Cum Show', minLength: 1, maxLength: 255, label: 'If you want a prize to be rare, enter it here', required: false }, { name: 'rareChance', type: 'int', minValue: 1, maxValue: 500, defaultValue: 79, label: ' Chance of rare prize - 1 in X? (the higher the number, less chance of getting the prize, up to 500)', required: false }, { name: 'rareMin', type: 'int', minValue: 1, maxValue: 100, defaultValue: 30, label: ' Rare will only happen after X roll', required: false }, { name: 'rareBonus', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: 'Should the rare prize only happen on bonus spins to encourage big tippers?' }, { name: 'pos1', type: 'str', default: 'Ass', minLength: 1, maxLength: 255, label: 'Reward #1 ' }, { name: 'pos2', type: 'str', default: 'Slap ass', minLength: 1, maxLength: 255, label: 'Reward #2 ', required: false }, { name: 'pos3', type: 'str', default: 'Pinch my nipples', minLength: 1, maxLength: 255, label: 'Reward #3 ', required: false }, { name: 'pos4', type: 'str', default: 'Spank pussy', minLength: 0, maxLength: 255, label: 'Reward #4 ', required: false }, { name: 'pos5', type: 'str', default: 'Pussy Close up', minLength: 0, maxLength: 255, label: 'Reward #5 ', required: false }, { name: 'pos6', type: 'str', default: 'Pussy Flash', minLength: 0, maxLength: 255, label: 'Reward #6 ', required: false }, { name: 'pos7', type: 'str', default: 'Spread Pussy', minLength: 0, maxLength: 255, label: 'Reward #7 ', required: false }, { name: 'pos8', type: 'str', default: 'Oil Boobs', minLength: 0, maxLength: 255, label: 'Reward #8 ', required: false }, { name: 'pos9', type: 'str', default: 'Any Double Flash', minLength: 0, maxLength: 255, label: 'Reward #9 ', required: false }, { name: 'pos10', type: 'str', default: 'Flash of your choice', minLength: 0, maxLength: 255, label: 'Reward #10 ', required: false }, { name: 'pos11', type: 'str', default: 'Boobs on Cam', minLength: 0, maxLength: 255, label: 'Reward #11 ', required: false }, { name: 'pos12', type: 'str', default: 'Dance Tease', minLength: 0, maxLength: 255, label: 'Reward #12 ', required: false }, { name: 'pos13', type: 'str', default: 'Boobjob', minLength: 0, maxLength: 255, label: 'Reward #13 ', required: false }, { name: 'pos14', type: 'str', default: 'Tease Ass with dildo', minLength: 0, maxLength: 255, label: 'Reward #14 ', required: false }, { name: 'pos15', type: 'str', default: 'Naked Chair tease', minLength: 0, maxLength: 255, label: 'Reward #15 ', required: false }, { name: 'pos16', type: 'str', default: 'Pussy tease with dildo', minLength: 0, maxLength: 255, label: 'Reward #16 ', required: false }, { name: 'pos17', type: 'str', default: 'Twerk Ass', minLength: 0, maxLength: 255, label: 'Reward #17 ', required: false }, { name: 'pos18', type: 'str', default: 'Remove Panties', minLength: 0, maxLength: 255, label: 'Reward #18 ', required: false }, { name: 'pos19', type: 'str', default: 'Blowjob Tease', minLength: 0, maxLength: 255, label: 'Reward #19 ', required: false }, { name: 'pos20', type: 'str', default: 'Remove Bra', minLength: 0, maxLength: 255, label: 'Reward #20 ', required: false }, { name: 'pos21', type: 'str', default: 'Remove Cloth of your choice', minLength: 0, maxLength: 255, label: 'Reward #21 ', required: false }, { name: 'pos22', type: 'str', default: 'Pussy Tease', minLength: 0, maxLength: 255, label: 'Reward #22 ', required: false }, { name: 'pos23', type: 'str', default: 'Suck on fingers', minLength: 0, maxLength: 255, label: 'Reward #23 ', required: false }, { name: 'pos24', type: 'str', default: 'Closeup of your choice', minLength: 0, maxLength: 255, label: 'Reward #24 ', required: false }, { name: 'pos25', type: 'str', default: 'Free PM 5minutes', minLength: 0, maxLength: 255, label: 'Reward #25 ', required: false }, { name: 'pos26', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #26 ', required: false }, { name: 'pos27', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #27 ', required: false }, { name: 'pos28', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #28 ', required: false }, { name: 'pos29', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #29 ', required: false }, { name: 'pos30', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #30 ', required: false }, { name: 'pos31', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #31 ', required: false }, { name: 'pos32', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #32 ', required: false }, { name: 'pos33', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #33 ', required: false }, { name: 'pos34', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #34 ', required: false }, { name: 'pos35', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #35 ', required: false }, { name: 'pos36', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #36 ', required: false }, { name: 'pos37', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #37 ', required: false }, { name: 'pos38', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #38 ', required: false }, { name: 'pos39', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #39 ', required: false }, { name: 'pos40', type: 'str', minLength: 0, maxLength: 255, label: 'Reward #40 ', 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, cb.settings.pos21, cb.settings.pos22, cb.settings.pos23, cb.settings.pos24, cb.settings.pos25, cb.settings.pos26, cb.settings.pos27, cb.settings.pos28, cb.settings.pos29, cb.settings.pos30, cb.settings.pos31, cb.settings.pos32, cb.settings.pos33, cb.settings.pos34, cb.settings.pos35, cb.settings.pos36, cb.settings.pos37, cb.settings.pos38, cb.settings.pos39, cb.settings.pos40); var rewards = new Array(); var winName = new Array(); var winPrize = new Array(); var spinCost = cb.settings.cost_per_spin; var maxSpin = cb.settings.multispin_count; var multiExact = cb.settings.multispin_exact; var multiOver = cb.settings.multispin_over; var rarePrize = ' :1star '+cb.settings.rarePrize +' :1star '; var rareChance = cb.settings.rareChance; var rareMin = cb.settings.rareMin; var background = "#640b77"; var rollCount = 0; var foreground = "#FFFFFF"; if ( cb.settings.fontcolor =='Black'){ foreground = "#000000";} for (var i = 0; i < temp.length; i++) { if (temp[i] != '') { rewards.push(temp[i]); } } if ( cb.settings.rarePrize != "" && cb.settings.rareBonus == 'Yes' && maxSpin == 0 ){ cb.chatNotice(' Error - Rare is set to only happen on bonus spin and bonus spin is set to 0.', "", '#ff0000', foreground); cb.settings.rarePrize = ""; } if (cb.settings.multispin_count > 0) { multiMessage = 'Enabled! x ' + cb.settings.multispin_count; } cb.chatNotice('--------------------------------', "", background, foreground); cb.chatNotice(' Wheel of fortune by 4science', "", background, foreground); cb.chatNotice('Wheel Value Set To : ' + spinCost + ' tokens.', "", background, foreground); if (multiExact == 'Yes') { cb.chatNotice('The wheel will only spin for multiples of ' + (spinCost) + ' tokens', "", background, foreground); } cb.chatNotice('type /rewards to see all the prizes.', "", background, foreground); cb.chatNotice('--------------------------------', "", background, foreground); cb.onTip(function(tip) { var spinCount = Math.min(Math.floor(tip['amount'] / spinCost), maxSpin + 1); var randomnumber; var u = tip['from_user']; if (multiOver > 0 && tip['amount'] <= multiOver || multiOver == 0) { if (spinCount > 0) { if (multiExact == 'No' || tip['amount'] % spinCost == 0) { //Spin The Wheel. cb.chatNotice('**** ' + u + ' is spinning The Wheel! ****', "", background, foreground, "bold"); if (cb.settings.rareBonus == 'No' && cb.settings.rarePrize != "" && rollCount >= rareMin && Math.random() < (1 / rareChance)) { cb.chatNotice('**** The Wheel Stop On : ' + rarePrize + '!!!! Lucky you!!!', "", background, foreground, "bold"); winName.push(u); rollCount++; winPrize.push(rarePrize); } else { randomnumber = Math.floor(Math.random() * (rewards.length)); cb.chatNotice('**** The Wheel Stop On : ' + rewards[randomnumber], "", background, foreground, "bold"); winName.push(u); winPrize.push(rewards[randomnumber]); rollCount++; } if (spinCount > 1) { cb.chatNotice('*** ! Multi-Spin Bonus Activated ! ***', "", background, foreground, "bold"); for (var x = 1; x < spinCount; x++) { if (cb.settings.rarePrize != "" && rollCount >= rareMin && Math.random() < (1 / rareChance)) { cb.chatNotice('**** Bonus Spin Stop On : '+ rarePrize + '!!!! Lucky you!!!', "", background, foreground , "bold"); winName.push(u); rollCount++; winPrize.push(rarePrize); } else { randomnumber = Math.floor(Math.random() * (rewards.length)); cb.chatNotice('**** Bonus Spin Stop On : ' + rewards[randomnumber], "", background, foreground, "bold"); winName.push(u); winPrize.push(rewards[randomnumber]); rollCount++; } } } cb.chatNotice('**********************************', "", background, foreground); } } } }); cb.onMessage(function(m) { var u = m['user']; var msg = m['m'].split(" "); var isMod = (cb.room_slug == u || m['is_mod']); var message; if (msg['0'] == '/rewards' || msg['0'] == '/srewards') { m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (isMod && msg['0'] != '/srewards') { u = ''; } message = '**** Here is the list of prizes on the wheel ****\n'; for (var x = 0; x < rewards.length; x++) { message +='Reward ' + (x + 1) + ': ' + rewards[x] +'\n'; } if (cb.settings.rarePrize != "" && cb.settings.rareBonus == 'Yes') { message +='Trigger the bonus spins to get a small chance of winning the rare prize: ' + rarePrize +'\n'; } if (cb.settings.rarePrize != "" && cb.settings.rareBonus == 'No') { message +='The rare prize: ' + rarePrize +'\n'; } message +='--------------------------------\n'; message +=' Good Luck And Have Fun. \n' message +='--------------------------------'; cb.chatNotice(message, u, background, foreground, 'bold'); return m; } if (msg['0'] == '/winners' || msg['0'] == '/swinners' || msg['0'] == '/winner') { m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (isMod && msg['0'] != '/swinners') { u = ''; } var cmdVar1 = msg[1]; var cmdVar2 = parseInt(msg[1]); var nameNum; if (winName.length == 0){ cb.chatNotice('**** No one has won a prize yet ****', u, background, foreground); return m; } if ( isNaN(cmdVar1) && cmdVar1 !== undefined){ if (cmdVar1 == "all" || cmdVar1 == "All") { if( winName.length > 100 ){ message ='**** Here is the list of the last 100 winners! ****\n'; nameNum = winName.length - 100; }else { message ='**** Here is the list of all the winners! ****\n'; nameNum = winName.length; } for (var x = nameNum; x < winName.length; x++) { message += 'Roll #' + (x + 1) + ': ' + winName[x] + ' won ' + winPrize[x] +'\n'; } message += '**************************************'; cb.chatNotice(message, u, background, foreground); return m; } else if(cbjs.arrayContains(winName, cmdVar1)){ message ='**** Here is the list of all the prizes ' + cmdVar1 + ' won! ****\n'; var prizesWon =[]; for (var x = 0; x < winName.length; x++) { if (cmdVar1 == winName[x]){ prizesWon.push(winPrize[x]); } } message += prizesWon.join(', '); message += '\n**************************************'; cb.chatNotice(message, u, background, foreground); }else { cb.chatNotice('Unable to find '+ cmdVar1 +' on the winners list.', u, background, foreground); } }else{ if ( cmdVar1 === undefined){ cmdVar2 = 10; } if (cmdVar2 <= 0) { cb.chatNotice('**** Here are the last 0 winners! :p', u, background, foreground); return m; } if (winName.length < cmdVar2) { cmdVar2 = winName.length; } message = '**** Here are the last ' + cmdVar2 + ' winners! **** \n'; for (var x = winName.length - cmdVar2; x < winName.length; x++) { message += 'Roll #' + (x + 1) + ': ' + winName[x] + ' won ' + winPrize[x]+'\n'; } message += '**************************************'; cb.chatNotice(message, u, background, foreground); return m; } } if (msg['0'] == '/whowon' && msg['1'] == 'rare'|| msg['0'] == '/swhowon' && msg['1'] == 'rare') { m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (isMod && msg['0'] != '/swhowon') { u = ''; } var winners =[]; for (var x = 0; x <winName.length; x++){ if(winPrize[x] == rarePrize){ winners.push(winName[x]); } } if (winners.length > 0){ message = '**** Here is everyone who won '+ rarePrize +'! **** \n'; message += winners.join(', '); message += '\n**************************************'; }else{ message = '**** No one has won '+ rarePrize +' yet. **** '; } cb.chatNotice(message, u, background, foreground); return m; } if (msg['0'] == '/whowon' || msg['0'] == '/swhowon') { m['X-Spam'] = true; m['background'] = '#d9d9d9'; if (isMod && msg['0'] != '/swhowon') { u = ''; } var winners =[]; var cmdVar1 = parseInt(msg[1]) - 1; for (var x = 0; x <winName.length; x++){ if(winPrize[x] == rewards[cmdVar1]){ winners.push(winName[x]); } } if (winners.length > 0){ message = '**** Here is everyone who won '+ rewards[cmdVar1]+'! **** \n'; message += winners.join(', '); message += '\n**************************************'; }else{ message = '**** No one has won '+ rewards[cmdVar1]+' yet. **** '; } cb.chatNotice(message, u, background, foreground); return m; } }); cb.onEnter(function(user) { var u = user['user']; cb.chatNotice('--------------------------------', u, background, foreground); cb.chatNotice(' Wheel of fortune is active', u, background, foreground, 'bold'); cb.chatNotice('Wheel Value Set To : ' + cb.settings.cost_per_spin + ' tokens.', u, background, foreground, 'bold'); if (cb.settings.multispin_count > 0) { cb.chatNotice('Bonus spins are enabled. Tip at least ' + (spinCost * 2) + ' tokens to get a bonus spin', u, background, foreground, 'bold'); } if (multiExact == 'Yes' ) { cb.chatNotice('The wheel will only spin for multiples of ' + (spinCost) + ' tokens', u, background, foreground, 'bold'); } if (cb.settings.rarePrize != "" && cb.settings.rareBonus == 'Yes' ) { cb.chatNotice('To have a chance at winning the rare prize, you have to trigger the bonus spin by tipping more than ' + (spinCost * 2) + ' tokens', u, background, foreground, 'bold'); } cb.chatNotice('type /rewards to see all the prizes.', u, background, foreground, 'bold'); cb.chatNotice('--------------------------------', u, background, foreground); }); function advert() { cb.chatNotice('Wheel of fortune Is ACTIVE! Tip ' + cb.settings.cost_per_spin + ' To Play! Type \'/rewards\' to get a wheel reward listing', "", background, foreground, 'bold'); if (cb.settings.rarePrize != "" && cb.settings.rareBonus == 'Yes' ) { cb.chatNotice('To have a chance at winning the rare prize, you have to trigger the bonus spin by tipping more than ' + (spinCost * 2) + ' tokens', "", background, foreground, 'bold'); } 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.