Bots Home
|
Create an App
Sammy's Twister Game
Author:
hello_im_mark
Description
Source Code
Launch Bot
Current Users
Created by:
Hello_Im_Mark
var tct = [0,[]]; //Tip Count Totals [ttl,['user1','user2',..]] var cht = [0,'']; //Current High Tip [amt,'tipper'] var spc = String.fromCharCode(160); //SPaCe: non collapsible character // var ssa = 0; //Seconds Since Action var spn = 0; //SPiNs remaining var sps = []; //SPecial Spins var lma = ''; //Last Moved Appendage (ex: 'rh') var cbp = []; //Current Body Placement ['rh':'b', 'rf':'g', 'lh':'r', 'lf':'y'] var psd = false; //PauSeD: used to pause gameplay var whl = ['RIGHT (DERECHA)','LEFT (IZQUIERDA)','HAND (MANO)','FOOT (PIE)','BLUE (AZUL)','GREEN (VERDE)','RED (ROJO)','YELLOW (AMARILLO)']; var clr = {'BLUE (AZUL)':'#9999FF','GREEN (VERDE)':'#99FF99','RED (ROJO)':'#FF9999','YELLOW (AMARILLO)':'#FFFF99'} //CoLoRs // cb.settings_choices = [ {name:'cst', type:'int', minValue:1, maxValue:999, defaultValue:10, label:'Spin Cost (1-999)'}, //CoST {name:'sis', type:'choice', choice1:10, choice2:12, choice3:15, defaultValue:12, label:'Spin Interval (seconds)'}, ]; cb.onTip(function (tip) { tct[0] += tip['amount']; if (tip['amount']>cht[0]&&tip['amount']>=cb.settings.cst) { } spinWheel(spn+=Math.floor(tip['amount']/cb.settings.cst)); cb.drawPanel(); }); cb.onDrawPanel(function(user) { return { 'template': '3_rows_of_labels', 'row1_label': 'Total Tips:', 'row1_value': (tct[0])?tct[0]:'none :(', 'row2_label': 'Spin Cost:', 'row2_value': (cb.settings.cst==1)?cb.settings.cst+' Token':cb.settings.cst+' Tokens', 'row3_label': 'Highest Tip:', 'row3_value': (cht[0])?cht[0]+' ('+cht[1]+')':'(No Tips Yet)' }; }); cb.onMessage(function (msg) { if (/(?:camshacks|danacamsessions|milfic).*c[o0]m/ig.test(msg['m'])) msg['X-Spam'] = true; //block spam if ((msg['user']==cb.room_slug||msg['user']=='hello_im_a_user'||msg['is_mod'])&&msg['m']=='/pause') { psd = (psd)?false:true; cb.chatNotice('*** Twister gameplay has been toggled by '+msg['user']+' (pause='+psd+').','','','','bold'); if (!psd) spinWheel(); msg['X-Spam'] = true; } else if (spn>=10&&(!(msg['in_fanclub']||msg['has_tokens']||msg['is_mod']||msg['tipped_recently']||msg['user']==cb.room_slug))) msg['m'] = msg['m'].replace(":",";"); return msg; }); // function spinWheel(nil) { if (spn&&ssa>=cb.settings.sis) { //spin no more than once every X seconds if (psd) { cb.chatNotice('*** Spins Pending: '+spn+' Waiting for the broadcaster or a moderator to type /pause to resume spins.'); return false; } spn--; ssa=0; if (sps.length) { var pt0 = sps.shift().toUpperCase().split(" "); var pt1 = pt0[0]; var pt2 = pt0[1]; var pt3 = pt0[2]; var cca = pt1.charAt(0)+pt2.charAt(0); //Current Chosen Appendage ssa = -8; //pause an extra 8 seconds before next spin } else { do { var pt1 = whl[Math.floor(Math.random()*2)]; var pt2 = whl[Math.floor(Math.random()*2)+2]; //array offset 2 var pt3 = whl[Math.floor(Math.random()*4)+4]; //array offset 4 var cca = pt1.charAt(0)+pt2.charAt(0); //Current Chosen Appendage } while (cbp[cca]==pt3.charAt(0)||cca==lma); } cbp[cca] = pt3.charAt(0); lma = cca; var pt4 = (spn>1)?'s':'', pt4 = (spn)?' ['+spn+' spin'+pt4+' remaining]':''; cb.chatNotice('*** '+pt1+spc+spc+spc+pt2+spc+spc+spc+pt3+' ***'+pt4,'',clr[pt3],'','bold'); } if (spn) cb.setTimeout(spinWheel,1000); } function counter() { if (++ssa&&ssa%cb.settings.ris==0) { //request tokens if X seconds since activity if (psd) cb.chatNotice('*** Twister is currently paused. Waiting for broadcaster to type /pause to resume gameplay.'); else cb.chatNotice('Tip *'+cb.settings.cst+' tokens* to spin the Twister wheel!'); } cb.setTimeout(counter,1000); } // cb.chatNotice('*** ATTENTION *** you or a moderator may type /pause at any time to pause the spins (such as after falling if you need a second to recuperate).',cb.room_slug) counter();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.