Apps Home
|
Create an App
Dime Throwing App
Author:
bigpapi1469
Description
Source Code
Launch App
Current Users
Created by:
Bigpapi1469
// startof CBSv2 module - not for re-compilation (function(a,h){function f(a){this.message=a}f.prototype=Error();f.prototype.name="InvalidCharacterError";a.btoa||(a.btoa=function(a){a=String(a);for(var g,b,m=0,d=h,q="";a.charAt(m|0)||(d="=",m%1);q+=d.charAt(63&g>>8-m%1*8)){b=a.charCodeAt(m+=.75);if(255<b)throw new f('"btoa" failed: The string to be encoded contains characters outside of the Latin1 range.');g=g<<8|b}return q});a.atob||(a.atob=function(a){a=String(a).replace(/=+$/,"");if(1==a.length%4)throw new f('"atob" failed: The string to be decoded is not correctly encoded.'); for(var g=0,b,m,d=0,q="";m=a.charAt(d++);~m&&(b=g%4?64*b+m:m,g++%4)?q+=String.fromCharCode(255&b>>(-2*g&6)):0)m=h.indexOf(m);return q})})("undefined"===typeof exports?this:exports,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="); (function(a){var h=cb.onMessage,f=null,p=null,g,b="#"+(cb.settings.hasOwnProperty("slot")?cb.settings.slot:"")+"CBSv2",m=/^\/#[0-3]CBSv2\//;cb.onMessage=function(d){if("function"!==typeof d)throw new TypeError(d+" is not a function");h(function(h){var e=h.m.replace(/\s*/g,"").split("/"),k,r;3<e.length&&""===e[0]&&e[1]===b?(f&&p&&h.user===cb.room_slug&&(k=e[2],4===e.length?(e[3]="?",h.m=e.join("/")):6===e.length?((g||{}).hasOwnProperty(k)||(r=f(),g={},g[k]=a.btoa(a.unescape(a.encodeURIComponent(r))), r||cb.log("onSave returned no data.")),g.hasOwnProperty(k)&&(r=parseInt(e[3],10),k=g[k].slice(r,r+512),e[4]=k,e[5]=k.length,h.m=e.join("/"))):7===e.length&&("0"===e[3]&&(g={},g[k]=""),g.hasOwnProperty(k)&&(e[3]=g[k].length,e[6]=e[4].length,h.m=e.join("/"),e[4]?g[k]+=e[4]:(r=a.decodeURIComponent(a.escape(a.atob(g[k]))),p(r),cb.sendNotice("Previously Saved Data Restored.",cb.room_slug))))),h["X-Spam"]=!0):m.test(h.m)&&(h["X-Spam"]=!0);return d(h)});return d};cb.onRestore=function(a){if("function"!== typeof a)throw new TypeError(a+" is not a function");return p=a};cb.onSave=function(a){if("function"!==typeof a)throw new TypeError(a+" is not a function");return f=a};cb.onMessage(function(a){return a})})("undefined"===typeof exports?this:exports); // endof CBSv2 module - not for re-compilation var v=function(){function G(){var a=0,b=0;return{g:function(){return a},f:function(){return b},C:function(c){a+=c;b++}}}function K(a){a=/^\d+$/.exec(a.replace(/^\s+|\s+$/g,""));null!==a&&(a=Number(a[0]));return a}function S(a){return null===a?"--":12<a.length?a.substring(0,11)+"\u2026":a}function t(a,b){a=a||0;return a.toString()+" "+(1===a?b:b+"s")}function L(a){return null===a?"--":(null===a?"--":t(k[a].g(),"tkn"))+" in "+(null===a?"--":t(k[a].f(),"tip"))}function aa(a,b,c){return c.indexOf(a)=== b}function C(a,b){cb.setTimeout(a,1E3>b?1E3:b)}function d(a){if(a&&"string"===typeof a){d.hasOwnProperty("log")||(d.log=[]);var b=/(..)(:..)(:..)/.exec(new Date),c=b[1]%12||12;d.log.push((10>c?"0"+c:c)+b[2]+b[3]+" "+(12>b[1]?"A":"P")+"M : "+a);25<d.log.length&&d.log.shift();a=("Papi's: "+a).replace(/\+/g,"\uff0b").replace(/&/g,encodeURIComponent("&"))}d.hasOwnProperty("log")||cb.log(a.replace(/(\r\n|\n|\r|\\n)/gm," ").trim())}function M(a){var b=Array.prototype.slice.call(arguments), c,T=0,d;a&&"string"===typeof a&&("Enable"===cb.settings.multi_line_safe&&(c=a.split(/ *\n */),T=c.length,a=c[0]),b[0]=("Papi's: "+a.replace(/\+/g,"\uff0b")).replace(/&/g,encodeURIComponent("&")));cb.chatNotice.apply(cb,b);for(d=1;d<T;d++)b[0]=c[d].replace(/\+/g,"\uff0b").replace(/&/g,encodeURIComponent("&")),cb.chatNotice.apply(cb,b)}function l(a,b){var c=Array.prototype.slice.call(arguments);b&&"string"===typeof b&&b.length&&(c[0]=""+a,M.apply(ba,c))}function ca(a,b){function c(a){a= a.replace(/^#/,"");6>a.length&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]);a=parseInt(a,16);return[a>>16,a>>8&255,a&255]}function d(a,b,e){b/=100;a=c(a);a.forEach(function(a,c,d){d[c]=Math.round(a*b)+Math.round(e*(1-b));255<d[c]&&(d[c]=255)});return"#"+(16777216+a[2]+256*a[1]+65536*a[0]).toString(16).substr(1)}function k(a){a=c(a);return(299*a[0]+587*a[1]+114*a[2])/1E3}function l(a,c){var b=k(a),e=k(c);return Math.abs(b-e)}function n(a,b){var e=c(a),d=c(b);return Math.abs(e[0]-d[0])+Math.abs(e[1]-d[1])+Math.abs(e[2]- d[2])}var h,g,e,m,f;for(h=100;-1<h&&!(g=d(a,h,0),e=d(a,h,255),m=l(g,b),f=l(e,b),f>m&&(g=e,m=f),f=n(g,b),126<m&&500<f);h--);return g}function y(){var a=cb.settings.goal-cb.settings.tipped;0>a&&d("Unexpected result: tipped > cb.settings.goal");a=m===h.a?"....and here we gooooo!!! - Tip to chat and for "+N:" "+N+" ["+a+" token"+(1!==a?"s":"")+" remaining]";U!==a&&(d("Changing subject to: "+a),cb.changeRoomSubject(a),U=a)}function w(){var a,b;a=z*cb.settings.goal+cb.settings.tipped;m===h.a?(b=null!==A? Math.floor(((new Date).valueOf()-A)/1E3):0,b=cb.settings.timeout-b,6>b?(f.template="3_rows_11_21_31",f.row1_value="Wall ends in\u2026",f.row2_value=b.toString(),f.row3_value="seconds."):(f.template="3_rows_of_labels",f.row1_label="Rec'd / Goal (Total):",f.row1_value=cb.settings.tipped.toString()+" / "+cb.settings.goal+" ("+a+")",f.row2_label="King of the Wall:",f.row2_value=S(p)+" ("+(null===p?"--":t(k[p].g(),"tkn"))+")",f.row3_label="Master Builder:",f.row3_value=S(q)+" ("+(null===q?"--":t(k[q].f(), "tip"))+")")):(null!==H?(b=Math.floor(((new Date).valueOf()-H)/6E4),b=60>b?t(b,"minute")+" ago":"> 1 hour ago"):b="Never",f.template="3_rows_of_labels",f.row1_label="Rec'd / Goal (Total):",f.row1_value=cb.settings.tipped.toString()+" / "+cb.settings.goal+" ("+a+")",f.row2_label="Goal Reached:",f.row2_value=t(z,"time"),f.row3_label="Last Reached:",f.row3_value=b)}function V(){m=h.h;q=p=null;k={};w();cb.drawPanel();y()}function I(){var a=[],b=null!==A?Math.floor(((new Date).valueOf()-A)/1E3):0,c=""; d("timeout_count:"+b);b>cb.settings.timeout?(d("wall timed-out"),c+="Wall finished.",m===h.a&&(Object.keys(k).forEach(function(b){b!==p&&b!==q&&a.push(b)}),a.length&&(c+="\nThanks to the following contributor"+(1===a.length?"":"s")+", "+a.join(", ")+"."),p!==q?c+="\nPapi Thank, "+q+", who contributed "+L(q)+".\n King of the Dime Wall, "+p+", who contributed "+L(p)+".":null!==p&&(c+="The King of Papi's Dime Throwing Wall, "+p+", who contributed "+ L(p)+".")),M(c,"","#d5ebf8"),V()):m===h.i&&b>x.b.l?(d("subject_update timed-out"),y(),C(I,J)):m!==h.h&&C(I,J);w();cb.drawPanel()}function W(){C(I,J);m=h.i;w();cb.drawPanel()}function X(){m!==h.i&&C(I,J);m=h.a;y();w();cb.drawPanel()}function Y(){w();cb.drawPanel();C(Y,6E4)}function Z(a){if(m===h.a)l("sorry!! can't set a new goal description during a Dime Throwing wall.",cb.room_slug,"#f2f9fd");else{a=(a||cb.settings.goal_description||"").trim();for(var b=/\\u([0-9a-f]{4})/gi,c,d=[];null!==(c=b.exec(a));)d.push(c[1]); if(d.length)for(d=d.filter(aa),b=0,c=d.length;b<c;b++)a=a.replace(new RegExp("\\\\u"+d[b],"gi"),String.fromCharCode(parseInt(d[b],16)));1>a.length?l("error!! new goal description missing!",cb.room_slug,"#f2f9fd"):(N=a,l("goal description: "+a,cb.room_slug,"#f2f9fd"),y())}}function O(a){for(;cb.settings.tipped>=cb.settings.goal;)H=new Date,z++,cb.settings.tipped-=cb.settings.goal,a&&cb.settings.tipped<cb.settings.goal&&a()}function B(a){var b=(new Date).valueOf(),c=a.m,f=a.user,p="rubzombie"===f,q= f===cb.room_slug,n=a.is_mod,t=a.hasOwnProperty("is_pm")&&a.is_pm,g=/\/(yellowwall|yw|#[0-3])?(activate|fans|goal|help|mods|prime|reset|slice|text|timeout)\s*([^\/]*)/ig,e,u;if(D)if(q||n){if(/\/(sh|sphammer|#[0-3])?(english|enonly|sphammered)/i.test(c)||/\/(sh|sphammer)(help|spam)/i.test(c))D=!1,d("SpamBlockerAd: SpHammer detected");/\/(ngs|nogreyspammers)(help|spam|\?)/i.test(c)&&(D=!1,d("SpamBlockerAd: No Grey Spammers detected"))}else/<<<( has been SPAM HAMMERED| spHammer hit#)/.test(c)&&"#595959"=== a.background&&"#999999"===a.c&&(D=!1,d("SpamBlockerAd: SpHammer detected"));if(q&&!a["X-Spam"]&&"/"===c.trim()[0])for(n="";null!==(e=g.exec(c));)if(u=(e[1]||"yw").toLowerCase(),"yw"===u||"yellowwall"===u||u===P)switch(a["X-Spam"]=!0,u=e[3],e=e[2].toLowerCase(),e){case "goal":e=u;m===h.a?l("sorry!! can't set a new goal amount during a Dime Throwing wall.",cb.room_slug,"#f2f9fd"):void 0===e?l("error!! usage /goal new_goal_amount",cb.room_slug,"#f2f9fd"):(e=K(e),null===e||1>e?(d(e),l("error!! new goal amount invalid value!", cb.room_slug,"#f2f9fd")):(cb.settings.goal=e,l("goal amount: "+e,cb.room_slug,"#f2f9fd"),z=cb.settings.tipped=0,H=null,l("received tokens auto-reset!",cb.room_slug,"#f2f9fd"),w(),cb.drawPanel(),y()));break;case "help":p&&(n+="version: 2014/12/25.0\nAKA The Great Wall of Dime Throwing . Dime Throwers must keep chucking dimes to stop non-tippers from chatting.\nDime Throwing Wall of Chat: ");n+="Help:\nIn-chat commands:\n\u00a0\u00a0/goal num - set goal to num tokens\n\u00a0\u00a0/text str - set goal description to str\n\u00a0\u00a0/timeout sec - set wall timeout to sec seconds ("+ x.b.l+".."+x.b.s+")\n\u00a0\u00a0/reset [num] - reset received tokens (to num)\n\u00a0\u00a0/fans - toggle fan chat amnesty mode on and off\n\u00a0\u00a0/mods - toggle mod chat amnesty mode on and off\n";n+="\u00a0\u00a0/help - show this help message\n";l(n,f,"#f2f9fd");break;case "text":Z(u);break;case "timeout":e=u;m===h.a?l("sorry!! can't set a new timeout during a Dime Throwing wall.",cb.room_slug,"#f2f9fd"):void 0===e?l("error!! usage /timeout new_timeout_seconds",cb.room_slug,"#f2f9fd"):(e=K(e),null=== e||e<x.b.l||e>x.b.s?(d(e),l("error!! new timeout seconds invalid value!",cb.room_slug,"#f2f9fd")):(cb.settings.timeout=e,l("wall timeout: "+e,cb.room_slug,"#f2f9fd")));break;case "reset":e=u;m===h.a?l("sorry!! can't (re)set the received amount during a Dime Throwing wall.",cb.room_slug,"#f2f9fd"):(e=K(e)||0,cb.settings.tipped=e,l("received amount: "+e,cb.room_slug,"#f2f9fd"),z=0,H=null,O(),w(),cb.drawPanel(),y());break;case "slice":l("sorry!! this is a development only option.",cb.room_slug,"#f2f9fd");break; case "activate":m===h.a?l("sorry!! can't activate an active Dime Throwing wall.",cb.room_slug,"#f2f9fd"):(A=new Date,X());break;case "prime":m!==h.h?l("sorry!! can't prime Dime Throwing wall from a non-idle state.",cb.room_slug,"#f2f9fd"):(A=new Date,W());break;case "fans":E=!E;l("Fan amnesty mode "+(E?"enabled":"disabled")+". Type /fans again to "+(E?"disable it.":"allow non-contributing fan chat during a Dime Throwing wall."),cb.room_slug,"#f2f9fd");break;case "mods":F=!F,l("Mod amnesty mode "+(F?"enabled":"disabled")+ ". Type /mods again to "+(F?"disable it.":"allow non-contributing mod chat during a Dime Throwing wall."),cb.room_slug,"#f2f9fd")}if(!q&&!a["X-Spam"]&&!t&&D){p=c.replace(/[\W_]/g,"").toLowerCase();t=p.replace(/[aeiou]/g,"");n=e=!1;g=f.replace(/_[0-9a-f]+/ig,"");B.hasOwnProperty("echo_user")&&B.hasOwnProperty("echo_text")&&(n=B.echo_text===c&&B.echo_user===g);B.echo_user=g;B.echo_text=c;!0===(e=n)&&d("SpamBlockerAd: echo match");g=0;for(n=r.o.length;!e&&g<n&&!(t.length<r.o[g].length);g++)!0===(e=-1!==t.indexOf(r.o[g]))&& d("SpamBlockerAd: simple match ("+g+"): "+r.o[g]);g=0;for(n=r.text.length;!e&&g<n;g++)!0===(e=r.text[g].test(c))&&d("SpamBlockerAd: text match ("+g+"): "+r.text[g].source);g=0;for(n=r.v.length;!e&&g<n;g++)!0===(e=r.v[g].test(p))&&d("SpamBlockerAd: plain match ("+g+"): "+r.v[g].source);g=0;for(n=r.u.length;!e&&g<n;g++)!0===(e=(new RegExp("(?:^|\\s):"+r.u[g]+"(?=\\s|$)","")).test(c))&&d("SpamBlockerAd: blacklist emoticons match ("+g+"): "+r.u[g]);e&&(l(["Message from the author:\n\u00a0\u00a0Thanks for using my "+ (Q?"app":"bot")+" :)\n\u00a0\u00a0By the way, user "+f+" has just spammed your chat!\n\u00a0\u00a0To stop them doing it again, launch my spam blocker, No\u00a0Grey\u00a0Spammers.\n\u00a0\u00a0See this "+(Q?"app":"bot")+"'s Description for a link ;)","End of Message"].join("\nPapi's World of Dime Throwing: "),cb.room_slug,"#f37e7e"),D=!1)}m!==h.i||q||k[f]?m===h.a&&(q||k[f]||E&&a.in_fanclub||F&&a.is_mod?(d("Wall chat from: "+f),a.background="#ffff00",a.c=R.hasOwnProperty(a.c)?R[a.c]:R[a.c]=ca(a.c,a.background)): (a["X-Spam"]=!0,d("Wall chat from non-contributor: "+f+" suppressed."),a.m="*** Sorry, Dime Throwing Wall in progress - Tip to chat. ***")):(d("Wall unprimed by: "+f),V());d("onMessage: "+((new Date).valueOf()-b)+"ms");return a}var x={w:!1,A:!1,b:{B:10,s:60,l:5}},h={h:0,i:1,a:2},r={text:[/[^\u0000-\u0080\u00ad\u2605\u2606\u2654\u2655\u265a\u265b]/],v:[],o:"dlnws mcmcm rtmnt chnskv cht4fr frtkns wgwgwg bst4cms httpggl lv4prty lvtrffn nd4strp prfllsn bnjknntt kkmlvlns nsxyjngs pssy4shw vcmsssns wlchstdt 100kstnls chnnmnwhr cmsssnscm grls4prty llgcmdtcm prmmchtcm rgclsngsn sndtdrtch tknsgnrtr tmrqrllh1 tpgmscrck bfrtsptchd glsmtrprtl mnhndynmmr schnmnprfl schtglbntr snddrtchlv wwwsxchtsr knntjmlgckn lslsnndmldn stdchlngwlg strmngnkdcm wtchmcmgrls chbnnjngsgls dtschmtrprtl fndfrtknshck hrgldtschkrl pyplrwstrnnn schfdsmwgdch wsnddglnpmml wstrnnnrpypl jckjxshrngnds kstnlsndhnrsk llrdngsnchthr mncmstjtztchn wndmrmnfrrlds dknnmnglbwchsn mprdndstrngtrk n1gnhmpgstfrtg chtwththswsmgrl stdnglchnnmnwhr wnnjrktwthmfrfr fsllnghtpcsndvds dsthtdstwchmmrsnd hbknfnnzllnntrssn nrnchbzckmtdntpps schfcktrffnndcmsx fdrstdnglchnnmnwhr llnfssthnmprflvnmr nynwnnjrktwthmfrfr vrllmsndfstnrdtsch glbdgbtsgrnchtmhrdr snddwskstnlsndglrst wsnddnnnndglndtschn chtrbtknnmndchvrgssn ftzstmgglndbrchtshrt mchvrdrcmllswshrwllt nynhrdrmstfckldrmlfs chtrbttknsddrblgsptcm mchnchtlngwrtnndkmmzmr wrbckhtknnmchdjmlbschn kstnlsdtngprtlndtschlnd ntrssntbrmchfndstdnmnmprfl wnnjschtnmnprflndkntktrtmchdrt hbthrgntlchdhlfschlgschffthrvlldtn thsmnstrlysnfbtchsllngthmtfhsgrlfrnd dspmmrsndnfchzdmmvnjdmmdwrdnsgbnntndnsnstnflltdchknrfsnbldsnngwrbngrn".split(" "), u:"anarchy dance69 endlesspoop exbf extremevomit extremevomit2 extremevomitscat FISTING fuckass1 gape420 gay gay6 gaybj gayfuck2 gayfuck5 gaysuck2 goats3 gross kena kisshug55 kisshug56 kisshug57 powerbottom prolapse56 prolapse57 prolapse58 shit50 shit55 shithead takeit tubgirl3 vbutt wag".split(" ")},ba=this,P=null,Q,N="",z=0,H=null,A=null,m=h.h,J=1E3,k={},p=null,q=null,U="",E=x.w,F=x.A,f={template:"3_rows_11_21_31",row1_label:"...",row1_value:"Papi's Dime Throwing Wall of Chat",row2_label:"...",row2_value:"...", row3_label:"...",row3_value:"..."},R={},D=!0;return{j:x,D:function(){d("version: 2014/12/25.0");cb.settings.hasOwnProperty("slot")&&(P="#"+cb.settings.slot);Q="#0"===P;O();Z(cb.settings.goal_description);y();E="Yes"===cb.settings.famnesty;F="Yes"===cb.settings.mamnesty;C(Y,6E4)},onMessage:B,F:function(a){var b=A=new Date,c=a.from_user,f=k[c]||new G;cb.settings.tipped+=a.amount;O(function(){var a=["th","st","nd","rd"],b=z%100;M("Goal was reached for the "+(z+(a[(b-20)%10]||a[b]||a[0]))+" time!","", "#d5ebf8")});f.C(a.amount);k[c]=f;if(!p||p&&(k[p].g()<k[c].g()||k[p].g()===k[c].g()&&k[p].f()>k[c].f()))p=c;if(!q||q&&(k[q].f()<k[c].f()||k[q].f()===k[c].f()&&k[q].g()<k[c].g()))q=c;m===h.h?(W(),d("wall idle -> wall primed")):m===h.i?(X(),d("wall primed -> wall active")):(w(),cb.drawPanel(),d("wall active"));d("onTip: "+((new Date).valueOf()-b)+"ms")},G:f}}(); cb.settings_choices=[{defaultValue:100,label:"How Much Cash You Need?",minValue:1,name:"goal",type:"int"},{label:"What are you promising the dime throwers?",maxLength:255,minLength:1,name:"goal_description",type:"str"},{defaultValue:v.j.b.B,label:"How many seconds until the Dime Throwing Wall Ends?",maxValue:v.j.b.s,minValue:v.j.b.l,name:"timeout",type:"int"},{defaultValue:0,label:"Dime Throwing Starting Point",minValue:0,name:"tipped",required:!1,type:"int"},{choice1:"Yes",choice2:"No",defaultValue:v.j.w?"Yes":"No",label:"Allow non-contributing fans to chat during a Dime Throwing Wall", name:"famnesty",required:!1,type:"choice"},{choice1:"Yes",choice2:"No",defaultValue:v.j.A?"Yes":"No",label:"Allow non-contributing mods to chat during a Dime Throwing Wall",name:"mamnesty",required:!1,type:"choice"},{choice1:"Enable",choice2:"Disable",defaultValue:"Disable",label:"(Multi-line Safe Mode)",name:"multi_line_safe",type:"choice"}];cb.onDrawPanel(function(){return v.G});cb.onMessage(function(G){return v.onMessage(G)});cb.onTip(function(G){v.F(G)});v.D();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.