Bots Home
|
Create an App
LizsRoom
Author:
entomy
Description
Source Code
Launch Bot
Current Users
Created by:
Entomy
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var discount; (function (discount) { "use strict"; discount.fanclub = 1.0; discount.moderator = 1.0; function apply(item, user) { var in_fanclub = user.hasOwnProperty("from_user_in_fanclub") ? user.from_user_in_fanclub : user.in_fanclub; var is_mod = user.hasOwnProperty("from_user_is_mod") ? user.from_user_is_mod : user.is_mod; if (!in_fanclub && !is_mod) return item.cost; if (discount.fanclub <= discount.moderator) { if (in_fanclub) return Math.floor(item.cost * discount.fanclub); else if (is_mod) return Math.floor(item.cost * discount.moderator); } else if (discount.moderator <= discount.fanclub) { if (is_mod) return Math.floor(item.cost * discount.moderator); else if (in_fanclub) return Math.floor(item.cost * discount.fanclub); } return item.cost; } discount.apply = apply; })(discount || (discount = {})); var emblems; (function (emblems) { "use strict"; emblems.arrow = " :arrow16 "; emblems.ballot = " :ballot16 "; emblems.bb8 = " :miniBB-8 "; emblems.blank = " :blank16 "; emblems.bronzemedal = " :bronzemedal16c "; emblems.coppermedal = " :coppermedal16 "; emblems.crown = " :crown16 "; emblems.gavel = " :gavel16 "; emblems.goldmedal = " :goldmedal16 "; emblems.hitachi = " :hitachi16 "; emblems.notice = " :notice16 "; emblems.silvermedal = " :silvermedal16 "; emblems.song = " :song16 "; emblems.timer = " :timer16 "; emblems.tinmedal = " :tinmedal16 "; emblems.tipmenu = " :tipmenu16 "; emblems.token = " :token12 "; emblems.trusted = " :trusted16 "; emblems.whisper = " :whisper16 "; emblems.whispermod = " :whispermod16 "; })(emblems || (emblems = {})); var hatchery; (function (hatchery) { "use strict"; hatchery.level1 = ""; hatchery.level2 = ""; hatchery.level3 = ""; hatchery.level4 = ""; hatchery.level5 = ""; hatchery.level6 = ""; hatchery.level7 = ""; hatchery.level8 = ""; hatchery.level9 = ""; hatchery.level10 = ""; function apply(message) { var tipper = tippers.lookup(message.user); if (tipper == null) return message.m; if (tipper.tipped >= hatchery.progression * 10) return hatchery.level10 + message.m; else if (tipper.tipped >= hatchery.progression * 9) return hatchery.level9 + message.m; else if (tipper.tipped >= hatchery.progression * 8) return hatchery.level8 + message.m; else if (tipper.tipped >= hatchery.progression * 7) return hatchery.level7 + message.m; else if (tipper.tipped >= hatchery.progression * 6) return hatchery.level6 + message.m; else if (tipper.tipped >= hatchery.progression * 5) return hatchery.level5 + message.m; else if (tipper.tipped >= hatchery.progression * 4) return hatchery.level4 + message.m; else if (tipper.tipped >= hatchery.progression * 3) return hatchery.level3 + message.m; else if (tipper.tipped >= hatchery.progression * 2) return hatchery.level2 + message.m; else if (tipper.tipped >= hatchery.progression) return hatchery.level1 + message.m; else return message.m; } hatchery.apply = apply; })(hatchery || (hatchery = {})); var hightip; (function (hightip) { "use strict"; var slot; function compare(tip) { if (slot == null || tip.amount > slot.tipped) { slot = new tipper(tip.from_user, tip.amount); } } hightip.compare = compare; function help(message) { notice.add("/hightip --Get the highest single tipper"); notice.post(message.user); } hightip.help = help; function load(state) { var tipped = state.split(" ")[0]; var name = state.split(" ")[1]; slot = new tipper(name, Number(tipped)); } hightip.load = load; function name() { return slot == null ? null : slot.name; } hightip.name = name; function tipped() { return slot == null ? null : slot.tipped; } hightip.tipped = tipped; function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/hightip": notice.send(slot.tipped + " " + slot.name, message.user); return true; default: return false; } } hightip.tryParse = tryParse; })(hightip || (hightip = {})); var leaderboard; (function (leaderboard) { "use strict"; leaderboard.lapse = 10; leaderboard.size = 5; function help(message) { notice.add("/leaderboard --Print the leaderboard"); notice.post(message.user); message['X-Spam'] = true; } leaderboard.help = help; function isPos(pos, tipper) { return tippers.top(pos)[pos - 1] === tipper; } leaderboard.isPos = isPos; function print(slots, sendTo) { if (slots === void 0) { slots = leaderboard.size; } if (sendTo === void 0) { sendTo = ""; } var top = tippers.top(slots); if (top != null && top.length != 0) notice.add("===== Leaderboard ====="); if (top[0] != null && top[0].tipped != 0) notice.add(emblems.goldmedal + top[0].name + " " + top[0].tipped); if (top[1] != null && top[1].tipped != 0) notice.add(emblems.silvermedal + top[1].name + " " + top[1].tipped); if (top[2] != null && top[2].tipped != 0) notice.add(emblems.bronzemedal + top[2].name + " " + top[2].tipped); if (top[3] != null && top[3].tipped != 0) notice.add(emblems.tinmedal + top[3].name + " " + top[3].tipped); if (top[4] != null && top[4].tipped != 0) notice.add(emblems.coppermedal + top[4].name + " " + top[4].tipped); notice.post(sendTo); } function rotate(slots) { if (slots === void 0) { slots = leaderboard.size; } print(slots); cb.setTimeout(rotate, leaderboard.lapse * 60 * 1000); } leaderboard.rotate = rotate; function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/leaderboard": print(leaderboard.size, message.user); return true; default: return false; } } leaderboard.tryParse = tryParse; })(leaderboard || (leaderboard = {})); var menuitem = (function () { function menuitem(name, cost, handler) { var params = []; for (var _i = 3; _i < arguments.length; _i++) { params[_i - 3] = arguments[_i]; } this.name = name; this.cost = cost; this.handler = handler; this.params = params; } menuitem.prototype.handle = function (tip, params) { if (params === void 0) { params = this.params; } if (this.handler != null) { this.handler(tip, params); } }; return menuitem; }()); var menusection = (function () { function menusection(name) { var items = []; for (var _i = 1; _i < arguments.length; _i++) { items[_i - 1] = arguments[_i]; } this.items = []; this.name = name; this.items = items; } menusection.prototype.add = function (name, cost, handler) { var params = []; for (var _i = 3; _i < arguments.length; _i++) { params[_i - 3] = arguments[_i]; } this.items[this.items.length] = new menuitem(name, cost, handler, params); }; menusection.prototype.clear = function () { this.items = []; }; menusection.prototype.del = function (name) { this.items = cbjs.arrayRemove(this.items, this.lookup(name)); }; menusection.prototype.list = function () { return this.items; }; menusection.prototype.lookup = function (name) { for (var _i = 0, _a = this.items; _i < _a.length; _i++) { var item = _a[_i]; if (item.name.toLowerCase() === name.toLowerCase()) { return item; } } return null; }; menusection.prototype.match = function (tip) { var price; for (var _i = 0, _a = this.items; _i < _a.length; _i++) { var item = _a[_i]; if (tip.amount === price) { return item; } } return null; }; menusection.prototype.print = function (user, limit, discountMethod) { if (discountMethod === void 0) { discountMethod = null; } notice.add("===== " + this.name + " ====="); var price; for (var _i = 0, _a = this.items; _i < _a.length; _i++) { var item = _a[_i]; price = discountMethod != null ? discountMethod(item, user) : item.cost; if (limit != null && price >= limit) continue; notice.add(price + emblems.token + item.name); } notice.apply(emblems.tipmenu); notice.post(user.user); }; return menusection; }()); var notice; (function (notice_1) { "use strict"; notice_1.color = "#000000"; var buffer = []; function add(notice) { buffer[buffer.length] = notice; } notice_1.add = add; function adds() { var notices = []; for (var _i = 0; _i < arguments.length; _i++) { notices[_i] = arguments[_i]; } for (var _a = 0, notices_1 = notices; _a < notices_1.length; _a++) { var notice_2 = notices_1[_a]; add(notice_2); } } notice_1.adds = adds; function apply(emblem) { for (var _i = 0, buffer_1 = buffer; _i < buffer_1.length; _i++) { var notice_3 = buffer_1[_i]; notice_3 = emblem + notice_3; } } notice_1.apply = apply; function clear() { buffer = []; } notice_1.clear = clear; function help(message) { if (permissions.isAtLeastModerator(message)) { add("/note,notice <Message> --Send a notice to chat"); post(message.user); } } notice_1.help = help; function post(to, textcolor, weight, autoclear) { if (to === void 0) { to = ""; } if (textcolor === void 0) { textcolor = notice_1.color; } if (weight === void 0) { weight = "bold"; } if (autoclear === void 0) { autoclear = true; } var message = buffer.join("\n"); cb.sendNotice(message, to, "#FFFFFF", textcolor, weight); if (autoclear) clear(); } notice_1.post = post; function postGroup(to, textcolor, weight, autoclear) { if (textcolor === void 0) { textcolor = notice_1.color; } if (weight === void 0) { weight = "bold"; } if (autoclear === void 0) { autoclear = true; } var message = buffer.join("\n"); cb.sendNotice(message, "", "#FFFFFF", textcolor, weight, to); if (autoclear) clear(); } notice_1.postGroup = postGroup; function send(message, to, textcolor, weight) { if (to === void 0) { to = ""; } if (textcolor === void 0) { textcolor = notice_1.color; } if (weight === void 0) { weight = "bold"; } cb.sendNotice(message, to, "#FFFFFF", textcolor, weight); } notice_1.send = send; function sendGroup(message, to, textcolor, weight) { if (textcolor === void 0) { textcolor = notice_1.color; } if (weight === void 0) { weight = "bold"; } cb.sendNotice(message, "", "#FFFFFF", textcolor, weight, to); } notice_1.sendGroup = sendGroup; function tryParse(message) { if (permissions.isAtLeastModerator(message)) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/note": case "/notice": send(emblems.notice + m.join(" ")); return true; default: return false; } } return false; } notice_1.tryParse = tryParse; })(notice || (notice = {})); var permissions; (function (permissions) { "use strict"; var trusted = []; function entrust() { var users = []; for (var _i = 0; _i < arguments.length; _i++) { users[_i] = arguments[_i]; } for (var _a = 0, users_1 = users; _a < users_1.length; _a++) { var user_1 = users_1[_a]; trusted[trusted.length] = user_1; } } permissions.entrust = entrust; function detrust() { var users = []; for (var _i = 0; _i < arguments.length; _i++) { users[_i] = arguments[_i]; } for (var _a = 0, users_2 = users; _a < users_2.length; _a++) { var user_2 = users_2[_a]; trusted = cbjs.arrayRemove(trusted, user_2); } } permissions.detrust = detrust; function isBroadcaster(user) { return user.user === cb.room_slug; } permissions.isBroadcaster = isBroadcaster; function isTrusted(user) { return cbjs.arrayContains(trusted, user.user); } permissions.isTrusted = isTrusted; function isAtLeastTrusted(user) { return isBroadcaster(user) || isTrusted(user); } permissions.isAtLeastTrusted = isAtLeastTrusted; function isModerator(user) { return user.is_mod; } permissions.isModerator = isModerator; function isAtLeastModerator(user) { return isAtLeastTrusted(user) || isModerator(user); } permissions.isAtLeastModerator = isAtLeastModerator; function isInFanclub(user) { return user.in_fanclub; } permissions.isInFanclub = isInFanclub; function isAtLeastInFanclub(user) { return isAtLeastModerator(user) || isInFanclub(user); } permissions.isAtLeastInFanclub = isAtLeastInFanclub; function hasTippedTons(user) { return user.tipped_tons_recently; } permissions.hasTippedTons = hasTippedTons; function hasAtLeastTippedTons(user) { return isAtLeastInFanclub(user) || hasTippedTons(user); } permissions.hasAtLeastTippedTons = hasAtLeastTippedTons; function hasTippedAlot(user) { return user.tipped_alot_recently; } permissions.hasTippedAlot = hasTippedAlot; function hasAtLeastTippedAlot(user) { return hasAtLeastTippedTons(user) || hasTippedAlot(user); } permissions.hasAtLeastTippedAlot = hasAtLeastTippedAlot; function hasTipped(user) { return user.tipped_recently; } permissions.hasTipped = hasTipped; function hasAtLeastTipped(user) { return hasAtLeastTippedAlot(user) || hasTipped(user); } permissions.hasAtLeastTipped = hasAtLeastTipped; function hasTokens(user) { return user.has_tokens; } permissions.hasTokens = hasTokens; function hasAtLeastTokens(user) { return hasAtLeastTipped(user) || hasTokens(user); } permissions.hasAtLeastTokens = hasAtLeastTokens; function help(message) { if (permissions.isAtLeastTrusted(message)) { notice.add("/trust,trusted"); } if (permissions.isBroadcaster(message)) { notice.add(emblems.blank + "add <User>+ --Entrust the users"); notice.add(emblems.blank + "del,delete,rem,remove <User>+ --Detrust the users"); } if (permissions.isAtLeastTrusted(message)) { notice.add(emblems.blank + "list --List all trusted users"); notice.post(message.user); } } permissions.help = help; function tryParse(message) { if (permissions.isBroadcaster(message)) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/detrust": for (var _i = 0, m_1 = m; _i < m_1.length; _i++) { var user_3 = m_1[_i]; detrust(user_3); } return true; case "/entrust": for (var _a = 0, m_2 = m; _a < m_2.length; _a++) { var user_4 = m_2[_a]; entrust(user_4); } return true; case "/trust": case "/trusted": if (m.length === 0) return false; var operation = m.shift().toLowerCase(); switch (operation) { case "add": for (var _b = 0, m_3 = m; _b < m_3.length; _b++) { var user_5 = m_3[_b]; entrust(user_5); } return true; case "del": case "delete": case "rem": case "remove": for (var _c = 0, m_4 = m; _c < m_4.length; _c++) { var user_6 = m_4[_c]; detrust(user_6); } return true; case "help": help(message); return true; case "list": notice.send(trusted.join(", "), message.user); return true; default: return false; } } } return false; } permissions.tryParse = tryParse; })(permissions || (permissions = {})); var rotater; (function (rotater) { "use strict"; rotater.lapse = 3; var pool = []; var n = 0; function add(message) { pool[pool.length] = message; notice.send(emblems.notice + "'" + message + "' has been added to rotation"); } rotater.add = add; function del(message) { if (typeof message === "string") { pool = cbjs.arrayRemove(pool, message); notice.send(emblems.notice + "'" + message + "' has been removed from rotation"); } else if (typeof message === "number") { notice.send(emblems.notice + "'" + pool[message - 1] + "' has been removed from rotation"); pool = cbjs.arrayRemove(pool, pool[message - 1]); } } rotater.del = del; function help(message) { notice.add("/rotater,rotating,rotation"); if (permissions.isAtLeastModerator(message)) { notice.add(emblems.blank + "add <Message> --Add the notice to rotation"); } if (permissions.isAtLeastTrusted(message)) { notice.add(emblems.blank + "del,delete (<Message> | <Position>) --Delete the notice from rotation"); } notice.add(emblems.blank + "list,print --List all notices in rotation"); notice.post(message.user); notice.clear(); } rotater.help = help; function list() { return pool; } rotater.list = list; function print(user) { var i = 0; for (var _i = 0, pool_1 = pool; _i < pool_1.length; _i++) { var note = pool_1[_i]; notice.add(++i + ") " + note); } notice.post(user.user); notice.clear(); } rotater.print = print; function rotate() { notice.send(emblems.notice + pool[n++]); n %= pool.length; cb.setTimeout(rotate, rotater.lapse * 60 * 1000); } function start() { cb.setTimeout(rotate, rotater.lapse * 60 * 1000); } rotater.start = start; function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/rotater": case "/rotating": case "/rotation": break; default: return false; } if (m.length === 0) return false; var operation = m.shift().toLowerCase(); switch (operation) { case "add": if (permissions.isAtLeastModerator(message)) { rotater.add(m.join(" ")); return true; } return false; case "del": case "delete": if (permissions.isAtLeastTrusted(message)) { var pos = m.shift(); if (isNaN(Number(pos))) { m.unshift(pos); rotater.del(m.join(" ")); } else { rotater.del(Number(pos)); } return true; } return false; case "help": help(message); return true; case "list": case "print": print(message); return true; default: return false; } } rotater.tryParse = tryParse; })(rotater || (rotater = {})); var songqueue; (function (songqueue) { "use strict"; var publicPostings = false; var queue = []; function add(user, song, type) { if (type === void 0) { type = requesttype.play; } queue[queue.length] = new songrequest(user, song, type); switch (type) { case requesttype.dance: if (publicPostings) { notice.send(emblems.song + "Dance: '" + song + "' queued", cb.room_slug); } else { notice.send(emblems.song + "Dance: '" + song + "' queued"); } break; case requesttype.karaoke: if (publicPostings) { notice.send(emblems.song + "Karaoke: '" + song + "' queued", cb.room_slug); } else { notice.send(emblems.song + "Karaoke: '" + song + "' queued"); } break; case requesttype.play: if (publicPostings) { notice.send(emblems.song + "Song: '" + song + "' queued", cb.room_slug); } else { notice.send(emblems.song + "Song: '" + song + "' queued"); } break; } } songqueue.add = add; function get() { if (queue.length === 0) return null; else return queue.shift(); } songqueue.get = get; function help(message) { if (permissions.isBroadcaster(message)) { notice.add("/song"); notice.add(emblems.blank + "next --Get the next song from the queue"); notice.post(message.user); notice.clear(); } } songqueue.help = help; function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/song": break; default: return false; } if (m.length === 0) return false; var operation = m.shift().toLowerCase(); switch (operation) { case "help": help(message); return true; case "next": if (permissions.isBroadcaster(message)) { var request = get(); if (request == null) { notice.send(emblems.song + "No songs in queue"); } else { switch (request.type) { case requesttype.dance: notice.send(emblems.song + request.user + ":Dance: " + request.song); break; case requesttype.karaoke: notice.send(emblems.song + request.user + ":Karaoke: " + request.song); break; case requesttype.play: notice.send(emblems.song + request.user + ":Play: " + request.song); break; } } return true; } return false; default: return false; } } songqueue.tryParse = tryParse; })(songqueue || (songqueue = {})); var requesttype; (function (requesttype) { requesttype[requesttype["dance"] = 0] = "dance"; requesttype[requesttype["karaoke"] = 1] = "karaoke"; requesttype[requesttype["play"] = 2] = "play"; })(requesttype || (requesttype = {})); var songrequest = (function () { function songrequest(user, song, type) { if (type === void 0) { type = requesttype.play; } this.user = user; this.song = song; this.type = type; } return songrequest; }()); var tipmenu; (function (tipmenu) { "use strict"; tipmenu.specials = new menusection("Specials"); var special; (function (special) { function help(message) { if (permissions.isAtLeastTrusted(message)) { notice.add("/special,specials"); notice.add(emblems.blank + "add <Cost> <Name> --Add the special to the menu"); notice.add(emblems.blank + "clr,clear --Clear all specials"); notice.add(emblems.blank + "del,delete <Name> --Delete the special from the menu"); notice.post(message.user); } } special.help = help; function tryParse(message) { if (!permissions.isAtLeastTrusted(message)) return false; var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/special": case "/specials": break; default: return false; } if (m.length === 0) return false; var operation = m.shift().toLowerCase(); var name; switch (operation) { case "add": var cost = m.shift(); if (isNaN(Number(cost))) { m.unshift(cost); cost = m.pop(); if (isNaN(Number(cost))) return false; } name = m.join(" "); tipmenu.specials.add(name, Number(cost)); notice.send(emblems.tipmenu + "'" + name + "' added as a special for " + cost + emblems.token); return true; case "clr": case "clear": tipmenu.specials.clear(); notice.send(emblems.tipmenu + "All specials have been removed"); return true; case "del": case "delete": name = m.join(" "); tipmenu.specials.del(name); notice.send(emblems.tipmenu + "'" + name + "' has been removed from the specials"); return true; case "help": help(message); return true; default: return false; } } special.tryParse = tryParse; })(special = tipmenu.special || (tipmenu.special = {})); })(tipmenu || (tipmenu = {})); var stats; (function (stats) { "use strict"; function meanHalves(sendTo) { notice.add("Upper Mean: " + tippers.meanUpper()); notice.add("Lower Mean: " + tippers.meanLower()); notice.post(sendTo); } stats.meanHalves = meanHalves; function medianTip(sendTo) { notice.add("Median Tip: " + tippers.median()); notice.post(sendTo); } stats.medianTip = medianTip; function showDuration(sendTo) { var duration = timers.showDuration(); notice.add("Show Duration: " + duration[0] + ":" + duration[1] + ":" + duration[2]); notice.post(sendTo); } stats.showDuration = showDuration; function tippersTotal(sendTo) { notice.add("Tippers Total: " + tippers.count); notice.post(sendTo); } stats.tippersTotal = tippersTotal; function tokensPerHour(sendTo) { var duration = timers.showDuration(); var minutes = duration[0] * 60 + duration[1]; var rate = (tippers.tipped() / minutes) * 60; notice.add("Tokens Per Hour: " + rate); notice.post(sendTo); } stats.tokensPerHour = tokensPerHour; function tokensPerTipper(sendTo) { notice.add("Tokens Per Tipper: " + tippers.tipped() / tippers.count()); notice.post(sendTo); } stats.tokensPerTipper = tokensPerTipper; function tokensTotal(sendTo) { notice.add("Tokens Total: " + tippers.tipped()); notice.post(sendTo); } stats.tokensTotal = tokensTotal; })(stats || (stats = {})); var tallier; (function (tallier) { "use strict"; var tallies = []; function add(item, amount) { if (amount === void 0) { amount = 1; } var tally = lookup(item); if (tally == null) { tallies[tallies.length] = [item, amount]; } else { tally[1] += amount; } } tallier.add = add; function clear() { tallies = []; } tallier.clear = clear; function highest() { if (tallies == null || tallies === []) return null; var high = [null, 0]; for (var _i = 0, tallies_1 = tallies; _i < tallies_1.length; _i++) { var tally = tallies_1[_i]; if (tally[1] > high[1]) high = tally; } return high; } tallier.highest = highest; function lookup(item) { for (var _i = 0, tallies_2 = tallies; _i < tallies_2.length; _i++) { var tally = tallies_2[_i]; if (tally[0] === item) return tally; } return null; } tallier.lookup = lookup; })(tallier || (tallier = {})); var teamate = (function () { function teamate(tipper, points) { if (points === void 0) { points = 0; } this.tipper = tipper; this.points = points; } teamate.prototype.name = function () { return this.tipper.name; }; teamate.prototype.tipped = function () { return this.tipper.tipped; }; return teamate; }()); var team = (function () { function team(name, emblem, discount) { if (discount === void 0) { discount = 0; } this.members = []; this.name = ""; this.emblem = ""; this.discount = 0; this.name = name; this.emblem = emblem; this.discount = discount; } team.prototype.add = function (user, points) { if (points === void 0) { points = 0; } var member = this.lookup(user); if (member !== null) return; var tipper = tippers.lookup(user); if (tipper === null) { tippers.dummy(user); tipper = tippers.lookup(user); } this.members[this.members.length] = new teamate(tipper, points); }; team.prototype.adds = function () { var users = []; for (var _i = 0; _i < arguments.length; _i++) { users[_i] = arguments[_i]; } if (typeof users[0] === "string") { for (var _a = 0, _b = users; _a < _b.length; _a++) { var user_7 = _b[_a]; this.add(user_7); } } else { for (var _c = 0, _d = users; _c < _d.length; _c++) { var user_8 = _d[_c]; this.add(user_8[0], user_8[1]); } } }; team.prototype.applyEmblem = function (message) { if (this.isMember(message)) { return this.emblem + message.m; } else { return message.m; } }; team.prototype.applyDiscount = function (item, user) { if (!this.isMember(user)) { return item.cost; } else { return Math.floor(item.cost * (1 - this.discount)); } }; team.prototype.del = function (user) { cbjs.arrayRemove(this.members, this.lookup(user)); }; team.prototype.dels = function (users) { for (var _i = 0, users_3 = users; _i < users_3.length; _i++) { var user_9 = users_3[_i]; cbjs.arrayRemove(this.members, this.lookup(user_9)); } }; team.prototype.isMember = function (user) { var name; if (typeof user == "string") { name = user; } else { name = user.hasOwnProperty("from_user") ? user.from_user : user.user; } for (var _i = 0, _a = this.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.name() == name) return true; } return false; }; team.prototype.length = function () { return this.members.length; }; team.prototype.list = function (withPoints) { if (withPoints === void 0) { withPoints = false; } this.sort(); var result = []; if (withPoints) { var points = void 0; for (var _i = 0, _a = this.members; _i < _a.length; _i++) { var member = _a[_i]; points = member.points + member.tipped(); result[result.length] = "[" + points + "] " + member.name(); } } else { for (var _b = 0, _c = this.members; _b < _c.length; _b++) { var member = _c[_b]; result[result.length] = member.name(); } } return result; }; team.prototype.load = function (state) { var users = state.trim().split(","); var name; var points; for (var _i = 0, users_4 = users; _i < users_4.length; _i++) { var user_10 = users_4[_i]; name = user_10.trim().split(" ")[0]; points = Number(user_10.trim().split(" ")[1]); this.add(name, points); } }; team.prototype.lookup = function (name) { for (var _i = 0, _a = this.members; _i < _a.length; _i++) { var member = _a[_i]; if (member.name() == name) { return member; } } return null; }; team.prototype.save = function () { this.sort(); var state = ""; for (var _i = 0, _a = this.members; _i < _a.length; _i++) { var member = _a[_i]; state += member.name() + " " + (member.points + member.tipped()) + ", "; } state = state.substring(0, state.length - 2); return state; }; team.prototype.sort = function () { this.members = this.members.sort(function (a, b) { return (b.points + b.tipped()) - (a.points + a.tipped()); }); }; team.prototype.points = function () { var result; for (var _i = 0, _a = this.members; _i < _a.length; _i++) { var member = _a[_i]; result += member.points; } return result; }; return team; }()); var fanteam = (function (_super) { __extends(fanteam, _super); function fanteam() { return _super !== null && _super.apply(this, arguments) || this; } fanteam.prototype.isMember = function (user) { return user.hasOwnProperty("from_user") ? user.from_user_in_fanclub : user.in_fanclub; }; return fanteam; }(team)); var modteam = (function (_super) { __extends(modteam, _super); function modteam() { return _super !== null && _super.apply(this, arguments) || this; } modteam.prototype.isMember = function (user) { return user.hasOwnProperty("from_user") ? user.from_user_is_mod : user.is_mod; }; return modteam; }(team)); var teams; (function (teams) { var pool = []; function addTeam(team) { pool[pool.length] = team; } teams.addTeam = addTeam; function addToTeam(user, teamName) { var name; if (typeof user === "string") { name = user; } else { name = user.hasOwnProperty("from_user") ? user.from_user : user.user; } var team = lookup(teamName); if (team == null) return; if (!team.isMember(user)) team.add(name); } teams.addToTeam = addToTeam; function applyDiscount(item, user) { cb.log("applyDiscount()"); var result = Number.MAX_VALUE; var discount = Number.MAX_VALUE; for (var _i = 0, pool_2 = pool; _i < pool_2.length; _i++) { var team = pool_2[_i]; discount = team.applyDiscount(item, user); cb.log("discount: " + discount); if (discount < result) { result = discount; cb.log("result: " + result); } } return result; } teams.applyDiscount = applyDiscount; function applyEmblem(message) { var team = memberOf(message); if (team !== null) { return team.applyEmblem(message); } else { return message.m; } } teams.applyEmblem = applyEmblem; function help(message) { if (permissions.isAtLeastModerator(message)) { notice.add("/team list --List the teams"); if (permissions.isAtLeastTrusted(message)) { notice.add("/team <Team> add <Users>+ --Add the specified users to the team"); notice.add("/team <Team> del,delete,rem,remove <Users>+ --Remove the specified users from the team"); } notice.add("/team <Team> list --List the members of the specifed team"); } notice.post(message.user); } teams.help = help; function isMember(user) { for (var _i = 0, pool_3 = pool; _i < pool_3.length; _i++) { var team = pool_3[_i]; if (team.isMember(user)) return true; } return false; } teams.isMember = isMember; function isMemberOf(user, teamName) { var team = lookup(teamName); if (team == null) return false; return team.isMember(user); } teams.isMemberOf = isMemberOf; function lookup(teamName) { for (var _i = 0, pool_4 = pool; _i < pool_4.length; _i++) { var team = pool_4[_i]; if (team.name == teamName) return team; } return null; } teams.lookup = lookup; function memberOf(user) { for (var _i = 0, pool_5 = pool; _i < pool_5.length; _i++) { var team = pool_5[_i]; if (team.isMember(user)) return team; } return null; } teams.memberOf = memberOf; function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/team": case "/teams": break; default: return false; } if (m.length === 0) return false; var operation = m.shift().toLowerCase(); switch (operation) { case "help": help(message); return true; case "list": for (var _i = 0, pool_6 = pool; _i < pool_6.length; _i++) { var p = pool_6[_i]; notice.send(p.name, message.user); } return true; default: m.push(operation); break; } var teamName = m.shift().toLowerCase(); var team = lookup(teamName); if (team == null) { notice.send("The given team '" + teamName + "' does not seem to exist", message.user); return false; } if (m.length === 0) return false; operation = m.shift().toLowerCase(); switch (operation) { case "add": for (var _a = 0, m_5 = m; _a < m_5.length; _a++) { var user = m_5[_a]; team.adds(user); } return true; case "del": case "delete": case "rem": case "remove": for (var _b = 0, m_6 = m; _b < m_6.length; _b++) { var user = m_6[_b]; team.del(user); } case "list": case "print": for (var _c = 0, _d = team.list(); _c < _d.length; _c++) { var teamate = _d[_c]; notice.send(teamate, message.user); } return true; default: return false; } } teams.tryParse = tryParse; })(teams || (teams = {})); var tickets; (function (tickets) { "use strict"; tickets.saleprice = null; function help(message) { notice.add("/ticket,tickets"); if (permissions.isAtLeastModerator(message)) { notice.add(emblems.blank + "holders --List all ticket holders"); } if (permissions.isAtLeastTrusted(message)) { notice.add(emblems.blank + "issue,give <names>+ --Issue a ticket to all specified users"); notice.add(emblems.blank + "revoke <names>+ --Revoke tickets from all specified users"); notice.add(emblems.blank + "sale,sell <cost> --Start selling tickets for the specified cost"); notice.add(emblems.blank + "start show [<message>] --Start the ticket show, with optional message to show non-ticket holders"); notice.add(emblems.blank + "stop sale,sell --Stop selling tickets"); notice.add(emblems.blank + "stop show --Stop the ticket show"); } } tickets.help = help; function holders() { return cb.limitCam_allUsersWithAccess(); } tickets.holders = holders; function is_holder(name) { return cb.limitCam_userHasAccess(name); } tickets.is_holder = is_holder; function issue() { var names = []; for (var _i = 0; _i < arguments.length; _i++) { names[_i] = arguments[_i]; } cb.limitCam_addUsers(names); } tickets.issue = issue; function revoke() { var names = []; for (var _i = 0; _i < arguments.length; _i++) { names[_i] = arguments[_i]; } cb.limitCam_removeUsers(names); } tickets.revoke = revoke; function revokeAll() { cb.limitCam_removeAllUsers(); } tickets.revokeAll = revokeAll; function startSales(cost) { tickets.saleprice = cost; } tickets.startSales = startSales; function startShow(message) { if (message === void 0) { message = "Buy a ticket into the show for " + tickets.saleprice + " tokens"; } cb.limitCam_start(message); } tickets.startShow = startShow; function stopSales() { tickets.saleprice = null; } tickets.stopSales = stopSales; function stopShow() { cb.limitCam_stop(); } tickets.stopShow = stopShow; function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/ticket": case "/tickets": if (!permissions.isAtLeastModerator(message)) return false; break; default: return false; } if (m.length === 0) return false; var operation = m.shift().toLowerCase(); switch (operation) { case "help": help(message); return true; case "holders": notice.send(holders().join(", "), message.user); return true; case "issue": case "give": if (!permissions.isAtLeastTrusted(message)) return false; for (var _i = 0, m_7 = m; _i < m_7.length; _i++) { var user_11 = m_7[_i]; issue(user_11); } notice.send("Tickets issued for: " + m, message.user); return true; case "revoke": if (!permissions.isAtLeastTrusted(message)) return false; for (var _a = 0, m_8 = m; _a < m_8.length; _a++) { var user_12 = m_8[_a]; revoke(user_12); } notice.send("Tickets revoked for: " + m, message.user); return true; case "sale": case "sell": if (!permissions.isAtLeastTrusted(message)) return false; var cost = m.shift(); if (isNaN(Number(cost))) { notice.send("'" + cost + "' wasn't recognized as a number", message.user); return false; } startSales(Number(cost)); notice.send(emblems.notice + "Ticket sales have started for " + tickets.saleprice + emblems.token); return true; case "start": if (!permissions.isAtLeastTrusted(message)) return false; if (m.length === 0) return false; operation = m.shift().toLowerCase(); switch (operation) { case "show": if (m.length === 0) { startShow(); } else { startShow(m.join(" ")); } return true; default: return false; } case "stop": if (!permissions.isAtLeastTrusted(message)) return false; if (m.length === 0) return false; operation = m.shift().toLowerCase(); switch (operation) { case "sale": case "sell": stopSales(); notice.send(emblems.notice + "Ticket sales have stopped"); return true; case "show": stopShow(); return true; default: return false; } default: return false; } } tickets.tryParse = tryParse; })(tickets || (tickets = {})); var timer = (function () { function timer(name, duration, delay, onStart, onStop) { if (delay === void 0) { delay = 0; } this.name = name; this.duration = duration; this.remaining = duration; this.delay = delay; this.onStart = onStart; this.onStop = onStop; } timer.prototype.extend = function (seconds) { this.duration += seconds; this.remaining += seconds; notice.send(emblems.timer + "'" + this.name + "' extended with " + seconds + "sec"); }; timer.prototype.isActive = function () { return this.delay > 0 || this.remaining > 0; }; timer.prototype.isDelayed = function () { return this.delay > 0; }; timer.prototype.isRunning = function () { return this.remaining < this.duration && this.remaining > 0; }; timer.prototype.tick = function () { if (this.delay === 0 && this.remaining === this.duration) { notice.send(emblems.timer + "'" + this.name + "' started with " + this.duration / 60 + "min"); if (this.onStart != null) this.onStart(); } else if (this.delay === 0 && this.remaining === 0) { notice.send(emblems.timer + "'" + this.name + "' has expired"); if (this.onStop != null) this.onStop(); } else if (this.delay === 0 && this.remaining % 60 === 0) { notice.send(emblems.timer + "'" + this.name + "' has " + this.remaining / 60 + "min remaining"); } if (this.delay > 0) { this.delay--; } else if (this.remaining > 0) { this.remaining--; } }; return timer; }()); var timers; (function (timers) { "use strict"; var pool = []; var showtime = 0; function add(name, duration, delay, onStart, onStop) { if (delay === void 0) { delay = 0; } pool[pool.length] = new timer(name, duration, delay, onStart, onStop); if (delay > 0) { notice.send(emblems.timer + "'" + name + "' will start in " + delay + "s"); } } timers.add = add; function clear() { pool = []; } timers.clear = clear; function del(timer) { if (typeof timer === "number") { notice.send(emblems.timer + "'" + pool[timer].name + "' has been removed"); pool = cbjs.arrayRemove(pool, pool[timer]); } else if (typeof timer === "string") { if (cbjs.arrayContains(pool, lookup(timer))) { notice.send(emblems.timer + "'" + timer + "' has been removed"); pool = cbjs.arrayRemove(pool, lookup(timer)); } } } timers.del = del; function extend(name, duration) { var timer = lookup(name); if (timer != null) { timer.extend(duration); } } timers.extend = extend; function help(message) { if (permissions.isAtLeastModerator(message)) { notice.add("/timer,timers"); notice.add(emblems.blank + "add,start <Duration> <Name> --Add and start the timer"); } if (permissions.isAtLeastTrusted(message)) { notice.add(emblems.blank + "clr,clear --Clear and stop all timers"); notice.add(emblems.blank + "del,delete (<Name> | <Position>) --Delete the timer without any stop events"); notice.add(emblems.blank + "ext,extend <Duration> <Name> --Extend the timer"); } notice.add(emblems.blank + "list,print --List all active timers"); if (permissions.isAtLeastTrusted(message)) { notice.add(emblems.blank + "stop (<Name | <Position>) --Stop the timer next tick"); } notice.post(message.user); } timers.help = help; function list() { return pool; } timers.list = list; function lookup(name) { for (var _i = 0, pool_7 = pool; _i < pool_7.length; _i++) { var timer_1 = pool_7[_i]; if (timer_1.name.toLowerCase() == name.toLowerCase()) { return timer_1; } } return null; } timers.lookup = lookup; function showDuration() { var hours = 0; var minutes = 0; var seconds = showtime; while (seconds >= 3600) { seconds -= 3600; hours += 1; } while (seconds >= 60) { seconds -= 60; minutes += 1; } return [hours, minutes, seconds]; } timers.showDuration = showDuration; function start() { cb.setTimeout(tick, 1000); } timers.start = start; function stop(timer) { if (typeof timer === "number") { if (pool[timer] != null) pool[timer].remaining = 0; } else if (typeof timer === "string") { var t = lookup(timer); if (t != null) { t.remaining = 0; } } } timers.stop = stop; function tick() { var keep = []; showtime += 1; for (var _i = 0, pool_8 = pool; _i < pool_8.length; _i++) { var timer_2 = pool_8[_i]; if (timer_2.isActive()) keep[keep.length] = timer_2; timer_2.tick(); } if (pool !== keep) { pool = keep; } cb.setTimeout(tick, 1000); } function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/timer": case "/timers": break; default: return false; } if (m.length === 0) return false; var operation = m.shift().toLowerCase(); var name; var duration; var pos; switch (operation) { case "add": case "start": if (!permissions.isAtLeastModerator(message)) return false; duration = m.shift(); if (isNaN(Number(duration))) { m.unshift(duration); duration = m.pop(); if (isNaN(Number(duration))) return false; } name = m.join(" "); timers.add(name, Number(duration) * 60); return true; case "clr": case "clear": if (!permissions.isAtLeastTrusted(message)) return false; timers.clear(); return true; case "del": case "delete": if (!permissions.isAtLeastTrusted(message)) return false; pos = m.shift(); if (isNaN(Number(pos))) { m.unshift(pos); timers.del(m.join(" ")); } else { timers.del(Number(pos) - 1); } return true; case "ext": case "extend": if (!permissions.isAtLeastTrusted(message)) return false; duration = m.shift(); if (isNaN(Number(duration))) { m.unshift(duration); duration = m.pop(); if (isNaN(Number(duration))) return false; } name = m.join(" "); timers.extend(name, Number(duration) * 60); return true; case "help": help(message); return true; case "list": case "print": var i = 0; for (var _i = 0, pool_9 = pool; _i < pool_9.length; _i++) { var timer_3 = pool_9[_i]; notice.add(++i + ") '" + timer_3.name + "' with " + timer_3.remaining + "s"); } notice.apply(emblems.timer); notice.post(message.user); return true; case "stop": if (!permissions.isAtLeastTrusted(message)) return false; pos = m.shift(); if (isNaN(Number(pos))) { m.unshift(pos); timers.stop(m.join(" ")); } else { timers.stop(Number(pos) - 1); } return true; default: return false; } } timers.tryParse = tryParse; })(timers || (timers = {})); var tipper = (function () { function tipper(name, tipped) { this.name = name; this.tipped = tipped; } return tipper; }()); var tippers; (function (tippers) { "use strict"; var pool = []; function add(tip) { var candidate = lookup(tip.from_user); if (candidate == null) { pool[pool.length] = new tipper(tip.from_user, 0); candidate = pool[pool.length - 1]; } candidate.tipped += tip.amount; } tippers.add = add; function count() { return pool.length; } tippers.count = count; function dummy(name) { pool[pool.length] = new tipper(name, 0); } tippers.dummy = dummy; function lookup(user) { for (var _i = 0, pool_10 = pool; _i < pool_10.length; _i++) { var tipper_1 = pool_10[_i]; if (tipper_1.name === user) return tipper_1; } return null; } tippers.lookup = lookup; function meanLower() { sort(); var lower = pool.slice(0, pool.length); var total = 0; for (var _i = 0, lower_1 = lower; _i < lower_1.length; _i++) { var tipper_2 = lower_1[_i]; total += tipper_2.tipped; } return total / lower.length; } tippers.meanLower = meanLower; function meanUpper() { sort(); var upper = pool.slice(pool.length / 2, pool.length); var total = 0; for (var _i = 0, upper_1 = upper; _i < upper_1.length; _i++) { var tipper_3 = upper_1[_i]; total += tipper_3.tipped; } return total / upper.length; } tippers.meanUpper = meanUpper; function median() { sort(); if (pool[Math.floor(pool.length / 2)] == null) { return NaN; } else { return pool[Math.floor(pool.length / 2)].tipped; } } tippers.median = median; function sort() { pool = pool.sort(function (a, b) { return b.tipped - a.tipped; }); } tippers.sort = sort; function top(amount) { sort(); return pool.slice(0, amount); } tippers.top = top; function tipped() { var total = 0; for (var _i = 0, pool_11 = pool; _i < pool_11.length; _i++) { var tipper_4 = pool_11[_i]; total += tipper_4.tipped; } return total; } tippers.tipped = tipped; })(tippers || (tippers = {})); var viewers; (function (viewers) { "use strict"; viewers.current = 0; viewers.withTokens = 0; viewers.inFanclub = 0; viewers.claimMale = 0; viewers.claimFemale = 0; viewers.claimTrans = 0; viewers.claimCouple = 0; function enter(user) { viewers.current += 1; if (user.has_tokens) viewers.withTokens += 1; if (user.in_fanclub) viewers.inFanclub += 1; if (user.gender == "m") viewers.claimMale += 1; if (user.gender == "f") viewers.claimFemale += 1; if (user.gender == "s") viewers.claimTrans += 1; if (user.gender == "c") viewers.claimTrans += 1; } viewers.enter = enter; function leave(user) { viewers.current -= 1; if (user.has_tokens) viewers.withTokens -= 1; if (user.in_fanclub) viewers.inFanclub -= 1; if (user.gender == "m") viewers.claimMale -= 1; if (user.gender == "f") viewers.claimFemale -= 1; if (user.gender == "s") viewers.claimTrans -= 1; if (user.gender == "c") viewers.claimTrans -= 1; } viewers.leave = leave; })(viewers || (viewers = {})); var votes; (function (votes) { "use strict"; var casts = []; var ballot = []; function cast(username, choice) { for (var _i = 0, ballot_1 = ballot; _i < ballot_1.length; _i++) { var ch = ballot_1[_i]; if (ch.toLowerCase() === choice.toLowerCase()) { casts[casts.length] = [username, choice]; notice.send(emblems.ballot + "Vote cast", username); return; } } notice.send(emblems.ballot + "Your vote for '" + choice + "' was not recognized among the valid options", username); } votes.cast = cast; function clear() { casts = []; ballot = []; } votes.clear = clear; function help(message) { if (permissions.hasAtLeastTokens(message)) { notice.add("/vote,votes,voting <Choice> --Cast a vote for the choice"); } if (permissions.isAtLeastModerator(message)) { notice.add(emblems.blank + "start,ballot (<Choice>,)+ --Start voting among the specified choices"); notice.add(emblems.blank + "stop,end,tally --Stop voting, tally results, and declare the winner"); } notice.post(message.user); } votes.help = help; function lookup(username) { for (var _i = 0, casts_1 = casts; _i < casts_1.length; _i++) { var cast_1 = casts_1[_i]; if (cast_1[0] === username) return cast_1; } return null; } votes.lookup = lookup; function start(choices) { clear(); for (var _i = 0, choices_1 = choices; _i < choices_1.length; _i++) { var choice = choices_1[_i]; ballot[ballot.length] = choice.trim(); } notice.add(emblems.ballot + "A ballot has started between the following:"); for (var _a = 0, choices_2 = choices; _a < choices_2.length; _a++) { var choice = choices_2[_a]; notice.add(emblems.ballot + choice); } notice.post(); notice.clear(); } votes.start = start; function stop() { if (casts == null || casts === []) { notice.send(emblems.ballot + "No votes have been cast"); return; } for (var _i = 0, casts_2 = casts; _i < casts_2.length; _i++) { var cast_2 = casts_2[_i]; tallier.add(cast_2[1]); } var highest = tallier.highest(); notice.send(emblems.ballot + "Winner is: '" + highest[0] + "' with " + highest[1] + " votes"); clear(); tallier.clear(); } votes.stop = stop; function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/vote": case "/votes": case "/voting": break; default: return false; } if (m.length === 0) return false; var operation = m.shift().toLowerCase(); switch (operation) { case "help": help(message); return true; case "start": case "ballot": if (!permissions.isAtLeastModerator(message)) return false; var choices = m.join(" ").split(","); for (var _i = 0, choices_3 = choices; _i < choices_3.length; _i++) { var choice = choices_3[_i]; choice = choice.trim(); } start(choices); return true; case "stop": case "end": case "tally": if (!permissions.isAtLeastModerator(message)) return false; stop(); return true; default: if (!permissions.hasAtLeastTokens(message)) return false; m.unshift(operation); cast(message.user, m.join(" ")); return true; } } votes.tryParse = tryParse; })(votes || (votes = {})); var whisper; (function (whisper) { "use strict"; function help(message) { if (permissions.hasAtLeastTokens(message)) { notice.add("/w,whisper"); notice.add(emblems.blank + "model <Message> --Send a message to the model"); notice.add(emblems.blank + "mod,mods,moderator,moderators <Message> --Send a message to all moderators"); notice.add(emblems.blank + "<User> <Message> --Send a message to the user"); notice.post(message.user); notice.clear(); } } whisper.help = help; function model(message, m) { if (permissions.isTrusted(message)) notice.send(emblems.whisper + message.user + ": " + m, cb.room_slug, "#802080", "bolder"); else if (permissions.isModerator(message)) notice.send(emblems.whisper + message.user + ": " + m, cb.room_slug, "#802020", "bolder"); else if (permissions.isInFanclub(message)) notice.send(emblems.whisper + message.user + ": " + m, cb.room_slug, "#208020"); else if (permissions.hasTokens(message)) notice.send(emblems.whisper + message.user + ": " + m, cb.room_slug, "#808080"); } function mods(message, m) { notice.add(emblems.whispermod + message.user + ": " + m); notice.post(cb.room_slug, "#802020", "bolder", false); notice.postGroup("red", "#802020", "bolder", false); notice.clear(); } function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/model": model(message, m.join(" ")); notice.send(emblems.whisper + "Sent to: " + cb.room_slug, message.user); return true; case "/mod": case "/mods": case "/moderator": case "/moderators": mods(message, m.join(" ")); notice.send(emblems.whispermod + "Sent to all moderators", message.user); return true; case "/w": case "/whisper": break; default: return false; } if (m.length === 0) return false; var target = m.shift().toLowerCase(); switch (target) { case "help": help(message); return true; case "model": model(message, m.join(" ")); notice.send(emblems.whisper + "Sent to: " + cb.room_slug, message.user); return true; case "mod": case "mods": case "moderator": case "moderators": mods(message, m.join(" ")); notice.send(emblems.whispermod + "Sent to all moderators", message.user); return true; default: if (target.toLowerCase() === cb.room_slug) { model(message, m.join(" ")); } else if (message.user === cb.room_slug) { notice.send(emblems.whisper + message.user + ": " + m.join(" "), target, "#804020"); } else { notice.send(emblems.whisper + message.user + ": " + m.join(" "), target, "#808080", "normal"); } notice.send(emblems.whisper + "Sent to: " + target, message.user); return true; } } whisper.tryParse = tryParse; })(whisper || (whisper = {})); cb.onEnter(function (user) { notice.adds("Welcome to my room!", "To see available commands, enter /roomhelp in chat", "Check out the tip menu with: /menu"); notice.apply(emblems.notice); notice.post(user.user); viewers.enter(user); }); cb.onLeave(function (user) { if (hightip.name() !== null && hightip.name() === user.user) { notice.send(emblems.notice + "King " + hightip.name() + " has left... Quick, steal the" + emblems.crown); } viewers.leave(user); }); cb.onMessage(function (message) { if (message.m.trim().charAt(0) === "/") message['X-Spam'] = true; var validCommand = false; if (!validCommand) validCommand = hightip.tryParse(message); if (!validCommand) validCommand = leaderboard.tryParse(message); if (!validCommand) validCommand = notice.tryParse(message); if (!validCommand) validCommand = permissions.tryParse(message); if (!validCommand) validCommand = room.tryParse(message); if (!validCommand) validCommand = rotater.tryParse(message); if (!validCommand) validCommand = songqueue.tryParse(message); if (!validCommand) validCommand = tipmenu.special.tryParse(message); if (!validCommand) validCommand = stats.tryParse(message); if (!validCommand) validCommand = teams.tryParse(message); if (!validCommand) validCommand = tickets.tryParse(message); if (!validCommand) validCommand = timers.tryParse(message); if (!validCommand) validCommand = tipmenu.tryParse(message); if (!validCommand) validCommand = votes.tryParse(message); if (!validCommand) validCommand = whisper.tryParse(message); if (message['X-Spam'] || validCommand) return message; message.m = message.m.replace(/\bbb\b/ig, " :miniBB-8 "); message.m = message.m.replace(/\bpm\b/ig, " :Truedeau "); if (permissions.isTrusted(message)) { message.m = " :greylizard16 " + message.m; } else if (message.is_mod) { message.m = " :redlizard16 " + message.m; } else if (message.in_fanclub) { message.m = " :greenlizard16 " + message.m; } else if (teams.isMember(message)) { message.m = teams.applyEmblem(message); } else { message.m = hatchery.apply(message); } if (tippers.lookup(message.user) !== null) { message.m = "[" + tippers.lookup(message.user).tipped + "]" + message.m; } return message; }); cb.onTip(function (tip) { tippers.add(tip); hightip.compare(tip); var match = tipmenu.match(tip); if (match != null) { notice.send(emblems.tipmenu + tip.from_user + " has tipped for " + match.name); match.handle(tip); } }); var tipmenu; (function (tipmenu) { "use strict"; var analLevel; (function (analLevel) { analLevel[analLevel["off"] = 0] = "off"; analLevel[analLevel["small"] = 1] = "small"; analLevel[analLevel["medium"] = 2] = "medium"; analLevel[analLevel["large"] = 3] = "large"; analLevel[analLevel["xlarge"] = 4] = "xlarge"; })(analLevel = tipmenu.analLevel || (tipmenu.analLevel = {})); ; var clampsLevel; (function (clampsLevel) { clampsLevel[clampsLevel["off"] = 0] = "off"; clampsLevel[clampsLevel["on"] = 1] = "on"; })(clampsLevel = tipmenu.clampsLevel || (tipmenu.clampsLevel = {})); ; var clothesLevel; (function (clothesLevel) { clothesLevel[clothesLevel["off"] = 0] = "off"; clothesLevel[clothesLevel["on"] = 1] = "on"; })(clothesLevel = tipmenu.clothesLevel || (tipmenu.clothesLevel = {})); ; var danceLevel; (function (danceLevel) { danceLevel[danceLevel["off"] = 0] = "off"; danceLevel[danceLevel["on"] = 1] = "on"; })(danceLevel = tipmenu.danceLevel || (tipmenu.danceLevel = {})); ; var gagsLevel; (function (gagsLevel) { gagsLevel[gagsLevel["off"] = 0] = "off"; gagsLevel[gagsLevel["ball"] = 1] = "ball"; gagsLevel[gagsLevel["chode"] = 2] = "chode"; })(gagsLevel = tipmenu.gagsLevel || (tipmenu.gagsLevel = {})); ; var gamesLevel; (function (gamesLevel) { gamesLevel[gamesLevel["off"] = 0] = "off"; gamesLevel[gamesLevel["on"] = 1] = "on"; })(gamesLevel = tipmenu.gamesLevel || (tipmenu.gamesLevel = {})); ; var iceLevel; (function (iceLevel) { iceLevel[iceLevel["off"] = 0] = "off"; iceLevel[iceLevel["on"] = 1] = "on"; })(iceLevel = tipmenu.iceLevel || (tipmenu.iceLevel = {})); ; var miscLevel; (function (miscLevel) { miscLevel[miscLevel["off"] = 0] = "off"; miscLevel[miscLevel["on"] = 1] = "on"; })(miscLevel = tipmenu.miscLevel || (tipmenu.miscLevel = {})); ; var oralLevel; (function (oralLevel) { oralLevel[oralLevel["off"] = 0] = "off"; oralLevel[oralLevel["blowjob"] = 1] = "blowjob"; oralLevel[oralLevel["deepthroat"] = 2] = "deepthroat"; })(oralLevel = tipmenu.oralLevel || (tipmenu.oralLevel = {})); ; var pussyLevel; (function (pussyLevel) { pussyLevel[pussyLevel["off"] = 0] = "off"; pussyLevel[pussyLevel["coveredOnly"] = 1] = "coveredOnly"; pussyLevel[pussyLevel["showOnly"] = 2] = "showOnly"; pussyLevel[pussyLevel["noShowPlay"] = 3] = "noShowPlay"; pussyLevel[pussyLevel["fullPlay"] = 4] = "fullPlay"; })(pussyLevel = tipmenu.pussyLevel || (tipmenu.pussyLevel = {})); ; var showerLevel; (function (showerLevel) { showerLevel[showerLevel["off"] = 0] = "off"; showerLevel[showerLevel["on"] = 1] = "on"; })(showerLevel = tipmenu.showerLevel || (tipmenu.showerLevel = {})); ; var spanksLevel; (function (spanksLevel) { spanksLevel[spanksLevel["off"] = 0] = "off"; spanksLevel[spanksLevel["ass"] = 1] = "ass"; spanksLevel[spanksLevel["pussy"] = 2] = "pussy"; })(spanksLevel = tipmenu.spanksLevel || (tipmenu.spanksLevel = {})); ; var flags; (function (flags) { })(flags = tipmenu.flags || (tipmenu.flags = {})); })(tipmenu || (tipmenu = {})); var tipmenu; (function (tipmenu) { var handlers; (function (handlers) { function addButtplug(_tip) { tipmenu.flags.plugged = true; } handlers.addButtplug = addButtplug; function ballgag(_tip, duration) { var timer = timers.lookup("Ballgag"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Ballgag", duration * 60, 30, function () { tipmenu.flags.gagged = tipmenu.gagsLevel.ball; tipmenu.build(); }, function () { tipmenu.flags.gagged = tipmenu.gagsLevel.off; tipmenu.build(); }); } } handlers.ballgag = ballgag; function ballgagClamps(_tip, duration) { var timer = timers.lookup("Ballgag with Clamps"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Ballgag with Clamps", duration * 60, 30, function () { tipmenu.flags.clamped = true; tipmenu.flags.gagged = tipmenu.gagsLevel.ball; tipmenu.build(); }, function () { tipmenu.flags.gagged = tipmenu.gagsLevel.off; tipmenu.build(); }); } } handlers.ballgagClamps = ballgagClamps; function chodeGag(_tip, duration) { var timer = timers.lookup("Chodegag"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Chodegag", duration * 60, 30, function () { tipmenu.flags.gagged = tipmenu.gagsLevel.chode; tipmenu.build(); }, function () { tipmenu.flags.gagged = tipmenu.gagsLevel.off; tipmenu.build(); }); } } handlers.chodeGag = chodeGag; function coldShower(_tip, duration) { var timer = timers.lookup("Cold Shower"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Cold Shower", duration * 60, 15); } } handlers.coldShower = coldShower; function danceRequest(_tip) { songqueue.add(_tip.from_user, _tip.message, requesttype.dance); } handlers.danceRequest = danceRequest; function gagBan(_tip, duration) { var timer = timers.lookup("Gag Ban"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Gag Ban", duration * 60, 0, function () { tipmenu.flags.gagsBan = true; tipmenu.build(); }, function () { tipmenu.flags.gagsBan = false; tipmenu.build(); }); } } handlers.gagBan = gagBan; function icePlay(_tip, duration) { var timer = timers.lookup("Gag Ban"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Ice Play", duration * 60, 60); } } handlers.icePlay = icePlay; function karaokeRequest(_tip) { songqueue.add(_tip.from_user, _tip.message, requesttype.karaoke); } handlers.karaokeRequest = karaokeRequest; function mute(_tip, duration) { var timer = timers.lookup("Mute"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Mute", duration * 60, 0, function () { tipmenu.flags.mute = true; tipmenu.build(); }, function () { tipmenu.flags.mute = false; tipmenu.build(); }); } } handlers.mute = mute; function nippleClamps(_tip, duration) { var timer = timers.lookup("Nipple Clamps"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Nipple Clamps", duration * 60, 30, function () { tipmenu.flags.clamped = true; tipmenu.build(); }, function () { tipmenu.flags.clamped = false; tipmenu.build(); }); } } handlers.nippleClamps = nippleClamps; function nippleSuckers(_tip, duration) { var timer = timers.lookup("Nipple Suckers"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Nipple Suckers", duration * 60, 30, function () { tipmenu.flags.clamped = true, tipmenu.build(); }, function () { tipmenu.flags.clamped = false, tipmenu.build(); }); } } handlers.nippleSuckers = nippleSuckers; function pussyPlay(_tip, duration) { var timer = timers.lookup("Pussy Play"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Pussy Play", duration * 60, 30); } } handlers.pussyPlay = pussyPlay; function removeButtPlug(_tip) { tipmenu.flags.plugged = false; tipmenu.build(); } handlers.removeButtPlug = removeButtPlug; function shenanigansBan(_tip) { tipmenu.flags.shenanigansBan = false; tipmenu.build(); } handlers.shenanigansBan = shenanigansBan; function showerShow(_tip) { tipmenu.flags.showerShow = true; tipmenu.build(); } handlers.showerShow = showerShow; function songRequest(_tip) { songqueue.add(_tip.from_user, _tip.message, requesttype.play); } handlers.songRequest = songRequest; function spankBan(_tip, duration) { var timer = timers.lookup("Spank Ban"); if (timer != null) { timer.extend(duration * 60); } else { timers.add("Spank Ban", duration * 60, 0, function () { tipmenu.flags.spanksBan = true; tipmenu.build(); }, function () { tipmenu.flags.spanksBan = false; tipmenu.build(); }); } } handlers.spankBan = spankBan; function unmute(_tip) { timers.stop("Mute"); } handlers.unmute = unmute; })(handlers = tipmenu.handlers || (tipmenu.handlers = {})); })(tipmenu || (tipmenu = {})); var room; (function (room) { function help(message) { notice.help(message); permissions.help(message); rotater.help(message); songqueue.help(message); tipmenu.special.help(message); stats.help(message); timers.help(message); tipmenu.help(message); votes.help(message); whisper.help(message); } function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/room": if (m.length === 0) return false; command = m.shift().toLowerCase(); switch (command) { case "help": break; default: return false; } case "/roomhelp": help(message); return true; } return false; } room.tryParse = tryParse; })(room || (room = {})); var cb; (function (cb) { cb.settings_choices = [ { name: "anal", label: "Anal Items", type: "choice", choice1: "x-large", choice2: "large", choice3: "medium", choice4: "small", choice5: "off", defaultValue: "medium", required: true, }, { name: "buttplug", label: "Buttplug Wear Items", type: "choice", choice1: "x-large", choice2: "large", choice3: "medium", choice4: "small", choice5: "off", defaultValue: "medium", required: true, }, { name: "clamps", label: "Clamps Items", type: "choice", choice1: "on", choice2: "off", defaultValue: "off", required: true, }, { name: "clothes", label: "Clothes Items", type: "choice", choice1: "on", choice2: "off", defaultValue: "on", required: true, }, { name: "dance", label: "Dance Items", type: "choice", choice1: "on", choice2: "off", defaultValue: "on", required: true, }, { name: "gags", label: "Gags Items", type: "choice", choice1: "chode", choice2: "ball", choice3: "off", defaultValue: "ball", required: true, }, { name: "games", label: "Game Items", type: "choice", choice1: "on", choice2: "off", defaultValue: "on", required: true, }, { name: "ice", label: "Ice Items", type: "choice", choice1: "on", choice2: "off", defaultValue: "off", required: true, }, { name: "misc", label: "Misc. Items", type: "choice", choice1: "on", choice2: "off", defaultValue: "on", required: true, }, { name: "oral", label: "Oral Items", type: "choice", choice1: "deepthroat", choice2: "blowjob", choice3: "off", defaultValue: "blowjob", required: true, }, { name: "pussy", label: "Pussy Items", type: "choice", choice1: "full play", choice2: "no-show play", choice3: "show only", choice4: "covered only", choice5: "off", defaultValue: "full play", required: true, }, { name: "shower", label: "Shower Items", type: "choice", choice1: "on", choice2: "off", defaultValue: "off", required: true, }, { name: "spanks", label: "Spank Items", type: "choice", choice1: "pussy", choice2: "ass", choice3: "off", defaultValue: "pussy", required: true, } ]; })(cb || (cb = {})); var stats; (function (stats) { "use strict"; function help(message) { if (permissions.isAtLeastTrusted(message)) { notice.add("/stats,statistics --Get all calculated stats"); notice.post(message.user); message['X-Spam'] = true; } } stats.help = help; function print(message) { stats.showDuration(message.user); stats.tokensTotal(message.user); stats.tippersTotal(message.user); stats.tokensPerHour(message.user); stats.tokensPerTipper(message.user); stats.meanHalves(message.user); stats.medianTip(message.user); listViewers(message.user); } function listViewers(sendTo) { notice.add("Viewers (Signed In): " + viewers.current); notice.add("Viewers (With Tokens): " + viewers.withTokens); notice.post(sendTo); } function tryParse(message) { if (permissions.isAtLeastTrusted(message)) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/stat": case "/stats": case "/statistic": case "/statistics": print(message); return true; default: return false; } } return false; } stats.tryParse = tryParse; })(stats || (stats = {})); var tipmenu; (function (tipmenu) { function help(message) { notice.add("/tipmenu --Get the entire tipmenu"); notice.add(emblems.blank + "<Section>+ --Get only the specified sections"); notice.add(emblems.blank + "limit <Cost> --Get all items lesser or equal to the specified cost"); if (permissions.isAtLeastTrusted(message)) { notice.add(emblems.blank + "set (<Flag> <Level>)+ --Set each specified flag to level, and rebuild the tipmenu"); } notice.post(message.user); } tipmenu.help = help; function match(tip) { var price; for (var _i = 0, _a = tipmenu.specials.list(); _i < _a.length; _i++) { var item = _a[_i]; price = item.cost; if (tip.amount === price) return item; } for (var _b = 0, _c = tipmenu.sections.taxes.list(); _b < _c.length; _b++) { var item = _c[_b]; price = item.cost; if (tip.amount === price) return item; } for (var _d = 0, _e = tipmenu.sections.anal.list(); _d < _e.length; _d++) { var item = _e[_d]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _f = 0, _g = tipmenu.sections.clothes.list(); _f < _g.length; _f++) { var item = _g[_f]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _h = 0, _j = tipmenu.sections.dance.list(); _h < _j.length; _h++) { var item = _j[_h]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _k = 0, _l = tipmenu.sections.gags.list(); _k < _l.length; _k++) { var item = _l[_k]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _m = 0, _o = tipmenu.sections.games.list(); _m < _o.length; _m++) { var item = _o[_m]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _p = 0, _q = tipmenu.sections.misc.list(); _p < _q.length; _p++) { var item = _q[_p]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _r = 0, _s = tipmenu.sections.oral.list(); _r < _s.length; _r++) { var item = _s[_r]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _t = 0, _u = tipmenu.sections.pussy.list(); _t < _u.length; _t++) { var item = _u[_t]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _v = 0, _w = tipmenu.sections.spanks.list(); _v < _w.length; _v++) { var item = _w[_v]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _x = 0, _y = tipmenu.sections.wet.list(); _x < _y.length; _x++) { var item = _y[_x]; price = discount.apply(item, tip); if (tip.amount === price) return item; } for (var _z = 0, _0 = tipmenu.sections.merchandise.list(); _z < _0.length; _z++) { var item = _0[_z]; price = item.cost; if (tip.amount === price) return item; } return null; } tipmenu.match = match; function print(message, limit, flags) { if (limit === void 0) { limit = null; } if (flags === void 0) { flags = [true, true, true, true, true, true, true, true, true, true, true, true, true]; } if (flags[0]) tipmenu.specials.print(message, limit); if (flags[1]) tipmenu.sections.taxes.print(message, limit); if (flags[2]) tipmenu.sections.anal.print(message, limit, discount.apply); if (flags[3]) tipmenu.sections.clothes.print(message, limit, discount.apply); if (flags[4]) tipmenu.sections.dance.print(message, limit, discount.apply); if (flags[5]) tipmenu.sections.gags.print(message, limit, discount.apply); if (flags[6]) tipmenu.sections.games.print(message, limit, discount.apply); if (flags[7]) tipmenu.sections.misc.print(message, limit, discount.apply); if (flags[8]) tipmenu.sections.oral.print(message, limit, discount.apply); if (flags[9]) tipmenu.sections.pussy.print(message, limit, discount.apply); if (flags[10]) tipmenu.sections.spanks.print(message, limit, discount.apply); if (flags[11]) tipmenu.sections.wet.print(message, limit, discount.apply); if (flags[12]) tipmenu.sections.merchandise.print(message, limit, discount.apply); } tipmenu.print = print; function tryParse(message) { var m = message.m.split(" "); if (m.length === 0) return false; var command = m.shift().toLowerCase(); switch (command) { case "/menu": case "/tipmenu": if (m.length === 0) { print(message); return true; } else { var sections_1 = [false, false, false, false, false, false, false, false, false, false, false, false, false]; var setmode = false; var word = void 0; var level = void 0; while (m.length !== 0) { word = m.shift().toLowerCase(); switch (word) { case "limit": if (m.length === 0) return false; var limit = m.shift(); if (isNaN(Number(limit))) return false; print(message, Number(limit)); return true; case "shenanigan": case "shenanigans": if (permissions.isAtLeastTrusted(message)) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "on": case "unban": tipmenu.flags.shenanigansBan = false; tipmenu.build(); notice.send(emblems.tipmenu + "Shenanigans Ban lifted"); return true; case "off": case "ban": tipmenu.flags.shenanigansBan = true; tipmenu.build(); notice.send(emblems.tipmenu + "Shenanigans Ban enforced"); return true; default: m.unshift(level); break; } } break; case "special": case "specials": sections_1[0] = true; break; case "tax": case "taxes": sections_1[1] = true; break; case "anal": case "ass": case "booty": case "butt": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "xl": case "xlarge": case "x-large": tipmenu.flags.anal = tipmenu.analLevel.xlarge; tipmenu.build(); notice.send(emblems.tipmenu + "Anal items up to x-large are now active"); continue; case "l": case "large": tipmenu.flags.anal = tipmenu.analLevel.large; tipmenu.build(); notice.send(emblems.tipmenu + "Anal items up to large are now active"); continue; case "m": case "medium": tipmenu.flags.anal = tipmenu.analLevel.medium; tipmenu.build(); notice.send(emblems.tipmenu + "Anal items up to medium are now active"); continue; case "s": case "small": tipmenu.flags.anal = tipmenu.analLevel.small; tipmenu.build(); notice.send(emblems.tipmenu + "Anal items up to small are now active"); continue; case "off": tipmenu.flags.anal = tipmenu.analLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Anal items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | small | medium | large | x-large)", message.user); return false; } } sections_1[2] = true; break; case "buttplug": case "plugged": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "true": case "yes": tipmenu.flags.plugged = true; tipmenu.build(); continue; case "false": case "no": tipmenu.flags.plugged = false; tipmenu.build(); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (no | yes)", message.user); return false; } } case "clamp": case "clamps": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "on": tipmenu.flags.clamps = tipmenu.clampsLevel.on; tipmenu.build(); notice.send(emblems.tipmenu + "Clamps items are now active", message.user); continue; case "off": tipmenu.flags.clamps = tipmenu.clampsLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Clamps items are no longer active", message.user); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | on)", message.user); return false; } } sections_1[3] = true; break; case "clothes": case "clothing": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "on": tipmenu.flags.clothes = tipmenu.clothesLevel.on; tipmenu.build(); notice.send(emblems.tipmenu + "Clothes items are now active"); continue; case "off": tipmenu.flags.clothes = tipmenu.clothesLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Clothes items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | on)", message.user); return false; } } sections_1[4] = true; break; case "dance": case "dancing": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "on": tipmenu.flags.dance = tipmenu.danceLevel.on; tipmenu.build(); notice.send(emblems.tipmenu + "Dance items are now active"); continue; case "off": tipmenu.flags.dance = tipmenu.danceLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Dance items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | on)", message.user); return false; } } sections_1[5] = true; break; case "gag": case "gags": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "chode": tipmenu.flags.gags = tipmenu.gagsLevel.chode; tipmenu.build(); notice.send(emblems.tipmenu + "Gag and Mute items up to chodegag are now active"); continue; case "ball": case "ballgag": tipmenu.flags.gags = tipmenu.gagsLevel.ball; tipmenu.build(); notice.send(emblems.tipmenu + "Gag and Mute items up to ballgags are now active"); continue; case "off": tipmenu.flags.gags = tipmenu.gagsLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Gag and Mute items are no longer active"); continue; default: } } sections_1[6] = true; break; case "game": case "games": case "fun": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "on": tipmenu.flags.games = tipmenu.gamesLevel.on; tipmenu.build(); notice.send(emblems.tipmenu + "Fun and Games items are now active"); continue; case "off": tipmenu.flags.games = tipmenu.gamesLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Fun and Games items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | on)", message.user); return false; } } sections_1[7] = true; break; case "help": tipmenu.help(message); return true; case "misc": case "misc.": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "on": tipmenu.flags.misc = tipmenu.miscLevel.on; tipmenu.build(); notice.send(emblems.tipmenu + "Misc. items are now active"); continue; case "off": tipmenu.flags.misc = tipmenu.miscLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Misc. items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | on)", message.user); return false; } } sections_1[8] = true; break; case "oral": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "deepthroat": tipmenu.flags.oral = tipmenu.oralLevel.deepthroat; tipmenu.build(); notice.send(emblems.tipmenu + "Oral items up to deepthroat are now active"); continue; case "blowjob": tipmenu.flags.oral = tipmenu.oralLevel.blowjob; tipmenu.build(); notice.send(emblems.tipmenu + "Oral items up to blowjob are now active"); continue; case "off": tipmenu.flags.oral = tipmenu.oralLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Oral items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | blowjob | deepthroat)", message.user); return false; } } sections_1[9] = true; break; case "pussy": case "vagina": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "full": case "fullplay": case "full-play": tipmenu.flags.pussy = tipmenu.pussyLevel.fullPlay; tipmenu.build(); notice.send(emblems.tipmenu + "Pussy items up to full play are now active"); continue; case "noshow": case "no-show": tipmenu.flags.pussy = tipmenu.pussyLevel.noShowPlay; tipmenu.build(); notice.send(emblems.tipmenu + "Pussy items up to no-show play are now active"); continue; case "showonly": case "show-only": tipmenu.flags.pussy = tipmenu.pussyLevel.showOnly; tipmenu.build(); notice.send(emblems.tipmenu + "Pussy items up to show only are now active"); continue; case "off": tipmenu.flags.pussy = tipmenu.pussyLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Pussy items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | showonly | noshow | full)", message.user); return false; } } sections_1[10] = true; break; case "set": case "setmode": if (permissions.isAtLeastTrusted(message)) { setmode = true; } else { return false; } break; case "spank": case "spanks": case "spanking": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "pussy": tipmenu.flags.spanks = tipmenu.spanksLevel.pussy; tipmenu.build(); notice.send(emblems.tipmenu + "Spank items up to pussy are now active"); continue; case "ass": tipmenu.flags.spanks = tipmenu.spanksLevel.ass; tipmenu.build(); notice.send(emblems.tipmenu + "Spank items up to ass are now active"); continue; case "off": tipmenu.flags.spanks = tipmenu.spanksLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Spank items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | ass | pussy)", message.user); return false; } } sections_1[11] = true; break; case "wet": case "water": case "shower": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "on": tipmenu.flags.shower = tipmenu.showerLevel.on; tipmenu.build(); notice.send(emblems.tipmenu + "Shower items are now active"); continue; case "off": tipmenu.flags.shower = tipmenu.showerLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Shower items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | on)", message.user); return false; } } case "ice": case "cold": if (setmode) { if (m.length === 0) return false; level = m.shift().toLowerCase(); switch (level) { case "on": tipmenu.flags.ice = tipmenu.iceLevel.on; tipmenu.build(); notice.send(emblems.tipmenu + "Ice items are now active"); continue; case "off": tipmenu.flags.ice = tipmenu.iceLevel.off; tipmenu.build(); notice.send(emblems.tipmenu + "Ice items are no longer active"); continue; default: notice.send("For '" + word + "', found '" + level + "', but expected a level of (off | on)", message.user); return false; } } sections_1[12] = true; break; case "merchandise": sections_1[13] = true; break; default: break; } } tipmenu.print(message, null, sections_1); for (var _i = 0, sections_2 = sections_1; _i < sections_2.length; _i++) { var section = sections_2[_i]; if (section) return true; } return false; } default: return false; } } tipmenu.tryParse = tryParse; })(tipmenu || (tipmenu = {})); var tipmenu; (function (tipmenu) { function build() { tipmenu.sections.anal.clear(); tipmenu.sections.clothes.clear(); tipmenu.sections.dance.clear(); tipmenu.sections.gags.clear(); tipmenu.sections.games.clear(); tipmenu.sections.misc.clear(); tipmenu.sections.oral.clear(); tipmenu.sections.pussy.clear(); tipmenu.sections.spanks.clear(); tipmenu.sections.wet.clear(); if (tipmenu.flags.shenanigansBan) return; if (tipmenu.flags.anal > tipmenu.analLevel.off && !tipmenu.flags.plugged) { tipmenu.sections.anal.add("Finger Butt", 151); } if (tipmenu.flags.plugged) { tipmenu.sections.anal.add("Remove Plug (off cam)", 170, tipmenu.handlers.removeButtPlug); } if (tipmenu.flags.anal >= tipmenu.analLevel.small) { if (tipmenu.flags.plugged) { tipmenu.sections.anal.add("Change Butt Plug (small)", 175); } else { tipmenu.sections.anal.add("Add Butt Plug (small)", 303, tipmenu.handlers.addButtplug); } } if (tipmenu.flags.buttplug >= tipmenu.analLevel.small) { tipmenu.sections.anal.add("Wear Butt Plug Off Cam (small)", 805); } if (tipmenu.flags.anal > tipmenu.analLevel.off && !tipmenu.flags.plugged) { tipmenu.sections.anal.add("Butt Play (2min)", 325); } if (tipmenu.flags.anal >= tipmenu.analLevel.medium) { if (tipmenu.flags.plugged) { tipmenu.sections.anal.add("Change Butt Plug (medium)", 355); tipmenu.sections.anal.add("Change Butt Plug (tail)", 404); } else { tipmenu.sections.anal.add("Add Butt Plug (medium)", 505, tipmenu.handlers.addButtplug); tipmenu.sections.anal.add("Add Butt Plug (tail)", 555, tipmenu.handlers.addButtplug); } } if (tipmenu.flags.buttplug >= tipmenu.analLevel.medium) { tipmenu.sections.anal.add("Wear Butt Plug Off Cam (medium)", 1005); } if (tipmenu.flags.anal >= tipmenu.analLevel.large) { if (tipmenu.flags.plugged) { tipmenu.sections.anal.add("Change Butt Plug (large)", 555); } else { tipmenu.sections.anal.add("Add Butt Plug (large)", 705, tipmenu.handlers.addButtplug); } } if (tipmenu.flags.buttplug >= tipmenu.analLevel.large) { tipmenu.sections.anal.add("Wear Butt Plug Off Cam (Large)", 1705); } if (tipmenu.flags.anal >= tipmenu.analLevel.xlarge) { if (tipmenu.flags.plugged) { tipmenu.sections.anal.add("Change Butt Plug (x-large)", 705); } else { tipmenu.sections.anal.add("Add Butt Plug (x-large)", 955, tipmenu.handlers.addButtplug); } } if (tipmenu.flags.clothes == tipmenu.clothesLevel.on) { tipmenu.sections.clothes.add("Change Accessory", 74); tipmenu.sections.clothes.add("Remove Accessory", 79); tipmenu.sections.clothes.add("Add Accessory", 84); tipmenu.sections.clothes.add("Change Clothing (1 item)", 185); tipmenu.sections.clothes.add("Remove Clothing (1 item)", 215); tipmenu.sections.clothes.add("Add Clothing (1 item)", 225); tipmenu.sections.clothes.add("Change Outfit", 485); tipmenu.sections.clothes.add("Remove Outfit", 515); tipmenu.sections.clothes.add("Add Outfit", 525); } if (tipmenu.flags.dance == tipmenu.danceLevel.on) { tipmenu.sections.dance.add("Sexy Dancing", 81); tipmenu.sections.dance.add("Twerk", 121); tipmenu.sections.dance.add("Ballet", 343); tipmenu.sections.dance.add("Strip Tease", 545); } if (tipmenu.flags.gags >= tipmenu.gagsLevel.ball && !tipmenu.flags.gagsBan) { if (tipmenu.flags.gagged == tipmenu.gagsLevel.ball) { tipmenu.sections.gags.add("Extend Ballgag (2min)", 208, tipmenu.handlers.ballgag, 2); } else if (tipmenu.flags.gagged == tipmenu.gagsLevel.off) { tipmenu.sections.gags.add("Ballgag (2min)", 208, tipmenu.handlers.ballgag, 2); } } if (tipmenu.flags.mute) { tipmenu.sections.gags.add("Unmute", 212, tipmenu.handlers.unmute); } else { tipmenu.sections.gags.add("Mute (7min)", 243, tipmenu.handlers.mute, 7); } if (tipmenu.flags.gags >= tipmenu.gagsLevel.ball && tipmenu.flags.clamps == tipmenu.clampsLevel.on && !tipmenu.flags.gagsBan) { if (tipmenu.flags.gagged == tipmenu.gagsLevel.ball) { tipmenu.sections.gags.add("Extend Ballgag (2min)", 248, tipmenu.handlers.ballgagClamps, 2); } else if (tipmenu.flags.gagged == tipmenu.gagsLevel.off) { tipmenu.sections.gags.add("Ballgag with Clamps (2min)", 308, tipmenu.handlers.ballgagClamps, 2); } } if (tipmenu.flags.gags >= tipmenu.gagsLevel.chode && !tipmenu.flags.gagsBan) { if (tipmenu.flags.gagged == tipmenu.gagsLevel.chode) { tipmenu.sections.gags.add("Extend Chodegag (2min)", 358, tipmenu.handlers.chodeGag, 2); } else if (tipmenu.flags.gagged == tipmenu.gagsLevel.off) { tipmenu.sections.gags.add("Chodegag (2min)", 358, tipmenu.handlers.chodeGag, 2); } } if (tipmenu.flags.gags > tipmenu.gagsLevel.off) { if (!tipmenu.flags.gagsBan) { tipmenu.sections.gags.add("Gag Ban (15min)", 668, tipmenu.handlers.gagBan, 15); } else { tipmenu.sections.gags.add("Extend Gag Ban (15min)", 668, tipmenu.handlers.gagBan, 15); } } if (tipmenu.flags.games == tipmenu.gamesLevel.on) { tipmenu.sections.games.add("Fuck One, Marry One, Kill One", 13); tipmenu.sections.games.add("Flip Cup", 22); tipmenu.sections.games.add("Cards Against Humanity", 33); tipmenu.sections.games.add("Madlibs", 40); tipmenu.sections.games.add("Pictionary", 44); tipmenu.sections.games.add("Song Request", 49, tipmenu.handlers.songRequest); tipmenu.sections.games.add("Drawing", 101); tipmenu.sections.games.add("Makeout with Plushie", 127); tipmenu.sections.games.add("Play with BB-8", 137); if (!tipmenu.flags.mute) { tipmenu.sections.games.add("Karaoke", 147); tipmenu.sections.games.add("Reading", 159); } } if (tipmenu.flags.pussy >= tipmenu.pussyLevel.showOnly) { tipmenu.sections.misc.add("Flash (Specify)", 30); } else if (tipmenu.flags.pussy <= tipmenu.pussyLevel.coveredOnly) { tipmenu.sections.misc.add("Flash (Specify, no pussy today)", 30); } if (tipmenu.flags.misc == tipmenu.miscLevel.on) { tipmenu.sections.misc.add("Lap Milk", 70); } if (tipmenu.flags.pussy >= tipmenu.pussyLevel.showOnly) { tipmenu.sections.misc.add("Doggy Spread", 75); } else if (tipmenu.flags.pussy < tipmenu.pussyLevel.coveredOnly) { tipmenu.sections.misc.add("Doggy Spread (Panties stay in place)", 65); } if (tipmenu.flags.clamps == tipmenu.clampsLevel.on) { tipmenu.sections.misc.add("Nipple Clamps (8min)", 86, tipmenu.handlers.nippleClamps, 8); } if (tipmenu.flags.misc == tipmenu.miscLevel.on) { tipmenu.sections.misc.add("Nipple Suckers (2min)", 125, tipmenu.handlers.nippleSuckers, 2); tipmenu.sections.misc.add("Oil/Lotion (Specify)", 165); } if (!tipmenu.flags.shenanigansBan) { tipmenu.sections.misc.add("Shenanigans Ban", 1234, tipmenu.handlers.shenanigansBan); } if (tipmenu.flags.oral >= tipmenu.oralLevel.deepthroat) { tipmenu.sections.oral.add("Deepthroat Attempt", 36); } if (tipmenu.flags.oral >= tipmenu.oralLevel.blowjob) { tipmenu.sections.oral.add("BJ Dildo", 141); } if (tipmenu.flags.pussy == tipmenu.pussyLevel.fullPlay) { tipmenu.sections.pussy.add("Taste Self", 66); tipmenu.sections.pussy.add("Pussy Play (2min)", 245, tipmenu.handlers.pussyPlay, 2); tipmenu.sections.pussy.add("InstaCum", 2000); if (tipmenu.flags.anal > tipmenu.analLevel.off) { tipmenu.sections.pussy.add("InstaCum with Anal", 2700); } } else if (tipmenu.flags.pussy == tipmenu.pussyLevel.noShowPlay) { tipmenu.sections.pussy.add("Pussy Play (over panties) (2min)", 245, tipmenu.handlers.pussyPlay, 2); tipmenu.sections.pussy.add("InstaCum (over panties)", 2000); if (tipmenu.flags.anal > tipmenu.analLevel.off) { tipmenu.sections.pussy.add("InstaCum with Anal (over panties)", 2700); } } if (tipmenu.flags.spanks >= tipmenu.spanksLevel.ass && !tipmenu.flags.spanksBan) { tipmenu.sections.spanks.add("5 Hand Spanks", 42); tipmenu.sections.spanks.add("3 Leather Paddle Spanks", 52); tipmenu.sections.spanks.add("2 Wood Paddle Spanks", 62); } if (tipmenu.flags.spanks >= tipmenu.spanksLevel.pussy && !tipmenu.flags.spanksBan) { tipmenu.sections.spanks.add("3 Pussy Spanks", 68); } if (tipmenu.flags.spanks >= tipmenu.spanksLevel.ass && !tipmenu.flags.spanksBan) { tipmenu.sections.spanks.add("2 PC Paddle Spanks", 72); } if (tipmenu.flags.spanks > tipmenu.spanksLevel.off) { if (tipmenu.flags.spanksBan) { tipmenu.sections.spanks.add("Extend Spank Ban (15min)", 440, tipmenu.handlers.spankBan, 15); } else { tipmenu.sections.spanks.add("Spank Ban (15min)", 440, tipmenu.handlers.spankBan, 15); } } if (tipmenu.flags.ice == tipmenu.iceLevel.on) { tipmenu.sections.wet.add("Ice Play (Specify) (2min)", 88, tipmenu.handlers.icePlay, 2); } if (tipmenu.flags.ice == tipmenu.iceLevel.on && tipmenu.flags.shower == tipmenu.showerLevel.on) { tipmenu.sections.wet.add("Cold Shower (1min)", 175, tipmenu.handlers.coldShower, 1); } if (tipmenu.flags.shower == tipmenu.showerLevel.on) { tipmenu.sections.wet.add("Shower Show", 575); } } tipmenu.build = build; })(tipmenu || (tipmenu = {})); var tipmenu; (function (tipmenu) { var sections; (function (sections) { sections.taxes = new menusection("Taxes", new menuitem("Derp Tax", 6), new menuitem("Fap Tax", 9), new menuitem("Princess Tax", 12)); sections.anal = new menusection("Anal"); sections.clothes = new menusection("Clothes"); sections.dance = new menusection("Dance"); sections.gags = new menusection("Gags and Mute"); sections.games = new menusection("Fun and Games"); sections.misc = new menusection("Misc."); sections.oral = new menusection("Oral"); sections.pussy = new menusection("Pussy"); sections.spanks = new menusection("Spanks"); sections.wet = new menusection("Wet and Cold"); sections.merchandise = new menusection("Merchandise", new menuitem("Handwritten Note", 333), new menuitem("Panties (Clean)", 400), new menuitem("Panties (Dirty)", 600), new menuitem("Panties (Cummed In)", 800), new menuitem("Snapchat", 533), new menuitem("Kik", 1066), new menuitem("Steam/Xbox/Battle.net", 555)); })(sections = tipmenu.sections || (tipmenu.sections = {})); })(tipmenu || (tipmenu = {})); { notice.color = "#206080"; permissions.entrust("entomy", "kellyholic", "cutelilpiggy"); discount.fanclub = 0.9; discount.moderator = 0.75; teams.addTeam(new team("models", " :bluelizard16 ")); if (teams.lookup("models") !== null) { teams.lookup("models").adds("blondiebanger", "ginger_soulz", "aynmarie", "miarand", "bruisedkitten", "whipmebabe", "baby_moon420", "pavlovswhore", "babyfaceforever", "scarletloveu", "thenovastorm"); } timers.start(); rotater.add("Follow me on Twitter: @TheRealLizRose"); rotater.add("Check me out on ManyVids: LizRose.ManyVids.com"); rotater.add("Check out the tipmenu with: /menu"); rotater.add("Join the fanclub to receive a discount of: 10%"); rotater.add("Need help with commands or the tipmenu? Type: /roomhelp"); rotater.start(); hatchery.progression = 50; hatchery.level1 = " :hatch1 "; hatchery.level2 = " :hatch2 "; hatchery.level3 = " :hatch3 "; hatchery.level4 = " :hatch4 "; hatchery.level5 = " :hatch5 "; hatchery.level6 = " :hatch6 "; hatchery.level7 = " :hatch7 "; hatchery.level8 = " :hatch8 "; hatchery.level9 = " :hatch9 "; hatchery.level10 = " :hatch10 "; leaderboard.rotate(3); switch (cb.settings.anal) { case "x-large": tipmenu.flags.anal = tipmenu.analLevel.xlarge; break; case "large": tipmenu.flags.anal = tipmenu.analLevel.large; break; case "medium": tipmenu.flags.anal = tipmenu.analLevel.medium; break; case "small": tipmenu.flags.anal = tipmenu.analLevel.small; break; case "off": tipmenu.flags.anal = tipmenu.analLevel.off; break; } switch (cb.settings.clamps) { case "on": tipmenu.flags.clamps = tipmenu.clampsLevel.on; break; case "off": tipmenu.flags.clamps = tipmenu.clampsLevel.off; break; } switch (cb.settings.clothes) { case "on": tipmenu.flags.clothes = tipmenu.clothesLevel.on; break; case "off": tipmenu.flags.clothes = tipmenu.clothesLevel.off; break; } switch (cb.settings.dance) { case "on": tipmenu.flags.dance = tipmenu.danceLevel.on; break; case "off": tipmenu.flags.dance = tipmenu.danceLevel.off; break; } switch (cb.settings.gags) { case "chode": tipmenu.flags.gags = tipmenu.gagsLevel.chode; break; case "ball": tipmenu.flags.gags = tipmenu.gagsLevel.ball; break; case "off": tipmenu.flags.gags = tipmenu.gagsLevel.off; break; } switch (cb.settings.games) { case "on": tipmenu.flags.games = tipmenu.gamesLevel.on; break; case "off": tipmenu.flags.games = tipmenu.gamesLevel.off; break; } switch (cb.settings.ice) { case "on": tipmenu.flags.ice = tipmenu.iceLevel.on; break; case "off": tipmenu.flags.ice = tipmenu.iceLevel.off; break; } switch (cb.settings.misc) { case "on": tipmenu.flags.misc = tipmenu.miscLevel.on; break; case "off": tipmenu.flags.misc = tipmenu.miscLevel.off; break; } switch (cb.settings.oral) { case "deepthroat": tipmenu.flags.oral = tipmenu.oralLevel.deepthroat; break; case "blowjob": tipmenu.flags.oral = tipmenu.oralLevel.blowjob; break; case "off": tipmenu.flags.oral = tipmenu.oralLevel.off; break; } switch (cb.settings.pussy) { case "full play": tipmenu.flags.pussy = tipmenu.pussyLevel.fullPlay; break; case "no-show play": tipmenu.flags.pussy = tipmenu.pussyLevel.noShowPlay; break; case "show only": tipmenu.flags.pussy = tipmenu.pussyLevel.showOnly; break; case "covered only": tipmenu.flags.pussy = tipmenu.pussyLevel.coveredOnly; break; case "off": tipmenu.flags.pussy = tipmenu.pussyLevel.off; break; } switch (cb.settings.shower) { case "on": tipmenu.flags.shower = tipmenu.showerLevel.on; break; case "off": tipmenu.flags.shower = tipmenu.showerLevel.off; break; } switch (cb.settings.spanks) { case "pussy": tipmenu.flags.spanks = tipmenu.spanksLevel.pussy; break; case "ass": tipmenu.flags.spanks = tipmenu.spanksLevel.ass; break; case "off": tipmenu.flags.spanks = tipmenu.spanksLevel.off; break; } tipmenu.build(); }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.