Bots Home
|
Create an App
menu command for users with toks
Author:
madyetti_tb
Description
Source Code
Launch Bot
Current Users
Created by:
Madyetti_Tb
/************************************************************* ** ** Title: Antonia_Family ** Author: me ** Description: tip to become a member of my familly ** *************************************************************/ /* Features: Family members can use color and view level commands model and mods can paint users with colors allow mods/broadcaster to change foreground and background colors can use color names or hashcodes Keeps track of all tips Show tip scoreboard (all tips) Announce top X tippers (public) Send tippers lists to self (private) Manage users in groups: Friends, Family, Lovers, Fiances, Husbands Allow Mods to use commands Special user greetings Greetings for group members Gender Emotes (male, female, couple, trans) or custom icon for special users User timeouts (forever or specified time) Spam blocker, blocks advertisments from grey users Auto timeout for grey that demand, ask for pm, ask to view cam, etc Emote blocker for grey users Select background colors for group users Thank you note for tippers, custom message for certain tip amounts Automatically add user to group for specific tip amounts and send reminder to model to add them in config Flood control to stop timeout users from flooding the room with notices 2 custom notifications with selectable time delay Send public room notice Send notice to all mods Send private notice to broadcaster If used by another model sends exclusive notice to them at startup, also tells each user as they enter. Ghost function lets silenced or banned users type through chat notices */ /* * Setup vars */ var friendTag = "cb.settings.friendTag"; var familyTag = "cb.settings.familyTag"; var loverTag = "cb.settings.loverTag"; var husbandTag = "cb.settings.husbandTag"; var newGoalPrice = null; var goalPrice = null; var goal = ""; var mMenu = "Here is my Tip Menu:>My Favorite Number = 8 tokens>Keep Me Wet = 15 tokens>Like Me = 25 tokens>Roll Dice = 50 tokens>Flash (You choose) = 50 tokens>Naked = 200 tokens>C2C = 220 tokens>Handjob = 88 tokens>Spit on Boobs = 101 tokens>Suck Dildo = 100 tokens>Sloppy Deepthroat = 299 tokens>Anal Plug = 112 tokens>Fuck My Ass = 489 tokens>Ride Anal = 1222 tokens>Fuck My Pussy = 308 tokens>Cum Show = 499 tokens>Cumplay (Sloppy Suck + Facial) = 500 tokens>Creampie (Ass or Pussy) = 700 tokens>Squirt = 1500 tokens or PVT>Ahegao = 38 tokens>Dance = 80 tokens>Spank Ass (Hand) = 40 tokens>Spank Ass (Paddle) = 70 tokens>Show Feet = 35 tokens>Suck Feet = 120 tokens>Put on High Heels = 122 tokens>Footjob = 180 tokens>Lovense Control = 400 tokens/10 minutes>Sexy Oil Show = 500 tokens<If you want something else please just ask me.<Please keep in mind that dice rolls are automatic and you have to choose if you want the prizes or a tip menu, not both."; var atMenu = true; var atMenuInterval = "4"; var botVersion = "1.5.3"; var botDate = "March 3rd, 2015"; var lastMessgeTime = 0; var lastMessageName = ""; var tippers = new Array(); var timeoutMessages = new Array(); var timeoutUsersArray = new Array(); var timeoutReleaseArray = new Array(); var friendUsersArray = new Array(); var familyUsersArray = new Array(); var loverUsersArray = new Array(); var fianceUsersArray = new Array(); var husbandUsersArray = new Array(); var ghostUsersArray = new Array(); var captchaUsersArray = new Array(); var vipUsersArray = cb.limitCam_allUsersWithAccess(); var vipPrice = cb.settings.min_start_tokens; var userColors = new Array(); var specialNames = new Array(); var tempString = ""; var tempNum = 0; var tempArray = new Array(); var modelName = cb.room_slug; var msgNotify = ""; var msgPublic = ""; var msgPrivate = ""; var msgModel = ""; var msgMod = ""; var tsColorD = "#007020"; var tsColor = tsColorD; var tsBackgroundD = "#eeffcc"; var tsBackground = tsBackgroundD; var tsTag = 'Creator'; var yettiTag = 'PDM'; var jokerTag = 'Sweety'; var groupColor = "#FFFFFF"; var autoNotice1Text = ""; var autoNotice2Text = ""; var botTrigger = "/model"; var botTrigger2 = "/mb"; var pmTrigger = "/pm"; var pmTrigger2 = "/w"; var timeoutReleaseInterval = 1; var modCommands = true; var userGreets = true; var genderEmotes = true; var allowGreyEmotes = true; var unmaskTimeout = false; var botMsgBg = '#BDDEDC'; var botAlertBg = '#D32B2B'; var botNoteBg = '#99FF66'; var botGhostBg = '#EDEDED'; var sendEmailMsg = 'If you didn\'t send your email address in the tip note, tip 1 token with your email address so your videos can be sent to you!'; timeoutMessages[1]= '[TIMEOUT] You\'re in timeout, other\'s can\'t see what you\'re typing.'; timeoutMessages[2]= '[TIMEOUT] Give it up no one can read what you\'re typing...'; timeoutMessages[3]= '[TIMEOUT] Keep typing no one can read it!'; timeoutMessages[4]= '[TIMEOUT] Why do you keeping typing? No one can see it!'; timeoutMessages[5]= '[TIMEOUT] Can\'t you read? You\'re in timeout, you can\'t type!'; /* * Settings */ cb.settings_choices = [ /* { name: 'mMenu', label: 'Tip menu, separate by using ">". Example: Pussy: 100 tokens>Anal: 300 tokens>Double Penetration: 500 tokens', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' },*/ { name: 'allowGreyEmotes', type: 'choice', label: 'Allow GREY Graphics?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'genderEmotes', type: 'choice', label: 'Show gender of users in chat?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'autoNotice1', label: 'Notification Message 1, use text and emotes', type: 'str', minLength: 0, maxLength: 512, required: false, defaultValue: 'If you are new here, please don\'t forget to :followbutton3 ' }, { name: 'autoNotice1Interval', label: 'Show Notification 1 Every x Minutes', type: 'choice', choice1: 2, choice2: 5, choice3: 8, choice4: 10, choice5: 12, choice6: 15, choice7: 20, choice8: 25, choice9: 30, choice10: 45, choice11: 60, defaultValue: 10 }, { name: 'autoNotice2', label: 'Notification Message 2, use text and emotes', type: 'str', minLength: 0, maxLength: 512, required: false, defaultValue: 'Remember to rate :satisfiediam if you tipped 25 tokens or more, your feedback is much appreciated :)' }, { name: 'autoNotice2Interval', label: 'Show Notification 2 Every x Minutes', type: 'choice', choice1: 2, choice2: 5, choice3: 8, choice4: 10, choice5: 12, choice6: 15, choice7: 20, choice8: 25, choice9: 30, choice10: 45, choice11: 60, defaultValue: 10 }, { name: 'modCommands', type: 'choice', label: 'Allow Moderators to use commands?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'userGreets', type: 'choice', label: 'Make special user announcements and emotes when they enter?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'friendTag', label: '*** FRIENDS *** *** *** Tag for Friend (non-tippers) users', type: 'str', minLength: 0, maxLength: 25, required: true, defaultValue: '[Friend]' }, { name: 'friendList', label: 'List of Friend users, separated by space (their CB usernames exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'friendColor', label: 'Highlight color to use for Friend users', type: 'choice', choice1: 'White FFFFFF', choice2: 'Aqua 7FFFD4', choice3: 'LtBrown F4A460', choice4: 'Cyan E0FFFF', choice5: 'Gold EEE8AA', choice6: 'Yellow FFF68F', choice7: 'Slate C6E2FF', choice8: 'Pink FFF0F5', choice9: 'Orange FFD39B', choice10: 'Mint BDFCC9', choice11: 'Grey F2F2F2', choice12: 'Plum CD96CD', defaultValue: 'Mint BDFCC9' }, { name: 'familyTag', label: '*** FAMILY *** *** *** Tag for Family users', type: 'str', minLength: 0, maxLength: 25, required: true, defaultValue: '[Family]' }, { name: 'familyList', label: 'List of Family users, separated by space (their CB usernames exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'familyColor', label: 'Highlight color to use for Family users', type: 'choice', choice1: 'White FFFFFF', choice2: 'Aqua 7FFFD4', choice3: 'LtBrown F4A460', choice4: 'Cyan E0FFFF', choice5: 'Gold EEE8AA', choice6: 'Yellow FFF68F', choice7: 'Slate C6E2FF', choice8: 'Pink FFF0F5', choice9: 'Orange FFD39B', choice10: 'Mint BDFCC9', choice11: 'Grey F2F2F2', choice12: 'Plum CD96CD', defaultValue: 'Cyan E0FFFF' }, { name: 'loverTag', label: '*** LOVERS *** *** *** Tag for Lovers users', type: 'str', minLength: 0, maxLength: 25, required: true, defaultValue: '[Lover]' }, { name: 'loverList', label: 'List of Lovers useres, separated by space (their CB usernames exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'loverColor', label: 'Highlight color to use for Lover users', type: 'choice', choice1: 'White FFFFFF', choice2: 'Aqua 7FFFD4', choice3: 'LtBrown F4A460', choice4: 'Cyan E0FFFF', choice5: 'Gold EEE8AA', choice6: 'Yellow FFF68F', choice7: 'Slate C6E2FF', choice8: 'Pink FFF0F5', choice9: 'Orange FFD39B', choice10: 'Mint BDFCC9', choice11: 'Grey F2F2F2', choice12: 'Plum CD96CD', defaultValue: 'Orange FFD39B' }, { name: 'husbandTag', label: '*** HUSBAND *** *** *** Tag for Husband users', type: 'str', minLength: 0, maxLength: 25, required: true, defaultValue: '[Husband]' }, { name: 'husbandList', label: 'List of Husband useres, separated by space (their CB usernames exactly)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: '' }, { name: 'husbandColor', label: 'Highlight color to use for Husband users', type: 'choice', choice1: 'White FFFFFF', choice2: 'Aqua 7FFFD4', choice3: 'LtBrown F4A460', choice4: 'Cyan E0FFFF', choice5: 'Gold EEE8AA', choice6: 'Yellow FFF68F', choice7: 'Slate C6E2FF', choice8: 'Pink FFF0F5', choice9: 'Orange FFD39B', choice10: 'Mint BDFCC9', choice11: 'Grey F2F2F2', choice12: 'Plum CD96CD', defaultValue: 'Plum CD96CD' }, { name: 'min_start_tokens', type: 'int', minValue: 1, maxValue: 1000, defaultValue: 100, label: "Cost to join VIP Show before it starts" }, { name: 'min_join_tokens', type: 'int', minValue: 0, maxValue: 1000, defaultValue: 100, label: "Cost to join during the show. Set to 0 to disable joining during show" }, { name: 'fans_vip', label: 'Are fan club members always VIP?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'mods_vip', label: 'Are your moderators always VIP?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' },{ name: 'captcha_sys', label: 'Enable captcha control system?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No' }, ]; /* * handle tips from users */ var totalTipped = 0; var totalTokens = 0; var last_tip_amount = 0; var subject_is_set_with_0 = false; cb.onTip(function (tip) { totalTokens += parseInt(tip['amount']) var divStr = ""; var msgText = ""; var msgNotify = ""; var tipAmount = parseInt(tip['amount']); var name = tip['from_user']; var modelName = cb.room_slug; if (goalPrice != null) { totalTipped += tip['amount'] update_subject(); last_tip_amount = tip['amount'] if (totalTipped > goalPrice) { totalTipped = goalPrice; } } if (!cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), tip['from_user'])) { if(!cb.limitCam_isRunning() && parseInt(tip['amount']) >= cb.settings.min_start_tokens) { cb.limitCam_addUsers([tip['from_user']]); } if(cb.limitCam_isRunning() && parseInt(tip['amount']) >= cb.settings.min_join_tokens && cb.settings.min_join_tokens > 0) { cb.limitCam_addUsers([tip['from_user']]); } } // is user in tipper array? if (!tippers[name]) { //nope add them tippers[name] = {username: name, tips: 0}; } if (!tippers[name].tips) { tippers[name].tips = 0; } tippers[name].tips += tipAmount; switch(tipAmount) { case 2000: result = addUser(husbandUsersArray, name); if (result instanceof Array) { husbandUsersArray = result; msgPublic = name + ' is now in ' + modelName + '\'s ' + husbandTag + ' list! Thank you for your tip!'; msgModel = modelName + ', don\'t forget to add ' + name + ' to Husbands in the bot config!'; } else { if (result == 'duplicate') { msgPublic = name + ' is already in ' + modelName + '\'s ' + husbandTag + ' list! Thank you for your tip!';; } else { msgPublic = 'Failed to add user ' + name + ' to Husbands. Something went wrong!'; } } break; case 333: if (!userInArray (husbandUsersArray, name) && !userInArray (fianceUsersArray, name) && !userInArray (loverUsersArray, name) && !userInArray (familyUsersArray, name)) { result = addUser(friendUsersArray, name); if (result instanceof Array) { friendUsersArray = result; msgPublic = name + ' is now ' + modelName + '\'s Friend!!! Thank you for your tip!'; msgModel = modelName + ', don\'t forget to add ' + name + ' to Friends in the bot config!'; } else { if (result == 'duplicate') { msgPublic = name + ' is already ' + modelName + '\'s Friend!!! Thank you for your tip!';; } else { msgPublic = 'Failed to add user ' + name + ' to Friends. Something went wrong!'; } } } else { msgPublic = name + ' already has a higher status than Friend! Status not changed. Thank you for your tip!'; } break; case 1000: if (!userInArray (husbandUsersArray, name) && !userInArray (fianceUsersArray, name)) { result = addUser(loverUsersArray, name); if (result instanceof Array) { loverUsersArray = result; msgPublic = name + ' is now in ' + modelName + '\'s ' + loverTag + ' list! Thank you for your tip!'; msgModel = modelName + ', don\'t forget to add ' + name + ' to Lovers in the bot config!'; } else { if (result == 'duplicate') { msgPublic = name + ' is already in ' + modelName + '\'s ' + loverTag + ' list! Thank you for your tip!';; } else { msgPublic = 'Failed to add user ' + name + ' to Lovers. Something went wrong!'; } } } else { msgPublic = name + ' already has a higher status than ' + loverTag + '! Status not changed. Thank you for your tip!'; } break; case 444: if (!userInArray (husbandUsersArray, name) && !userInArray (fianceUsersArray, name) && !userInArray (loverUsersArray, name)) { result = addUser(familyUsersArray, name); if (result instanceof Array) { familyUsersArray = result; msgPublic = name + ' is now in ' + modelName + '\'s Family!!! Thank you for your tip!'; msgModel = modelName + ', don\'t forget to add ' + name + ' to Family in the bot config!'; } else { if (result == 'duplicate') { msgPublic = name + ' is already in ' + modelName + '\'s Family!!! Thank you for your tip!';; } else { msgPublic = 'Failed to add user ' + name + ' to Family. Something went wrong!'; } } } else { msgPublic = name + ' already has a higher status than Family! Status not changed. Thank you for your tip!'; } break; default: msgPublic = 'Thank you ' + name + ' for your tip of ' + tipAmount; if (tipAmount == 1) { msgPublic += ' token!'; } else { msgPublic += ' tokens!'; } break; } // Output any notices or command results to user if (msgPrivate.length > 0) { cb.sendNotice(msgPrivate, name, botMsgBg,'','bold'); msgPrivate = ""; } // Output any public notices or command results if (msgPublic.length > 0) { cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } // Output any messages to the model if (msgModel.length > 0) { cb.sendNotice(msgModel, modelName, botMsgBg,'','bold'); msgModel = ""; } }); /* * handle user entrance messages */ cb.onEnter(function(user) { var lenOfSpecialNames = 0; var nameFound = false; var greeting = ''; var modelName = cb.room_slug; var name = user['user']; var isMod = user['is_mod']; var isFan = user['in_fanclub']; var isTS = (name == 'tablesalt90'); var isYetti = (name == 'madyetti'); var isJoker = (name == 'joker1860'); var isReal = (cb.room_slug == 'antonia_savatto_'); var isModel = (name == cb.room_slug); var hasTokens = user['has_tokens']; var hasTipped = user['tipped_recently']; var isGrey = !(hasTokens || isMod || isModel || isFan); lenOfSpecialNames = specialNames.length; for(i=0; i < lenOfSpecialNames; i++) { if (specialNames[i][0] == name) { greeting = specialNames[i][1]; nameFound = true; break; } } if (checkBoolSetting(cb.settings.mods_vip) && user['is_mod']) { cb.limitCam_addUsers(user['user']); } if (checkBoolSetting(cb.settings.fans_vip) && user['in_fanclub']) { cb.limitCam_addUsers(user['user']); } if (nameFound && userGreets) { cb.sendNotice(greeting,'','#FFFFFF'); } else { if (userGreets) { if ( userInArray (familyUsersArray, user['user']) ) { cb.sendNotice('Welcome Family Member ' + user['user'] + ' to the room!','',familyColor,'','bold'); } else { if ( userInArray (friendUsersArray, user['user']) ) { cb.sendNotice('Welcome Friend ' + user['user'] + ' to the room!','',friendColor,'','bold'); } else { if (userInArray(loverUsersArray, user['user'])) { cb.sendNotice('Welcome Lover ' + user['user'] + ' to the room!','',loverColor,'','bold'); } else { if (userInArray(fianceUsersArray, user['user'])) { cb.sendNotice('Welcome Fiance ' + user['user'] + ' to the room!','',fianceColor,'','bold'); } else { if (userInArray(husbandUsersArray, user['user'])) { cb.sendNotice('Welcome Husband ' + user['user'] + ' to the room!','',husbandColor,'','bold'); } } } } } // show notice if user is in timeout if (userInArray(timeoutUsersArray, user['user']) ) { cb.sendNotice('Hello ' + name + ' I see you came back, sorry but you are still in timeout! Please follow the rules to avoid this.',user['user'],botAlertBg,'','bold'); } } } /* if (isYetti) { cb.sendNotice('Yetti is here!! :crazy','',tsBackground,'','bold'); cb.limitCam_addUsers(user['user']); } */ if (checkBoolSetting(cb.settings.captcha_sys) && isGrey) { addUser(captchaUsersArray,user['user']); } if (name == 'pep12e') { cb.limitCam_addUsers(user['user']); } /* if (isYetti) { cb.sendNotice('Joker is here!!! Happy Birthday Joker!!!! \uD83C\uDF82 \uD83C\uDF89 \uD83C\uDF89 \uD83C\uDF89 :fiestap','',familyColor,'','bold'); } */ if (name == 'ringoj') { cb.sendNotice('reyes!! \uD83D\uDC93 :hearts','','pink','','bold'); } if (name == 'mario9ph' || name == 'mario9h' || name == 'kira_kun1' || name == 'zorroviejo00') { addUser(timeoutUsersArray,user['user']); } if (name == 'gslayer1') { cb.sendNotice('Look everyone, it\'s the thief gslayer1! Stealing is bad, stop recording models or you\'ll be reported. Just enjoy the show like everyone else. :thumbdown','','red','','bold'); } if (isMod) { cb.sendNotice(modWelcome(),user['user'],botAlertBg,'','bold'); } else { cb.sendNotice("Welcome, " + name + "! Please be nice and follow the rules, I hope you enjoy your time in my room. If you like my show, please consider following me here and on my Instagram @calabaza_cutie to be notified when I'm online!",user['user'],botMsgBg,'','bold'); if (genderEmotes) { cb.sendNotice('Gender Emotes are enabled: :avatar_gen_male = Male User :avatar_gen_female = Female User\n :avatar_gen_couple = Couple User :avatar_gen_trans = Transgender User\n :avatar_gen_unknown = Gender Unknown',user['user'],'#ffffff','','bold'); } if (modelName != 'antonia_savatto_') { cb.sendNotice('\nThis is NOT Antonia\'s room!\nThis bot was created for model chaturbate.com/antonia_savatto_\nPlease follow her on instagram @calabaza_cutie and visit her room on CB!\n',user['user'],botAlertBg,'','bold'); } if (!allowGreyEmotes && isGrey) { cb.sendNotice('\nYou don\'t have any tokens. Use of emoticons for users without tokens and not part of the loyal family is not allowed at this time.\n\n\n',user['user'],botAlertBg,'','bold'); } } }); /* * handle messages from users */ cb.onMessage(function(message) { var msg = message['m']; var groupTag = ''; var name = message['user']; var commandProcessed = false; var gender = message['gender']; var modelName = cb.room_slug; var isMod = message['is_mod']; var isFan = message['in_fanclub']; var isTS = (name == 'tablesalt90'); var isYetti = (name == 'madyetti'); var isJoker = (name == 'joker1860'); var isReal = (cb.room_slug == 'antonia_savatto_'); var isModel = (name == cb.room_slug); var hasTokens = message['has_tokens']; var hasTipped = message['tipped_recently']; var isGrey = !(hasTokens || isMod || isModel || isFan); var divStr = ""; var tempAllowMsg = tempAllowMsg = "Only " + modelName; var userArray = new Array(); var userList = ""; var showOutput = true; var genderStr = ""; var isInGroup = false; if (userInArray (captchaUsersArray, name) && msg == 'I am human') { message['X-Spam'] = true; msg = "[You have been verified and can chat again! Keep in mind that if you refresh or lose connection, you may have to do it again. Sorry for the inconvenience.]"; delUser(captchaUsersArray,name); } if (isModel | isYetti | isMod && msg.substring(0, 9) == '/vcaptcha') { message['X-Spam'] = true; if (cb.settings.captcha_sys == 'Yes') { msgVIP = 'Captcha System is currently enabled.'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } else { cb.sendNotice("Captcha System is currently disabled.", name, botMsgBg,'','bold'); } } if (isModel | isYetti | isMod && msg.substring(0, 11) == '/captcha on') { message['X-Spam'] = true; cb.settings.captcha_sys = 'Yes'; msgVIP = 'Captcha System enabled!'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 12) == '/captcha off') { message['X-Spam'] = true; cb.settings.captcha_sys = 'No'; msgVIP = 'Captcha System disabled!'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg == '/start' && !cb.limitCam_isRunning()) { message['X-Spam'] = true; cb.chatNotice(modelName + ' has started a VIP show!', '', 'orange','','bold'); if (checkBoolSetting(cb.settings.fans_vip)) { cb.limitCam_start('VIP show started! Tip at least ' + vipPrice + ' tokens or join the Fan Club to watch!'); } else { cb.limitCam_start('VIP show started! Tip at least ' + vipPrice + ' tokens to watch!'); } } if (isModel | isYetti && msg == '/stop' && cb.limitCam_isRunning()) { message['X-Spam'] = true; cb.chatNotice(modelName + ' has ended the VIP show!', '', 'orange','','bold'); cb.limitCam_stop(); } if (isModel | isYetti && msg.substring(0, 6) == '/price') { message['X-Spam'] = true; vipPrice = msg.substring(7, message.length); msgVIP = 'VIP price changed to ' + vipPrice + '!'; cb.settings.min_start_tokens = vipPrice; cb.settings.min_join_tokens = vipPrice; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg.substring(0, 4) == '/del') { message['X-Spam'] = true; username = msg.substring(5, message.length); msgVIP = 'Removed ' + username + ' from the VIP list!'; cb.limitCam_removeUsers([username]); cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg.substring(0, 6) == '/check') { message['X-Spam'] = true; username = msg.substring(7, message.length); if (cb.limitCam_userHasAccess(username)) { msgVIP = username + " is in the VIP list!"; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } else { msgVIP = username + " is not in the VIP list!"; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } } if (isModel | isYetti && msg === '/list') { message['X-Spam'] = true; var userlist = cb.limitCam_allUsersWithAccess(); if (userlist.length > 0) { msgVIP = "" + userlist.length + (userlist.length > 1 ? " users" : " user") + " in the VIP list: " + cbjs.arrayJoin(userlist, ", "); cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } else { msgVIP = "No users in the VIP list."; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } } if (isModel | isYetti && msg.substring(0, 4) == '/add') { message['X-Spam'] = true; username = msg.substring(5, message.length); msgVIP = 'Added ' + username + ' to the VIP list!'; cb.limitCam_addUsers([username]); cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg.substring(0, 6) == '/clear' && cb.limitCam_allUsersWithAccess().length > 0) { message['X-Spam'] = true; msgVIP = "Cleared all users from the VIP list"; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); cb.limitCam_removeUsers(cb.limitCam_allUsersWithAccess()); } if (isModel | isYetti | isMod && msg.substring(0, 7) == '/notice') { message['X-Spam'] = true; msgNote = msg.substring(8, message.length); msgNotice = msgNote.replace(new RegExp(">", "g"), '\n'); cb.sendNotice(msgNotice, '', 'orange','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 5) == '/note') { message['X-Spam'] = true; msgNote = msg.substring(6, message.length); msgNotice = msgNote.replace(new RegExp(">", "g"), '\n'); cb.sendNotice(msgNotice, '', 'plum','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 6) == '/cmenu') { message['X-Spam'] = true; mMenu = msg.substring(7, message.length); msgVIP = 'Tip menu changed!'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 6) == '/vmenu') { message['X-Spam'] = true; cb.sendNotice(mMenu, name, botMsgBg,'','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 5) == '/menu') { message['X-Spam'] = true; msgMenu = mMenu.replace(new RegExp(">", "g"), '\n\u2763'); msgMenu2 = msgMenu.replace(new RegExp("<", "g"), '\n'); cb.sendNotice(msgMenu2, '', 'lightpink','','bold'); cb.sendNotice('*Menu Spam* ' + name + ' used ' + msg,'madyetti',botAlertBg,'','bold'); } if (hasTokens && !(isModel | isYetti | isMod) && msg.substring(0, 5) == '/menu') { message['X-Spam'] = true; msgMenu = mMenu.replace(new RegExp(">", "g"), '\n\u2763'); msgMenu2 = msgMenu.replace(new RegExp("<", "g"), '\n'); nMenu = 'Tip Menu sent to ' + name + '! Color users can type /tipmenu to see it.'; cb.sendNotice(msgMenu2, name, 'lightpink','','bold'); cb.sendNotice(nMenu, '', 'yellow','','bold'); } if (hasTokens && msg.substring(0, 8) == '/tipmenu') { message['X-Spam'] = true; msgMenu = mMenu.replace(new RegExp(">", "g"), '\n\u2763'); msgMenu2 = msgMenu.replace(new RegExp("<", "g"), '\n'); nMenu = 'Tip Menu sent to ' + name + '! Color users can type /tipmenu to see it.'; cb.sendNotice(msgMenu2, name, 'lightpink','','bold'); cb.sendNotice(nMenu, '', 'yellow','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 5) == '/meta') { message['X-Spam'] = true; goalLeft = msg.substring(6, message.length); msgGoal = 'Only ' + goalLeft + ' tokens left for goal guys :eyebrowsraised'; cb.sendNotice(msgGoal, '', 'orange','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 6) == '/watch') { message['X-Spam'] = true; msgWatch = 'Watching is free, requests are not. If you can\'t tip please just watch.'; cb.sendNotice(msgWatch, '', 'orange','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 5) == '/vids') { message['X-Spam'] = true; msgVids = 'New videos in the bio. Join the fan club and get full access to all the exclusive videos and pictures! :kissy '; cb.sendNotice(msgVids, '', 'orange','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 3) == '/ig') { message['X-Spam'] = true; msgVids = ':instagramlogo123 instagram.com/calabaza_cutie'; cb.sendNotice(msgVids, '', 'orange','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 4) == '/brb') { message['X-Spam'] = true; msgVids = 'One moment please guys, BRB :antonia_savatto_1'; cb.sendNotice(msgVids, '', 'orange','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 6) == '/mtips') { message['X-Spam'] = true; msgVids = 'Tokens help keep the show going, please consider tipping if you like! :antonia_savatto_moretokens '; cb.sendNotice(msgVids, '', 'orange','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 4) == '/flw') { message['X-Spam'] = true; msgVids = ':newusersfollowfox :antonia_savatto_besovolado'; msgInsta = ':instagramlogo123 instagram.com/calabaza_cutie'; msgSign = 'If you don\'t have an account you can sign up for free to be able to chat and follow!'; cb.sendNotice(msgVids, '', 'orange','','bold'); cb.sendNotice(msgInsta, '', 'orange','','bold'); cb.sendNotice(msgSign, '', 'plum','','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 3) == '/fc') { message['X-Spam'] = true; msgVids = 'Joining the Fan Club gives you lots of benefits like free PM, discounts, access to exclusive videos, whispers in chat and VIP status! :eyebrowsraised'; cb.sendNotice(msgVids, '', botNoteBg,'','bold'); } /* if (isModel | isYetti | isMod && msg.substring(0, 4) == '/spy') { message['X-Spam'] = true; msgVids = ':spythisprivts only 12 tokens/minute that\'s a 60% discount on the full price :mwhisper'; cb.sendNotice(msgVids, '', 'orange','','bold'); } */ if (isModel | isYetti | isMod && msg.substring(0, 4) == '/fan') { message['X-Spam'] = true; username = msg.substring(5, message.length); msgVids = 'Welcome to the family ' + username + '! :antonia_savatto_welcome'; cb.sendNotice(msgVids, '', botNoteBg,'','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 4) == '/tks') { message['X-Spam'] = true; msgTips = getTippers(); cb.sendNotice(msgTips, name, 'lightpink','','bold'); } if (isModel | isYetti && msg.substring(0, 6) == '/ninja') { message['X-Spam'] = true; username = msg.substring(7, message.length); msgNJ = 'No te preocupes, nadie nunca va saber que ' + username + ' fue eliminado. :evillaugh666 '; addUser(timeoutUsersArray,username); cb.sendNotice(msgNJ, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg.substring(0, 8) == '/deninja') { message['X-Spam'] = true; username = msg.substring(9, message.length); msgNJ = username + ' ya no est\u00e1 m\u00e1s silenciado.'; delUser(timeoutUsersArray,username); cb.sendNotice(msgNJ, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg.substring(0, 7) == '/demand') { message['X-Spam'] = true; username = msg.substring(8, message.length); addUser(timeoutUsersArray,username); addReleaseTime(timeoutReleaseArray, username, 2); msgPublic = 'MeBot put ' + username + ' in timeout for 2 minutes for demanding! Enjoy the show and tip for requests!'; cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } if (isModel | isYetti && msg.substring(0, 8) == '/newgoal') { message['X-Spam'] = true; newGoal = msg.substring(9, message.length); msgVIP = 'Goal changed to ' + newGoal + '!'; goal = newGoal; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg.substring(0, 10) == '/goalprice') { message['X-Spam'] = true; newGoalPrice = msg.substring(11, message.length); msgVIP = 'Goal Price changed to ' + newGoalPrice + '!'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg.substring(0, 8) == '/setgoal') { message['X-Spam'] = true; if (newGoalPrice != null) { msgVIP = 'Starting a new Goal!'; totalTipped = 0; goalPrice = newGoalPrice; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); init(); } else { msgVIP = 'Goal price is missing!'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } } if (isModel | isYetti && msg.substring(0, 8) == '/endgoal') { message['X-Spam'] = true; goalPrice = null; msgVIP = 'Ending the Goal now.'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti && msg.substring(0, 6) == '/title') { message['X-Spam'] = true; new_title = msg.substring(7, message.length); /* cb.log("Changing subject to: " + new_title); */ cb.changeRoomSubject(new_title); } if (isModel | isYetti | isMod && msg.substring(0, 10) == '/atmenu on') { message['X-Spam'] = true; atMenu = true; msgVIP = 'Starting Auto Menu with ' + atMenuInterval + ' minutes interval.'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); autoMenu(); } if (isModel | isYetti | isMod && msg.substring(0, 11) == '/atmenu off') { message['X-Spam'] = true; atMenu = false; msgVIP = 'Stopping Auto Menu.'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (isModel | isYetti | isMod && msg.substring(0, 10) == '/atmenuint') { message['X-Spam'] = true; atMenuInterval = msg.substring(11, message.length); msgVIP = 'Auto Menu Interval changed to ' + atMenuInterval + ' minutes.'; cb.sendNotice(msgVIP, name, botMsgBg,'','bold'); } if (modCommands) { tempAllowMsg = modelName + " and mods"; } helpMsg = tempAllowMsg + " may use the following commands:\n" + botTrigger + " view [family] = list of level users\n" + botTrigger + " useradd [family] [username] = add username to level\n" + botTrigger + " userdel [family] [username] = delete username from level\n" + botTrigger + " check [username] = show what level a user is in\n" + botTrigger + " mods [on/off] = turns on/off mod commands\n" + botTrigger + " greyemotes [on/off] = turns on/off grey emotes\n" + botTrigger + " note [message] = send a public message to chat\n" + botTrigger + " menote [message] = send a private message to me\n" + botTrigger + " modnote [message] = send a private message to mods\n" + botTrigger + " greets [on/off] = turns on/off level user greetings\n" + botTrigger + " tips = show all tippers (private)\n" + botTrigger + " tips # = show top # tippers (private)\n" + botTrigger + " colors [text] [bg] = change text and bg color\n" + botTrigger + " colors rest = reset colors to b/w\n" + botTrigger + " text [color] = change text color\n" + botTrigger + " bg [color] = change background color\n" + botTrigger + " status = show bot status\n" + "*** NOTE: To make names stick add them in the bot config."; // if user is in a group, add the group tag to their message // and change the background color if ( userInArray (vipUsersArray, name) ) { isInGroup = true; } if ( userInArray (familyUsersArray, name) ) { message['background'] = familyColor; groupTag = familyTag; groupColor = familyColor; isInGroup = true; } else { if ( userInArray (friendUsersArray, name) ) { message['background'] = friendColor; groupTag = friendTag; groupColor = friendColor; isInGroup = true; } else { if (userInArray(loverUsersArray, name)) { message['background'] = loverColor; groupTag = loverTag; groupColor = loverColor; isInGroup = true; } else { if (userInArray(fianceUsersArray, name)) { message['background'] = fianceColor; groupTag = fianceTag; groupColor = fianceColor; isInGroup = true; } else { if (userInArray(husbandUsersArray, name)) { message['background'] = husbandColor; message['c'] = 'black'; groupTag = husbandTag; groupColor = husbandColor; isInGroup = true; } } } } } // pm commands if (isModel || isMod || isYetti || isInGroup || isFan || hasTokens || isGrey) { var activePMTrigger = pmTrigger; if (msg.indexOf(pmTrigger2) > -1) { activePMTrigger = pmTrigger2; } if ((msg.indexOf(pmTrigger) > -1) || (msg.indexOf(pmTrigger2) > -1)) { msgParam1 = getParam(msg,' ',1); msgParam2 = getParam(msg,' ',2); msgParam3 = getParam(msg,' ',3); msgParam4 = getParam(msg,' ',4); var regexCommandSplit = '^' + activePMTrigger + ' (\\S+)(?:\\b\\s*)(.*)?'; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); var cmdSplit = msg.match(reCmdSplit); var cmd; var cmdval; var cmdValArray; switch(getParam(msg,' ',0)) { case '/w': case '/pm': message['X-Spam'] = true; if ( cmdSplit ) { cmdval = cmdSplit[2]; if ( cmdval != null ) { cmdval = cmdval.replace(/^\s+|\s+$/g,''); } // contains message. who do we send it to? switch(getParam(msg,' ',0)) { case '/w': if (isModel || isMod || isYetti || isInGroup || isFan) { if (msgParam1.length > 2) { cb.sendNotice('*** Private message from ' + name + ': ' + cmdval + ' ***', msgParam1, 'pink','','bold'); msgPrivate = 'Your message was sent to ' + msgParam1 + '...';} else { msgPrivate = 'Invalid user, please type the username correctly!'; }} else { message['X-Spam'] = true; msg = "[Whisper not sent! You don't have permission to send whispers. Try joining the Fan Club.]"; } break; case '/pm': if (isModel || isMod || isYetti || isInGroup || isFan) { if (msgParam1.length > 2) { cb.sendNotice('*** Private message from ' + name + ': ' + cmdval + ' ***', msgParam1, 'pink','','bold'); msgPrivate = 'Your message was sent to ' + msgParam1 + '...';} else { msgPrivate = 'Invalid user, please type the username correctly!'; }} else { message['X-Spam'] = true; msg = "[Whisper not sent! You don't have permission to send whispers. Try joining the Fan Club.]"; } break; } } break; } // Output any notices or command results to user if (msgPrivate.length > 0) { cb.sendNotice(msgPrivate, name, botMsgBg,'','bold'); msgPrivate = ""; } // Output any public notices or command results if (msgPublic.length > 0) { cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } // Output any messages to the mods if (msgMod.length > 0) { cb.sendNotice(msgMod,'', botMsgBg,'','bold','red'); msgMod = ""; } // Output any messages to the model if (msgModel.length > 0) { cb.sendNotice(msgModel, modelName, botMsgBg,'','bold'); msgModel = ""; } } } // handle commands if ( isModel || (isMod && (modCommands === true)) || isTS || isYetti || isInGroup || hasTokens || isGrey) { var activeBotTrigger = botTrigger; if (msg.indexOf(botTrigger2) > -1) { activeBotTrigger = botTrigger2; } if ((msg.indexOf(botTrigger) > -1) || (msg.indexOf(botTrigger2) > -1)) { msgParam1 = getParam(msg,' ',1); msgParam2 = getParam(msg,' ',2); msgParam3 = getParam(msg,' ',3); msgParam4 = getParam(msg,' ',4); var regexCommandSplit = '^' + activeBotTrigger + ' (\\S+)(?:\\b\\s*)(.*)?'; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); var cmdSplit = msg.match(reCmdSplit); var cmd; var cmdval; var cmdValArray; switch(msgParam1) { case 'help': if (isModel || isMod || isYetti) { message['X-Spam'] = true; divStr = makeDiv('_',50,50); msgPrivate = divStr + '\n'; msgPrivate += helpMsg + '\n' + divStr; } break; /* case 'tips': if (isModel || isMod) { message['X-Spam'] = true; if (!msgParam2) { msgParam2 = 0; } msgPublic = getTippers(msgParam2);} break; */ case 'tips': if (isModel || isMod || isYetti) { message['X-Spam'] = true; if (!msgParam2) { msgParam2 = 0; } msgTips = getTippers(msgParam2); cb.sendNotice(msgTips, name, 'lightpink','','bold');} break; case 'notice': case 'note': case 'modnote': case 'modnotice': case 'menote': case 'menotice': case 'n': case 'tstag': message['X-Spam'] = true; if ( cmdSplit ) { cmdval = cmdSplit[2]; if ( cmdval != null ) { cmdval = cmdval.replace(/^\s+|\s+$/g,''); } // contains message. who do we send it to? switch(msgParam1) { case 'tstag': if (isTS) { tsTag = cmdval; } break; case 'notice': case 'note': case 'n': if (isModel || isMod || isYetti) { cb.sendNotice('*** ' + cmdval + ' ***', '', 'orange','','bold');} break; case 'menote': case 'menotice': if (isModel || isMod || isYetti) { msgModel = '*** Private notice from ' + name + ': ' + cmdval + ' ***'; msgPrivate = 'Your message was sent to ' + modelName + '...';} break; case 'modnote': case 'modnotice': if (isModel || isMod) { msgMod = '*** Moderator notice from ' + name + ': ' + cmdval + ' ***'; msgPrivate = 'Your message was sent to the moderators...';} break; } } break; case 'checktimeouts': if (isModel || isMod) { releaseTimeouts();} break; case 'paint': if (isTS || isModel || isMod) { message['X-Spam'] = true; // is user color array if (!userColors[msgParam2]) { //nope add them userColors[msgParam2] = {username: msgParam2, fbColor: '#333333', bgColor: '#ffffff' }; } if (!userColors[msgParam2].fgColor) { userColors[msgParam2].fgColor = '#333333'; } if (!userColors[msgParam2].bgColor) { userColors[msgParam2].bgColor = '#ffffff'; } if (msgParam3 == 'reset' || msgParam3 == 'default') { delete userColors[msgParam2]; } else { userColors[msgParam2].fgColor = msgParam3; if (msgParam4) { userColors[msgParam2].bgColor = msgParam4; } } msgPrivate = "Changed color for user " + msgParam2 + "!"; cb.sendNotice(name + ' changed your colors!',msgParam2,botAlertBg,'','bold'); } else { msgPrivate = 'Only broadcaster, mods, and creator can paint other users!'; } break; case 'colors': if (isModel || isMod || isYetti) { message['X-Spam'] = true; // is user color array if (!userColors[name]) { //nope add them userColors[name] = {username: name, fbColor: '#333333', bgColor: '#ffffff' }; } if (!userColors[name].fgColor) { userColors[name].fgColor = '#333333'; } if (!userColors[name].bgColor) { userColors[name].bgColor = '#ffffff'; } if (msgParam2 == 'reset' || msgParam2 == 'default') { delete userColors[name]; } else { userColors[name].fgColor = msgParam2; if (msgParam3) { userColors[name].bgColor = msgParam3; } } msgPrivate = "Your Colors have been changed!";} break; case 'color': case 'text': case 'fgcolor': case 'fg': if (isModel || isMod) { message['X-Spam'] = true; // is user color array if (!userColors[name]) { //nope add them userColors[name] = {username: name, fbColor: '#333333', bgColor: '#ffffff' }; } if (!userColors[name].fgColor) { userColors[name].fgColor = '#333333'; } if (!userColors[name].bgColor) { userColors[name].bgColor = '#ffffff'; } if (msgParam2 == 'reset' || msgParam2 == 'default') { delete userColors[name]; } else { userColors[name].fgColor = msgParam2; } msgPrivate = "Your text color has been changed!";} break; case 'background': case 'bg': case 'bgcolor': if (isModel || isMod) { message['X-Spam'] = true; // is user color array if (!userColors[name]) { //nope add them userColors[name] = {username: name, fbColor: '#333333', bgColor: '#ffffff' }; } if (!userColors[name].fgColor) { userColors[name].fgColor = '#333333'; } if (!userColors[name].bgColor) { userColors[name].bgColor = '#ffffff'; } if (msgParam2 == 'reset' || msgParam2 == 'default') { delete userColors[name]; } else { userColors[name].bgColor = msgParam2; } msgPrivate = "Your background color has been changed!";} break; case 'view': case 'show': case 'list': // which user array do we need to display? var showOutput = true; message['X-Spam'] = true; switch(msgParam2) { case "ghost": userArray = ghostUsersArray; break; case "timeout": userArray = timeoutUsersArray; break; case "family": userArray = familyUsersArray; break; case "friends": case "friend": userArray = friendUsersArray; break; case "lovers": case "lover": userArray = loverUsersArray; break; case "fiance": case "fiances": userArray = fianceUsersArray; break; case "husband": case "husbands": userArray = husbandUsersArray; break; default: showOutput = false; msgPrivate = "You must provide a group name to list: family friends lovers fiances husbands"; break; } if (isModel || isMod || isYetti) { if (showOutput === true) { userList = getUsers(userArray); arrayProperName = msgParam2.charAt(0).toUpperCase() + msgParam2.substring(1); if (userList.length > 1) { divStr = makeDiv('_',userList.length,50); msgPrivate = divStr + '\n' + arrayProperName + ' Users\n'; msgPrivate += userList; msgPrivate += '\n' + divStr; } else { msgPrivate = 'No ' + arrayProperName + ' users found!'; } if (!isModel) { msgModel = name + ' viewed the list ' + arrayProperName + ' Users.'; } } break;} case 'useradd': case 'adduser': case 'add': case 'a': if (isTS || isModel || isMod || isYetti) { var validSyntax = true; // check that we got 3 parameters if (msgParam3) { // which user array are we updating? switch(msgParam2) { case "timeout": case "t": case "to": result = addUser(timeoutUsersArray, msgParam3); if (result instanceof Array) { timeoutUsersArray = result; msgPublic = 'MeBot put ' + msgParam3 + ' in timeout!!! They will not be able to type until released!'; if (msgParam4 ) { // command has number of minutes result2 = addReleaseTime(timeoutReleaseArray, msgParam3, msgParam4); if (result2 instanceof Array) { timeoutReleaseArray = result2; minutes = 'minutes'; if (msgParam4 == '1') minutes = 'minute'; msgPublic = 'MeBot put ' + msgParam3 + ' in timeout for ' + msgParam4 + ' ' + minutes + '!!! They will not be able to type until released!'; } else { if (result == 'duplicate') { msgPrivate = 'Failed to put user ' + msgParam3 + ' in timeout they are already scheduled for release!'; } else { msgPrivate = 'Failed to add user ' + msgParam3 + ' to release schedule. Something went wrong!'; } } } } else { if (result == 'duplicate') { msgPrivate = 'Failed to put user ' + msgParam3 + ' in timeout they are already in timeout!'; } else { msgPrivate = 'Failed to add user ' + msgParam3 + ' to timeout. Something went wrong!'; } } break; case "ghost": result = addUser(ghostUsersArray, msgParam3); if (result instanceof Array) { ghostUsersArray = result; msgPublic = msgParam3 + ' was added to the list of Ghosts!'; } else { if (result == 'duplicate') { msgPrivate = 'Failed to add user ' + msgParam3 + ' because they are already in Ghosts!'; } else { msgPrivate = 'Failed to add user ' + msgParam3 + ' to Ghosts. Something went wrong!'; } } break; case "family": result = addUser(familyUsersArray, msgParam3); if (result instanceof Array) { familyUsersArray = result; msgPublic = msgParam3 + ' was added to the ' + familyTag + ' list!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to add ' + msgParam3 + ' to the Family list in the bot config!'; } } else { if (result == 'duplicate') { msgPrivate = 'Failed to add user ' + msgParam3 + ' because they are already in Family!'; } else { msgPrivate = 'Failed to add user ' + msgParam3 + ' to Family. Something went wrong!'; } } break; case "friends": case "friend": result = addUser(friendUsersArray, msgParam3); if (result instanceof Array) { friendUsersArray = result; msgPublic = msgParam3 + ' was added to the ' + friendTag + ' list!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to add ' + msgParam3 + ' to Friends in the bot config!'; } } else { if (result == 'duplicate') { msgPrivate = 'Failed to add user ' + msgParam3 + ' because they are already in Friends!'; } else { msgPrivate = 'Failed to add user ' + msgParam3 + ' to Friends. Something went wrong!'; } } break; case "lovers": case "lover": result = addUser(loverUsersArray, msgParam3); if (result instanceof Array) { loverUsersArray = result; msgPublic = msgParam3 + ' was added to the ' + loverTag + ' list!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to add ' + msgParam3 + ' to Lovers in the bot config!'; } } else { if (result == 'duplicate') { msgPrivate = 'Failed to add user ' + msgParam3 + ' because they are already in Lovers!'; } else { msgPrivate = 'Failed to add user ' + msgParam3 + ' to Lovers. Something went wrong!'; } } break; case "fiance": case "fiances": result = addUser(fianceUsersArray, msgParam3); if (result instanceof Array) { fianceUsersArray = result; msgPublic = msgParam3 + ' was added to the list of Fiances!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to add ' + msgParam3 + ' to Fiances in the bot config!'; } } else { if (result == 'duplicate') { msgPrivate = 'Failed to add user ' + msgParam3 + ' because they are already in Fiances!'; } else { msgPrivate = 'Failed to add user ' + msgParam3 + ' to Fiances. Something went wrong!'; } } break; case "husband": case "husbands": result = addUser(husbandUsersArray, msgParam3); if (result instanceof Array) { husbandUsersArray = result; msgPublic = msgParam3 + ' was added to the ' + husbandTag + ' list!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to add ' + msgParam3 + ' to Husbands in the bot config!'; } } else { if (result == 'duplicate') { msgPrivate = 'Failed to add user ' + msgParam3 + ' because they are already in Husbands!'; } else { msgPrivate = 'Failed to add user ' + msgParam3 + ' to Husbands. Something went wrong!'; } } break; default: validSyntax = false; msgPrivate = 'You didn\'t supply a valid group to add the user to. Valid groups are:\n'; msgPrivate += 'family friend lover fiance husband ... choose only one.'; break; } } else { validSyntax = false; msgPrivate = 'You must provide the group and the username you wish to add. For example,\n' + botTrigger + ' adduser family someusername\n'; msgPrivate += 'or ' + botTrigger + ' adduser husband someuser'; } } else { msgPrivate = 'Only brodcaster, mods, and creator can add users to groups!'; } if (validSyntax === true) { message['X-Spam'] = true; } break; case 'userdel': case 'deluser': case 'delete': case 'remove': case 'd': case 'del': if (isTS || isModel || isMod || isYetti) { var validSyntax = true; // check that we got 3 parameters if (msgParam3) { // which user array are we updating? switch(msgParam2) { case "timeout": case "t": case "to": result = delUser(timeoutUsersArray, msgParam3); if (result instanceof Array) { timeoutUsersArray = result; msgPublic = 'MeBot released ' + msgParam3 + ' from timeout!!'; // delete any release time result2 = delReleaseTime(timeoutReleaseArray, msgParam3); } else { if (result == 'notfound') { msgPrivate = 'Failed to remove user ' + msgParam3 + ' from timeout because they are not in timeout!'; } else { msgPrivate = 'Failed to remove user ' + msgParam3 + ' from timeout. Something went wrong!'; } } break; case "family": result = delUser(familyUsersArray, msgParam3); if (result instanceof Array) { familyUsersArray = result; msgPublic = msgParam3 + ' was removed from the ' + familyTag + ' list!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to remove ' + msgParam3 + ' from the Family list in the bot config!'; } } else { if (result == 'notfound') { msgPrivate = 'Failed to remove user ' + msgParam3 + ' because they are not in Family!'; } else { msgPrivate = 'Failed to remove user ' + msgParam3 + ' from Family. Something went wrong!'; } } break; case "ghost": result = delUser(ghostUsersArray, msgParam3); if (result instanceof Array) { ghostUsersArray = result; msgPublic = name + ' removed ' + msgParam3 + ' from the Ghost list!'; } else { if (result == 'notfound') { msgPrivate = 'Failed to remove user ' + msgParam3 + ' because they are not in Ghosts!'; } else { msgPrivate = 'Failed to remove user ' + msgParam3 + ' from Ghosts. Something went wrong!'; } } break; case "friends": case "friend": result = delUser(friendUsersArray, msgParam3); if (result instanceof Array) { friendUsersArray = result; msgPublic = msgParam3 + ' was removed from the ' + friendTag + ' list!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to remove ' + msgParam3 + ' from Friends in the bot config!'; } } else { if (result == 'notfound') { msgPrivate = 'Failed to remove user ' + msgParam3 + ' because they are not in Friends!'; } else { msgPrivate = 'Failed to remove user ' + msgParam3 + ' from Friends. Something went wrong!'; } } break; case "lovers": case "lover": result = delUser(loverUsersArray, msgParam3); if (result instanceof Array) { loverUsersArray = result; msgPublic = msgParam3 + ' was removed from the ' + loverTag + ' list!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to remove ' + msgParam3 + ' from Lovers in the bot config!'; } } else { if (result == 'notfound') { msgPrivate = 'Failed to remove user ' + msgParam3 + ' because they are not in Lovers!'; } else { msgPrivate = 'Failed to remove user ' + msgParam3 + ' from Lovers. Something went wrong!'; } } break; case "fiance": case "fiances": result = delUser(fianceUsersArray, msgParam3); if (result instanceof Array) { fianceUsersArray = result; msgPublic = msgParam3 + ' was removed from the list of Fiances!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to remove ' + msgParam3 + ' from Fiances in the bot config!'; } } else { if (result == 'notfound') { msgPrivate = 'Failed to remove user ' + msgParam3 + ' because they are not in Fiances!'; } else { msgPrivate = 'Failed to remove user ' + msgParam3 + ' from Fiances. Something went wrong!'; } } break; case "husband": case "husbands": result = delUser(husbandUsersArray, msgParam3); if (result instanceof Array) { husbandUsersArray = result; msgPublic = msgParam3 + ' was removed from the ' + husbandTag + ' list!'; // if model didn't issue command remind model to update the bot if (!isModel) { msgModel = modelName + ', don\'t forget to remove ' + msgParam3 + ' from Husbands in the bot config!'; } } else { if (result == 'notfound') { msgPrivate = 'Failed to remove user ' + msgParam3 + ' because they are not in Husbands!'; } else { msgPrivate = 'Failed to remove user ' + msgParam3 + ' from Husbands. Something went wrong!'; } } break; default: validSyntax = false; msgPrivate = 'You didn\'t supply a valid group to remove the user from. Valid groups are:\n'; msgPrivate += 'family friend lover fiance husband ... choose only one.'; break; } } else { validSyntax = false; msgPrivate = 'You must provide the group and the username you wish to remove. For example,\n' + botTrigger + ' deluser family someusername\n'; msgPrivate += 'or ' + botTrigger + ' deluser husband someuser'; } } else { msgPrivate = 'Only broadcaster, mods, and creator can remove users from groups!'; } if (validSyntax === true) { message['X-Spam'] = true; } break; case 'check': if (isModel || isMod) { if (msgParam2) { message['X-Spam'] = true; groupList = checkUser(msgParam2); msgPrivate = 'User ' + msgParam2 + ' found in: ' + groupList;} } break; case 'modcommands': case 'mods': if(isModel || isTS) { if (msgParam2) { message['X-Spam'] = true; switch(msgParam2) { case "on": modCommands = true; msgPublic = name + ' has enabled Moderator commands!'; break; case "off": modCommands = false; msgPublic = name + ' has disabled Moderator commands!'; break; default: // invalid option msgPrivate = 'Invalid option, you must use on or off. Example: ' + botTrigger + ' modcommands off'; break; } } else { // missing on/off value msgPrivate = 'Missing option, you must use on or off. Example: ' + botTrigger + ' modcommands on'; } } else { msgPrivate = 'Only broadcaster and creator can enable or disable mod commands!'; } break; case 'unmask': case 'unmasktimeout': if(isYetti) { if (msgParam2) { message['X-Spam'] = true; switch(msgParam2) { case "on": unmaskTimeout = true; msgPrivate = 'Timeout messages will be sent to you for debugging...'; break; case "off": unmaskTimeout = false; msgPrivate = 'Timeout unmasking disabled...'; break; default: // invalid option msgPrivate = 'Invalid option, you must use on or off. Example: ' + botTrigger + ' unmask off'; break; } } else { // missing on/off value msgPrivate = 'Missing option, you must use on or off. Example: ' + botTrigger + ' unmask on'; } } else { msgPrivate = 'Only Creator can use the unmask command!'; } break; case 'greyemote': case 'greyemotes': case 'grayemote': case 'grayemotes': case 'emotes': case 'emote': if (isTS || isModel || isMod) { if (msgParam2) { message['X-Spam'] = true; switch(msgParam2) { case "on": allowGreyEmotes = true; msgPublic = name + ' has enabled grey emotes!'; break; case "off": allowGreyEmotes = false; msgPublic = name + ' has disabled grey emotes!'; break; default: // invalid option msgPrivate = 'Invalid option, you must use on or off. Example: ' + botTrigger + ' greyemotes off'; break; } } else { // missing on/off value msgPrivate = 'Missing option, you must use on or off. Example: ' + botTrigger + ' greyemotes on'; } } else { msgPrivate = 'Only broadcaster, mods and creator can disable or enable grey emotes!'; } break; case 'greets': case 'greetings': if(isModel || isTS) { if (msgParam2) { message['X-Spam'] = true; switch(msgParam2) { case "on": userGreets = true; msgPublic = name + ' has enabled User Greetings!'; break; case "off": userGreets = false; msgPublic = name + ' has disabled User Greetings!'; break; default: // invalid option msgPrivate = 'Invalid option, you must use on or off. Example: ' + botTrigger + ' greets off'; break; } } else { // missing on/off value msgPrivate = 'Missing option, you must use on or off. Example: ' + botTrigger + ' greets on'; } } else { msgPrivate = 'Only broadcaster and creator can enable or disable user greetings!'; } break; case "status": case "announce": if (isModel || isMod) { message['X-Spam'] = true; msgPrivate = announceBot();} break; default: if (isModel || isMod || isYetti) { message['X-Spam'] = true; msgPrivate = 'Invalid command.';} break; } // Output any notices or command results to user if (msgPrivate.length > 0) { cb.sendNotice(msgPrivate, name, botMsgBg,'','bold'); msgPrivate = ""; } // Output any public notices or command results if (msgPublic.length > 0) { cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } // Output any messages to the mods if (msgMod.length > 0) { cb.sendNotice(msgMod,'', botMsgBg,'','bold','red'); msgMod = ""; } // Output any messages to the model if (msgModel.length > 0) { cb.sendNotice(msgModel, modelName, botMsgBg,'','bold'); msgModel = ""; } } } // see if user envoked emotes that should be removed (no grey emotes) if (!isInGroup && !isTS && !isModel && !allowGreyEmotes && isGrey) { //user is grey, is not in a group, not TS, not model and grey emotes are not allowed if (msg.indexOf(':') > -1) { //colon found, replace all with _ msg = msg.replace(/:([^\s]+)/g,"[blocked emote]"); } } var inTimeout = userInArray(timeoutUsersArray, name); if (!isInGroup && !isYetti && !isModel && !isGrey && !inTimeout) { if (isWordInString("SEX18XX.COM",msg) || isWordInString(".com ",msg) || isWordInString("chaturbate.com",msg)) { if (unmaskTimeout) { cb.sendNotice('*Time Out ' + name + ' said ' + msg,'madyetti',botAlertBg,'','bold'); } message['X-Spam'] = false; msg = '[blocked advertisement]'; /* result = addUser(timeoutUsersArray, name); result2 = addReleaseTime(timeoutReleaseArray, name, 2); */ msgPublic = 'MeBot blocked ' + name + '\'s message for advertising! Please don\'t advertise in chat!'; cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } } if (!isInGroup && !isTS && !isModel && isGrey && !inTimeout) { // check for specific known advertisements if (isWordInString("premium cheat",msg) || isWordInString("tokens generator",msg) || isWordInString("token generator",msg) || isWordInString("premiumcheat",msg)) { if (unmaskTimeout) { cb.sendNotice('*Time Out ' + name + ' said ' + msg,'madyetti',botAlertBg,'','bold'); } message['X-Spam'] = true; msg = '[blocked advertisement]'; result = addUser(timeoutUsersArray, name); msgPublic = 'MeBot put ' + name + ' in timeout for advertising web sites!!! They will not be able to type until released!'; cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } else { if (isWordInString("erotimo",msg)) { if (unmaskTimeout) { cb.sendNotice('*Time Out ' + name + ' said ' + msg,'madyetti',botAlertBg,'','bold'); } message['X-Spam'] = true; msg = '[blocked advertisement]'; result = addUser(timeoutUsersArray, name); msgPublic = 'MeBot put ' + name + ' in timeout for advertising web sites!!! They will not be able to type until released!'; cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } else { if (isWordInString("freelive",msg) || isWordInString("freewebcam",msg) || isWordInString("net.au",msg) || isWordInString("xtoy24",msg) || isWordInString("EllaGoCam",msg) || isWordInString("livecams",msg)) { if (unmaskTimeout) { cb.sendNotice('*Time Out ' + name + ' said ' + msg,'madyetti',botAlertBg,'','bold'); } message['X-Spam'] = true; msg = '[blocked advertisement]'; result = addUser(timeoutUsersArray, name); msgPublic = 'MeBot put ' + name + ' in timeout for advertising web sites!!! They will not be able to type until released!'; cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } } } // check for message that contain ".com " "dot com" " com " if (isWordInString(".com ",msg) || isWordInString("dot com",msg) || isWordInString("dot net",msg) || isWordInString("cesso. org",msg) || isWordInString("escort profile",msg) || isWordInString("found all your dirty videos",msg) || isWordInString("sexymeet.",msg)) { if (unmaskTimeout) { cb.sendNotice('*Time Out ' + name + ' said ' + msg,'madyetti',botAlertBg,'','bold'); } message['X-Spam'] = true; msg = '[blocked website]'; result = addUser(timeoutUsersArray, name); msgPublic = 'MeBot put ' + name + ' in timeout for posting a web address! Don\'t put web sites in chat!'; cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } else { // check for demands if (isWordInString("show tits",msg) || isWordInString("open tits",msg) || isWordInString("open bobs",msg) || isWordInString("show boobs",msg) || isWordInString("show ass",msg) || isWordInString("show pussy",msg) || isWordInString("show tits",msg) || isWordInString("fuck pussy",msg) || isWordInString("fuck ass",msg) || isWordInString("suck my",msg) || isWordInString("lick my",msg) || isWordInString("open pussy",msg) || isWordInString("open ass",msg) || isWordInString("show your",msg) || isWordInString("show ur",msg) || isWordInString("fuck your",msg) || isWordInString("fuck ur",msg) || isWordInString("open bust",msg) || isWordInString("open boobs",msg)) { if (unmaskTimeout) { cb.sendNotice('*Time Out ' + name + ' said ' + msg,'madyetti',botAlertBg,'','bold'); } message['X-Spam'] = true; msg = '[blocked message]'; result = addUser(timeoutUsersArray, name); result2 = addReleaseTime(timeoutReleaseArray, name, 2); msgPublic = 'MeBot put ' + name + ' in timeout for 2 minutes for demanding! Enjoy the show and keep your demands to yourself!'; cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } else { // check for PM requests if (isWordInString("pm me",msg) || isWordInString("open pm",msg) || isWordInString("to pm",msg) || isWordInString("send pm",msg)) { if (unmaskTimeout) { cb.sendNotice('*Time Out ' + name + ' said ' + msg,'madyetti',botAlertBg,'','bold'); } message['X-Spam'] = true; msg = '[blocked message]'; result = addUser(timeoutUsersArray, name); result2 = addReleaseTime(timeoutReleaseArray, name, 1); msgPublic = 'MeBot put ' + name + ' in timeout for 1 minute for requesting a private message! NO PM! Type in chat!'; cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } else { // check for annoying spam and silence if (isWordInString("are you trans",msg) || isWordInString("are you a trans",msg) || isWordInString("you are a trans",msg) || isWordInString("u a trans",msg) || isWordInString("ur a trans",msg) || isWordInString("u trans",msg) || isWordInString("ur trans",msg) || isWordInString("u r trans",msg) || isWordInString("u r a trans",msg) || isWordInString("you are trans",msg) || isWordInString("you re trans",msg) || isWordInString("you're trans",msg) || isWordInString("she trans",msg) || isWordInString("she a trans",msg) || isWordInString("she is trans",msg) || isWordInString("she is a trans",msg) || isWordInString("he trans",msg) || isWordInString("he a trans",msg) || isWordInString("he is trans",msg) || isWordInString("he is a trans",msg) || isWordInString("eres trans",msg) || isWordInString("eres un trans",msg) || isWordInString("eres una trans",msg) || isWordInString("what's your address",msg) || isWordInString("what's ur address",msg) || isWordInString("what is your address",msg) || isWordInString("what is ur address",msg) || isWordInString("whats your address",msg) || isWordInString("whats ur address",msg) || isWordInString("wat's your address",msg) || isWordInString("wat's ur address",msg) || isWordInString("wat is your address",msg) || isWordInString("wat is ur address",msg) || isWordInString("wats your address",msg) || isWordInString("wats ur address",msg) || isWordInString("yesenia",msg) || isWordInString("jesenia",msg) || isWordInString("yese",msg) || isWordInString("jese",msg) || isWordInString("kill yourself",msg) || isWordInString("kill you",msg)) { if (unmaskTimeout) { cb.sendNotice('[UNMASKED] ' + name + ' said: ' + msg,'madyetti',botAlertBg,'','bold'); } message['X-Spam'] = true; msg = '[blocked message]'; result = addUser(timeoutUsersArray, name); } } } } } else { if (inTimeout) { message['X-Spam'] = true; msg = '[blocked message]'; msgPublic = ""; } } // apply group tags if (name == 'kaybear420') { msg = '[Girl Friend]' + ' ' + msg; } else { if (groupTag) { msg = groupTag + ' ' + msg; } } // if gender emotes are enabled, prefix message with correct gender if (genderEmotes) { switch (gender) { case 'm': genderStr = ':avatar_gen_male'; break; case 'f': genderStr = ':avatar_gen_female'; break; case 's': genderStr = ':avatar_gen_trans'; break; case 'c': genderStr = ':avatar_gen_couple'; break; default: genderStr = ':avatar_gen_unknown'; break; } // special user icons if (isTS) { genderStr= ':tsalien [' + tsTag + ']'; message['background'] = tsBackground; message['c'] = tsColor; } if ( userInArray (vipUsersArray, name) ) { genderStr= ':pinkstaricon [VIP]'; } if (isModel) { genderStr = ':crown_queen [Queen]'; } if (isYetti) { /* genderStr = ':juicy-rocker-certified'; */ message['background'] = tsBackground; message['c'] = tsColor; } if (isJoker) { genderStr= ':shield2 [' + jokerTag + ']'; } if (name == 'sfwhat') { genderStr = ':avatar_alien_1 [My Alien]'; } if (name == 'sunspotbb2') { genderStr = ':coeuryn_heart_purple'; } if (name == 'pa610c') { genderStr = ':coeuryn_heart_blue'; } if (name == 'johnny7835') { genderStr = '\uD83D\uDC9A'; } if (name == 'myplaceisatherfeet68') { genderStr = ':pinkstaricon [Queen\'s Bitch]'; } if (name == 'tmoneybagzz') { genderStr = ':pinkstaricon [El Loco Gringo]'; } if (name == 'j4mes34') { genderStr = '\uD83D\uDC96 [My Moonshine]'; } if (name == 'versacegang95') { genderStr = '\uD83D\uDC9B [My Sunshine]'; } if (name == 'eyeroll6777') { genderStr = '\uD83D\uDC40 [Orgasm Kingroll]'; } if (name == 'dunnop') { genderStr = ':pinkstaricon [Sweet Daddy]'; } if (name == 'drauga') { genderStr = '\uD83D\uDC9C [Honey]'; } if (name == 'von_croy') { genderStr = '\uD83D\uDCA3 [Exagerado]'; } if (name == 'ringoj') { genderStr = '\uD83D\uDC93 [Papasito Mio]'; } if (name == 'ghostglory') { genderStr = '\uD83D\uDC7B [Spooky Love]'; } if (name == 'kmwwpu') { genderStr = '\uD83D\uDC95'; } if (name == 'c_senpailolbayarea') { genderStr = '\uD83D\uDC97 [Corazoncito]'; } if (name == 'dunham8585') { genderStr = '\uD83C\uDF77 [Darling]'; } if (name == 'pindakaas23') { genderStr = ':pinkstaricon'; } if (name == 'kill4yourwill') { genderStr = ':pinkstaricon [El Poeta]'; } if (name == 'sweetvienna1 ') { genderStr = '\uD83D\uDC99'; } if (name == 'deep__sigh') { genderStr = '\uD83C\uDF1E'; } if (name == 'black0adder') { genderStr = '\uD83D\uDC2F'; } if (name == 'hatdownguy') { genderStr = '\uD83D\uDC9C [Tocayo]'; } if (name == 'ardillito123') { genderStr = '\uD83C\uDF30'; } if (name == 'maddall') { genderStr = '\uD83D\uDC9C'; } if (name == 'hiyall_99') { genderStr = '\uD83D\uDC3C [Panda]'; } /* if (name == 'antonious323') { genderStr = ':pkmn025 [Pikachu]'; } */ if (name == 'marcivi') { genderStr = '\uD83C\uDDE8\uD83C\uDDF4 [Colombianito Feliz]'; } if (name == 'xxowllover') { genderStr = '\uD83E\uDD89 [Hoot Hoot]'; } if (name == 'juanloveless') { genderStr = '\uD83D\uDC2F [Tigre]'; } if (name == 'sexylion147') { genderStr = '\uD83E\uDD81 [Leoncito]'; } /* if (name == 'greatdane173') { genderStr = '\uD83D\uDC9A [Papi]'; } */ if (name == 'rhmatts2') { genderStr = '\uD83D\uDC97 [Candy]'; } if (name == 'jugghead62') { genderStr = ':avatar_alien_1 [Hoog]'; } if (name == 'spectrel1') { genderStr = ':pinkstaricon [Team Ronery]'; } if (name == 'thecurvedfrenchy') { genderStr = '\uD83D\uDC9D [Frenchy]'; } /* if (name == 'johnokeefelives') { genderStr = '\uD83C\uDF82 [Birthday Boy]'; } */ msg = genderStr + ' ' + msg; } // captcha system test if ( userInArray(captchaUsersArray, name) ) { thisMessageTime = (new Date).getTime(); // simple trottle timeout message output to keep users from flooding room if ( (lastMessageName == name && (thisMessageTime > (lastMessgeTime + 4000))) || lastMessageName != name ) { selectedTimeoutMessage = Math.floor(Math.random() * 5) + 1; message['X-Spam'] = true; msg = "[CAPTCHA SYSTEM is enabled to avoid spam, please enter: I am human (exactly like this) and send to be able to chat.]"; lastMessgeTime = (new Date).getTime(); lastMessageName = name; } else { message['X-Spam'] = true; msg = ""; cb.sendNotice("Flood Protector Enabled! Message Blocked! Stop trying to flood the room! Type the captcha to confirm you are not a spam bot! [only you are seeing this]", name, botMsgBg,'','bold'); } } // show notice if user is in timeout if ( userInArray(timeoutUsersArray, name) ) { thisMessageTime = (new Date).getTime(); // simple trottle timeout message output to keep users from flooding room if ( (lastMessageName == name && (thisMessageTime > (lastMessgeTime + 4000))) || lastMessageName != name ) { selectedTimeoutMessage = Math.floor(Math.random() * 5) + 1; msg = timeoutMessages[selectedTimeoutMessage]; lastMessgeTime = (new Date).getTime(); lastMessageName = name; } else { message['X-Spam'] = true; msg = ""; cb.sendNotice("Timeout Flood Protector Enabled! Message Blocked! Stop trying to flood the room! [only you are seeing this]", name, botMsgBg,'','bold'); } } else { if ( userInArray(ghostUsersArray, name) ) { message['X-Spam'] = true; msg = '[Ghost] ' + name + ' says: ' + message['m']; cb.sendNotice(msg,'', botGhostBg,'','bold'); } } // does user have modified colors if (!userColors[name]) { // do nothing } else { // apply colors to message if in color array if (userColors[name].fgColor) { message['c'] = userColors[name].fgColor; } if (userColors[name].bgColor) { message['background'] = userColors[name].bgColor; } } // return final altered message message['m'] = msg; return message; }); //end onMessage /* * bot functions */ function checkBoolSetting(str) { return (str == 'Yes'); } function update_subject() { if (tips_remaining() == 0) { if (subject_is_set_with_0) { return; } subject_is_set_with_0 = true; goalPrice = null; msgVIP = 'Thank you everyone for hitting the goal!!!! :crazy '; cb.sendNotice(msgVIP, '', 'plum','','bold'); } else { subject_is_set_with_0 = false; } var new_subject = goal; var left = " [" + tips_remaining() + " tokens left]"; goalEdit = goal.replace(new RegExp("AT GOAL!", "g"), left); cb.log("Changing subject to: " + new_subject); cb.changeRoomSubject(goalEdit); } function tips_remaining() { var r = goalPrice - totalTipped; if (r < 0) { return 0; } else { return r; } } function init() { update_subject(); } /* * return string of tippers to display * can limit number of tippers returned to show only top 10, top 5 ect. */ function getTippers(topNumber) { var topTippers = new Array(); var tempTippers = objectToArray(tippers); var output = ''; tempTippers.sort(dynamicSort('-tips')); if (topNumber > 0) { topTippers = tempTippers.slice(0,topNumber); if (topTippers.length == 1) { output = '\nTop Tipper'; } else { output = '\nTop ' + topTippers.length + ' Tippers'; } } else { topTippers = tempTippers; output = '**All Tippers**\nTotal Tipped: ' + totalTokens + ' tokens\nTotal Tippers: ' + topTippers.length + (topTippers.length > 1 ? " tippers\n" : " tipper\n"); } if (topTippers.length > 0) { for (i = 0; i < topTippers.length; i++) { output += '\n' + topTippers[i].username + ': ' + topTippers[i].tips; } } else { output = '\nThere have been no tippers since the bot started!'; } return output + '\n'; } /* * check if a word or phrase is in a string */ function isWordInString(word,str) { var re = new RegExp(word,"i"); var n = str.search(re); if (n > -1) { return true; } else { return false; } } /* * add a user to the release array */ function addReleaseTime(userArray, username, timeoutMinutes) { var userArrayLength = userArray.length; username = username.toLowerCase(); // check if username is in userarray usernameExists = userInReleaseArray(userArray, username); if (usernameExists === true) { return "duplicate"; // username found in array, return duplicate } else { // add username to array currentEpoch = (new Date).getTime(); userArray[userArrayLength] = new Array(username,currentEpoch + (timeoutMinutes * 60000)); //userArray[userArrayLength][0] = username; //userArray[userArrayLength][1] = currentEpoch + timeoutMinutes * 60000; // check to see that addition of user worked usernameExists = userInReleaseArray(userArray, username); if (usernameExists === true) { return userArray; // it worked, return the array } else { return "failed"; // failed, return failed } } } function delReleaseTime(userArray, username) { var releaseArrayLength = userArray.length; var userElement = -1; username = username.toLowerCase(); if (userInReleaseArray(userArray, username)) { userElement = getRelaseArrayElement(userArray, username); if (userElement > -1) { tempArray = removeArrayElement(userArray, userElement); if (!userInReleaseArray(userArray, username)) { // user was removed return tempArray; } else { // user was not removed, failed return "failed"; } } else { //user element was not in array for some reason return "failed"; } } else { return 'notfound'; } } /* * remove users from timeout if their time has expired */ function releaseTimeouts() { // set current epoch time currentEpoch = (new Date).getTime(); //loop through all elements in timeout release array for (i = 0; i < timeoutReleaseArray.length; i++) { if (timeoutReleaseArray[i][1] < currentEpoch) { username = timeoutReleaseArray[i][0]; delUser(timeoutUsersArray, username); msgPublic += "User " + username + " has been released from timeout!"; delReleaseTime(timeoutReleaseArray, username); } } // setup next check call cb.setTimeout(releaseTimeouts, timeoutReleaseInterval * 60000); if (msgPublic) { cb.sendNotice(msgPublic, '', botMsgBg,'','bold'); msgPublic = ""; } } /* * display notification message and start interval timer */ function displayNotification1() { cb.sendNotice(autoNotice1Text,'',botNoteBg,'','bold'); cb.setTimeout(displayNotification1, cb.settings.autoNotice1Interval * 60000); } function displayNotification2() { cb.sendNotice(autoNotice2Text,'',botNoteBg,'','bold'); cb.setTimeout(displayNotification2, cb.settings.autoNotice2Interval * 60000); } function autoMenu() { if (atMenu === false){ return; } msgMenu = mMenu.replace(new RegExp(">", "g"), '\n\u2763'); msgMenu2 = msgMenu.replace(new RegExp("<", "g"), '\n'); cb.sendNotice(msgMenu2, '', 'lightpink','','bold'); cb.setTimeout(autoMenu, atMenuInterval * 60000); } /* * return parameter value from a message string * Req: msgString = full message as string * Req: splitChr = character to split on (usually space) * Req: paramNumber = number of the parameter to return (first is 0) * Return: paramValue = value of the requested parameter */ function getParam(msgString,splitChr,paramNumber) { var tempArray = new Array(); tempArray = msgString.split(splitChr); paramValue = tempArray[paramNumber]; return paramValue; } /* * build a variable length divider from a character * Req: divChr = the character to use for the divier, ie: _ - * * Req: strLen = length of the data to be divided (lenth of a string, or fixed) * Req: maxDivLen = the max number of characters the div can grow to * Return: divStr = string of repeated character that make the divider */ function makeDiv(divChr, strLen, maxDivLen) { var divLen = 0; var divStr = ""; if (strLen > maxDivLen) { divLen = maxDivLen; } else { divLen = strLen; } while (divStr.length < divLen) { divStr = divChr + divStr; } return divStr; } /* * return array of users with the new user added, duplicate, * or error string. * Req: userArray = array of users to add the new user to * Req: username = username of new user * Return: array of users with new users added * On error: return "duplicate" if username in user array already * On error: return "failed" if user no duplicate and wasn't added */ function addUser(userArray, username) { var userArrayLength = userArray.length; username = username.toLowerCase(); // check if username is in userarray usernameExists = userInArray(userArray, username); if (usernameExists === true) { return "duplicate"; // username found in array, return duplicate } else { // remove user from all user arrays delUserFromAll(username); // add username to array userArray[userArrayLength] = username; // check to see that addition of user worked usernameExists = userInArray(userArray, username); if (usernameExists === true) { return userArray; // it worked, return the array } else { return "failed"; // failed, return failed } } } /* * return array of users with the new user removed, duplicate, * or error string. * Req: userArray = array of users to add the new user to * Req: username = username of new user * Return: array of users with user removed * On error: return "notfound" if username not in user array * On error: return "failed" if user no duplicate and wasn't added */ function delUser(userArray, username) { var userArrayLength = userArray.length; var userElement = -1; username = username.toLowerCase(); if (userInArray(userArray, username)) { userElement = getArrayElement(userArray, username); if (userElement > -1) { tempArray = removeArrayElement(userArray, userElement); if (!userInArray(userArray, username)) { // user was removed return tempArray; } else { // user was not removed, failed return "failed"; } } else { //user element was not in array for some reason return "failed"; } } else { return 'notfound'; } } /* * remove a user from all groups * Req: username = name over user to remove * Return: none */ function delUserFromAll(username) { if ( userInArray(friendUsersArray, username) ) { result = delUser(friendUsersArray, username); if (result instanceof Array) { friendUsersArray = result; } } if ( userInArray(familyUsersArray, username) ) { result = delUser(familyUsersArray, username); if (result instanceof Array) { familyUsersArray = result; } } if ( userInArray(loverUsersArray, username) ) { result = delUser(loverUsersArray, username); if (result instanceof Array) { loverUsersArray = result; } } if ( userInArray(fianceUsersArray, username) ) { result = delUser(fianceUsersArray, username); if (result instanceof Array) { fianceUsersArray = result; } } if ( userInArray(husbandUsersArray, username) ) { result = delUser(husbandUsersArray, username); if (result instanceof Array) { husbandUsersArray = result; } } } /* retun group bg color */ function getGroupBgColor(username) { var bgc = "#ffffff"; if ( userInArray (familyUsersArray, username) ) { bgc = familyColor; } else { if ( userInArray (friendUsersArray, username) ) { bgc = friendColor; } else { if (userInArray(loverUsersArray, username)) { bgc = loverColor; } else { if (userInArray(fianceUsersArray, username)) { bgc = fianceColor; } else { if (userInArray(husbandUsersArray, username)) { bgc = husbandColor; } } } } } return bgc; } /* * return the element or index number of an array value * Req: sourceArray = array to parse * Req: value = value to find * Return: index of the element */ function getArrayElement(sourceArray, value) { var index = 0; for (i = 0; i < sourceArray.length; i++) { if (sourceArray[i] == value) { index = i; } } return index; } /* * same as getArrayElement but for timeout release array */ function getRelaseArrayElement(sourceArray, value) { var index = 0; for (i = 0; i < sourceArray.length; i++) { if (sourceArray[i][0] == value) { index = i; } } return index; } /* * dynamic sort function to sort array by a property * Borrowed from Asdfghjkl28 */ function dynamicSort(property) { var sortOrder = 1; if (property[0] === "-") { sortOrder = -1; property = property.substr(1, property.length - 1); } var sortfunc = function (a, b) { if (typeof a[property] === "undefined") { if (typeof b[property] === "undefined") { // both undef return 0; } else { // b ok, a undef return -1; } } if (typeof b[property] === "undefined") { if (typeof a[property] === "undefined") { // both undef return 0; } else { // a ok, b undef return 1; } } var result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0; return result * sortOrder; }; return sortfunc; } /* * convert object to an array * Borrowed from Asdfghjkl28 */ function objectToArray(myObj) { var arr = []; for (var i in myObj) { if (myObj.hasOwnProperty(i)) { arr.push(myObj[i]); } } return arr; } /* * return an array with the indicated element removed * Req: sourceArray = array to be modified * Req: element = element to be removed * Return: the modified array */ function removeArrayElement(sourceArray,element) { sourceArray.splice(element, 1); return sourceArray; } /* * return boolean if user is in user array * Req: userArray = array of users to parse * Req: userName = name of user to parse fr * Returns: userFound = true or false */ function userInArray(userArray, username) { var userFound = false; username = username.toLowerCase(); if (userArray.length > 0) { for(i=0; i < userArray.length; i++) { if (userArray[i] == username) userFound = true; } } return userFound; } /* * return boolean if user is in user release array * Req: timeoutReleaseArray = array of users to parse * Req: username = name of user to parse fr * Returns: userFound = true or false */ function userInReleaseArray(userArray, username) { var userFound = false; username = username.toLowerCase(); if (userArray.length > 0) { for(i=0; i < userArray.length; i++) { if (userArray[i][0] == username) userFound = true; } } return userFound; } /* * return a string of usernames from an array of users * Req: userArray = array of users * Return: string of of usersnames */ function getUsers(userArray) { var userList = ""; for (i = 0; i < userArray.length; i++) { userList += userArray[i] + ' '; } return userList; } /* * return list of groups that a user is a member of * Req: username = username to find * Return: string with list of groups the user was found in */ function checkUser(username) { var groupList = ""; username = username.toLowerCase(); if (userInArray(familyUsersArray, username)) groupList += "Family "; if (userInArray(friendUsersArray, username)) groupList += "Friends "; if (userInArray(loverUsersArray, username)) groupList += "Lovers "; if (userInArray(husbandUsersArray, username)) groupList += "Husbands"; return groupList; } function notModel() { var output = '\n' + modelName + '! This bot was created for '; output += 'antonia_savatto_, you are not her! Please consider having your own '; output += 'bot created. Contact Antonia on her page https://chaturbate.com/antonia_savatto_/ or her instagram @calabaza_cutie\n'; return output; } function bBuenas() { var output = '\nBuenas buenas ' + modelName + '! '; output += 'Dime... Estas lista para comerte el mundo hoy?\n'; output += 'Entonces... Vamos con toda carajos! Si se puede!!!!\n'; return output; } function modWelcome() { var output = '\nGreetings Moderator...'; output += "Thank you for your hard work. Let's do our best today, too! :)\n"; return output; } /* * Builds user arrays and strings based on data provided by bot * config settings */ function loadSettings() { // grey graphics if (cb.settings.allowGreyEmotes == 'Yes') { allowGreyEmotes = true; } else { allowGreyEmotes = false; } // mod commands if (cb.settings.modCommands == 'Yes') { modCommands = true; } else { modCommands = false; } // greetings if (cb.settings.userGreets == 'Yes') { userGreets = true; } else { userGreets = false; } // gender emotes if (cb.settings.genderEmotes == 'Yes') { genderEmotes = true; } else { genderEmotes = false; } // load friends into array and other variables if (cb.settings.mMenu) { mMenu = cb.settings.mMenu.replace(new RegExp(">", "g"), '\n') } if (cb.settings.friendList) { tempStr = cb.settings.friendList.toLowerCase(); //make names all lowercase cb.settings.friendList = tempStr.trim(); // remove extra spaces friendUsersArray = cb.settings.friendList.split(' '); } if (cb.settings.friendTag) { friendTag = cb.settings.friendTag.trim(); } if (cb.settings.friendColor) { tempArray = cb.settings.friendColor.split(' '); friendColor = '#' + tempArray[1]; } // load family into array and other variables if (cb.settings.familyList) { tempStr = cb.settings.familyList.toLowerCase(); //make names all lowercase cb.settings.familyList = tempStr.trim(); // remove extra spaces familyUsersArray = cb.settings.familyList.split(' '); } if (cb.settings.familyTag) { familyTag = cb.settings.familyTag.trim(); } if (cb.settings.familyColor) { tempArray = cb.settings.familyColor.split(' '); familyColor = '#' + tempArray[1]; } // load lover into array and other variables if (cb.settings.loverList) { tempStr = cb.settings.loverList.toLowerCase(); //make names all lowercase cb.settings.loverList = tempStr.trim(); // remove extra spaces loverUsersArray = cb.settings.loverList.split(' '); } if (cb.settings.loverTag) { loverTag = cb.settings.loverTag.trim(); } if (cb.settings.loverColor) { tempArray = cb.settings.loverColor.split(' '); loverColor = '#' + tempArray[1]; } // load fiance into array and other variables if (cb.settings.fianceList) { tempStr = cb.settings.fianceList.toLowerCase(); //make names all lowercase cb.settings.fianceList = tempStr.trim(); // remove extra spaces fianceUsersArray = cb.settings.fianceList.split(' '); } if (cb.settings.fianceTag) { fianceTag = cb.settings.fianceTag.trim(); } if (cb.settings.fianceColor) { tempArray = cb.settings.fianceColor.split(' '); fianceColor = '#' + tempArray[1]; } // load husband into array and other variables if (cb.settings.husbandList) { tempStr = cb.settings.husbandList.toLowerCase(); //make names all lowercase cb.settings.husbandList = tempStr.trim(); // remove extra spaces husbandUsersArray = cb.settings.husbandList.split(' '); } if (cb.settings.husbandTag) { husbandTag = cb.settings.husbandTag.trim(); } if (cb.settings.husbandColor) { tempArray = cb.settings.husbandColor.split(' '); husbandColor = '#' + tempArray[1]; } // load notifications if (cb.settings.autoNotice1) { autoNotice1Text = cb.settings.autoNotice1.trim(); } if (cb.settings.autoNotice2) { autoNotice2Text = cb.settings.autoNotice2.trim(); } } function announceBot() { var divStr=""; var statusMsg = ""; divStr = makeDiv('*', 45, 45); statusMsg = divStr + '\nLOYAL FAMILY modified version by antonia_savatto_\n' + divStr + '\n'; statusMsg += 'Gender Emotes: '; if (genderEmotes) { statusMsg += 'On'; } else { statusMsg += 'Off'; } statusMsg += '\n'; statusMsg += 'Grey Emotes: '; if (allowGreyEmotes) { statusMsg += 'On'; } else { statusMsg += 'Off'; } statusMsg += '\n'; statusMsg += 'Mod Commands: '; if (modCommands) { statusMsg += 'On'; } else { statusMsg += 'Off'; } statusMsg += '\n'; statusMsg += 'User Greetings: '; if (userGreets) { statusMsg += 'On'; } else { statusMsg += 'Off'; } statusMsg += '\n'; statusMsg += 'Number of ' + friendTag + ':' + friendUsersArray.length + '\n'; statusMsg += 'Number of ' + familyTag + ':' + familyUsersArray.length + '\n'; statusMsg += 'Number of ' + loverTag + ':' + loverUsersArray.length + '\n'; statusMsg += 'Number of ' + husbandTag + ':' + husbandUsersArray.length + '\n'; statusMsg += divStr; return statusMsg; } loadSettings(); cb.sendNotice(announceBot(),'', botMsgBg,'','bold'); if (modelName !='antonia_savatto_') cb.sendNotice(notModel(),modelName,botAlertBg,'','bold'); if (modelName == 'antonia_savatto_') cb.sendNotice(bBuenas(),modelName,'#000000','#FFFF00','bold'); if (autoNotice1Text) cb.setTimeout(displayNotification1, cb.settings.autoNotice1Interval * 60000); if (autoNotice2Text) cb.setTimeout(displayNotification2, cb.settings.autoNotice2Interval * 60000); if (mMenu) cb.setTimeout(autoMenu, atMenuInterval * 60000); // start timeout release event cb.setTimeout(releaseTimeouts, timeoutReleaseInterval * 60000);
© Copyright Chaturbate 2011- 2024. All Rights Reserved.