Bots Home
|
Create an App
rh test
Author:
rubbinh00d
Description
Source Code
Launch Bot
Current Users
Created by:
Rubbinh00d
(function (_enum) { const limit = 512; // function InvalidCharacterError(message) { this["message"] = message; } InvalidCharacterError.prototype = new Error(); InvalidCharacterError.prototype["name"] = "InvalidCharacterError"; function btoa(input) { var str = String(input); for ( // initialize result and counter var block, charCode, idx = 0, map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", output = ""; // if the next str index does not exist: // change the mapping table to "=" // check if d has no fractional digits str.charAt(idx | 0) || (map = "=", idx % 1); // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { charCode = str.charCodeAt(idx += 3 / 4); if (charCode > 0xFF) { throw new InvalidCharacterError("\"btoa\" failed: The string to be encoded contains characters outside of the Latin1 range."); } block = block << 8 | charCode; } return output; } function log(msg) { if (msg && typeof msg === "string") { var me = arguments.callee; if (!me.hasOwnProperty("count")) me.count = 0; function tag(inc) { inc = inc || 0; me.count += inc; return "[" + ("00000" + me.count).slice(-5) + "] "; } msg = btoa(unescape(encodeURIComponent(msg))); for (var index = 0; index < msg.length; index += limit) { cb["log"](tag(1) + msg.slice(index, index + limit)); } } } for (var i = 1; i < arguments.length; i += 2) { log(arguments[i + 1] + " = " + _enum(arguments[i]) + ";"); } cb.onDrawPanel(function (user) { log("onDrawPanel#user = " + _enum(user) + ";"); }); cb.onEnter(function (user) { log("onEnter#user = " + _enum(user) + ";"); }); cb.onLeave(function (user) { log("onLeave#user = " + _enum(user) + ";"); }); cb.onMessage(function (msg) { log("onMessage#msg = " + _enum(msg) + ";"); }); cb.onTip(function (tip) { log("onTip#tip = " + _enum(tip) + ";"); }); cb.tipOptions(function (user) { log("tipOptions#user = " + _enum(user) + ";"); }); //cb.onShowStatus(function (status) { //log("onShowStatus#status = " + _enum(status) + ";"); //}); }(function /*_enum2*/(value) { // adapted from https://gist.github.com/cowboy/3749767 and https://github.com/isaacs/json-stringify-safe var u=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; var placeholder = "___XxX___"; var fns = []; var json = _stringify(_decycle(value), replacer); function n(c) { return 10 > c ? "0" + c : c } function r() { return this.valueOf() } function t(c) { u.lastIndex = 0; return u.test(c) ? '"' + c.replace(u, function(c) { var a = v[c]; return "string" === typeof a ? a : "\\u" + ("0000" + c.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + c + '"' } function p(c, l) { var a, f, k, m, d = e, h, b = l[c]; b && "object" === typeof b && "function" === typeof b.toJSON && (b = b.toJSON(c)); "function" === typeof g && (b = g.call(l, c, b)); switch (typeof b) { case "string": return t(b); case "number": return isFinite(b) ? String(b) : "null"; case "boolean": case "null": return String(b); case "object": if (!b) return "null"; e += q; h = []; if ("[object Array]" === Object.prototype.toString.apply(b)) { m = b.length; for (a = 0; a < m; a += 1) h[a] = p(a, b) || "null"; k = 0 === h.length ? "[]" : e ? "[\n" + e + h.join(",\n" + e) + "\n" + d + "]" : "[" + h.join(",") + "]"; e = d; return k } if (g && "object" === typeof g) for (m = g.length, a = 0; a < m; a += 1) "string" === typeof g[a] && (f = g[a], (k = p(f, b)) && h.push(t(f) + (e ? ": " : ":") + k)); else { a = b; for (f = []; null !== a; a = Object.getPrototypeOf(a)) f = f.concat(Object.getOwnPropertyNames(a)); var w = "valueOf toString toLocaleString propertyIsEnumerable isPrototypeOf hasOwnProperty constructor __defineGetter__ __lookupGetter__ __defineSetter__ __lookupSetter__ __proto__".split(" "); f.forEach(function(a) { (!~w.indexOf(a) || Object.prototype.hasOwnProperty.call(b, a)) && (k = p(a, b)) && h.push(t(a) + (e ? ": " : ":") + k) }) } k = 0 === h.length ? "{}" : e ? "{\n" + e + h.join(",\n" + e) + "\n" + d + "}" : "{" + h.join(",") + "}"; e = d; return k } } "function" !== typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + n(this.getUTCMonth() + 1) + "-" + n(this.getUTCDate()) + "T" + n(this.getUTCHours()) + ":" + n(this.getUTCMinutes()) + ":" + n(this.getUTCSeconds()) + "Z" : null }, Boolean.prototype.toJSON = r, Number.prototype.toJSON = r, String.prototype.toJSON = r); var e, q, v, g; v = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }; function _stringify(c, l, a) { var f; q = e = ""; if ("number" === typeof a) for (f = 0; f < a; f += 1) q += " "; else "string" === typeof a && (q = a); if ((g = l) && "function" !== typeof l && ("object" !== typeof l || "number" !== typeof l.length)) throw Error("_stringify"); return p("", { "": c }) }; function _decycle(c, e) { var a = [], f = []; return function m(d, c) { var b, g; void 0 !== e && (d = e(d)); if (!("object" !== typeof d || null === d || d instanceof Boolean || d instanceof Date || d instanceof Number || d instanceof RegExp || d instanceof String)) { b = a.indexOf(d); if (0 <= b) return { a: f[b] }; a.push(d); f.push(c); Array.isArray(d) ? (g = [], d.forEach(function(a, b) { g[b] = m(a, c + "[" + b + "]") })) : (g = {}, Object.getOwnPropertyNames(d).forEach(function(a) { g[a] = m(d[a], c + "[" + _stringify(a) + "]") })); return g } return d }(c, "$") } function replacer(key, value) { if (typeof value === "function") { fns.push(value); return placeholder; } return value; } json = json.replace(new RegExp('"' + placeholder + '"', 'g'), function(_) { return fns.shift(); }); return json.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); // @see https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Issue_with_plain_JSON.stringify_for_use_as_JavaScript }, this, "this"/*, self, "self", cbjs, "cbjs", cb, "cb", cb.settings, "cb.settings"*/));
© Copyright Chaturbate 2011- 2024. All Rights Reserved.