Bots Home
|
Create an App
hush
Author:
hornyjason69
Description
Source Code
Launch Bot
Current Users
Created by:
Hornyjason69
/*bourbaki me fecit*/(function(){var g=parseInt,h=Infinity,k="prototype";function l(a){return void 0!==a} function m(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object[k].toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; else if("function"==b&&"undefined"==typeof a.call)return"object";return b};function n(a){return"true"===(""+a).toLowerCase()};function q(a){this.q=a||"";this.k=r;this.u=[]}var r={g:"normal",i:"#000000",h:"#ffffff"};q[k].send=function(a,b){s(this,this.u.join("\n"),a,b||this.k);this.u=[]};function t(a,b,c,d,e){b=d?b:""!=a.q?"["+a.q+"] "+b:b;s(a,b,c,e||a.k)} function s(a,b,c,d){var e="",f;if(l(c))if("number"==typeof c)switch(c){case 0:e=cb.room_slug;break;case 1:f="red";break;case 2:e="";break;case 3:f="lightblue";break;case 4:f="darkblue";break;case 5:f="lightpurple";break;case 6:f="darkpurple";break;case 7:f="green"}else e=""+c;var p=a.k;a=p.g;c=p.i;p=p.h;l(d)&&(l(d.g)&&(a=d.g),l(d.i)&&(c=d.i),l(d.h)&&(p=d.h));cb.sendNotice(b,e,p,c,a,f)};function u(a,b){for(var c=a.split("%s"),d="",e=Array[k].slice.call(arguments,1);e.length&&1<c.length;)d+=c.shift()+e.shift();return d+c.join("%s")};var v=Array[k],w=v.forEach?function(a,b,c){v.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e="string"==typeof a?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)};function x(a,b,c){for(var d in a)b.call(c,a[d],d,a)};var y=2147483648*Math.random()|0;function z(){this.w=this.C=this.B=this.A=this.D=!1;this.G={}}z.K=function(){return z.F?z.F:z.F=new z}; z[k].H=function(a){w(Array[k].slice.call(arguments,0),function(a){switch(a){case "t":this.D||(this.D=!0,cb.onTip(this.o.bind(this,"t")));break;case "m":this.A||(this.A=!0,cb.onMessage(this.o.bind(this,"m")));break;case "re":this.B||(this.B=!0,cb.onEnter(this.o.bind(this,"re")));break;case "rp":this.C||(this.C=!0,cb.onLeave(this.o.bind(this,"rp")));break;case "dp":this.w||(this.w=!0,cb.onDrawPanel(this.o.bind(this,"dp")))}},this)}; z[k].o=function(a,b){x(this.G,function(c){null!=c&&c.type==a&&c.J.call(c.I||this,b)},this)};function A(a,b){var c=B.v,d=B,e="brbki_"+y++,f={type:a,J:b};d&&(f.I=d);c.G[e]=f};var C=/#(.)(.)(.)/;function D(a){if(!E.test(a))throw Error("'"+a+"' is not a valid hex color");4==a.length&&(a=a.replace(C,"#$1$1$2$2$3$3"));a=a.toLowerCase();return[g(a.substr(1,2),16),g(a.substr(3,2),16),g(a.substr(5,2),16)]}function F(a,b,c){a=Number(a);b=Number(b);c=Number(c);if(isNaN(a)||0>a||255<a||isNaN(b)||0>b||255<b||isNaN(c)||0>c||255<c)throw Error('"('+a+","+b+","+c+'") is not a valid RGB color');return"#"+G(a.toString(16))+G(b.toString(16))+G(c.toString(16))}var E=/^#(?:[0-9a-f]{3}){1,2}$/i; function G(a){return 1==a.length?"0"+a:a}function H(a,b,c){c=Math.min(Math.max(c,0),1);return[Math.round(c*a[0]+(1-c)*b[0]),Math.round(c*a[1]+(1-c)*b[1]),Math.round(c*a[2]+(1-c)*b[2])]};function I(){this.v=z.K();var a=this.t=new q,b={g:"bold"};l(b.i)&&(a.k.i=b.i);l(b.h)&&(a.k.h=b.h);l(b.g)&&(a.k.g=b.g);this.e=new q("whispers");this.d=J;this.s={}}var aa=/^\/w(\w+)\s?(.+)?/,K=/^\/w\s(.+)/,L={O:"add",S:"del",Q:"mread",R:"mwrite",P:"m"};function M(a,b){var c=""+b.user,d=n(b.is_mod),c=c==cb.room_slug,e=["/w"];(c||d)&&e.push("/wm");if(c||d&&a.d.j)e.push("/wadd"),e.push("/wdel");c&&(e.push("/wmread"),e.push("/wmwrite"));return e}function N(a,b,c){return-1!=M(a,c).indexOf("/w"+b)} function O(a,b){a.r(ba,""+b.user);P(a,b)} I[k].M=function(a,b,c){var d=[];l(c)&&(d=c.trim().split(/\s+/));switch(b){case "m":N(this,"m",a)?(b=""+a.user,0!=d.length?Q(this,""+d.join(" "),b,1):R(this,S,""+a.user)):O(this,a);break;case "add":N(this,"add",a)?(b=d.length,1==b?this.add(h,d[0],a):2==b?(b=g(d[1],10),"number"==typeof b&&0<b&&this.add(b,d[0],a)):R(this,ca,""+a.user)):O(this,a);break;case "del":N(this,"del",a)?1==d.length?(d=d[0],b=""+a.user,a=n(a.is_mod),c=!1,b==cb.room_slug?c=!0:a&&(this.d.j?c=!0:this.r("Error - The host has not allowed moderators to add/remove whispers from other users.", b)),c&&(d==cb.room_slug||(this.s[d]=0),a=u("%s removed all whispers from %s",b,d),b=T,t(this.e,a,0,!1,b),t(this.e,a,1,!1,b),a=u("@%s Whispers removed. All your whispers are belong to us.",d),this.l(a,d,T))):R(this,da,""+a.user):O(this,a);break;case "mread":N(this,"mread",a)?(a=!this.d.n,this.d.n=a,a=u(ea,!0===a?"enabled":"disabled",a?"disable":"enable"),this.l(a,cb.room_slug)):O(this,a);break;case "mwrite":N(this,"mwrite",a)?(a=!this.d.j,this.d.j=a,a=u(fa,!0===a?"enabled":"disabled",a?"disable":"enable"), this.l(a,cb.room_slug)):O(this,a);break;default:O(this,a)}}; var ga=u("Type %s MSG to whisper MSG to the room host. Ex: %s Hi cutie!","/w","/w"),S=u("Type %s MSG to whisper MSG to the room moderators. Ex: %s I'll brb!","/wm","/wm"),ca=u("Type %s USER N to give USER N whispers. Ex: %s gooduser123 5","/wadd","/wadd"),da=u("Type %s USER to delete all whispers from USER. Ex: %s baduser69","/wdel","/wdel"),ea="Read whispers by moderators is now %s. Type /wmread to %s",fa="Add/remove whispers by moderators is now %s. Type /wmwrite to %s",ba="Error - Unrecognized command."; function R(a,b,c){"array"==m(b)?(w(b,function(a){var b=this.e;a=""!=b.q?"["+b.q+"] "+a:a;b.u.push(a)},a),a.e.send(c,U)):t(a.e,""+b,c,!1,U)}function P(a,b){var c=""+b.user,d=[];c==cb.room_slug?d.push(S):d.push(ga);var e=M(a,b).join(" ");d.push(u("Available commands: %s",e));R(a,d,c)}function V(a){var b=l(void 0)?void 0:.8;a=D(a);b=H([0,0,0],a,b);return F(b[0],b[1],b[2])}function W(a,b){var c=l(b)?b:.5,d=D(a),c=H([255,255,255],d,c);return F(c[0],c[1],c[2])} var X={h:W("#90ee90"),i:V("#90ee90"),g:"normal"},T={h:W("#ffb6c1"),i:V("#ffb6c1"),g:"normal"},Y={h:W("#87cefa",.65),i:V("#87cefa"),g:"normal"},U={h:"#fafad2",i:V("#fafad2"),g:"bold"};I[k].l=function(a,b,c){t(this.e,a,b,!1,c)};I[k].r=I[k].l; var J={p:!0,n:!0,j:!0},ha={name:"a",type:"choice",choice1:"Yes",choice2:"No",defaultValue:J.p?"Yes":"No",label:"Moderators have unlimited whispers"},ia={name:"b",type:"choice",choice1:"Yes",choice2:"No",defaultValue:J.n?"Yes":"No",label:"Moderators can read all whispers"},ja={name:"c",type:"choice",choice1:"Yes",choice2:"No",defaultValue:J.j?"Yes":"No",label:"Moderators can add or remove whispers"};function Z(a,b){var c=a.s;return c.hasOwnProperty(b)?c[b]:0} function $(a,b,c){var d=a.s,e=0;d.hasOwnProperty(b)&&(e=d[b]);a.s[b]=e+("number"==typeof c?c:h)} I[k].add=function(a,b,c){var d;if(l(c)){d=""+c.user;c=n(c.is_mod);var e=!1;d==cb.room_slug?e=!0:c&&(this.d.j?e=!0:this.r("Error - The host has not allowed moderators to add/remove whispers from other users.",d))}else d="The app",e=!0;e&&($(this,b,a),d=l(d)?d:"App",d=u("%s granted %s whispers to %s",d,a===h?"unlimited":""+a,b),t(this.e,d,0,!1,X),t(this.e,d,1,!1,X),b!=cb.room_slug&&(d=Z(this,b),a=u("@%s You were given %s whispers (quota: %s). For help, type: /w",b,a==h?"unlimited":""+a,d==h?"\u221e": ""+d),this.l(a,b,X)))};function Q(a,b,c,d){d=l(d)?d:cb.room_slug;var e=a.d.n;d==cb.room_slug&&(e=e?u(":wspc %s: %s",c,b):u(":wspc %s whispered.",c),t(a.e,e,1,!1,Y));b=u(":wspc %s: %s",c,b);t(a.e,b,d,!1,Y);$(a,c,-1);b=Z(a,c);b=u("@%s Whisper sent and hidden from public view. (quota: %s)",c,b==h?"\u221e":""+b);a.l(b,c,Y)}I[k].N=function(a){var b=""+a.user;n(a.is_mod)&&this.d.p&&Z(this,b)<h&&this.add(h,b)}; I[k].L=function(a){var b=""+a.user,c=""+a.m;n(a.is_mod)&&this.d.p&&Z(this,b)<h&&this.add(h,b);var d;if(0==c.lastIndexOf("/w",0)){if(0<Z(this,b)){d=c.match(aa);var e;if(e=d){e=[];var f=0,p;for(p in L)e[f++]=L[p];e=-1!=e.indexOf(d[1])}e?this.M.call(this,a,d[1],d[2]):K.test(c)?Q(this,c.match(K)[1],b):P(this,a)}else this.r("Error - Cannot whisper. Your quota is empty or disallowed.",b);a["X-Spam"]=!0}return a};cb.settings_choices=[ha,ia,ja];var B=new I;B.d.p="yes"===(""+cb.settings.a).toLowerCase();B.d.n="yes"===(""+cb.settings.b).toLowerCase();B.d.j="yes"===(""+cb.settings.c).toLowerCase();B.add(h,cb.room_slug);B.v.H("m","re");A("m",B.L);A("re",B.N);t(B.t,"Whispers is running. For available commands, type: /w",0);t(B.t,"Whispers is running. For available commands, type: /w",1);})();
© Copyright Chaturbate 2011- 2026. All Rights Reserved.