Bots Home
|
Create an App
bbf-twistbot
Author:
bbm1979_1
Description
Source Code
Launch Bot
Current Users
Created by:
Bbm1979_1
var player = ""; var addon =""; var lines = '\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501'; cb.settings_choices = [ {name: 'notfree', label: "Play for Tokens? (if Yes you still can spin it for free)", type:'choice', choice1:'Yes', choice2:'No', default:'Yes'}, {name: 'tokens', type: 'int', minValue: 1, default: 50, label: 'Tokens to spin the wheel'}, {name: 'mod_as_king', label: "Allow mods to spin the Wheel?", type:'choice', choice1:'Yes', choice2:'No', default:'Yes'}, ]; function spinWheel(player){ var wheel = Math.floor(Math.random() * 24 + 1); drawSpinner(wheel); prize_won = cb.settings[wheel]; stateChange(player, prize_won); } function stateChange(player, prize_won) { setTimeout(function(){ if(player){ cb.chatNotice(' \u2605 ' + player + ', Thank you for spinning!' + ' \u2605','','#666699','#FFFFFF'); cb.drawPanel();} }, 3500); } cb.onMessage(function (msg) { if (msg['user'] == cb.room_slug && msg['m'].indexOf('!spin') === 0) { msg['X-Spam'] = true; cb.chatNotice('New command!! use !r username', msg['user'],'','','bold'); } if (msg['user'] == cb.room_slug && msg['m'].indexOf('!r ') === 0) { msg['X-Spam'] = true; player = msg['m'].replace("!r ", ""); cb.chatNotice('Spinning Wheel for '+ player,'','','','bold'); spinWheel(player); } if (msg['user'] == cb.room_slug && msg['m'].indexOf('!tk') === 0) { msg['X-Spam'] = true; var tks = msg['m'].replace("!tk ", ""); if (tks > 0) { cb.settings.tokens = tks; addon = 'Tip ' + tks + ' tokens to spin Wheel.'; } cb.chatNotice(' Tip amount for spinning has changed! '+ addon, '', '#B00000','#FFFFFF','bold'); } return msg; }); cb.onTip(function(tip){ player = tip.from_user; var amount = tip.amount; if (amount == cb.settings.tokens){ if (cb.settings.notfree == 'Yes'){ spinWheel(player); } } cb.drawPanel(); }); function init(){ cb.drawPanel(); } drawings = { 1: ":Twister1", 2: ":Twister2", 3: ":Twister3", 4: ":Twister4", 5: ":Twister5", 6: ":Twister6", 7: ":Twister7", 8: ":Twister8", 9: ":Twister9", 10: ":Twister10", 11: ":Twister11", 12: ":Twister12", 13: ":Twister13", 14: ":Twister14", 15: ":Twister15", 16: ":Twister16", 17: ":Twister17", 18: ":Twister18", 19: ":Twister19", 20: ":Twister20", 21: ":Twister21", 22: ":Twister22", 23: ":Twister23", 24: ":Twister24", }; function drawSpinner(spinVal){ cb.chatNotice(drawings[spinVal]); } init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.