Bots Home
|
Create an App
Brunettejulie's tip menu
Author:
thejunk88
Description
Source Code
Launch Bot
Current Users
Created by:
Thejunk88
function S(a) { function b() { if (d <= c) { var e = v[d].hex, h = C(e); cb.sendNotice(v[d].label, a, h, e, "bold"); d++; setTimeout(b, 10) } } var c = v.length - 1, d = 0; b() } function I(a, b) { var c = !1, h; for (h in w) if (a.match(w[h])) for (var e = 0; e < d.length; e++) { var l = d[e].tag, g = d[e].item, k = d[e].price; !E(l) && l.includes(h) && (c = !0, cb.sendNotice(g + ": " + k, b, m, r, "bold")) } return c } function J(a, b, c) { a in x ? x[a][b].push(c) : (new T(x, a), x[a][b] = [c]) } function T(a, b) { a[b] = { messages: [], tokens: [], total: 0, notes: [] } } function E(a) { return void 0 === a || null === a || "" === a } function K(a) { return Math.floor(Math.random() * (a + 1)) } function D(a) { return "#" == a.charAt(0) ? a.substring(1, 7) : a } function U(a) { var b = []; b[0] = parseInt(D(a).substring(0, 2), 16); b[1] = parseInt(D(a).substring(2, 4), 16); b[2] = parseInt(D(a).substring(4, 6), 16); return b } function F(a) { a && (a = a.toString().trim()); return void 0 === a || null === a || "" === a } function V() { "Do not sort" !== cb.settings.sort_menu && ("Lowest to highest" === cb.settings.sort_menu ? d.sort(function(a, b) { return a.price - b.price }) : d.sort(function(a, b) { return b.price - a.price })) } function y(a) { var b = G + "'s Tip Menu:", c = "", h = z ? "\n" : " "; void 0 === a && (a = ""); d.forEach(function(a, b) { c = 0 === b ? q + " " + a.item + " (" + a.price + ")\u00a0" : c + (h + q + " " + a.item + " (" + a.price + ")\u00a0") }); setTimeout(function() { cb.sendNotice(b, a, m, r, "bold") }, 10); setTimeout(function() { cb.sendNotice(c, a, r, m, "bold") }, 40) } function L() { 0 < d.length && (setTimeout(y(), 6E4 * cb.settings.menu_time), setTimeout(L, 6E4 * cb.settings.menu_time)) } function W() { var a = cb.settings.menu_color; if ("Random" == a) { a = ["a", "b", "c", "d", "e", "f", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]; for (var b = "#", c = 0; 6 > c;) b += a[K(a.length - 1)], c++; return b } for (b = 0; b < t.length; b++) if (a === t[b].label) return t[b].hex; return !1 } function C(a) { a = D(a); a = U(a); a = [a[0] / 255, a[1] / 255, a[2] / 255].map(function(a) { return .03928 >= a ? a / 12.92 : Math.pow((a + .055) / 1.055, 2.4) }); return .179 < .2126 * a[0] + .7152 * a[1] + .0722 * a[2] ? "#000000" : "#ffffff" } function M(a) { var b = "Commands:"; a === p || A.includes(a) || (b += "\n/menu -- Display the tip menu"); if (a === p || A.includes(a)) b += "\n/menu -- Send the tip menu to everyone in the room\n/auto -- Toggle auto response on or off\n/mode -- Switch between Single and Multi line modes\n/list -- Display a list of colors by name\n/color [name|code] -- Change the menu color. E.g. '/color blue', '/color 0000ff'"; a === p && (b += "\n/cc -- Clear the chat of all messages"); cb.sendNotice(b + "\n/help -- Display this help message", a, "", "", "bold") } function N(a) { setTimeout(function() { cb.sendNotice("", a, "#FFFFFF", "#FFFFFF", ""); M(a) }, 1E3) } var x = {}, A = [], O = [], B = !1, z = !1, d = [], P = [], p = cb.room_slug, G = p.charAt(0).toUpperCase() + p.substring(1), v = [{ label: "AliceBlue", hex: "#F0F8FF" }, { label: "AntiqueWhite", hex: "#FAEBD7" }, { label: "Aqua", hex: "#00FFFF" }, { label: "Aquamarine", hex: "#7FFFD4" }, { label: "Azure", hex: "#F0FFFF" }, { label: "Beige", hex: "#F5F5DC" }, { label: "Bisque", hex: "#FFE4C4" }, { label: "Black", hex: "#000000" }, { label: "BlanchedAlmond", hex: "#FFEBCD" }, { label: "Blue", hex: "#0000FF" }, { label: "BlueViolet", hex: "#8A2BE2" }, { label: "Brown", hex: "#A52A2A" }, { label: "BurlyWood", hex: "#DEB887" }, { label: "CadetBlue", hex: "#5F9EA0" }, { label: "Chartreuse", hex: "#7FFF00" }, { label: "Chocolate", hex: "#D2691E" }, { label: "Coral", hex: "#FF7F50" }, { label: "CornflowerBlue", hex: "#6495ED" }, { label: "Cornsilk", hex: "#FFF8DC" }, { label: "Crimson", hex: "#DC143C" }, { label: "Cyan", hex: "#00FFFF" }, { label: "DarkBlue", hex: "#00008B" }, { label: "DarkCyan", hex: "#008B8B" }, { label: "DarkGoldenRod", hex: "#B8860B" }, { label: "DarkGray", hex: "#A9A9A9" }, { label: "DarkGrey", hex: "#A9A9A9" }, { label: "DarkGreen", hex: "#006400" }, { label: "DarkKhaki", hex: "#BDB76B" }, { label: "DarkMagenta", hex: "#8B008B" }, { label: "DarkOliveGreen", hex: "#556B2F" }, { label: "DarkOrange", hex: "#FF8C00" }, { label: "DarkOrchid", hex: "#9932CC" }, { label: "DarkRed", hex: "#8B0000" }, { label: "DarkSalmon", hex: "#E9967A" }, { label: "DarkSeaGreen", hex: "#8FBC8F" }, { label: "DarkSlateBlue", hex: "#483D8B" }, { label: "DarkSlateGray", hex: "#2F4F4F" }, { label: "DarkSlateGrey", hex: "#2F4F4F" }, { label: "DarkTurquoise", hex: "#00CED1" }, { label: "DarkViolet", hex: "#9400D3" }, { label: "DeepPink", hex: "#FF1493" }, { label: "DeepSkyBlue", hex: "#00BFFF" }, { label: "DimGray", hex: "#696969" }, { label: "DimGrey", hex: "#696969" }, { label: "DodgerBlue", hex: "#1E90FF" }, { label: "FireBrick", hex: "#B22222" }, { label: "FloralWhite", hex: "#FFFAF0" }, { label: "ForestGreen", hex: "#228B22" }, { label: "Fuchsia", hex: "#FF00FF" }, { label: "Gainsboro", hex: "#DCDCDC" }, { label: "GhostWhite", hex: "#F8F8FF" }, { label: "Gold", hex: "#FFD700" }, { label: "GoldenRod", hex: "#DAA520" }, { label: "Gray", hex: "#808080" }, { label: "Grey", hex: "#808080" }, { label: "Green", hex: "#008000" }, { label: "GreenYellow", hex: "#ADFF2F" }, { label: "HoneyDew", hex: "#F0FFF0" }, { label: "HotPink", hex: "#FF69B4" }, { label: "IndianRed", hex: "#CD5C5C" }, { label: "Indigo", hex: "#4B0082" }, { label: "Ivory", hex: "#FFFFF0" }, { label: "Khaki", hex: "#F0E68C" }, { label: "Lavender", hex: "#E6E6FA" }, { label: "LavenderBlush", hex: "#FFF0F5" }, { label: "LawnGreen", hex: "#7CFC00" }, { label: "LemonChiffon", hex: "#FFFACD" }, { label: "LightBlue", hex: "#ADD8E6" }, { label: "LightCoral", hex: "#F08080" }, { label: "LightCyan", hex: "#E0FFFF" }, { label: "LightGoldenRodYellow", hex: "#FAFAD2" }, { label: "LightGray", hex: "#D3D3D3" }, { label: "LightGrey", hex: "#D3D3D3" }, { label: "LightGreen", hex: "#90EE90" }, { label: "LightPink", hex: "#FFB6C1" }, { label: "LightSalmon", hex: "#FFA07A" }, { label: "LightSeaGreen", hex: "#20B2AA" }, { label: "LightSkyBlue", hex: "#87CEFA" }, { label: "LightSlateGray", hex: "#778899" }, { label: "LightSlateGrey", hex: "#778899" }, { label: "LightSteelBlue", hex: "#B0C4DE" }, { label: "LightYellow", hex: "#FFFFE0" }, { label: "Lime", hex: "#00FF00" }, { label: "LimeGreen", hex: "#32CD32" }, { label: "Linen", hex: "#FAF0E6" }, { label: "Magenta", hex: "#FF00FF" }, { label: "Maroon", hex: "#800000" }, { label: "MediumAquaMarine", hex: "#66CDAA" }, { label: "MediumBlue", hex: "#0000CD" }, { label: "MediumOrchid", hex: "#BA55D3" }, { label: "MediumPurple", hex: "#9370DB" }, { label: "MediumSeaGreen", hex: "#3CB371" }, { label: "MediumSlateBlue", hex: "#7B68EE" }, { label: "MediumSpringGreen", hex: "#00FA9A" }, { label: "MediumTurquoise", hex: "#48D1CC" }, { label: "MediumVioletRed", hex: "#C71585" }, { label: "MidnightBlue", hex: "#191970" }, { label: "MintCream", hex: "#F5FFFA" }, { label: "MistyRose", hex: "#FFE4E1" }, { label: "Moccasin", hex: "#FFE4B5" }, { label: "NavajoWhite", hex: "#FFDEAD" }, { label: "Navy", hex: "#000080" }, { label: "OldLace", hex: "#FDF5E6" }, { label: "Olive", hex: "#808000" }, { label: "OliveDrab", hex: "#6B8E23" }, { label: "Orange", hex: "#FFA500" }, { label: "OrangeRed", hex: "#FF4500" }, { label: "Orchid", hex: "#DA70D6" }, { label: "PaleGoldenRod", hex: "#EEE8AA" }, { label: "PaleGreen", hex: "#98FB98" }, { label: "PaleTurquoise", hex: "#AFEEEE" }, { label: "PaleVioletRed", hex: "#DB7093" }, { label: "PapayaWhip", hex: "#FFEFD5" }, { label: "PeachPuff", hex: "#FFDAB9" }, { label: "Peru", hex: "#CD853F" }, { label: "Pink", hex: "#FFC0CB" }, { label: "Plum", hex: "#DDA0DD" }, { label: "PowderBlue", hex: "#B0E0E6" }, { label: "Purple", hex: "#800080" }, { label: "RebeccaPurple", hex: "#663399" }, { label: "Red", hex: "#FF0000" }, { label: "RosyBrown", hex: "#BC8F8F" }, { label: "RoyalBlue", hex: "#4169E1" }, { label: "SaddleBrown", hex: "#8B4513" }, { label: "Salmon", hex: "#FA8072" }, { label: "SandyBrown", hex: "#F4A460" }, { label: "SeaGreen", hex: "#2E8B57" }, { label: "SeaShell", hex: "#FFF5EE" }, { label: "Sienna", hex: "#A0522D" }, { label: "Silver", hex: "#C0C0C0" }, { label: "SkyBlue", hex: "#87CEEB" }, { label: "SlateBlue", hex: "#6A5ACD" }, { label: "SlateGray", hex: "#708090" }, { label: "SlateGrey", hex: "#708090" }, { label: "Snow", hex: "#FFFAFA" }, { label: "SpringGreen", hex: "#00FF7F" }, { label: "SteelBlue", hex: "#4682B4" }, { label: "Tan", hex: "#D2B48C" }, { label: "Teal", hex: "#008080" }, { label: "Thistle", hex: "#D8BFD8" }, { label: "Tomato", hex: "#FF6347" }, { label: "Turquoise", hex: "#40E0D0" }, { label: "Violet", hex: "#EE82EE" }, { label: "Wheat", hex: "#F5DEB3" }, { label: "White", hex: "#FFFFFF" }, { label: "WhiteSmoke", hex: "#F5F5F5" }, { label: "Yellow", hex: "#FFFF00" }, { label: "YellowGreen", hex: "#9ACD32" } ], t = [{ label: "White", hex: "#FFFFFF" }, { label: "Red", hex: "#FFAAAA" }, { label: "Orange", hex: "#FFA500" }, { label: "Yellow", hex: "#FFFF00" }, { label: "Olive", hex: "#d8d88c" }, { label: "Lime", hex: "#00FF00" }, { label: "Aqua", hex: "#00FFFF" }, { label: "Light Purple", hex: "#EDCAF9" }, { label: "Magenta", hex: "#FF99FF" }, { label: "Black", hex: "#000000" }, { label: "Maroon", hex: "#800000" }, { label: "Green", hex: "#006600" }, { label: "Teal", hex: "#005959" }, { label: "Blue", hex: "#0000FF" }, { label: "Navy", hex: "#000080" }, { label: "Purple", hex: "#800080" }], H = [{ label: "Vertical Bar", shortcut: "|" }, { label: "Hearts", shortcut: ":heart2" }, { label: "Glitter", shortcut: ":pixelglitter" }, { label: "Flowers", shortcut: ":tinyflower2" }, { label: "Bow", shortcut: ":bluebow" }, { label: "Hearts2", shortcut: ":pixelheart" }, { label: "Smiley", shortcut: ":smile" }, { label: "Text Heart", shortcut: "e" }, { label: "Text Diamond", shortcut: "f" }, { label: "Text Star", shortcut: "\u0005" }, { label: "Bullet", shortcut: '"' }, { label: "Pile of poo", shortcut: "=\u00a9" }, { label: "Fapp", shortcut: ":fapp" }, { label: "Hearty", shortcut: ":hearty" }, { label: "Spinning Star", shortcut: ":star_olivia_dellvine" }, { label: "Butterflies", shortcut: ":earthbutterfly" }, { label: "Blue Heart", shortcut: ":bluepixelheart" }], w = { boobs: /bo+b+i*e*s*|tit+i*e*s*|breasts*|chest|bra/gi, pussy: /pus+y+|dog+(y|ie)|spread|cunt|vagina|kitty|piska|play/gi, ass: /(ass|butt)(hole)*/gi, pm: /pm/gi, mouth: /lick|suck|spit|blow|kiss|finger/gi, flash: /flash/gi, strip: /strip|tease|dance|pole|naked/gi, naked: /naked|full|completely/gi, feet: /fe+t|legs*|heels*|soles*/gi }, Q = /how\s((much|many).?(.*tips*|\bto*c*k*e*n*s*\b|\bfor\b))/g, f = { a: "0", b: "1", c: "2", d: "3", e: "4", f: "5", g: "6", h: "7", i: "8", j: "9" }; if (!0 || (f.j + f.b + f.i + f.a + f.b).split("").reverse().join("") === G.replace(G, cb.app_id).toString()) { cb.settings_choices = [{ name: "menu_style", type: "choice", choice1: "Single line", choice2: "Multi line", label: "Menu Style", defaultValue: "Multi line" }, { name: "separator", type: "choice", choice1: "Vertical Bar", choice2: "Hearts", choice3: "Glitter", choice4: "Flowers", choice5: "Bow", choice6: "Hearts2", choice7: "Smiley", choice8: "Text Heart", choice9: "Text Diamond", choice10: "Text Star", choice11: "Bullet", choice12: "Text Diamond", choice13: "Text Star", choice14: "Bullet", choice15: "Pile of poo", choice16: "Fapp", choice17: "Hearty", choice18: "Spinning Star", choice19: "Butterflies", choice120: "Blue Heart", choice121: "Custom Separator", label: "Item Separator", defaultValue: "Blue Heart" }, { name: "custom_separator", type: "str", minLength: 1, label: "Custom separator", required: !1 }, { name: "menu_color", type: "choice", choice1: "White", choice2: "Black", choice3: "Red", choice4: "Maroon", choice5: "Orange", choice6: "Yellow", choice7: "Olive", choice8: "Lime", choice9: "Green", choice10: "Aqua", choice11: "Teal", choice12: "Blue", choice13: "Navy", choice14: "Magenta", choice15: "Blue", choice16: "Navy", choice17: "Magenta", choice18: "Purple", choice19: "Light Purple", choice20: "Custom color code", choice21: "Random", label: "Menu color", defaultValue: "Light Purple" }, { name: "custom_color", type: "str", minLength: 6, maxLength: 6, required: !1, label: "Custom color code", defaultValue: "" }, { name: "sort_menu", type: "choice", choice1: "Lowest to highest", choice2: "Highest to lowest", choice3: "Do not sort", label: "Sort menu items by price", defaultValue: "Lowest to highest" }, { name: "menu_time", type: "int", minValue: 1, maxValue: 30, label: "Number of minutes between each notice", defaultValue: 3 }, { name: "auto_menu", type: "choice", choice1: "Yes", choice2: "No", label: "Auto respond to common questions?", defaultValue: "Yes" }, { name: "start_help", type: "choice", choice1: "Yes", choice2: "No", label: "Display help when starting the app?", defaultValue: "Yes" }]; for (f = 0; 30 > f; f++) { var u = f + 1, R = 1 === u ? !0 : !1; cb.settings_choices.push({ name: "item" + u, type: "str", minLength: 1, maxLength: 255, label: "Menu Item " + u, required: R }, { name: "price" + u, type: "int", minValue: 1, maxValue: 99999, label: "Price of Item " + u, required: R }) } cb.onEnter(function(a) { var b = a.user; a = a.is_mod; P.includes(b) || (y(b), P.push(b)); setTimeout(function() { cb.sendNotice("Type /menu at anytime to see the tip menu", b, "", "", "bold") }, 600); a && (A.includes(b) || A.push(b), O.includes(b) || (N(b), O.push(b))) }); cb.onMessage(function(a) { var b = a.user, c = a.gender, h = b == p, e = a.in_fanclub, l = a.is_mod, g = !a.has_tokens && !h && !l && !e; e = a.m.replace(/\s+/g, " ").trim().toLowerCase(); var k = !1; J(b, "messages", e); "/" === e.charAt(0) && (k = !0, a["X-Spam"] = !0); g && "f" === c && (a["X-Spam"] = !0); l && (A.includes(b) || A.push(b)); if (!h && !l && B && (Q.test(e) && (g = e, c = !1, [g.match(/\w+/g).join(" ")].toString() === g.match(Q).toString() && (c = x[b].messages.indexOf(g) - 1, g = x[b].messages[c], c = !0, I(g, b)), c || I(e, b) || cb.sendNotice("I don't do that")), c = a.m.replace(/\s+/g, " ").trim().toLowerCase().match(/\w+/g), !E(c) && 1 === c.length && ":" !== e.charAt(0))) { g = c[0]; for (var n in w) if (g.match(w[n])) for (var f = 0; f < d.length; f++) { var q = d[f].tag, t = d[f].item, u = d[f].price; !E(q) && q.includes(n) && cb.sendNotice(t + ": " + u, "", m, r, "bold") } } if (k) { k = e.split(" ")[0].substring(1); "help" === k && M(b); if (h && "cc" === k) { n = 0; for (g = "\n"; 200 >= n; n++) g += "\n"; cb.sendNotice(g, "", "#FFFFFF", "#FFFFFF") } if (h || l) { "menu" === k && y(); "auto" === k && (B = !B, cb.sendNotice("Auto Response: " + (B ? "On" : "Off"), b, "", "", "bold"), l && (c = "Moderator " + b + " turned Auto Response: " + (B ? "On" : "Off"), cb.sendNotice(c, p, "#ffaaaa", "#000000", "bold"))); "mode" === k && (z = !z, cb.sendNotice("Menu style: " + (z ? "Multi Line" : "Single Line"), b, "", "", "bold"), l && (c = "Moderator " + b + " set Menu Style to: " + (z ? "Multi Line" : "Single Line"), cb.sendNotice(c, p, "#ffaaaa", "#000000", "bold"))); if ("color" === k) if (e = e.split(" ")[1], (new RegExp(/^[0-9a-fA-F]{6}/g)).test(e)) m = "#" + e, r = C(m), y(b); else for (n = 0; n < v.length; n++) e === v[n].label.toLowerCase() && (m = v[n].hex, r = C(m), y(b)); "list" === k && S(b) } h || l || "menu" === k && y(b) } return a }); cb.onTip(function(a) { var b = a.from_user; a = parseInt(a.amount); J(b, "tokens", a); for (var c = 0; c < d.length; c++) a === d[c].price && cb.sendNotice(b + " tipped for " + d[c].item, "", m, r, "bold") }) } else cb.settings_choices = [{ name: "i", type: "str", minLength: 0, maxLength: 0, defaultValue: "https://chaturbate.com/apps/app_details/the-menu/", label: "You are using a pirated version of this app. The original working version of this app can be found @" }]; z = "Multi line" === cb.settings.menu_style; B = "Yes" == cb.settings.auto_menu; var m = function() { var a = W(); if (!a) { a = cb.settings.custom_color; var b = /^[0-9a-f]{6}$/i; a = a && b.test(a) ? "#" + cb.settings.custom_color : t[K(t.length - 1)].hex } return a }(); var r = C(m); var q = function() { var a = 0, b = cb.settings.separator, c, d = cb.settings.custom_separator; if ((c = F(d) ? !1 : ("\\" === d && (d = "=\u00a9"), d.toString())) && "Custom Separator" === b) return c; for (; a < H.length; a++) if (b === H[a].label) return H[a].shortcut; return q }(); void 0 == q && (q = "=\u00a9".toString()); (function() { for (var a = 0; a < cb.settings_choices.length; a++) { var b = a + 1; F(cb.settings["item" + b]) || F(cb.settings["price" + b]) || d.push({ item: cb.settings["item" + b], price: cb.settings["price" + b] }) } V() })(); (function() { for (var a in w) for (var b = 0; b < d.length; b++) d[b].item.match(w[a]) && (d[b].tag ? d[b].tag.push(a) : d[b].tag = [a]) var app = { name : "'Brunettejulie's Tip menu'", /* Script name */ type : 'Bot', /* Script type: bot|app */ version : '1.5', /* Internal: Script version number */ build : '.015', /* Internal: Script build number */ date : '2015.02.02', /* Internal: Script build date */ acg : 'acrazyguy', /* main developer */ pkm : 'phatkatmeow', /* main developer */ rx : 'robx7', /* Assoc developer */ bli : 'birdylovesit', CD : 'dump' /* debug: quick overview */ }; /***** App colours *****/ var COLOR = { DEVELOPER : '#D9F7F7', NOTICE : '#6900CC', /* Chat notice colour - Blue-purple */ RED : '#FF1407', HIGHLIGHT : '#EEE5FF', /* Ticket holder Highlight colour -Pastel purple */ SYNTAX : '#995B00', /* Usage notice colour - Brownish */ AMBER : '#E56B00', /* Amber */ MOD : '#DC0000', /* Moderator red */ HVTEXT : '#D80A00', /* Text colour for hi-vis notices - Red */ HVBACK : '#FFFFBF', /* Background colour for hi-vis notices - Yellow */ HVTEXT1 : '#0FFE33', /* Text colour for hi-vis notices - Green */ HVBACK1 : '#FFFFFF', /* Background colour for hi-vis notices - White */ HVTEXT2 : '#2326EE', /* Text colour for hi-vis notices - Blue */ HVBACK2 : '#B2B0B0', /* Background colour for hi-vis notices - Silver */ HELP : '#144D8C', /* Text colour for help - Blue-grey */ INFO : '#144D8C', /* neutral notice - Blue-grey */ MAG : '#E509E5', /* Magenta */ BLI : '#DDFFCC' /* Pastel green */ }; /***** App Commands *****/ var COMMAND = { CN : 'cn', /* Send general notice to the public */ BC : 'bc', /* Send private notice to the broadcaster (mods only) */ MA : 'ma', /* Send private notice to the broadcaster & mods */ TM : 'tm', /* Send private notice to mods as a group */ TV : 'tv', /* Send private notice to s viewer */ CNHELP : 'cnhelp', /* Send command list to mod/broadcaster */ TPRICE : 'tprice', /* Assign ticket price. */ ADD : 'add', /* Add one or more viewers to ticket list */ AU : 'au', /* Add user(s) alias */ DEL : 'del', /* Delete a user */ DU : 'du', /* Delete alias */ TLIST : 'tlist', /* Lists users who paid for a ticket */ SIL : 'sil', UNSIL : 'unsil', SLIST : 'slist', EXPORT : 'export', PRELIST : 'prelist' }; /********** Variables **********/ var FLAG = { price : false, dev : false, bb : false }; var ticketsSold = 0; var ticketPrice = 0; var tipTot = 0; var startTime = new Date(); var onlyMods = "* Command is only available to moderators."; var junklovesyou = "* Message Sent ."; var roomHost = cb.room_slug; var dashLine = "--------------------------------------------------"; /***** Arrays *****/ var ticketList = []; var silList = []; var devList = []; var preSales = { name : [], email : [] }; /************************/ /***** API Functions ****/ /************************/ cb.onMessage(function (msg) { var regexCommandSplit = '^' + '/' + '(\\S+)(?:\\b\\s*)(.*)?'; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); var cmdSplit = msg['m'].match(reCmdSplit); var cmd; var cmdval; var cmdValArray; if ( cmdSplit ) { cmd = cmdSplit[1]; cmdval = cmdSplit[2]; if ( cmdval != null ) { cmdval = cmdval.replace(/^\s+|\s+$/g,''); } if ( cmdval != null ) { cmdValArray = cmdval.split(regexListSplit); } else { cmdValArray = ''; } } var muteOwlre = /(\bowl)|(:[a-z0-9]*owl[a-z0-9]*)/i; var repGIFre = /:[a-z0-9]*owl[a-z0-9]*/i // for convenience var m = msg['m']; var u = msg['user']; var isMod = msg['is_mod']; var isRoomHost = (u === roomHost); var isACG = (u === app.acg); var viewer, toViewer; if (m[0] == "?" || m[0] == "!") { msg['X-Spam'] = true; return cb.sendNotice("* " +app.name+ ": Incorrect command prefix.",u,'',COLOR.MOD,'bold'); } if (cbjs.arrayContains(silList,u)) { msg['X-Spam'] = true; return; } if ((roomHost === 'birdylovesit' || roomHost === 'blazefyre') && muteOwlre.test(m)) { msg['X-Spam'] = true; cb.sendNotice("*CN* '"+u+": "+m,app.acg,'',COLOR.INFO,'bold'); cb.sendNotice("*CN* '"+u+": "+m.replace(repGIFre,"*Owl GIF*"),'birdylovesit','',COLOR.RED,'bold'); } if ( cmdval != null ) { cmdval = cmdval.replace(/^\s+|\s+$/g,''); } if ( cmdval != null ) { cmdValArray = cmdval.split(regexListSplit); } else { cmdValArray = ''; } /* Added by 'acrazyguy' */ if (!FLAG.bb) { msg['m'] = m.replace(/\bbb\b/gi,"beautiful"); m = msg['m']; FLAG.bb = true; } else { msg['m'] = m.replace(/\bbb\b/gi,"princess"); m = msg['m']; FLAG.bb = false; } msg['m'] = m.replace(/:hmmm\w*/g,":hmm3"); m = msg['m']; msg['m'] = m.replace(/:umm\w*/g,":umm1"); m = msg['m']; if (!FLAG.bb) { msg['m'] = m.replace(/girl4y\w*/g,":jenstwitter"); m = msg['m']; FLAG.girl4y = true; } else { msg['m'] = m.replace(/girl4y\w*/g,":jenstwitter2"); m = msg['m']; FLAG.girl4y = false; } if (!FLAG.bb) { msg['m'] = m.replace(/Salute Guys. My pussy is so horny Let's go cam2cam\w*/g,":jenstwitter"); m = msg['m']; FLAG.girl4y = true; } else { msg['m'] = m.replace(/Salute Guys. My pussy is so horny Let's go cam2cam\w*/g,":jenstwitter2"); m = msg['m']; FLAG.girl4y = false; } if (!FLAG.bb) { msg['m'] = m.replace(/Sexy Milf will Sex haben\w*/g,":jenstwitter"); m = msg['m']; FLAG.girl4y = true; } else { msg['m'] = m.replace(/Sexy Milf will Sex haben\w*/g,":jenstwitter2"); m = msg['m']; FLAG.girl4y = false; } if (!FLAG.bb) { msg['m'] = m.replace(/C2 C\w*/g,":jenstwitter"); m = msg['m']; FLAG.girl4y = true; } else { msg['m'] = m.replace(/C2 C\w*/g,":jenstwitter2"); m = msg['m']; FLAG.girl4y = false; } if (!FLAG.bb) { msg['m'] = m.replace(/Hola Guys. My pussy is so wet! Lets go c2c\w*/g,":jenstwitter"); m = msg['m']; FLAG.girl4y = true; } else { msg['m'] = m.replace(/Hola Guys. My pussy is so wet! Lets go c2c\w*/g,":jenstwitter2"); m = msg['m']; FLAG.girl4y = false; } /* End 'acrazyguy' */ /***** Ok, let's start processing commands *****/ switch (cmd) { /***** Public Notice *****/ case COMMAND.CN: if (isMod || isRoomHost || (u===app.acg && FLAG.dev)) { if (cmdval) { cb.sendNotice("* " + cmdval.substr(0,1).toUpperCase()+cmdval.substr(1),'','',COLOR.NOTICE,'bold'); } else { cb.sendNotice("* Syntax: /cn <message>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(onlyMods,u,'',COLOR.NOTICE,'bold'); } break; /***** Message to Broadcaster & Mods *****/ case COMMAND.MA: if (isMod || isRoomHost || (u===app.acg && FLAG.dev)) { if (cmdval) { cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,'',COLOR.HVBACK,COLOR.HVTEXT,'bold','red'); } else { cb.sendNotice("* Syntax: /ma <message>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(junklovesyou,u,'',COLOR.NOTICE,'bold'); } if (isMod || (u===app.acg && FLAG.dev)) { if (cmdval) { cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,roomHost,COLOR.HVBACK,COLOR.HVTEXT,'bold'); cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,u,COLOR.HVBACK,COLOR.HVTEXT,'bold'); } else { cb.sendNotice("* Syntax: /ma <message>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(junklovesyou,u,'',COLOR.NOTICE,'bold'); } break; /***** Message to Broadcaster *****/ case COMMAND.BC: if (isMod || (u===app.acg && FLAG.dev)) { if (cmdval) { cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,roomHost,COLOR.HVBACK1,COLOR.HVTEXT1,'bold'); cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,u,COLOR.HVBACK1,COLOR.HVTEXT1,'bold'); } else { cb.sendNotice("* Syntax: /bc <message>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(onlyMods,u,'',COLOR.NOTICE,'bold'); } break; /***** Message to Mods *****/ case COMMAND.TM: if (isMod || isRoomHost) { if (cmdval) { cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,'',COLOR.HVBACK2,COLOR.HVTEXT2,'bold','red'); } else { cb.sendNotice("* Syntax: /tm <message>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(onlyMods,u,'',COLOR.NOTICE,'bold'); } break; /***** Message to Broadcaster & Mods *****/ case COMMAND.MA: if (isMod || isRoomHost) { if (cmdval) { cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,'',COLOR.HVBACK,COLOR.HVTEXT,'bold','red'); } else { cb.sendNotice("* Syntax: /ma <message>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(onlyMods,u,'',COLOR.NOTICE,'bold'); } if (isMod || (u===app.acg && FLAG.dev)) { if (cmdval) { cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,roomHost,COLOR.HVBACK,COLOR.HVTEXT,'bold'); cb.sendNotice("* "+ u.toUpperCase() + ": " + cmdval,u,COLOR.HVBACK,COLOR.HVTEXT,'bold'); } else { cb.sendNotice("* Syntax: /ma <message>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(onlyMods,u,'',COLOR.NOTICE,'bold'); } break; /***** Message to Viewer *****/ case COMMAND.TV: viewer = cmdValArray[0]; cbjs.arrayRemove(cmdValArray,cmdValArray[0]); toViewer = cbjs.arrayJoin(cmdValArray," "); if (isMod || isRoomHost) { if (cmdval) { cb.sendNotice("*CrazyNote* " + toViewer,viewer,'',COLOR.RED,'bold'); } else { cb.sendNotice("* Syntax: /tv viewername message",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(onlyMods,u,'',COLOR.NOTICE,'bold'); } break; /***** Ticket Price *****/ case COMMAND.TPRICE: if (isMod || isRoomHost) { if(cmdval) { if (parseInt(cmdval)) { ticketPrice = cmdval; cb.sendNotice("* Ticket price set at " + cmdval + " tokens.",u,'',COLOR.NOTICE,'bold'); FLAG.price = true; } else { cb.sendNotice("* '" + cmdval + "' not a valid argument.",u,'',COLOR.NOTICE,'bold'); } } else { cb.sendNotice("* Syntax: " + '/' + COMMAND.TPRICE + " <price>",u,'',COLOR.SYNTAX,'bold'); } } else { cb.sendNotice(onlyMods,u,'',COLOR.NOTICE,'bold'); } break; /***** Help *****/ case COMMAND.CNHELP: if (isMod || isRoomHost) cb.sendNotice(getCommandList(),u,'',COLOR.HELP,'bold'); else cb.sendNotice(onlyMods,u,'',COLOR.NOTICE,'bold'); break; /***** Add user(s) *****/ case COMMAND.ADD: case COMMAND.AU: if (isMod || isRoomHost) { if (cmdval) { if (cmdValArray.length > 1) { for (var i=0; i<cmdValArray.length; i++) { if ( !user('check',cmdValArray[i]) ) { user('add',cmdValArray[i],false); } } // end for } else { user('add',cmdval,false); } // end if cmdValArray.length } else { if ( !user('check',msg['user']) ) { user('add',msg['user'],false); } } // end if cmdval } break; /***** Delete user *****/ case COMMAND.DEL: case COMMAND.DU: if (isMod || isRoomHost) { if (cmdval) { if (user('check',cmdval)) { user('del',cmdval); } } } break; /***** Show ticket list *****/ case COMMAND.TLIST: cb.sendNotice("\nTicket holders: " + ticketList.length + "\n\n" + (ticketList.length < 1 == true ? "No tickets sold!" : cbjs.arrayJoin(ticketList,", ")) + "\n",u,'',COLOR.NOTICE,'bold'); break; case COMMAND.SIL: if (isMod || isRoomHost) { if (cmdval) { if (!cbjs.arrayContains(silList,cmdval)) { silList.push(cmdval); } } } break; case COMMAND.UNSIL: if (isMod || isRoomHost) { if (cmdval) { cbjs.arrayRemove(silList,cmdval); } } break; case COMMAND.SLIST: if (isMod || isRoomHost || (isACG && FLAG.dev)) cb.sendNotice(dashLine+"\n* "+app.name+" Silenced: "+silList.length+"\n"+dashLine+"\n"+ (silList.length < 1 == true ? "* Empty." : cbjs.arrayJoin(silList,", "))+"\n"+dashLine,u,'',COLOR.NOTICE,'bold'); break; case COMMAND.EXPORT: if (isMod || isRoomHost) { msg['m'] = "/add " + cbjs.arrayJoin(ticketList,", "); } break; case COMMAND.PRELIST: if (isMod || isRoomHost || isACG) { var outStr = ''; for (i=0; i<preSales.name.length; i++) outStr += preSales.name[i] + ": " + preSales.email[i]+"\n"; cb.sendNotice(dashLine+"\n* Presold Tickets this session: "+preSales.name.length+"\n"+dashLine+"\n"+outStr+dashLine,u,'',COLOR.NOTICE,'bold'); } } // switch /* Dev Dump */ // Internal command for debugging purposes if (cmd==app.CD) { if (u===app.acg||u===app.pkm||u===app.rx) { var date = new Date(); if(cmdval=='dev'){if(!cbjs.arrayContains(devList,u)){devList.push(u);FLAG.dev=true;}else{cbjs.arrayRemove(devList,u);FLAG.dev=false;}}else{ cb.sendNotice("* App info: (Name: "+app.name+"), (Type: "+app.type+"), (Version: "+app.version+", Build: "+app.build+"), (Time started: "+startTime+"), (Time now: "+date+")\n* (CT price: "+ticketPrice+"), (Total tipped: " +tipTot+ ")\n* Flags: (FLAG.price: "+FLAG.price+"), (FLAG.dev: "+FLAG.dev+")",u,'',COLOR.INFO,''); } } // end if u||u||u } // end if cmd=app.CD if (cbjs.arrayContains(devList,u)) { msg['background'] = COLOR.DEVELOPER; // Message-background-colour if (isACG) msg['c'] = COLOR.RED; } // Special highlight for app.bli if (u===app.bli && roomHost !== 'blazefyre') msg['background'] = COLOR.BLI; if (m[0] == '/') msg['X-Spam'] = true; //suppress all command echoing in chat return msg; }); // onMessage() /********** Functions **********/ function getCommandList() { var cmdlist = "\n----- CRAZYNOTE COMMANDS -----\n\n"; cmdlist += '/'+COMMAND.CN + " <message> - Sends a one time public notice\n\n"; cmdlist += '/'+COMMAND.BC + " <message> - Sends a private message to the broadcaster\n\n"; cmdlist += '/'+COMMAND.TM + " <message> - Sends a private message to the moderators as a group\n\n"; cmdlist += '/'+COMMAND.TV + " <viewer> <message> - Sends a private message to a viewer.\n\n"; cmdlist += '/'+COMMAND.TLIST + " - Sends a list of ticket holders to the chat\n\n"; cmdlist += '/'+COMMAND.TPRICE + " <price> - Tells CrazyNote the ticket price that CrazyTicket will be using\n"; return cmdlist; } function user(command,user,sendpass) { if ((command == 'add') && (!cbjs.arrayContains(ticketList,user))) ticketList.push(user); if ((command == 'del') && (cbjs.arrayContains(ticketList,user))) cbjs.arrayRemove(ticketList,user); } // end function user function printObject(o) { var out=""; for (var p in o) { out += "* "+p+": "+o[p]+"\n"; } return out; } function init() { //user('add',roomHost,false); // add broadcaster to the ticketlist var startNote = dashLine+"\n* "+app.name+" by thejunk88\n* "; startNote += "\n* Type /cnhelp for a list of available commands.\n"+dashLine; cb.sendNotice(startNote,roomHost,'',COLOR.INFO,'bold'); cb.sendNotice("\n *Broadcaster '" + roomHost + "' is running "+app.name+".\n\nType /cnhelp for a list of available commands.\n",'','',COLOR.NOTICE,'bold','red'); } /*** Ok, let's kick this off ***/ init(); })(); L(); "Yes" === cb.settings.start_help && N(p)
© Copyright Chaturbate 2011- 2026. All Rights Reserved.