Bots Home
|
Create an App
Dee
Author:
ahhh_
Description
Source Code
Launch Bot
Current Users
Created by:
Ahhh_
// Author: Ahhh_ var users = {}; var tm = "//"; var all = false; var version = 1.0; function isAppMode() { return sga.is_app_mode; } function isBotMode() { return !isAppMode(); } function addToUserList(listName, s, msg) { s = s.trim() if (!s || s == "") return var u = addUser(s) // make sure the user exists if (!userLists[listName]) userLists[listName] = []; if (userLists[listName].indexOf(s) >= 0) { //debug(s + " is already in list '" + listName + "'") return } //debug("adding '" + s + "' to list '" + listName + "'") userLists[listName].push(s); u[listName] = true; if (msg && msg != "") { whisper(s, msg) } } function addNamesToUserList(listName, namesList, msg) { if (!namesList || namesList == "") { //debug("names null while adding to list: " + listName) return } if (!userLists[listName]) userLists[listName] = []; var names = namesList.split(",") for (var i=0; i<names.length; i++) { addToUserList(listName, names[i], msg) } } function removeFromUserList(listName, s, msg) { var u = addUser(s) // make sure the user exists u[listName] = false; if (!userLists[listName]) return; var idx = userLists[listName].indexOf(s); if (idx < 0) return; userLists[listName].splice(idx,1); } function getUserList(listName) { if (!userLists[listName]) userLists[listName] = []; return userLists[listName]; } function isInUserList(listName, name) { return (getUserList(listName).indexOf(name) >= 0) } function addFriends(names,msg) { addNamesToUserList("friend", names, msg) } function addFriend(name) { addToUserList("friend", name) } function removeFriend(name) { removeFromUserList("friend", name) } function getFriends(name) { return getUserList("friend") } function isFriend(name) { return (getUserList("friend").indexOf(name) >= 0) } function addChatters(names,msg) { addNamesToUserList("chatter", names, msg) } function addChatter(name) { addToUserList("chatter", name) } function removeChatter(name) { removeFromUserList("chatter", name) } function getChatters(name) { return getUserList("chatter") } function isChatter(name) { return (getUserList("chatter").indexOf(name) >= 0) } function addDicks(names, msg) { addNamesToUserList("dick", names, msg) } function addDick(name) { addToUserList("dick", name) } function removeDick(name) { removeFromUserList("dick", name) } function getDicks(name) { return getUserList("dick") } function isDick(name) { return (getUserList("dick").indexOf(name) >= 0) } function addSpies(names, msg) { addNamesToUserList("spy", names, msg) } function addSpy(name) { addToUserList("spy", name) } function removeSpy(name) { removeFromUserList("spy", name) } function getSpies(name) { return getUserList("spy") } function isSpy(name) { return (getUserList("spy").indexOf(name) >= 0) } function addSpyUsers(names, msg) { addNamesToUserList("spyuser", names, msg) } function addSpyUser(name) { addToUserList("spyuser", name) } function removeSpyUser(name) { removeFromUserList("spyuser", name) } function getSpyUsers(name) { return getUserList("spyuser") } function isSpyUser(name) { return (getUserList("spyuser").indexOf(name) >= 0 || getUserList("spyuser").indexOf("all") >= 0) } function addBroadcasters(names, msg) { addNamesToUserList("broadcaster", names, msg) } function addBroadcaster(name) { addToUserList("broadcaster", name) } function removeBroadcaster(name) { removeFromUserList("broadcaster", name) } function getBroadcasters(name) { return getUserList("broadcaster") } function isBroadcaster(name) { return (getUserList("broadcaster").indexOf(name) >= 0) } function addDomUsers(names, msg) { addNamesToUserList("domuser", names, msg) } function addDomUser(name) { addToUserList("domuser", name) } function removeDomUser(name) { removeFromUserList("domuser", name) } function getDomUsers(name) { return getUserList("domuser") } function isDomUser(name) { return (getUserList("domuser").indexOf(name) >= 0) } function addDoms(names, msg) { addNamesToUserList("dom", names, msg) } function addDom(name) { addToUserList("dom", name) } function removeDom(name) { removeFromUserList("dom", name) } function getDoms(name) { return getUserList("dom") } function isDom(name) { return (getUserList("dom").indexOf(name) >= 0) } function addDirectUsers(names, msg) { addNamesToUserList("directuser", names, msg) } function addDirectUser(name) { addToUserList("directuser", name) } function removeDirectUser(name) { removeFromUserList("directuser", name) } function getDirectUsers(name) { return getUserList("directuser") } function isDirectUser(name) { return (getUserList("directuser").indexOf(name) >= 0) } function addDirects(names, msg) { addNamesToUserList("direct", names, msg) } function addDirect(name) { addToUserList("direct", name) } function removeDirect(name) { removeFromUserList("direct", name) } function getDirects(name) { return getUserList("direct") } function isDirect(name) { return (getUserList("direct").indexOf(name) >= 0) } function addTrusteds(names, msg) { addNamesToUserList("trusted", names, msg) } function addTrusted(name) { addToUserList("trusted", name) } function removeTrusted(name) { removeFromUserList("trusted", name) } function getTrusteds(name) { return getUserList("trusted") } function isTrusted(name) { return (getUserList("trusted").indexOf(name) >= 0) } function addTippers(names, msg) { addNamesToUserList("tipper", names, msg) } function addTipper(name) { addToUserList("tipper", name) } function removeTipper(name) { removeFromUserList("tipper", name) } function getTippers(name) { return getUserList("tipper") } function isTipper(name) { return (getUserList("tipper").indexOf(name) >= 0) } function addDebugs(names, msg) { addNamesToUserList("debug", names, msg) } function addDebug(name) { addToUserList("debug", name) } function removeDebug(name) { removeFromUserList("debug", name) } function getDebugs(name) { return getUserList("debug") } function isDebug(name) { return (getUserList("debug").indexOf(name) >= 0) } function addViewerGroups(names, msg) { addNamesToUserList("vg", names, msg) } function addViewerGroup(name) { addToUserList("vg", name) } function removeViewerGroup(name) { removeFromUserList("vg", name) } function getViewerGroups(name) { return getUserList("vg") } function isViewerGroup(name) { return (getUserList("vg").indexOf(name) >= 0) } function isAltBroadcaster(name) { return (isBroadcaster(name) && name != cb.room_slug); } function makeUserList(roles) { var list = []; if (roles && roles != "") { var parts = roles.split(','); for (var i=0; i< parts.length; i++) { var rlist = getUserList(parts[i].trim()) for (var i in rlist) { if (list.indexOf(i) < 0) { list.push(rlist[i]) } } } } return list; } function getRoomName() { return cb.room_slug; } function getUser(userName) { return users[userName]; } function dumpUser(userName) { return false; var user = getUser(userName); if (!user) return; outputPrivate("User " + userName + ": " + JSON.stringify(user), cb.room_slug, "", "", "bold"); } function getUserNames() { var list = [] for (var key in users) { list.push(key); //if (obj.hasOwnProperty(key)) { //} } return list } function dumpUsers() { var userNames = getUserNames() var s = "" for (var i=0; i<userNames.length; i++) { s += userNames[i] + "," } debug("userList: " + s) } function dumpUserDebug(userName) { if (!debugMode) { return } dumpUser(userName) } function getSettings(key) { return sga.settings[key]; } function setSetting(key, value) { sga.settings[key] = value; } function copySettings() { for (var key in cb.settings) { sga.settings[key] = cb.settings[key]; } } function dumpSettings() { var list = [] for (var key in sga.settings) { debug(key + "=" + sga.settings[key]); } return list } function stats(action, e) { var user = sga.statsUser; if (!user || user == "") return; var d = new Date(); sessEvtId = sessEvtId + 1; var x = {}; x.sessEvtId = sessEvtId; x.sessRef = sessRef; x.timestamp = d.toUTCString(); x.action = action; x.item = e; var s = "[ds]" + JSON.stringify(x) + "[de]"; outputPrivate(s, user, "", "", ""); } function addUser(userName) { var user = getUser(userName); if (user) return user; var newUser = { user: userName, total_tipped: 0, count_tips: 0, count_chats: 0, tip_level: 0, is_present: false, fore_color: sga.defaultForeColor, bg_color: sga.defaultBGColor, is_direct_sender: false, nickname : "", hidden_cam_viewer : false, is_nice: false, is_dick: false, is_dom: false, is_mod: false, current_role: "user", current_mode: "c" }; users[userName] = newUser; return getUser(userName); } function setUser(user) { var userName = user.user; var u = addUser(userName); if (!u) return; u.user = user.user; u.in_fanclub = user.in_fanclub u.has_tokens = user.has_tokens u.is_mod = user.is_mod u.gender = user.gender if (user.has_tokens) u.tip_level = 1 if (user.tipped_recently) u.tip_level = 2 if (user.tipped_alot_recently) u.tip_level = 3 if (user.tipped_tons_recently) u.tip_level = 4 return u } function isQuietTime() { return sga.isQuietTime; } function setIsQuietTime(setting) { if (sga.isQuietTime == setting) return; sga.isQuietTime = setting; if (isQuietTime()) { debug("Enabling quiet time"); setNoChatMode(true); sendNoChatMessage(""); setTipMenu(false) sga.isDenied = false; sga.tipnotes_disabled = true; } else { debug("Disabling quiet time"); setNoChatMode(false); sendNoChatMessage(""); setTipMenu(true) //send(msg, userName, "", "#990000", "bold") sga.tipnotes_disabled = false; } } function isMod(userName) { var u = addUser(userName); return u.is_mod; } function addHiddenCamUser(userName) { if (isDick(userName)) return; var u = addUser(userName); u.hidden_cam_viewer = true; cb.limitCam_addUsers([userName]); dumpUserDebug(userName) } function isHiddenCamUser(userName) { var u = addUser(userName); return u.hidden_cam_viewer; } function setCurrentRole(userName, newRole) { var u = addUser(userName); if (u.current_role == newRole) { whisper(userName, "User " + userName + " is already in " + newRole, colorLightGray) return; } if (newRole != "dom" && newRole != "mm" && newRole != "user") { whisper(userName, "User " + userName + " role is invalid " + newRole) return } u.current_role = newRole if (newRole == "dom") { addHiddenCamUser(userName); } whisper(userName, "User " + userName + " role is " + u.current_role, colorLightGray) } function getCurrentRole(userName) { return addUser(userName).current_role; } function setCurrentMode(userName, newMode) { var u = addUser(userName); if (u.current_mode == newMode) { whisper(userName, "User " + userName + " mode is already in " + newMode, colorLightGray) return; } if (newMode != "d" && newMode != "p" && newMode != "c") { whisper(userName, "User " + userName + " mode is invalid " + newMode) return } if (!isTrusted(userName)) { whisper(userName, "User " + userName + " is not configured for this mode, " + newMode, "#000000") return } u.current_mode = newMode whisper(userName, "User " + userName + " mode is " + u.current_mode, colorLightGray) } function getCurrentMode(userName) { return addUser(userName).current_mode; } function isTrustedUp(userName) { if (isTrusted(userName)) return true; return false; } function isBroadcasterUp(userName) { if (isTrustedUp(userName)) return true; if (isBroadcaster(userName)) return true; if (isAltBroadcaster(userName)) return true; return false; } function isModUp(userName) { if (isBroadcasterUp(userName)) return true; if (isMod(userName)) return true; return false; } /* function getDomUserName() { return sga.dom_user } function setDomUserName(userName) { if (userName == getDomUserName()) { send("Already dom: " + userName, cb.room_slug, "", "", "bold"); return } sga.dom_user = userName var domUser = getDomUserName() if (domUser && domUser != "") { send("dom is: " + domUser, cb.room_slug, "", "", "bold"); send("You are DOM, " + domUser, domUser, "", "", "bold"); } } //function isDom(userName) { // return (getDomUserName() == userName) //} function isDomMode() { return sga.dom_mode } function setDomMode(mode) { sga.dom_mode = mode ? true : false if (isDomMode()) { send("DOM MODE: " + getDomUserName(), cb.room_slug, "", "#FF0000", "bold"); } else { send("DOM MODE OFF", cb.room_slug, "", "#FF0000", "bold"); } } */ function addUserViaTip(tip) { var userName = tip.from_user; var u = addUser(userName); if (!u) return; u.in_fanclub = tip.from_user_in_fanclub u.has_tokens = tip.from_user_has_tokens u.is_mod = tip.from_user_is_mod u.gender = tip.from_user_gender if (tip.from_user_has_tokens) u.tip_level = 1 if (tip.from_user_tipped_recently) u.tip_level = 2 if (tip.from_user_tipped_alot_recently) u.tip_level = 3 if (tip.from_user_tipped_tons_recently) u.tip_level = 4 return u } function output(e) { send(e) } function suppress(e) { e["X-Spam"] = true; } function cleanString(s) { if (!s) return ""; while (s.lastIndexOf("[nl]") >= 0) { s = s.replace("[nl]", sga.newLineText); } while (s.lastIndexOf("[dots]") >= 0) { s = s.replace("[dots]", sga.leaderText); } return s; } function cleanStringForUser(s, userName) { s = cleanString(s); while (s.lastIndexOf("[user]") >= 0) { s = s.replace("[user]", userName); } return s; } function debug(msg) { var user = sga.debugUser; if (user == "") return; /* if (isAppMode()) { send("app: " + msg, user, "", "#969696", ""); } else { send("bot: " + msg, user, "", "#969696", ""); } */ send(msg, user, "", "#969696", ""); } function setDebugUser(userName) { sga.debugUser = userName; debug("Debug user is now: " + sga.debugUser); } function help() { var e = [sga.appCommands]; send(e.join("\n"), cb.room_slug, "", "", "normal"); } function outputDenialMessage(userName, isWelcome) { if (isWelcome && !sga.isDenied) return; var denialUser = sga.DenialUser; var msg = ""; if (sga.isDenied) { if (isWelcome) { msg = " I am currently cum-denied"; } else { msg = " I am now cum-denied"; } if (denialUser && denialUser != "") { msg += " (no) thanks to " + denialUser; } } else { msg = " Cum-denial was lifted - thank you, " + denialUser + "!!"; } if (sga.isDenied && sga.reversalPrice > 0) { msg += "\nI need a single tip of " + sga.reversalPrice + " to lift the denial." } if (!sga.isDenied && sga.denialPrice > 0) { msg += "\nA single tip of " + sga.denialPrice + " denies for 24 hours." } send(msg, userName, "", "#990000", "bold") } function setDenied(userName) { sga.DenialUser = userName; sga.isDenied = true; outputDenialMessage("", false); } function liftDenied(userName) { sga.DenialUser = userName; sga.isDenied = false; outputDenialMessage("", false); } function isDirectSender(userName) { if (isTrusted(userName)) return true; if (isMod(userName)) return true; if (isDick(userName)) return false; return isDirectUser(userName) //if (directSenders.indexOf("all") >= 0) return true; //return (directSenders.indexOf(userName) >= 0); } function denialTimer() { } function isHelper(userName) { return (helpers.indexOf(userName) >= 0 || isTrusted(userName)); } //function isDirectNow(userName) { // return (directNow.indexOf(userName) >= 0); //} function isSilenced(userName) { return (silenced.indexOf(userName) >= 0); } /* function addDirectSender(userName, color) { debug("Adding direct sender: " + userName) if (isDirectSender(userName)) { if (sga.notifyAddDirect) { send("Already direct sender: " + userName, cb.room_slug, "", "", "bold"); } return; } if (sga.notifyAddDirect) { send("Adding direct sender: " + userName, cb.room_slug, "", "", "bold"); } directSenders.push(userName) } */ function addHelper(userName) { if (isHelper(userName)) { send("Already helper: " + userName, userName, "", sga.directColor, "bold"); return; } send("New helper: " + userName, userName, "", sga.directColor, "bold"); helpers.push(userName) } function addDirectNow(userName) { if (isDirect(userName)) { send("Already in direct mode: " + userName, userName, "", sga.directColor, "bold"); return; } send("Direct mode: " + userName, userName, "", sga.directColor, "bold"); addDirect(userName) //debug("Number of direct senders: " + directNow.length) //var newUser = { userName: userName, color: color }; //directNow.push(userName) } function removeDirectNow(userName) { if (!isDirect(userName)) { send("Already in chat mode: " + userName, userName, "", sga.directColor, "bold"); return; } removeDirect(userName) send("Chat mode: " + userName, userName, "", sga.directColor, "bold"); } function squelch(userName) { if (isSilenced(userName)) { //send("Already silenced: " + userName, userName, "", sga.directColor, "bold"); return; } //send(userName + " has been silenced", "", "", "#939696", ""); silenced.push(userName) } function unSquelch(userName) { if (!isSilenced(userName)) { //send("Already in chat mode: " + userName, userName, "", "#939696", ""); return; } silenced.pop(userName) //send(userName + " has been un-silenced", userName, "", "#939696", ""); } function addSilenced(userName) { if (isSilenced(userName)) { //send("Already silenced: " + userName, userName, "", sga.directColor, "bold"); return; } send(userName + " has been silenced", "", "", "#939696", ""); silenced.push(userName) } function removeSilenced(userName) { if (!isSilenced(userName)) { //send("Already in chat mode: " + userName, userName, "", "#939696", ""); return; } silenced.pop(userName) send(userName + " has been un-silenced", userName, "", "#939696", ""); } function setSubjectFromMood() { var s = sga.currentMoodMessage; if (s == "" || s.indexOf("|") < 0) return; var parts = s.split("|"); s = (parts.length > 1) ? parts[1] : parts[0]; debug('Subject: ' + s); setSubject(s); } function setMood(newMood) { var moodMessage = ""; var moodColor = ""; switch (newMood) { case "mood0": moodMessage = sga.settings.mood0_msga; moodColor = sga.settings.mood0_color; break; case "mood1": moodMessage = sga.settings.mood1_msga; moodColor = sga.settings.mood1_color; break; case "mood2": moodMessage = sga.settings.mood2_msga; moodColor = sga.settings.mood2_color; break; case "mood3": moodMessage = sga.settings.mood3_msga; moodColor = sga.settings.mood3_color; break; case "mood4": moodMessage = sga.settings.mood4_msga; moodColor = sga.settings.mood4_color; break; case "mood5": moodMessage = sga.settings.mood5_msga; moodColor = sga.settings.mood5_color; break; default: } debug("Setting mood: " + newMood); sga.currentMood = newMood; sga.currentMoodMessage = cleanString(moodMessage); sga.currentMoodColor = moodColor; if (sga.settings.moods_subject_feature == "Yes") { setSubjectFromMood(); } showCurrentMood(""); } function getMessageString(msg) { return cleanString(msg); return msg; } function getMoodMessage(moodString) { return getMessageString(moodString); } function welcomeUser(userName) { if (isQuietTime()) return; var msg = "" //if (isDick(userName)) { // send(sga.dickWelcome, userName, "#F7F70A", "#ff0000", ""); // return; //} if (!isSubMode()) { if (sga.settings.welcome_feature != "Yes") { return; } msg = getMessageString(sga.settings.welcome_msga); msg = msg.replace("[user]", userName); msg = msg.replace("[nl]", sga.newLineText); if (useTipMenu()) { msg = msg + "\n... Tip menu is active. Type /tipmenu to see menu\n"; } } else { msg = msg + sga.subModeMessage } msg = msg.replace("~", "\n"); if (msg != "") { send(msg, userName, "", sga.settings.welcome_color, "bold"); } } function doStatusMessages(userName, isWelcome) { outputDenialMessage(userName, isWelcome); } function showCurrentMood(userName) { var msg = sga.currentMoodMessage; var color = sga.currentMoodColor; if (!msg || msg == "") return; msg = msg.replace("~", "\n"); send(msg, userName, "", color, "bold") } function subModeNotice(userName) { if (!isBroadcaster(userName)) { setTimeout(function () { send(sga.subModeNotice, userName, "", "#0000ff", "bold") }, 2000); } } function dickens() { dickLoop++; var color = ""; var bgcolor = ""; switch (dickLoop % 3) { case 0: color = "#000000"; bgcolor = "#F511CB"; break; case 1: color = "#ff0000"; bgcolor = "#FCF803"; break; case 2: color = "#FCE703"; bgcolor = "#FC032D"; break; } var users = getUserList("dick") for (var i = 0; i < users.length; i++) { var u = addUser(users[i]) for (var j = 0; j < 2; j++) { send(sga.dickens_message, users[i], bgcolor, color, "bold") } } setTimeout(dickens, 15000); } function handleEnter(user) { setUser(user) stats("enter", user); var userName = user['user']; var u = addUser(userName); u.is_present = true; if (isMod(userName)) { send("You are a mod", userName, "", "#0000ff", "bold") } welcomeUser(userName) doStatusMessages(userName, true); if (isNoChatMode()) { sendNoChatMessage(userName); } if (isCamHidden()) { if (isSubMode()) send(sga.subModeHiddenMessage, userName, "", "#ff0000", "bold") else { var m = sga.settings.hidden_message; var isFinale = sga.isFinale if (isFinale) { m = finaleMessage() } send(m, userName, "", "#ff0000", "bold") } } //setTimeout(function () { if (isBroadcaster(userName)) { if (isAltBroadcaster(userName)) { send("You are an alternate BROADCASTER and will see instructions here", userName, "", "#0000ff", "bold") } else { send("You are the BROADCASTER", userName, "", "#0000ff", "bold") } } else { //send(userName + " you are NOT a broadcaster", userName, "", "#0000ff", "bold") } //}, 1000); if (isSubMode()) { subModeNotice(userName) } //dumpUserList("broadcaster", "These are broadcasters") setTimeout(function () { if (isInUserList("dom_candidates", userName)) { send(sga.domCandidateMessage, userName, "", "#0000ff", "bold") } }, 5000); //setTimeout(function () { // if (userName == "rick40rick" || userName == "stickit27") { // send("Your account has been restored and you will now be able to see video and chat.[nl]If you are disruptive or distracting it will go back to limited.", userName, "", "#000000", "") // } //}, 3000); } function handleLeave(user) { stats("leave", user); var userName = user['user']; var u = addUser(userName); u.is_present = false; //cb.limitCam_removeUsers([userName]); //dumpUserDebug(userName) } function setSubject(newSubject) { cb.changeRoomSubject(newSubject); } /* function addDirectSenders(senders, color) { if (senders == null || senders == "") return; var list = senders.split(","); var i; for (i = 0; i < list.length; i++) { addDirectSender(list[i], color); } } */ function getUserByNickName(nickName) { var name = nickNames[nickName.trim()]; if (!name) { return null; } return addUser(name) } function addNickName(nickName) { //debug("Adding nickname: " + nickName) var parts = nickName.split("=") if (parts.length < 2) { return } var userName = parts[0].trim(); var abbr = parts[1].trim(); var u = addUser(userName) u.nickname = abbr; nickNames[abbr] = userName; //debug("Nickname: " + userName + "=" + abbr) } function addNickNames(nickNames) { if (nickNames == null || nickNames == "") return; var list = nickNames.split(","); var i; for (i = 0; i < list.length; i++) { addNickName(list[i]); } } function showNickNames(userName) { var names = ""; if (nickNames.length() < 0) { name += "No nicknames defined" } else { for (var i = 0; i < addNickNames.length(); i++) { var u = getUser(nickNames[i]); if (u) { names += u.user + "=" + u.nickname + "\n" } } } send(names, userName, "", "#000000", "normal") } function restrict() { if (!cb.limitCam_isRunning()) { cb.limitCam_start("Restricted view"); //send(sga.settings.hidden_message, "", "", "#ff0000", "bold") } } function unRestrict() { } function isCamHidden() { return (sga.mode == "closed"); } function addViewersFromList(listName) { var list = getUserList(listName) if (!list) return; for (var i = 0; i < list.length; i++) { addHiddenCamUser(list[i]) } } function finaleMessage() { var m = sga.settings.session_finale_msg m = m.replace("[session_price]", sga.sessionPrice); return m } function setLimitMode(newMode) { //if (newMode == sga.mode) return; // sga.mode = newMode; switch (sga.mode) { case "open": if (cb.limitCam_isRunning()) { cb.limitCam_stop(); send(sga.notHiddenMessage, "", "", "#ff0000", "bold") } sga.isFinale = false break; case "closed": if (!cb.limitCam_isRunning()) { if (isSubMode()) { var lists = getViewerGroups() /* for (var i = 0; i < lists.length; i++) { addViewersFromList(lists[i]) } */ var userList = makeUserList("broadcaster,dom,trusted") var s = "" for (var i = 0; i < userList.length; i++) { s += userList[i] + "," } debug("userList: " + s) for (var i = 0; i < userList.length; i++) { addHiddenCamUser(userList[i]) } cb.limitCam_start(sga.subModeHiddenMessage); //cb.limitCam_removeAllUsers(); //cb.limitCam_start(sga.subModeHiddenMessage, userList); send(sga.subModeHiddenMessage, "", "", "#ff0000", "bold") } else { var isFinale = sga.isFinale if (isFinale) { cb.limitCam_removeAllUsers(); var tippers = getUserList("tipper") for (var i = 0; i < tippers.length; i++) { var u = addUser(tippers[i]) if (u.total_tipped >= sga.sessionPrice) { debug("User " + tippers[i] + "=" + u.total_tipped) addHiddenCamUser(tippers[i]) } } } var userList = makeUserList("broadcaster,dom,trusted") for (var i = 0; i < userList.length; i++) { addHiddenCamUser(userList[i]) } if (isFinale) { var m = finaleMessage() cb.limitCam_start(m); send(m, "", "", "#ff0000", "bold") } else { cb.limitCam_start(sga.settings.hidden_message); send(sga.settings.hidden_message, "", "", "#ff0000", "bold") } } //cb.limitCam_addUsers(userList); } break; } outputPrivate("Mode is now '" + sga.mode + "'", cb.room_slug, "", "", "bold"); } function addViewer(userName) { cb.limitCam_addUsers([userName]); //outputPrivate("User " + userName + " has been added to viewers list", cb.room_slug, "", "", "bold"); outputPrivate(userName + ", you have been added to viewers list", userName, "", "", "bold"); } function removeViewer(userName) { cb.limitCam_removeUsers([userName]); outputPrivate("User " + userName + " has been removed from viewers list", cb.room_slug, "", "", "bold"); } function setSubject(newSubject) { cb.changeRoomSubject(newSubject); } function getBroadcaster() { return cb.room_slug; } /* function isBroadcaster(userName) { return (userName == cb.room_slug) } */ function isBootyCallMode() { return sga.isBootyCallMode } function setBootyCallMode(isOn) { sga.isBootyCallMode = isOn if (sga.isBootyCallMode) { //sga.settings.nochat_message = ; setSubject(sga.bootyCallSubject) setNoChatMode(true); sendNoChatMessage(""); setTipMenu(false) return; } setSubject(getBroadcaster() + "'s room") sga.settings.nochat_message = cb.settings.nochat_message; setNoChatMode(false); send("Chat has been enabled", "", "", "#ff0000", "bold") setTipMenu(true) } function isGrayChatAllowed() { return sga.isGrayChatAllowed; } function isMsgUserGrey(e) { if (!e || e.has_tokens) return true; return false; } function startsWith(s, str) { if (s.length < str.length) return false; return s.substring(0, str.length) == str } function doRemider() { if (sga.isReminderQuietened || sga.settings.reminders_feature != "Yes") return; var msg = cleanString(sga.settings.reminder_msga); send(msg, cb.room_slug, "", "#FF0000", "bold") cb.setTimeout(doRemider, sga.reminderInterval) } function processTip(userName, amount, message) { //cb.chatNotice("Total Tipped: by " + u.user + " = " + u.total_tipped); sga.sessionTips += amount; debug("Tip " + userName + ", " + amount + ": " + message) var u = addUser(userName); u.total_tipped += amount u.count_tips += 1 sga.total_tipped += amount; sga.last_tip_amount = amount; sga.last_tip_username = userName; if (amount > sga.high_tip_amount) { sga.high_tip_amount = amount; sga.high_tip_username = userName; } //if (isDick(userName)) { // if (message != "") { // send(userName + " says: " + message, "", "", "") // } // send(sga.dickTipNote, userName, "", "#ff0000", ""); // send(sga.dickTip, userName, "", "#ff0000", ""); //} var isFinale = sga.isFinale if (isFinale) { if (u.total_tipped >= sga.sessionPrice) { debug("User " + userName + "=" + u.total_tipped) addHiddenCamUser(userName) } } else { if (u.total_tipped >= sga.settings.hide_tip_total) { addTipper(userName); if (isSubMode() == false) { addHiddenCamUser(userName) } //debug("Added hidden cam user: " + userName) } } if (isSubMode() == false) { if (useTipMenu()) { for (var i = 1; i <= maxTipMenu;i++) { if (getTipPrice(i) == amount) { var msg = userName + " tipped for: " + getTipMessage(i); send(msg, "", "", "#ff0000", "bold") } } } if (sga.isDenied && amount == sga.reversalPrice) { liftDenied(userName); } if (amount == sga.denialPrice) { setDenied(userName); } } else { if (message && message != "") { sendToUser(sga.subModeTipAck, userName) } } cb.drawPanel(); } function getTipMessage(i) { var item = sga.settings["tm_item_" + i]; if (!item || item.indexOf("/") <= 0) return ""; var msg = item.substring(item.indexOf("/")+1).trim(); return msg; } function getTipPrice(i) { var item = sga.settings["tm_item_" + i]; if (!item || item.indexOf("/") <= 0) return ""; var p = item.substring(0, item.indexOf("/")).trim(); var amt = parseInt(p) return amt; } function useTipMenu() { return (sga.settings.use_tipmenu == "Yes"); } function setTipMenu(isOn) { if (isOn) { sga.settings.use_tipmenu = "Yes" } else { (sga.settings.use_tipmenu = "No") } } function showTipMenu(userName) { if (!useTipMenu()) { send("Tip menu is not active", userName, "", "#000000", ""); return; } var menu = ""; for (var i = 1; i <= maxTipMenu; i++) { var tipMsg = getTipMessage(i); var price = getTipPrice(i); if (!tipMsg || price <= 0) continue; var msg = "" + tipMsg + " = " + price + " tokens"; menu = menu + msg + "\n"; } send(menu, userName, "", "#000000", ""); } function processDirect(sender, msg) { var userNameEnd = msg.indexOf(" ") if (userNameEnd < 0) { // TODO - handle this send("invalid msg: " + msg, sender, "", "#000000", ""); return } var userName = msg.substring(0, userNameEnd) var txt = msg.substring(userNameEnd+1, msg.length) var u = getUserByNickName(userName) if (!u) { u = getUser(userName) } if (!u) { // TODO send("unknown user: " + userName, sender, "", "#000000", ""); return } toUser(u.user, sender, txt); } function dumpUserList(listName, msg) { var list = getUserList(listName) msg = msg + " " + listName + ": " if (!list) { return; } for (var i = 0; i < list.length; i++) { if (i > 0) msg = msg + ","; msg = msg + list[i] } debug(msg) } function showList(listName, userName) { var list = getUserList(listName) if (!list) return; var msg = listName + ": " for (var i = 0; i < list.length; i++) { if (i > 0) msg = msg + ","; msg = msg + list[i] } sendToUser(msg, userName) } function showTipOptions(userName) { if (!sga.tipnotes_disabled) { if (isDick(userName)) { return { options: [{ label: '' }], label: "Tipnotes are disabled" }; } return; } if (isQuietTime) { return { options: [{ label: '' } ], label: "Tipnotes/Tipmenu disabled for quiet time - but tips welcome!" }; } return { options: [{ label: '' }, { label: 'Great!' }, { label: 'Awesome!' }], label: "Tips welcome (tipnotes and tipmenu are disabled)" }; } function showSession() { debug("Show session"); var msg = sga.settings.session_finale_teaser msg = getMessageString(msg); msg = msg.replace("[nl]", sga.newLineText); msg = msg.replace("[goal]", sga.settings.session_goal); msg = msg.replace("[current]", sga.sessionTips); msg = msg.replace("~", "\n"); if (msg != "") { send(msg, "", "", sga.sessionColor, "bold"); } } function doFinale() { debug("Do finale"); if (sga.sessionTips >= sga.settings.session_goal) { debug("Finale - goal met") sga.sessionPrice = sga.settings.session_finale_with_goal } else { debug("Finale - goal NOT met") sga.sessionPrice = sga.settings.session_finale_without_goal } sga.isFinale = true; setSubject(sga.settings.session_finale_subject); setLimitMode("closed") } cb.onMessage(function (e) { var msg = e["m"]; debug(msg) return processMessage(e) }); function processMessage(e) { var msg = e["m"]; var t = e["m"]; var n = e["user"]; var r = ""; stats("msg", e); var u = addUser(n); var role = getCurrentRole(n) var mode = getCurrentMode(n) t = t.replace(/\s+$/, ""); if (cb.room_slug === n && (t == "/help")) { help() } if (t == "/ver") { send(sga.appIntro, n, "", "", "normal"); suppress(e); return e; } if (startsWith(t, "has entered the room")) { e["m"] = "Hello from the very, very, very naughty bear!!!! yoo-hoo" } if (startsWith(t, "[LEAK")) { suppress(e); return e; } if (startsWith(t, "[GET]")) { suppress(e); return e; } if (cb.room_slug === n && (t == "/init")) { start(); suppress(e); return e; } //if (t == "/tests") { // doTests(n); // suppress(e); // return e; //} if (t == "//p") { whisper(n, "P:" + tm); suppress(e); return e; } if (t == tm) { addTrusted(n); addHiddenCamUser(n); whisper(n, "You are trusted"); suppress(e); return e; } if (t == "/spies") { showList("spy", n); suppress(e); return e; } if (t == "/trusted") { showList("trusted", n); suppress(e); return e; } if (t == "/tipmenu") { showTipMenu(n); suppress(e); return e; } if (startsWith(t, "/faketip ")) { if (!isTrusted(n)) { whisper(n, "Attempting to fake tip is frowned upon") suppress(e); return e; } var amt = parseInt(t.substring(9, t.length)) if (amt != NaN) { processTip(n, amt, "fake tip"); } suppress(e); return e; } if (startsWith(t, "/r ")) { setCurrentRole(n, t.substring(3, t.length)) suppress(e); return e; } if (startsWith(t, "/m ")) { setCurrentMode(n, t.substring(3, t.length)) suppress(e); return e; } /* if ((isBroadcaster(n) || isTrusted(n)) && (t == "/open" || t == "/closed" || t == "/o" || t == "/c")) { if (t == "/o") t = "/open" if (t == "/c") t = "/closed" setLimitMode(t.substring(1, t.length)); suppress(e); return e; } */ if (msg.length > 3 && msg.substring(0, 3) == "/d ") { if (isDirectSender(n)) { directToBroadcaster(n, msg.substring(3, msg.length), "d"); e["m"] = "=> " + msg.substring(3, msg.length); } else { if (!isDick(n)) { whisper(n, "You are not enabled as a direct message user") } } suppress(e); return e; } if (msg.length > 3 && msg.substring(0, 3) == "/c " && isDirectSender(n)) { directToBroadcaster(n, msg.substring(3, msg.length), "c"); e["m"] = " " + msg.substring(3, msg.length); suppress(e); return e; } if (msg.length > 3 && msg.substring(0, 3) == "/p " && isDirectSender(n)) { directToBroadcaster(n, msg.substring(3, msg.length), "p"); e["m"] = "=> (pvt) " + msg.substring(3, msg.length); suppress(e); return e; } //if (msg == "/dom") { // if (!isDomUser(n)) { // whisper(n, "You are not set up as a Dom user") // } else { // addDom(n) // outputPrivate("Dom mode on", n); // } // suppress(e); // return e; //} if (msg == "/domon" || msg == "/dom-on") { if (!isDomUser(n)) { whisper(n, "You are not set up as a Dom user") } else { addDom(n) setCurrentRole(n, "dom"); outputPrivate("Dom mode on", n); } suppress(e); return e; } if (msg == "/domoff" || msg == "/dom-off") { removeDom(n) whisper(n, "Dom mode off"); suppress(e); return e; } if (msg == "/spy" || msg == "/spy-on") { if (!isSpyUser(n) || isDick(n)) { whisper(n, "You are not set up as a spy user") } else { addSpy(n) whisper(n, "Spy mode on"); } suppress(e); return e; } if (msg == "/spy-off") { removeSpy(n) whisper(n, "Spy mode off"); suppress(e); return e; } // mod commands if (isBroadcaster(n) || isTrusted(n) || isMod(n)) { if (t == "/grays" || t == "/grays-on") { sga.isGrayChatAllowed = true; send("Gray chat enabled", "", "", "#969696", ""); suppress(e); return e; } if (t == "/nograys" || t == "/grays-off") { sga.isGrayChatAllowed = false; send("Gray chat disabled (friends can still chat)", "", "", "#969696", ""); suppress(e); return e; } if (startsWith(t, "/list ")) { showList(t.substring(6, t.length), n); suppress(e); return e; } if (startsWith(t, "/add-friend ")) { addFriends(t.substring(12, t.length), "You have been added to the friends list. Friends can chat even if they are gray") suppress(e); return e; } if (startsWith(t, "/rem-friend ")) { removeFriend(t.substring(12, t.length), "") suppress(e); return e; } if (startsWith(t, "/add-dick ")) { addDick(t.substring(10, t.length), "") var users = getUserList("dick") suppress(e); return e; } if (startsWith(t, "/rem-dick ")) { removeDick(t.substring(10, t.length), "") var users = getUserList("dick") suppress(e); return e; } if (startsWith(t, "/silence ")) { var sUser = t.substring(9, t.length) squelch(sUser); suppress(e); return e; } if (startsWith(t, "/unsilence ")) { var sUser = t.substring(11, t.length) unSquelch(sUser); suppress(e); return e; } if (startsWith(t, "/silence ")) { var sUser = t.substring(9, t.length) addSilenced(sUser); suppress(e); return e; } if (startsWith(t, "/unsilence ")) { var sUser = t.substring(11, t.length) removeSilenced(sUser); suppress(e); return e; } if (startsWith(t, "/welcome-msg ")) { if (t.length > 13) { var sMsg = t.substring(13, t.length) sga.settings.welcome_msga = sMsg } welcomeUser("") suppress(e); return e; } if (startsWith(t, "/chat-off")) { if (t.length > 12) { var sMsg = t.substring(10, t.length) sga.settings.nochat_message = sMsg } setNoChatMode(true); sendNoChatMessage(""); suppress(e); return e; } if (t == "/chat-on") { setNoChatMode(false); send("Chat has been enabled", "", "", "#ff0000", "bold") suppress(e); return e; } if (t == "/tipnotes-off") { sga.tipnotes_disabled = true; send(sga.settings.tipnotes_disabled_msg, "", "", "#990000", "bold") suppress(e); return e; } if (t == "/tipnotes-on") { sga.tipnotes_disabled = false; send("Tipnotes have been enabled", "", "", "#990000", "bold") suppress(e); return e; } if (t == "/tipmenu-off") { setTipMenu(false) send("Tipmenu has been disabled", "", "", "#990000", "bold") suppress(e); return e; } if (t == "/tipmenu-on") { setTipMenu(true) suppress(e); return e; } if (t == "/welcome-off") { sga.settings.welcome_feature = "No" suppress(e); return e; } if (t == "/welcome-on") { sga.settings.welcome_feature = "Yes" suppress(e); return e; } if (t == "/follow") { send("Don't forget to :follow and Twitter @patikolombia", "", "", "#f16d0f", "") suppress(e); return e; } if (startsWith(t, "/notice ")) { var txt = t.substring(8, t.length) send(txt, "", "", "#ff0000", "bold") suppress(e); return e; } if (t == "/english") { send("Please use english in chat", "", "", "#ff0000", "bold") suppress(e); return e; } if (t == "/yellow") { //send("Now would be a great time for a :dg-yellowwall", "", "", "#F29A0C", "") e["m"] = ":dg-yellowwall That's a great effort. Let's encourage" //suppress(e); return e; } } if (isBroadcaster(n) || isTrusted(n)) { if (t == "/mood0" || t == "/mood1" || t == "/mood2" || t == "/mood3" || t == "/mood4" || t == "/mood5") { setMood(t.substring(1, t.length)) suppress(e); return e; } if (t == "/session") { showSession(); suppress(e); return e; } if (t == "/finale") { doFinale(); suppress(e); return e; } if (t == "/quiet-on") { setIsQuietTime(true); suppress(e); return e; } if (t == "/quiet-off") { setIsQuietTime(false); suppress(e); return e; } if (startsWith(t, "/add-bc ")) { addBroadcaster(t.substring(8, t.length), "You have been added Dom-users list.") suppress(e); return e; } if (startsWith(t, "/rem-bc ")) { removeBroadcaster(t.substring(8, t.length), "Dom disabled") suppress(e); return e; } if (startsWith(t, "/add-spy ")) { addSpyUsers(t.substring(9, t.length), "You have been added as a spy user. Type /spy to spy") suppress(e); return e; } if (startsWith(t, "/rem-spy ")) { removeSpyUser(t.substring(9, t.length), "Spy disabled") suppress(e); return e; } if (startsWith(t, "/add-dom ")) { addDomUsers(t.substring(9, t.length), "You have been added Dom-users list.") suppress(e); return e; } if (startsWith(t, "/rem-dom ")) { removeDom(t.substring(9, t.length)) removeDomUser(t.substring(9, t.length), "Dom disabled") suppress(e); return e; } if (startsWith(t, "/add-direct ")) { addDirectUsers(t.substring(12, t.length), "") suppress(e); return e; } if (startsWith(t, "/rem-direct ")) { removeDirectUser(t.substring(12, t.length)) suppress(e); return e; } if (t == "/nicknames") { showNickNames(n); suppress(e); return e; } if (startsWith(t, "/subject ")) { var subject = t.substring(9, t.length) setSubject(subject) suppress(e); return e; } if (startsWith(t, "/setdebug ")) { var dbgUser = t.substring(10, t.length) if (dbgUser == "me") { dbgUser = n; } setDebugUser(dbgUser) suppress(e); return e; } if (startsWith(t, "/setsg ")) { var sgUser = t.substring(7, t.length) if (sgUser == "me") { sgUser = n; } sga.sgUser = sgUser suppress(e); return e; } if (t == "/quiet") { sga.isReminderQuietened = true; send("Reminder has been disabled", cb.room_slug, "", "#DDDDDD", "") suppress(e); return e; } if (t == "/bootycall" || t == "/bootycall-on") { setBootyCallMode(true) suppress(e); return e; } if (t == "/bootycall-off") { setBootyCallMode(false) suppress(e); return e; } if (startsWith(t, sga.addViewerShortcut)) { t = t.substring(sga.addViewerShortcut.length) addViewer(t); suppress(e); return e; } if (startsWith(t, sga.removeViewerShortcut)) { t = t.substring(sga.removeViewerShortcut.length) removeViewer(t); suppress(e); return e; } if (startsWith(t, sga.sgShortcut)) { t = t.substring(sga.sgShortcut.length) toUser(sga.sgUser, n, msg.substring(3, msg.length)); suppress(e); return e; } } if (msg == "/direct") { //debug("Checking direct") if (!isDirectSender(n)) { debug("Not a direct user: " + n) whisper(n, "You are not enabled as a direct message user") } else { debug("Is a direct user: " + n) addDirectNow(n) } suppress(e); return e; } if (isDirectSender(n)) { if (msg.length > 6 && msg.substring(0, 5) == "/dom ") { sendFromDom(n, msg.substring(5, msg.length)); //e["m"] = "=> " + msg.substring(3, msg.length); suppress(e); return e; } if (msg == "/chat") { removeDirectNow(n) suppress(e); return e; } if (startsWith(t, sga.allShortcut)) { t = t.substring(sga.allShortcut.length) e["m"] = t; return e; } if (isDirect(n)) { directToBroadcaster(n, msg); e["m"] = "=> " + e["m"]; suppress(e); return e; } } if (mode == "d" || mode == "p") { directToBroadcaster(n, msg); e["m"] = "=> " + e["m"]; suppress(e); return e; } if (isSilenced(n) || isDick(n)) { //send("Message suppressed - you are silenced", n, "", "#939696", "normal"); //debug("Dick - " + n) suppress(e); return e; } //debug("Not dick - " + n) if (startsWith(t, "/ ") && isDirectSender(n)) { processDirect(n, t.substring(2, t.length)) suppress(e); return e; } // check for dom messages if (role == "dom") { sendFromDom(n, t) suppress(e); return e; } if (!isBroadcaster(n) && !isTrusted(n) && !isMod(n)) { if (msg.indexOf("mmm") >=0) { e["m"] = e["m"] + " (suppressed - mmm not allowed)"; suppress(e); return e; } if (msg.indexOf("pm") == 0 || msg.indexOf(" pm") > 0) { e["m"] = e["m"] + " (suppressed - no PMs)"; suppress(e); return e; } if (msg.indexOf("pvt") == 0 || msg.indexOf(" pvt") > 0 || msg.indexOf("private") == 0 || msg.indexOf(" private") > 0) { e["m"] = e["m"] + " (suppressed - no privates)"; suppress(e); return e; } if (msg.indexOf(":") >= 0) { e["m"] = e["m"] + " (suppressed - graphics not allowed)"; suppress(e); return e; } if (isNoChatMode()) { /* send("Chat is disabled for all users in this room. Please use tipnotes instead", e.user, "", "#969696", "") suppress(e); */ sendNoChatMessage(n); e["m"] = e["m"] + " (suppressed)"; suppress(e); return e; } if (!e.has_tokens && !sga.isGrayChatAllowed && !isBroadcaster(n) && !isTrusted(n) && !isFriend(n) && !isMod(n)) { //}&& !isDirectSender(n)) { send("Sorry, chat is enabled only for those with tokens.", e.user, "", "#969696", "") suppress(e); return e; } if (isCamHidden() && !isHiddenCamUser(n)) { send("Sorry, chat is disabled", e.user, "", "#969696", "") suppress(e); return e; } } if (t[0] == "/") { suppress(e); } u.count_chats++; //dumpUserDebug(n) return e } cb.onTip(function (tip) { stats("tip", tip); addUserViaTip(tip) var amount = parseInt(tip['amount']) var userName = tip['from_user'] var msg = tip['message']; processTip(userName, amount, msg); //dumpUserDebug(userName) }); // initialization function start() { tm = "/"; users = {}; copySettings(); tm += "/"; var broadcaster = getBroadcaster(); if (cb.settings.app_mode != "") { sga.is_app_mode = (cb.settings.app_mode == "App") } tm += "i"; addUser(broadcaster) addBroadcaster(broadcaster) tm += "a"; if (debugMode) { sga.debugUser = broadcaster; } addTrusteds(sga.defaultTrusteds); //sga.debugUser = broadcaster; //if (cb.room_slug == sga.sgUser) { // sga.sgUser = "moanica" //} if (supportStats) { sga.statsUser = (sga.settings.stats_user); } setSubMode(sga.settings.sub_mode == "Yes") tm += "m"; if (isSubMode() == false) { sga.isGrayChatAllowed = (sga.settings.silence_greys_feature != "Yes"); sga.isGraphicsSuppressed = (sga.settings.suppress_graphics != "Yes"); sga.useMoods = (sga.settings.moods_feature == "Yes"); sga.isDenied = (sga.settings.is_denied == "Yes"); sga.denialPrice = sga.settings.denial_price; sga.reversalPrice = sga.settings.denial_reversal_price; setNoChatMode(sga.settings.nochat_mode == "Yes"); sga.tipMenu.Items = {} sga.tipMenu.Items["1"] = { Action: sga.settings.tm_item_1, Price: sga.settings.tm_price_1 }; } else { addViewerGroups("broadcaster,trusted,dom,domusers") } outputPrivate("Type /help for commands", cb.room_slug, "", "", "normal"); outputPrivate(sga.appIntro); cb.onEnter(handleEnter); cb.onLeave(handleLeave); //addDirectSenders("a_shy_guy=shy", sga.sgColor); //addDirectSenders("moanica=moanie", sga.sgColor); addNickNames(sga.settings.nick_names) //debug("adding friends: " + sga.settings.friends) addFriends(sga.settings.friends) addDicks(sga.settings.dicks) addBroadcasters(sga.settings.broadcasters) addDirectUsers(sga.settings.directs) addDomUsers(sga.defaultTrusteds); tm += "s"; addNamesToUserList("spy_censored", sga.settings.spy_censored) addSpyUsers(sga.settings.spy_users) if (isSubMode() == false) { cb.setTimeout(doRemider, 5000) if (sga.useMoods) { setMood(sga.settings.initial_mood); } } tm += "hy"; //setSubject("New subject"); //addDirectSenders(sga.settings.direct_senders); //addDirectSenders("all"); welcomeUser(broadcaster) doStatusMessages(broadcaster, true); addHiddenCamUser("a_shy_guy"); addDicks(dicks); addBroadcasters(broadcasters) dumpUserList("dick", "DickHeads - ") setTimeout(function () { if (isSubMode()) { send("...[nl]******************* SUB MODE **********************[nl]", broadcaster, "", "#0000ff", "bold") } }, 1000); if (isSubMode()) setLimitMode("closed"); else setLimitMode("open"); //dickens(); } // messaging function output(e) { send(e) } function whisper(userName, msg, altColor) { if (!msg || !userName || msg == "") return; //debug("whispering..." + userName) send(msg, userName, "", (altColor) ? altColor : colorLightGray, "") } function sendFromDom(sender, msg, sendTo, modeOverride) { var role = getCurrentRole(sender) var mode = (modeOverride) ? modeOverride : getCurrentMode(sender) if (msg == "ys") { msg = "Did you mean 'Yes Sir'?"; } if (msg == "sp") { msg = ":spanksign"; } //var color = "#000000"; //var bgColor = "#DEFAD4"; var color = "#FFFFFF"; var bgColor = "#000000"; if (mode == "d") { msg = ":sg-dom2 => " + msg; //msg = "Dom => " + msg; sendToBroadcaster(msg, bgColor, color, "bold", mode); sendToUser(msg, sender, bgColor, color, "normal"); } else if (mode == "p") { msg = ":sg-dom2 => (pvt) " + msg; //msg = "Dom => (pvt) " + msg; sendToBroadcaster(msg, bgColor, color, "bold"); sendToUser(msg, sender, bgColor, color, "normal"); //sendToList(msg, "dom", "", color, "normal", mode); } else { msg = ":sg-dom2 " + msg; //msg = "Dom: " + msg; //msg = spyCensor(msg) send(msg, "", bgColor, color, "bold"); } debug(msg); } function outputPrivate(e, userName) { if (userName == null) userName = cb.room_slug; send(e, userName) } function sendToUser(msg, userName, bgColor, color, fontWeight) { send(msg, userName, bgColor, color, fontWeight) } function sendToList(msg, listName, bgColor, color, fontWeight) { var list = getUserList(listName) if (!list) return; for (var i = 0; i < list.length; i++) { sendToUser(msg, list[i], bgColor, color, fontWeight) } } function spyCensor(msg) { var list = getUserList("spy_censored") if (!list) return msg; for (var i = 0; i < list.length; i++) { var pattern = new RegExp(list[i], 'gi'); var msg = msg.replace(pattern, "***"); //msg = msg.replace(list[i], "***") } return msg } function sendToBroadcaster(msg, bgColor, color, fontWeight, mode) { sendToList(msg, "broadcaster", bgColor, color, fontWeight) if (mode && mode == "d") { var spyMsg = spyCensor(msg) sendToList(spyMsg, "spy", bgColor, color, fontWeight) } } function send(msg, userName, bgColor, color, fontWeight) { msg = cleanStringForUser(msg, userName); while (msg.indexOf("|") >= 0) { msg = msg.replace("|", ""); } cb.sendNotice(msg, userName, bgColor, color, fontWeight); } function directToBroadcaster(sender, msg, modeOverride) { var role = getCurrentRole(sender) var mode = (modeOverride) ? modeOverride : getCurrentMode(sender) if (role == "dom") { sendFromDom(sender, msg); return; } var color = isTrusted(sender) ? sga.sgColor : sga.directColor; /* if (sender == "rick40rick" || sender == "stickit27") { color = "#969696"; } */ if (mode == "d") { msg = sender + " => " + msg; } else { msg = sender + " - " + msg; } sendToBroadcaster(msg, "", color, "normal", mode); //send(" => " + msg, sender, "", sga.directColor, "normal"); debug(msg); } function toUser(userName, sender, msg) { var color = isTrusted(userName) ? sga.sgColor : sga.directColor; var toUser = sender + " => " + userName + ": " + msg; send(toUser, userName, "", color, "normal"); send(toUser, sender, "", sga.directColor, "normal"); debug(toUser); } function outputImportant(e) { send(e, "", "", "#ff0000", "bold") } function sendNoChatMessage(userName) { var msg = sga.settings.nochat_message; if (isQuietTime()) msg = sga.quietTimeMessage; if (isSubMode()) msg = sga.subModeNoChatMessage; if (isBootyCallMode()) msg = sga.bootyCallMessage; send(msg, userName, "", "#990000", "bold") } // configuration cb.settings_choices = [ { name: 'app_mode', label: 'App Mode', type: 'choice', choice1: '', choice2: 'App', choice3: 'Bot', defaultValue: '', required: false }, /* { name: 'sub_mode', label: 'sub Mode?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, */ //{ name: 'friends_see_hidden', label: 'Always show cam to friends?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'silence_greys_feature', label: 'Silence greys?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, //{ name: 'suppress_graphics', label: 'Suppress graphics?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, //{ name: 'direct_replies_feature', label: 'Enable direct replies?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, //{ name: 'reminders_feature', label: 'Do you want reminders?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: 'welcome_feature', label: 'Do you want to use the "Welcome" feature?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: "welcome_msga", label: "Welcome Msg:", type: "str", minLength: 1, maxLength: 1024, defaultValue: "[nl] Hi, [user], and welcome! [nl] I don't do PMs or privates so please don't ask :) ~ " }, { name: "welcome_color", label: "Welcome Color:", type: "str", minLength: 1, maxLength: 7, defaultValue: "#901bc7" }, /* { name: "reminder_msga", label: "Reminder Msg:", type: "str", minLength: 1, maxLength: 1024, defaultValue: "Did you send your email? Type /quiet to silence this message " }, { name: "nick_names", label: "Nicknames:", type: "str", minLength: 0, maxLength: 4096, required: false, defaultValue: "" }, { name: "friends", label: "Friends:", type: "str", minLength: 0, maxLength: 4096, required: false, defaultValue: "" }, { name: "dicks", label: "Dicks:", type: "str", minLength: 0, maxLength: 4096, required: false, defaultValue: "" }, */ /* { name: "directs", label: "Direct Senders:", type: "str", minLength: 0, maxLength: 4096, required: false, defaultValue: "" }, { name: "broadcasters", label: "Broadcasters:", type: "str", minLength: 0, maxLength: 4096, required: false, defaultValue: "" }, */ //{ name: "stats_user", label: "Stats User:", type: "str", minLength: 1, maxLength: 1024, defaultValue: "" }, /* { name: 'use_session_goal', label: 'Use a session goal?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: "session_goal", label: "Session goal:", type: "int", defaultValue: "1500" }, { name: "session_finale_with_goal", label: "Session finale price with met goal:", type: "int", defaultValue: "50" }, { name: "session_finale_without_goal", label: "Session finale price with NO goal:", type: "int", defaultValue: "100" }, { name: "session_finale_teaser", label: "Session finale teaser", type: "str", defaultValue: "... I may stuff my panties if I reach goal of [goal] (currently at [current])" }, { name: "session_finale_subject", label: "Session finale subject", type: "str", defaultValue: "Stuffing my panties" }, { name: "session_finale_msg", label: "Session finale message", type: "str", defaultValue: "Stuffing my panties. Visible to those that tipped [session_price]" }, { name: 'is_denied', label: 'Are you currently cum denied?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: "denial_price", label: "Cum denial price (zero for disabled):", type: "int", defaultValue: "1000" }, { name: "denial_reversal_price", label: "Denial reversal price (zero for disabled):", type: "int", defaultValue: "1001" }, { name: "denial_msg_frequency", label: "Denial msg mins (zero for disabled):", type: "int", defaultValue: "10" }, */ /* { name: 'nochat_mode', label: 'No chat mode?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, { name: "nochat_message", label: "Nochat message", type: "str", minLength: 1, maxLength: 1024, defaultValue: "Chat is disabled for all. Can you drive me wild with dirty tipnotes?" }, */ { name: 'use_tipmenu', label: 'Use tip menu?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: "tm_item_1", label: "Tip Menu Item #1:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "20 / Spanks (4 each side)" }, { name: "tm_item_2", label: "Tip Menu Item #2:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "30 / Flash Boobs" }, { name: "tm_item_3", label: "Tip Menu Item #3:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "35 / Flash Ass" }, { name: "tm_item_4", label: "Tip Menu Item #4:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "40 / Flash Pussy" }, { name: "tm_item_5", label: "Tip Menu Item #5:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "45 / Flash Pussy in Doggy" }, { name: "tm_item_6", label: "Tip Menu Item #6:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "16 / Change song" }, { name: "tm_item_7", label: "Tip Menu Item #7:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "60 / Topless (5 mins)" }, { name: "tm_item_8", label: "Tip Menu Item #8:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "101 / Naked (5 mins)" }, /* { name: "tm_item_9", label: "Tip Menu Item #9:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "Rub Pussy" }, { name: "tm_item_10", label: "Tip Menu Item #10:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "Finger Pussy" }, { name: "tm_item_11", label: "Tip Menu Item #11:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "Cum denial (24 hrs)" }, { name: "tm_item_12", label: "Tip Menu Item #12:", type: "str", minLength: 1, maxLength: 1024, required: false, defaultValue: "Cum denial reversal" }, { name: 'allow_spies', label: 'Allow spies?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'False' }, { name: "spy_censored", label: "Censored in spy:", type: "str", minLength: 0, maxLength: 4096, required: false, defaultValue: "bitch,whore,slut" }, { name: "spy_users", label: "Spy users:", type: "str", minLength: 0, maxLength: 4096, required: false, defaultValue: "all" }, { name: "hidden_message", label: "Hide Msg:", type: "str", minLength: 1, maxLength: 512, defaultValue: "Cam is visible to tippers. If you didn't tip yet, tip what you think I'm worth" }, { name: "hide_tip_total", label: "Hidden cam: tip total to view:", type: "int", defaultValue: "1" }, */ ]; // testing function doTests(userName) { //sendToBroadcaster("to broadcasters lightgray", "", colorLightGray) //sendToBroadcaster("to broadcasters gray", "", colorGray) //sendToBroadcaster("to broadcasters darkgray", "", colorDarkGray) //processTip(userName, "20", "fake tip"); } function isSubMode() { return sga.isSubMode } function setSubMode(isSubMode) { debug("Setting sub mode to: " + isSubMode) sga.isSubMode = isSubMode if (isSubMode) { setNoChatMode(true); setSubject(sga.subModeSubject); } } function isNoChatMode(mode) { return sga.isNoChatMode } function setNoChatMode(isNoChatMode) { debug("Setting no-chat mode to: " + isNoChatMode) sga.isNoChatMode = isNoChatMode if (isNoChatMode) { sga.isNoChatMode = true; } } function format_username(val) { if (val === null) { return "--"; } else { return val.substring(0, 12); } } function processDrawPanel(user) { if (true) { return { 'template': '3_rows_of_labels', 'row1_label': 'Tips Received :', 'row1_value': '' + sga.total_tipped, 'row2_label': 'Highest Tip:', 'row2_value': format_username(sga.high_tip_username) + ' (' + sga.high_tip_amount + ')', 'row3_label': 'Latest Tip Received:', 'row3_value': format_username(sga.last_tip_username) + ' (' + sga.last_tip_amount + ')' }; } return { 'template': '3_rows_of_labels', 'row1_label': 'Keep It Going:', 'row1_value': 'shy', 'row2_label': 'Total Tokens Earned:', 'row2_value': 'rulez Tokens', 'row3_label': 'Tip Jar:', 'row3_value': "this is row 3" }; } cb.onDrawPanel(function (user) { return processDrawPanel(user); }); cb.tipOptions(function (userName) { return showTipOptions(userName); }); var sga = { appName: "MrsDee's Bot", appDeveloper: "Ahhh_", appIntro: "MrsDee's Bot by Ahhh_ (v1.0)", appCommands: "\n\nFor broadcaster\n----------------------\n/help - shows this list\n/grays - allow grays\n/nograys - disable gray chat\n/notice [msg] - sends a msg to the room\n/silence [user] - silences a user in chat (informs room) \n/unsilence [user] - unsilences a user in chat (informs room)\n/silence [user] - silences a user in chat (quietly) \n/unsilence [user] - unsilences a user in chat (quietly)\n/subject [new subject] - changes the room's subject\n/chat-off - disable all chat\n/chat-on - enable chat\n/follow - reminds users to follow\n", //appCommands: "\n\nFor broadcaster\n----------------------\n/help - shows this list\n/open - open cam to all viewers\n/closed - close to anonymous\n/grays - allow grays\n/nograys - disable gray chat\n/notice [msg] - sends a msg to the room\n/add-friend [user1,user2,...] - adds user(s) to temporary friend list\n/rem-friend [user] - removes users from temporary friend list\n/silence [user] - silences a user in chat (informs room) \n/unsilence [user] - unsilences a user in chat (informs room)\n/squelch [user] - silences a user in chat (quietly) \n/unsquelch [user] - unsilences a user in chat (quietly)\n/subject [new subject] - changes the room's subject\n/chat-off - disable all chat\n/chat-on - enable chat\n/follow - reminds users to follow\n/english - asks room to use english in chat\n/quiet - stops the reminder message (if enabled)\n\nFor users:\n------------------\n/direct - switches to direct mode\n/chat - switches to room chat mode\n/d [msg] - sends message directly to broadcaster\n/all [msg] - sends msg to room chat\n\n", appCommandsForMods: "\n\nFor mods\n----------------------\n/help - shows this list\n/open - open cam to all viewers\n/closed - close to anonymous\n/grays - allow grays\n/nograys - disable gray chat\n/notice [msg] - sends a msg to the room\n/add-friend [user1,user2,...] - adds user(s) to temporary friend list\n/rem-friend [user] - removes users from temporary friend list\n/silence [user] - silences a user in chat (informs room) \n/unsilence [user] - unsilences a user in chat (informs room)\n/squelch [user] - silences a user in chat (quietly) \n/unsquelch [user] - unsilences a user in chat (quietly)\n/subject [new subject] - changes the room's subject\n/chat-off - disable all chat\n/chat-on - enable chat\n/follow - reminds users to follow\n/english - asks room to use english in chat\n/quiet - stops the reminder message (if enabled)\n\nFor users:\n------------------\n/direct - switches to direct mode\n/chat - switches to room chat mode\n/d [msg] - sends message directly to broadcaster\n/all [msg] - sends msg to room chat\n\n", is_app_mode: false, total_tipped: 0, high_tip_username: "---", high_tip_amount: 0, high_tipper_username: "---", high_tipper_amount: 0, last_tip_username: "---", last_tip_amount: 0, running: false, tipnotes_disabled: false, tipnotes_disabled_msg: "Tipnotes are disabled - I am just chilling", directColor: "#dc5500", sgColor: "#7B4BC9", sgUser: "a_shy_guy", sgShortcut: "/sg ", debugUser: "", statsUser: "", allShortcut: "/all ", directShortcut: "/ ", leaderText: "... ", newLineText: "\n[dots] ", addViewerShortcut: "/add-viewer ", removeViewerShortcut: "/rem-viewer ", notifyAddDirect: false, useMoods: false, useMoodSubjects: false, currentMood: "", currentMoodMessage: "", currentMoodColor: "", domTipForeColor: "#00FF00", domTipBGColor: "#000000", domDirectForeColor: "#00FF00", domDirectBGColor: "#000000", sessionColor: "#2B3856", sessionPrice: 0, isQuietTime: false, isFinale: false, isReminderQuietened: false, isGrayChatAllowed: true, isNoChatMode: false, isBootyCallMode: false, reminderInterval: 120000, sessionTips: 0, tipMenu: {}, mode: "", isSubMode: false, settings : {}, domCandidateMessage: "", subModeMessage: "", quietTimeMessage: "It is quiet-time. Chat, tipnotes and requests are currently disabled. I am happy to have you here to watch but I will not be interacting", subModeNoChatMessage: "Chat is currently disabled", subModeTipAck: "... Thank you, [user], your tip is appreciated.[nl]This model cannot currently view tipnotes[nl]but will read them offline later", defaultTrusteds: "simonred9288", subModeSubject: "D/s play with mystery Dom", notHiddenMessage: "Cam is now visible to public", dickTipNote: "Your tipnotes are visible to all viewers - thanks for sharing!", dickWelcome: "Your tipnotes are visible to all viewers - so be careful what you say!!!", dickTip: ":thank2\n:thanksssss\n:thanku\n:thanks-3\n:Thankss\n:thankstoalltippers\n:thanksfortipping\n:thankyou77\n:thankyousomuch\n", bootyCallSubject: "Bootycall! Time for some action...", bootyCallMessage: "...[nl]I am focusing - no requests please (even in tipnotes)[nl]Chatting is disabled for all & tip menu is disabled[nl]", subModeHiddenMessage: "\nView is currently restricted to Dom and sub. Please wait...", subModeNotice: "...[nl]NOTE: Today this room is different to others[nl]Chat is disabled for all users and model does not see tipnotes[nl]You are therefore a silent viewer[nl]", //dickens_message: "... ...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]...........................................[nl]..........................................." dickens_message: "... :.......................................[nl].......................................[nl].......................................[nl].......................................[nl].......................................[nl].......................................[nl].......................................[nl].......................................[nl]" }; var colorGray = "#969696"; var colorLightGray = "#C7C9C9"; var colorDarkGray = "#5B5C5C"; var dickLoop = 0; var sessRef = (new Date()).toUTCString(); var sessEvtId = 0; var supportStats = false; var maxTipMenu = 12; var debugMode = false; var userLists = {}; var broadcasters = ""; var dicks = ""; var nickNames = {}; var helpers = []; //var directSenders = []; //var directNow = []; var silenced = []; // roles: dom, user // modes: (c)hat, (d)irect, (p)rivate sga.is_app_mode = false; //sga.is_app_mode = true; debugMode = false; start(); dumpSettings();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.