Apps Home
|
Create an App
nqa test
Author:
nicole_asahi
Description
Source Code
Launch App
Current Users
Created by:
Nicole_Asahi
/* Based on Lovense Lush by geni_xxx Summary: Anna's Lovense 20201016_1126 Description: 5-14 2 Medium 15-29 6 Medium 30-99 10 Medium 100-199 20 High 200-299 30 High 300-499 30 Ultra high 500-infinity 60 Ultra high Based on Lovense Lush by geni_xxx */ var nextIndex = 0, noteNb = 0, levelMode = "LIST"; function init() { cb.log("init {\n_______________________________________________________"); cb.settings.tags && (tags = cb.settings.tags.trim() ? cb.settings.tags : ""); (!tags || tags.toLowerCase().indexOf("Lovense") < 0) && (tags += ""); cb.settings.levelMode && (levelMode = levelModeList[cb.settings.levelMode].level); cb.settings.messageColor && (messageColor = colorList[cb.settings.messageColor].c); cb.settings.tags && (tags = cb.settings.tags.trim() ? cb.settings.tags : ""); (!tags || tags.toLowerCase().indexOf("Lovense") < 0) && (tags += ""); var e = splitOnWhiteSpaces(tags); tags = ""; for (var t = 0; t < e.length; t++) tags += "#" == e[t].substring(0, 1) ? e[t] : "#" + e[t]; initNotice(); cb.settings.levelTitle && (levelTitle = cb.settings.levelTitle.trim() ? cb.settings.levelTitle : "Lovense Lush: Device that vibrates longer at Tips"); levelMode && setLevelNoticeMessage(); noteNb || cbjs.arrayRemove(actionsArray, "NOTE"); levelMode || cbjs.arrayRemove(actionsArray, "LEVEL"); actionsArray.length && (nextAction = actionsArray[nextIndex], cb.setTimeout(roomDisplay, 2000)); // 2e4 = 20000 i.e. 20 seconds cb.log("messageColor <" + messageColor + ">"); cb.log("levelMode <" + levelMode + ">"); cb.log("numActionsBeforeDisplay <" + numActionsBeforeDisplay + "> noteNb <" + noteNb + "> nextAction <" + nextAction + "> secsBetDisplayReminders <" + secsBetDisplayReminders + ">" ); cb.log("actionsArray {"); for (var i in actionsArray) { cb.log(i + ": <" + actionsArray[i] + ">"); } cb.log("actionsArray }"); cb.log("init }"); } function initNotice() { for (var e = 1; maxNotice >= e; e++) { var t = cb.settings["notice" + e] ? cb.settings["notice" + e].trim() : ""; t && (noteList[++noteNb] = { note: t }) } } /* * Pick up any thank-you messages set by user on app start-up. */ function setLevelNoticeMessage() { for (var i = 0; i < levels.length; i++) { var lvl_m = cb.settings["level" + i] ? cb.settings["level" + i].trim() : ""; lvl_m && (levelNoticeMessage += "LIST" == levelMode ? square + lvl_m + newline : square + lvl_m) var lvl_thx_m = cb.settings["level_thank_" + i]; lvl_thx_m ? lvl_thx_m.trim() : ""; if (lvl_thx_m) { levels[i].thank_message = lvl_thx_m; } else { levels[i].thank_message = levels[i].default_thank_message; } } } function manageTotalList(e, t) { return e in totalList ? totalList[e].sum += t : totalList[e] = { sum: t, num: ++usrNb }, totalList[e].sum } function manageUserList(e, t) { return e in userList ? userList[e].sum += t : userList[e] = { sum: t }, userList[e].sum } function sy(e, t) { return e == t ? trg : square } function cmdSum(e) { if (0 == tipNb) return sendTitle(e, lck + "SUMMARY : No Tipper yet."); var t = xLine(5), n = elapsTime(startTime, "[hms]"), o = newline + t + newline + lck + appName + newline + t + newline + square + "RunningTime : " + n + newline + square + " SUMMARY (since the App Started) :", a = "" + dot + x(usrNb, "Tipper$ / ") + x(Math.round(tipSum / usrNb), "token$ by Tipper.") + newline + dot + "Highest Tipper : " + qt(maxSumUsr) + " : " + x(maxSum, "Token$.") + newline + dot + "Highest Tip : " + qt(maxTipUsr) + " : " + x(maxTip, "Token$."), i = "" + t + newline + square + "Total received : " + x(tipSum, "Token$.") + newline + t + newline + square + qt("/sum") + " to display a Summary again."; sendTitle(e, o), sendNote(e, a), sendTitle(e, i) } function roomDisplay() { cb.log("roomDisplay {"); var seconds = 30; cb.log("numActionsSinceLastDisplay <" + numActionsSinceLastDisplay + ">"); if (numActionsSinceLastDisplay >= numActionsBeforeDisplay) { nextDisplay(); numActionsSinceLastDisplay = 0; seconds = noteNb && "LEVEL" == nextAction ? 30 : secsBetDisplayReminders; } cb.setTimeout(roomDisplay, 1000 * seconds); cb.log("roomDisplay }"); } function nextDisplay() { cb.log("nextDisplay {\nnextAction <" + nextAction + ">"); if ("LEVEL" == nextAction) { levelDisplay(all); cb.log("numActionsBeforeDisplay <" + numActionsBeforeDisplay + "> noteNb <" + noteNb + "> nextAction <" + nextAction + "> secsBetDisplayReminders <" + secsBetDisplayReminders + ">" ); } else if ("NOTE" == nextAction) { noteDisplay(); } if (nextIndex >= actionsArray.length - 1) { nextIndex = 0; } else { nextIndex + 1; nextAction = actionsArray[nextIndex]; } cb.log("nextDisplay }"); } function noteDisplay() { cb.log("noteDisplay {"); cycleNum = cycleNum >= noteNb ? 1 : cycleNum + 1, sendTitle(all, noteList[cycleNum].note) cb.log("noteDisplay }"); } function levelDisplay(e) { cb.log("levelDisplay {"); "LINE" == levelMode ? sendTitle(e, levelTitle + " :" + levelNoticeMessage + newline) : sendTitle(e, levelTitle + " :" + newline + levelNoticeMessage); cb.log("levelDisplay }"); } function cut(e) { return qt(e.substring(0, 25)) } function errorCommand(e, t, n) { sendTitle(e, newline + lck + " Error command : /" + n + newline + square + t + newline) } function isOwner(e) { return e == cb.room_slug } function sendTitle(e, t, n) { var o = n ? n : messageColor; o = isOwner(e) ? "#000000" : o, cb.sendNotice(t, e, "", o, "bolder") } function sendNote(e, t, n) { var o = n ? n : messageColor; cb.sendNotice(t, e, "", o, "normal") } function trimEmot(e) { e = e.replace(/\[/g, ""), e = e.replace(/\]/g, ""); for (var t = splitOnWhiteSpaces(e), n = 0; n < t.length; n++) ":" == t[n][0] && t[n].length > 1 && (e = e.replace(t[n], "")); return e } function splitOnWhiteSpaces(str) { return str.trim().replace(/\s+/g, " ").split(" ") } function myRandom(e, t) { return Math.floor(e + Math.random() * (t - e + 1)) } function elapsTime(e, t) { var n = (new Date).getTime(); return toHms(n, e, t) } function toHms(e, t, n) { var o = (e - t) / 1e3, a = o / 86400; a = a >= 1 ? a - a % 1 : 0; var i = (o - 3600 * a * 24) / 3600; i -= i % 1; var l = o % 3600 / 60; l -= l % 1; var s = o % 3600 - 60 * l; s -= s % 1; var r = a > 0 ? x(a, "Day$ ") : "", c = 10 > i ? "0" + i : i, m = 10 > l ? "0" + l : l, u = 10 > s ? "0" + s : s, p = r + c + ":" + m + ":" + u, g = n; return g = g.replace("day", r), g = g.replace("hour", "00" == c ? "" : x(i, "hour$ ")), g = g.replace("minute", "00" == m ? "" : x(l, "minute$ ")), g = g.replace("seconde", "00" == u ? "" : s + " sec"), g = g.replace("hms", p), g.replace(/ /g, "") ? g : "00" } function xLine(e) { var t = ""; for (e *= 5; e--;) t += lne; return t } function qt(e) { return ' "' + e + '"' } function x(e, t) { return e + " " + t.replace("$", e > 1 ? "s" : "") } function y(e, t) { return t.replace("$", e > 1 ? "s" : "") } var appName = " [ Nicole Asahi Lovense ] ", owner = cb.room_slug, startTime = (new Date).getTime(), yr = 16436, mth = 5, messageColor = "#6900CC", cbColor = "#DC5500", all = "", newline = "\n", dot = " \u2981 ", hrt = " \u2665 ", square = " \u25A0 ", trg = " \u25B6 ", lne = "\u2500", lck = " :w__lck ", wht = " :w__wht "; cb.settings_choices = [{ name: "roomSubject", label: "1. ROOM SETTINGS ........ Room Subject", type: "str", minLength: 1, maxLength: 150, required: !0, defaultValue: "Lovense Lush & Ambi: tip me and watch me squirm and hear me squeal!" }, { name: "tags", label: "Tags (#) ", type: "str", minLength: 1, maxLength: 120, required: !1, defaultValue: "Lovense" }, { name: "tokenOn", label: "Tokens", type: "choice", choice1: "Display \"Total Received\" in Panel", choice2: "Not displayed", "default": "Not displayed" }, { name: "messageColor", label: "2. NOTICES SETTINGS ... - Display Color", type: "choice", choice1: "Orange", choice2: "Blue", choice3: "Purple", choice4: "Pink", choice5: "Dark_Red", choice6: "Black", defaultValue: "Pink" }, { name: "secsBetDisplayReminders", label: "Time, in seconds, between displaying reminders", // was "Display Time" type: "int", minValue: 1, maxValue: 1800, defaultValue: 240 }, { name: "levelMode", label: "- Notification of Lovense-Levels", type: "choice", choice1: "NO (next info will not be used)", choice2: "YES - Mode List", choice3: "YES - Single Line", defaultValue: "YES - Mode List" }, { name: "levelTitle", label: "Level Title", type: "str", minLength: 0, maxLength: 10240, required: !0, defaultValue: "The more you tip, the more I squeal! :smile" }, /* { name: "level1", label: "Level 1 description", type: "str", minLength: 0, maxLength: 10240, required: !1, defaultValue: "Level 1, 5-14 tokens: 2 seconds (medium power)" }, { name: "level2", label: "Level 2 description", type: "str", minLength: 0, maxLength: 10240, required: !1, defaultValue: "Level 2, 15-29 tokens: 6 seconds (medium power)" }, { name: "level3", label: "Level 3 description", type: "str", minLength: 0, maxLength: 10240, required: !1, defaultValue: "Level 3, 30-99 tokens: 10 seconds (high power)" }, { name: "level4", label: "Level 4 description", type: "str", minLength: 0, maxLength: 10240, required: !1, defaultValue: "Level 4, 100-199 tokens: 20 seconds (high power)" }, { name: "level5", label: "Level 5 description", type: "str", minLength: 0, maxLength: 10240, required: !1, defaultValue: "Level 5, 200-299 tokens: 30 seconds (HIGH power)" }, { name: "level6", label: "Level 6 description", type: "str", minLength: 0, maxLength: 10240, required: !1, defaultValue: "Level 6, 300-499 tokens: 30 seconds (ULTRA HIGH power)" }, { name: "level7", label: "Level 7 description", type: "str", minLength: 0, maxLength: 10240, required: !1, defaultValue: "Level 7, 500-500+ tokens: 60 seconds (ULTRA HIGH! power)" }, */ { name: "RandomLevel", label: "Random Level ", type: "str", minLength: 0, maxLength: 10240, required: !1, defaultValue: "Random Lvl - Tip (1000) To get a random level!" }, { name: 'autoThanks', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Auto thank you active with tips? (notices have different colors)" }, { name: "setRemaining", label: "Amount", type: "int", minValue: 0, maxValue: 9999999, defaultValue: 2e3 }]; var notices = [ { label: "- Optional Additional ...... Notice 1 ", defaultValue:" :Lovense9 Your tips make me shake, rattle, and roll!" }, { label: "Notice 2 ", defaultValue: "Lovense Lush : Device that vibrates longer on your Tips!" }, { label: "Notice 3 ", defaultValue: " : Lovense info \n Give me pleasure with your tips!!!" }, ]; for (var notice in notices) { var i = 1; cb.settings_choices.push( { name: "notice" + i++, label: notice.label, type: "str", minLength: 0, maxLength: 10240, required: false, defaultValue: notice.defaultValue, } ); } /* { name: "notice1", label: "- Optional Additional ...... Notice 1 ", type: "str", minLength: 0, maxLength: 10240, required: false, defaultValue:" :Lovense9 Your tips make me shake, rattle, and roll!" }, { name: "notice2", label: "Notice 2 ", type: "str", minLength: 0, maxLength: 10240, required: false, defaultValue: "Lovense Lush : Device that vibrates longer on your Tips!" }, { name: "notice3", label: "Notice 3 ", type: "str", minLength: 0, maxLength: 10240, required: false, defaultValue: " : Lovense info \n Give me pleasure with your tips!!!" }, */ var secsBetDisplayReminders = parseInt(cb.settings.secsBetDisplayReminders), numActionsBeforeDisplay = 5, numActionsSinceLastDisplay = numActionsBeforeDisplay, cycleNum = 0, actionsArray = ["LEVEL", "NOTE"], nextAction = "", roomSubject = cb.settings.roomSubject, levelTitle = "", levelNoticeMessage = "", levelModeList = {}; levelModeList["NO (next info will not be used)"] = { level: "" }; levelModeList["YES - Mode List"] = { level: "LIST" }; levelModeList["YES - Single Line"] = { level: "LINE" }; var maxNotice = 3, noteList = {}, tipSum = 0, tipNb = 0, lastTipper = "", lastTip = 0, mvpName = "", mvpSum = 0, userList = {}, higherTip = 0, higherTipName = "", totalList = {}, usrNb = 0, maxSum = 0, maxSumUsr = "", maxTip = 0, maxTipUsr = "", autoThanks = cb.settings.autoThanks, tokenOn = "Not displayed" == cb.settings.tokenOn ? !1 : !0, setRemaining = parseInt(cb.settings.setRemaining), remaining = setRemaining, runNb = 0, tags = "", row1 = "", row2 = "", row3 = ""; var levels = [ { name: "", thank_message: "", min: 5, max: 14, duration: 2, // in seconds power: "medium", // description: "2 seconds (medium power)", default_thank_message: "Thank you, <name>!", }, { name: "", thank_message: "", min: 15, max: 29, duration: 6, // in seconds power: "medium", // description: "6 seconds (medium power)", default_thank_message: "Mmmmm, that was nice! Thank you, <name>!", }, { name: "", thank_message: "", min: 30, max: 99, duration: 20, // in seconds power: "medium", // description: "20 seconds (medium power)", default_thank_message: "Gosh, you're such a sweetie, <name>!", }, { name: "", thank_message: "", min: 100, max: 199, duration: 20, // in seconds power: "HIGH", // description: "20 seconds (HIGH power)", default_thank_message: "<name>, that took my breath away!", }, { name: "", thank_message: "", min: 200, max: 299, duration: 30, // in seconds power: "HIGH", // description: "30 seconds (HIGH power)", default_thank_message: "You took me right to the edge, <name>!", }, { name: "", thank_message: "", min: 300, max: 499, duration: 30, // in seconds power: "ULTRA HIGH", // description: "30 seconds (ULTRA HIGH power)", default_thank_message: "OMG you're gonna kill me with orgasms, <name>!", }, { name: "", thank_message: "", min: 500, max: Number.MAX_SAFE_INTEGER, duration: 60, // in seconds power: "ULTRA HIGH", // description: "60 seconds (ULTRA HIGH power)", default_thank_message: "<name>, I'm just gonna bend over and you can fuck me all night long, OK?", } ]; // Initialize description and default thank-you message. This happens upon app starting, before displaying app's settings to user. for (var i = 0; i < levels.length; i++) { var level = levels[i]; var i1 = i + 1; var max_str = level.max == Number.MAX_SAFE_INTEGER ? (level.min + "+") : level.max; // var label = "Thank you for " + level.min + " to " + max_str; // level.label = label; var level_name = "level" + i; level.name = level_name; var description = level.duration + " seconds (" + level.power + " power)"; cb.settings_choices.push( { name: level_name, label: "Description, level " + i1, type: "str", minLength: 0, maxLength: 10240, required: false, defaultValue: "Level " + i1 + ", " + level.min + "-" + max_str + " tokens: " + description, } ); cb.settings_choices.push( { name: "level_thank_" + i, label: "Thank you message, level " + i1, type: "str", minLength: 0, maxLength: 10240, required: false, defaultValue: level.default_thank_message, } ); } var colorList = {}; colorList["General Display Color"] = { c: "" }, colorList.Orange = { c: "#DC5500" }, colorList.Blue = { c: "#2e49ba" }, colorList.Purple = { c: "#6900CC" }, colorList.Pink = { c: "#F88888" }, colorList.Dark_Red = { c: "#9F000F" }, colorList.Black = { c: "#000000" }; cb.onEnter(function(e) { var t = e.user; isOwner(t) || levelMode && levelDisplay(t) }); function cmdToken(e, t) { return 1 == t.length ? sendTitle(e, newline + lck + "Token Received Setting is : " + (tokenOn ? "ON" : "OFF") + newline + dot + qt("/token on") + " : Display the Total Tokens received in Panel." + newline + dot + qt("/token off") + " : Stop display the Total Tokens received." + newline) : "on" == t[1] ? tokenOn ? sendTitle(e, lck + "Token Received Display already ON") : (tokenOn = !0, sendTitle(e, lck + "Token Received Display settled ON.")) : "off" == t[1] ? tokenOn ? (tokenOn = !1, void sendTitle(e, lck + "Token Received Display settled OFF.")) : sendTitle(e, lck + "Token Received Display already OFF") : "Format : " + qt("/token <on/off>") } function doCommand(e, t) { var n = splitOnWhiteSpaces(t.toLowerCase()), cmd = n[0]; if (cmd == "sum") { return cmdSum(e); } else if (cmd == "token") { return cmdToken(e, n); } else if (cmd == "lvls") { levelDisplay(all); return 0; } else if (cmd == "fake_tip") { var amount = parseInt(n[1]); onTip({ amount: (amount == NaN ? 1 : amount), message: "Hello dolly!", is_anon_tip: false, to_user: "", from_user: "sugar_daddy", from_user_in_fanclub: false, from_user_has_tokens: true, from_user_is_mod: false, from_user_tipped_recently: false, from_user_tipped_alot_recently: false, from_user_tipped_tons_recently: false, from_user_gender: "m", }); } else { return void 0; } } var cmdList = {}; cmdList["/sum"] = { cmd: "sum" }; cmdList["!sum"] = { cmd: "sum" }; cmdList["/tok"] = { cmd: "token" }; cmdList["!tok"] = { cmd: "token" }; cmdList["/lvls"] = { cmd: "lvls" }; cmdList["/ftip"] = { cmd: "fake_tip" }; function watchCommand(message) { for (var t in cmdList) { var n = message.toLowerCase().indexOf(t); if (n >= 0) { var o = splitOnWhiteSpaces(message.substring(n)); return message.substring(n).replace(o[0], cmdList[t].cmd) } } } cb.onMessage(function(msg) { var t = msg.user, message = msg.m, o = msg.is_mod; if (! (msg.hasOwnProperty("X-Spam") && msg["X-Spam"])) { numActionsSinceLastDisplay += 1 } if (isOwner("nicole_asahi")) { var a = watchCommand(message); if (a) { var i = doCommand(t, a, o); i && errorCommand(t, i, a); // e.m = "", e["X-Spam"] = !0; } } return msg; }); function onTip(e) { cb.log("onTip {"); var t = parseInt(e.amount), n = e.from_user; numActionsSinceLastDisplay += 1, tipNb += 1, tipSum += t; var n = manageTotalList(e, t); if (cb.settings.autoThanks == 'yes'){ cb.log(JSON.stringify(e, undefined, "")); cb.log(JSON.stringify(levels, undefined, "")); for (var i in levels) { var level = levels[i]; cb.log(JSON.stringify(level, undefined, "")); cb.log("checking level: <" + level.name + ">"); if (e['amount'] >= level.min && e['amount'] <= level.max) { cb.log("is tip level: <" + level.name + ">"); var thank_message = level.thank_message.replace("<name>", e.from_user); var message_font_weight = "normal"; var message_font_color = "#006666"; var bangs = ""; if (e.amount >= 500) { bangs = "!!!!"; message_font_weight = "bolder"; } else if (e.amount >= 300) { bangs = "!!!"; message_font_weight = "bolder"; } else if (e.amount >= 200) { bangs = "!!"; message_font_weight = "bold"; } else if (e.amount >= 100) { bangs = "!"; message_font_weight = "bold"; } else if (e.amount < 30) { message_font_color = "#00aaaa"; } thank_message += newline + " (" + level.duration + " seconds at " + level.power + " power" + bangs + ")"; cb.chatNotice(thank_message, "", '#FFFFFF', message_font_color, message_font_weight); break; } } } cb.log("onTip }"); } cb.onTip(function(e) { cb.log("cb.onTip {"); onTip(e); cb.log("cb.onTip }"); }); cb.onDrawPanel(function() { return { template: "3_rows_11_21_31", row1_value: row1, row2_value: row2, row3_value: row3 } }); init();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.