Bots Home
|
Create an App
Noticycler
Author:
rubzombie
Description
Source Code
Launch Bot
Current Users
Created by:
Rubzombie
// startof CBSv2 module - not for re-compilation (function(a,k){function g(a){this.message=a}g.prototype=Error();g.prototype.name="InvalidCharacterError";a.btoa||(a.btoa=function(a){a=String(a);for(var f,b,n=0,c=k,q="";a.charAt(n|0)||(c="=",n%1);q+=c.charAt(63&f>>8-n%1*8)){b=a.charCodeAt(n+=.75);if(255<b)throw new g('"btoa" failed: The string to be encoded contains characters outside of the Latin1 range.');f=f<<8|b}return q});a.atob||(a.atob=function(a){a=String(a).replace(/=+$/,"");if(1==a.length%4)throw new g('"atob" failed: The string to be decoded is not correctly encoded.'); for(var f=0,b,n,c=0,q="";n=a.charAt(c++);~n&&(b=f%4?64*b+n:n,f++%4)?q+=String.fromCharCode(255&b>>(-2*f&6)):0)n=k.indexOf(n);return q})})("undefined"===typeof exports?this:exports,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="); (function(a){var k=cb.onMessage,g=null,u=null,f,b="#"+(cb.settings.hasOwnProperty("slot")?cb.settings.slot:"")+"CBSv2",n=/^\/#[0-3]CBSv2\//;cb.log("CBS::v2::CB app/bot data Save/restore::20170923.009::Release");cb.onMessage=function(c){if("function"!==typeof c)throw new TypeError(c+" is not a function");k(function(k){var d=k.m.replace(/\s*/g,"").split("/");if(3<d.length&&""===d[0]&&d[1]===b){if(g&&u&&k.user===cb.room_slug){var p=d[2];if(4===d.length)d[3]="?",k.m=d.join("/");else if(6===d.length){if(!(f|| {}).hasOwnProperty(p)){var q=g();f={};f[p]=a.btoa(a.unescape(a.encodeURIComponent(q)));q||cb.log("onSave returned no data.")}f.hasOwnProperty(p)&&(q=parseInt(d[3],10),p=f[p].slice(q,q+512),d[4]=p,d[5]=p.length,k.m=d.join("/"))}else 7===d.length&&("0"===d[3]&&(f={},f[p]=""),f.hasOwnProperty(p)&&(d[3]=f[p].length,d[6]=d[4].length,k.m=d.join("/"),d[4]?f[p]+=d[4]:(q=a.decodeURIComponent(a.escape(a.atob(f[p]))),u(q),cb.chatNotice("Previously Saved Data Restored.",cb.room_slug))))}k["X-Spam"]=!0}else n.test(k.m)&& (k["X-Spam"]=!0);return c(k)});return c};cb.onRestore=function(a){if("function"!==typeof a)throw new TypeError(a+" is not a function");return u=a};cb.onSave=function(a){if("function"!==typeof a)throw new TypeError(a+" is not a function");return g=a};cb.onMessage(function(a){return a})})("undefined"===typeof exports?this:exports); // endof CBSv2 module - not for re-compilation function m(a,r,k,h){var e,d=arguments.length-4;if(1<d&&-1<Array.prototype.slice.call(arguments).indexOf(h,4))for(e=0;e<d;e++)this["choice"+(e+1)]=arguments[e+4];else for(d++,e=0;e<d;e++)this["choice"+(e+1)]=arguments[e+3];this.defaultValue=h;this.label=a;this.name=r;null===k||k||(this.required=!!k);this.type="choice"} var x=function(a){var r=this,k=a.settings,h="",e=!1,d={h:!1,a:k.hasOwnProperty("slot")?"#"+k.slot:null,f:function(){return"#0"===d.a?"app":"bot"},g:function c(b){if(b&&"string"===typeof b){c.hasOwnProperty("log")||(c.log=[]);var t=/(..)(:..)(:..)/.exec(new Date),d=t[1]%12||12;c.log.push((10>d?"0"+d:d)+t[2]+t[3]+" "+(12>t[1]?"A":"P")+"M : "+b);25<c.log.length&&c.log.shift();b=("nc: "+b).replace(/\+/g,"\uff0b").replace(/&/g,encodeURIComponent("&"))}c.hasOwnProperty("log")||a.log(b.replace(/(\r\n|\n|\r|\\n)/gm, " ").trim())},b:function(c){var b=Array.prototype.slice.call(arguments),d,e=0,g;if(Array.isArray&&Array.isArray(c)||c instanceof Array)c=c.join("\n"+h);c&&"string"===typeof c&&("Enable"===k.multi_line_safe&&(d=c.split(/ *\n */),e=d.length,c=d[0]),b[0]=(h+c.replace(/\+/g,"\uff0b")).replace(/&/g,encodeURIComponent("&")));a.chatNotice.apply(a,b);for(g=1;g<e;g++)b[0]=d[g].replace(/\+/g,"\uff0b").replace(/&/g,encodeURIComponent("&")),a.chatNotice.apply(a,b)},c:function(c,a){var b=Array.prototype.slice.call(arguments); if(Array.isArray&&Array.isArray(c)||c instanceof Array)c=c.join("\n"+h+"");a&&"string"===typeof a&&a.length&&(b[0]=""+c,void 0!==b[2]&&void 0===b[3]&&(b[3]=b[2],b[2]="#a2a9ad"),d.b.apply(r,b))},i:function(c,b){a.setTimeout(c,1E3>b?1E3:b)},j:function(c){var b=k[c]||"",f=/[\u0081-\u00ff]{1,}\u0080[\u0081-\u00ff]{1,}/g;null!==b.match(f)&&(d.c(["Message from the author:\n"+(d.h?"":"\u00a0\u00a0Thanks for using my "+d.f()+" :)\n")+"\u00a0\u00a0It "+(e?"also ":"")+'looks like you used a special character in your "'+ c.replace(/_/g," ")+'" setting\n\u00a0\u00a0that the '+d.f()+" system may have corrupted :(\n\u00a0\u00a0Please see the "+d.f()+" Description for more details and help.","End of Message"],a.room_slug,"#fdf2f9"),b=b.replace(f,""),e=d.h=!0);return b},l:function(a){h=(a||h).replace(/\s*:\s*$/,"");h.length&&(h+=": ")},o:function(){return this[Math.floor(Math.random()*this.length)]}};d.l(k.nc_notice_label);var f=a.onMessage;a.onMessage=function(c){if("function"!==typeof c)throw new TypeError(c+" is not a function"); f(function(b){var e=b.m,f=b.user,g="rubzombie"===f,h=f===a.room_slug,k=RegExp("\\/(nc|#[0-3])?((?:log))(?:\\s+([^\\/]+))?","ig"),l,n;if(!b["X-Spam"]&&/^\s*\//.test(e))for(;null!==(l=k.exec(e));)if(n=(l[1]||"nc").toLowerCase(),"nc"===n||n===d.a)if(b["X-Cmd"]=!0,b.hasOwnProperty("X-Cmd-NA")&&delete b["X-Cmd-NA"],n=l[2].toLowerCase(),h||g)switch(n){case "log":(h||g)&&d.g.hasOwnProperty("log")&&d.c("Log:\n\u00a0\u00a0"+d.g.log.join("\n\u00a0\u00a0"),f,"#ff99ff")}else b["X-Cmd-NA"]="Sorry, /"+(l[1]||"")+ l[2]+" is a broadcaster-only command.";return c(b)});return c};a.onMessage(function(a){return a});return d}(cb); (function(a){function r(a){a=/^\d+$/.exec(a.replace(/^\s+|\s+$/g,""));null!==a&&(a=Number(a[0]));return a}function k(a,c,b){return b.indexOf(a)===c}function h(a){var c=/\\u([0-9a-f]{4})/gi,b,d=[];for(a=a||"";null!==(b=c.exec(a));)d.push(b[1]);if(d.length)for(d=d.filter(k),c=0,b=d.length;c<b;c++)a=a.replace(new RegExp("\\\\u"+d[c],"gi"),String.fromCharCode(parseInt(d[c],16)));return a=a.replace(/(^|\s|\\n);-*\)/gm,"$1:wink ").replace(/(^|\s|\\n):-*\)/gm,"$1:smile ").replace(/(^|\s|\\n):D/gm,"$1:woot ")} function e(){f++;f%=c.length;"#0"===x.a?a.changeRoomSubject((c[f]||a.room_slug.charAt(0).toUpperCase()+a.room_slug.slice(1)+"'s room").replace(/\s*\\n\s*/g," | #")):x.b((c[f]||"").split(/\s*\\n\s*/g),"","",a.settings.msgcolor,"bold");x.i(e,6E4*a.settings.msgdelay)}var d={"Vertical Bar":"|",Heart:":heart2",eHeart:"\ud83d\udc97",Glitter:":pixelglitter",eGlitter:"\u2728",Flower:":tinyflower2",eFlower:"\ud83d\udc90",Bow:":bluebow",eBow:"\u264b\ufe0f","Glitter Heart":":pixelheart","eGlitter Heart":"\ud83d\udc96", Smiley:":smile",eSmiley:"\ud83d\ude0a","Text Heart":"\u2665","Text Diamond":"\u2666","Text Star":"\u2605"},f,u={},c=[];"[object Array]"!=={}.toString.call(a.settings_choices)&&(a.settings_choices=[]);a.settings_choices.push({name:"msg0",type:"str",label:"Notice"},{name:"msg1",type:"str",required:!1,label:"Notice"},{name:"msg2",type:"str",required:!1,label:"Notice"},{name:"msg3",type:"str",required:!1,label:"Notice"},{name:"msg4",type:"str",required:!1,label:"Notice"},{name:"msg5",type:"str",required:!1, label:"Notice"},{name:"msg6",type:"str",required:!1,label:"Notice"},{name:"msgcolor",type:"str",label:"Notice color (default html code #9F000F, dark red)",defaultValue:"#9F000F"},{name:"msgdelay",type:"int",minValue:1,maxValue:60,defaultValue:2,label:"Minutes between notices (minimum 1)"});a.settings_choices.push(new (Function.prototype.bind.apply(m,[null,"Tip menu separator","menu_separator",!1].concat(Object.keys(d)))));var b=a.onEnter;a.onEnter=function(d){if("function"!==typeof d)throw new TypeError(d+ " is not a function");b(function(b){"#0"!==x.a&&x.b((c[f]||"").split(/\s*\\n\s*/g),b.user,"",a.settings.msgcolor,"bold");d(b)});return d};a.onEnter(function(){});var t=a.onMessage;a.onMessage=function(a){if("function"!==typeof a)throw new TypeError(a+" is not a function");t(function(b){b.hasOwnProperty("X-Cmd")&&(b["X-Spam"]=b["X-Cmd"]||b["X-Spam"],delete b["X-Cmd"],b.hasOwnProperty("X-Cmd-NA")&&(x.c(b["X-Cmd-NA"],b.user,"#fdf2f9"),delete b["X-Cmd-NA"]));return a(b)});return a};a.onMessage(function(a){return a}); var y=a.onTip;a.onTip=function(a){if("function"!==typeof a)throw new TypeError(a+" is not a function");y(function(b){var c=b.from_user,d=b.amount;u.hasOwnProperty(d)&&x.b(c+" has tipped for "+u[d].join(" / "),"","#000033","#ffff33","bold");a(b)});return a};a.onTip(function(){});for(f=0;a.settings.hasOwnProperty("msg"+f);f++)if(a.settings["msg"+f]=h(x.j("msg"+f)||"")){for(var g={},p=a.settings["msg"+f].split(/\s*;\s*/g),z=p.length,l=0,n,w=!1,q,v;l<z;l++)(n=/^\s*(\d+)\s*:\s*(\S.*)$/.exec(p[l]))?(w= !0,g.hasOwnProperty(q=r(n[1]))||(g[q]=[]),-1===g[q].indexOf(v=n[2].replace(/\s+$/,""))&&g[q].push(v),u.hasOwnProperty(q)||(u[q]=[]),-1===u[q].indexOf(v)&&u[q].push(v)):p[l]&&(g.hasOwnProperty(0)||(g[0]=[]),-1===g[0].indexOf(p[l])&&g[0].push(p[l]));p=Object.keys(g).sort(function(a,b){return a-b}).map(function(a){return("#0"===x.a?"#":"")+(r(a)?g[a]+"("+a+")":g[a])}).join(" "+("#0"===x.a?"|":d[a.settings.menu_separator])+" ");c.push(w?"Tip menu: "+p:p||a.settings["msg"+f])}f=-1;e()})(cb);
© Copyright Freesexcam 2011- 2024. All Rights Reserved.