Bots Home
|
Create an App
dfsfsfs
Author:
eberk123
Description
Source Code
Launch Bot
Current Users
Created by:
Eberk123
// Karen's Shut IT // Version: 1.0.0 // Mar 22, 2017 // // Modified by piglovesalmon from: // Shut IT (Modified) by Ransyd // // v1.0.0 // Removed sexual gif /* ********** * TO DO ********** -add ways to spend currency -add custom notification */ var greyChat = false; var wordsPrivate = []; var bUsr = []; var gSpecialUser = 'piglovesalmon' var gHideKarenDollars = true; var gMenuTipping = true; var sexualGifList = [ ":ahotassjackyposexoxo", ":analvirgin", ":assdrop3", ":assfinger2", ":assfuck000000", ":assfuck100", ":assfukk", ":asshole12", ":assholeopen", ":asslick1", ":asslickinggg", ":asssex", ":assslap888", ":assspank", ":asstoface", ":aynmarie-virginchair", ":cock-1", ":cock", ":cock", ":cockmonster", ":cocks002", ":cockslap", ":cockspring", ":cocksuckbest69", ":cocksuckbest71", ":cocksuckbest72", ":cocktease10", ":cocktease12", ":cocktease14", ":cocktease15", ":cocktease3", ":cocktease4", ":cocktease6", ":cocktease9", ":dick", ":dick21", ":dick888888", ":dickbigmemf1s33", ":dickhardx55", ":dickhardxx02", ":dickhead", ":dicklic2000", ":dicklick01-dsb", ":dicklick02-dsb", ":dicklicking_101", ":dickslap", ":dickslapyou", ":dicksmack", ":dicksurprise78", ":dicksurprise79", ":dicksurprise81", ":dicksurprise82", ":dong", ":dongfuck", ":donglong", ":exoticcutesexy", ":fingerass", ":fingerass3", ":fingerassmooncouple", ":fingering1a", ":fingering1b", ":fingering1c", ":fingering3", ":fingering4", ":fingering567", ":fingering6", ":fingerpuss", ":fingerpussy0", ":fingerpussy1", ":fingerthatbitch", ":fuck", ":fuckasdog", ":fuckass777", ":fuckassssw", ":fuckhard1", ":fuckhard33333", ":fuckhard4547oiuy", ":fuckmehard1", ":fuckmehard25", ":fuckmehard43", ":fuckpussy555", ":fuckpussy77lo", ":fuckpussy80", ":insert", ":insert01", ":insert03", ":insert04", ":insert05", ":insert333", ":inserting_cock", ":inserting_cock2", ":insertion1", ":insertion12", ":insertion123", ":pussy_1", ":pussy", ":pussyfuch7", ":pussyfuck0", ":pussyfuck2", ":pussyfuck222", ":pussylick-2", ":pussylick1a", ":pussylick1b", ":pussylick1c", ":pussylick1d", ":pussylick22", ":pussylickjer1", ":pussylickjer2", ":pussylips888", ":pussyspanks002a", ":pussyspanks005", ":saback1", ":sabj1", ":sastrapon1", ":sex", ":sexo01", ":sexo2014", ":sexo66777122", ":sexol", ":sexom", ":sexommg", ":sexsign", ":slap8", ":slapana", ":slapass1", ":slapass2", ":slapass3", ":slapass77", ":slapboingdick2", ":slapcock", ":slapcock0", ":slapcock7", ":slapface47", ":slappazzzz", ":slappussy", ":titsmassage", ":titsshow001", ":titsshow002", ":titsshow003", ":titsshow004", ":titsshow005", ":titsshow006", ":titsshow007", ":touch", ":touch333", ":touch4u", ":touchass", ":touchass3", ":touchassssss", ":touchback", ":touchboobs1", ":touchingbooobbs", ":touchnipples", ":touchnippless2", ":touchpussy", ":toucht", ":touchtouch", ":touchyou45", ":touchyouhot", ":mll" ]; var TIME_ONE_MINUTE = 60 * 1000; var CONFIG_ADVERT_MINUTES = 1 * TIME_ONE_MINUTE; // you need to populate this, refer to init() for more information var gAdvertInformation = new Array(); // NOTE: karen_keno has the same copy pasted array var gTipMenuContainer = [ {text:"PM", cost:"5"}, {text:"Smile", cost:"10"}, {text:"Flash Left Boob", cost:"45"}, {text:"Flash Right Boob", cost:"46"}, {text:"Flash Ass", cost:"50"}, {text:"Twerk Ass", cost:"89"}, {text:"Flash Boob", cost:"100"}, {text:"Boob Close Up", cost:"111"}, {text:"Flash Pussy", cost:"200"} ]; // NOTE: karen_keno has the same copy pasted array var gNudeMenuContainer = [ {text:"Bra off for 7 min", cost:"400"}, {text:"Stay Nude for 4 min", cost:"555"}, {text:"Panties off for 7 min", cost:"600"}, {text:"Nude for 10 min", cost:"1000"} ]; var gLovenseLevelContainer = [ {text:"Sweet Pleasure", cost:1}, {text:"Wet Level", cost:15}, {text:"Oh YES, I love this toy!", cost:100}, {text:"OMG! OMG!", cost:500}, {text:"Deep in my heart... and pussy!", cost:1000}, {text:"Wave Pattern", cost:101}, {text:"Square Pattern", cost:201} ]; var gUsingNudeMenu = false; var gUsingLovense = true; var gUsingSpecialLovenseLevel = false; var gTotalTippedAmount = 0; var playerStats = new Array(); var gNotificationFrequency = [ "Often", "Normal", "Rare", "None" ]; var gNotification = [ {text:"Lovense is on :lovenseactivated1", frequency:gNotificationFrequency[0]}, {text:":kisses69 =** glad to see you)look at my new sexy photos) :photos2 PVT-60 tk.GROUP SHOW-18 tk.KISSES=** LOVE YOU EVERYONE!!!", frequency:gNotificationFrequency[1]}, {text:":tipifyou :helloguysh :Karenfollow", frequency:gNotificationFrequency[1]}, {text:"", frequency:gNotificationFrequency[3]}, {text:"", frequency:gNotificationFrequency[3]}, {text:"", frequency:gNotificationFrequency[3]} ]; cb['settings_choices'] = [{ name: 'nudeMenu', type: 'choice', choice1: 'No', choice2: 'Yes', defaultValue: 'No', label: 'Use nude menu? (type !nudemenu to turn it on/off at run time)' }, { name: 'lovense', type: 'choice', choice1: 'No', choice2: 'Yes', defaultValue: 'Yes', label: 'Use lovense? (type !lovense to turn it on/off at run time)' }, { name: 'specialLovenseLevel', type: 'choice', choice1: 'No', choice2: 'Yes', defaultValue: 'No', label: 'Use special lovense level? (type !speciallovense to turn it on/off at run time)' }, { name: 'lovenseLevel1', type: 'int', defaultValue: gLovenseLevelContainer[0].cost, label: 'Lovense Level 1 Start Token' }, { name: 'lovenseText1', type: 'str', defaultValue: gLovenseLevelContainer[0].text, label: 'Lovense Level 1 Description' }, { name: 'lovenseLevel2', type: 'int', defaultValue: gLovenseLevelContainer[1].cost, label: 'Lovense Level 2 Start Token' }, { name: 'lovenseText2', type: 'str', defaultValue: gLovenseLevelContainer[1].text, label: 'Lovense Level 2 Description' }, { name: 'lovenseLevel3', type: 'int', defaultValue: gLovenseLevelContainer[2].cost, label: 'Lovense Level 3 Start Token' }, { name: 'lovenseText3', type: 'str', defaultValue: gLovenseLevelContainer[2].text, label: 'Lovense Level 3 Description' }, { name: 'lovenseLevel4', type: 'int', defaultValue: gLovenseLevelContainer[3].cost, label: 'Lovense Level 4 Start Token' }, { name: 'lovenseText4', type: 'str', defaultValue: gLovenseLevelContainer[3].text, label: 'Lovense Level 4 Description' }, { name: 'lovenseLevel5', type: 'int', defaultValue: gLovenseLevelContainer[4].cost, label: 'Lovense Level 5 Start Token' }, { name: 'lovenseText5', type: 'str', defaultValue: gLovenseLevelContainer[4].text, label: 'Lovense Level 5 Description' }, { name: 'specialLovense1', type: 'int', defaultValue: gLovenseLevelContainer[5].cost, label: 'Special Lovense 1 Cost' }, { name: 'specialLovenseText1', type: 'str', defaultValue: gLovenseLevelContainer[5].text, label: 'Special Lovense 1 Description' }, { name: 'specialLovense2', type: 'int', defaultValue: gLovenseLevelContainer[6].cost, label: 'Special Lovense 2 Cost' }, { name: 'specialLovenseText2', type: 'str', defaultValue: gLovenseLevelContainer[6].text, label: 'Special Lovense 2 Description' }, { name: 'privateWords', type: 'str', minLength: 0, maxLength: 4000, label: 'Private Word List (No Spaces & Comma Separated)', defaultValue: 'hack,slut,cunt,hor,whore,firstname,lastname,housenumber,street,phone,city,state,zip' }]; var gLovenseThankYouMessage1 = [ ]; var gLovenseThankYouMessage2 = [ {text:"Thank you for give me more pleasure, I love it!!", color:"#FF00FF"}, {text:"Thank you sweetheart, I love it!!", color:"#FF00FF"}, {text:"I love the vibrations, thank you!!", color:"#FF00FF"}, {text:"Thank you!! :heart2", color:"#FF00FF"}, ]; var gLovenseThankYouMessage3 = [ {text:"Oh YES, You know how to make me moan, thank you!!", color:"#0101DF"} ]; var gLovenseThankYouMessage4 = [ {text:"OMG! OMG! OMG! Don't stop please", color:"#FF0000"} ]; var gLovenseThankYouMessage5 = [ {text:"Yeeeeeeeeeah!!!!!! , This is true love, thank you so much my love!!!", color:"#8904B1"} ]; var gLovenseThankYouMessageContainer = [ gLovenseThankYouMessage1, gLovenseThankYouMessage2, gLovenseThankYouMessage3, gLovenseThankYouMessage4, gLovenseThankYouMessage5, gLovenseThankYouMessage3, gLovenseThankYouMessage3 ]; /* Notification */ for (i = 0; i < gNotification.length; ++i) { goalIndex = i + 1; cb.settings_choices.push({ name: 'notice' + i, label: 'Notification #' + goalIndex, type: 'str', minLength: 0, maxLength: 500, required: false, defaultValue: gNotification[i].text }); cb.settings_choices.push({ name: 'noticeFrequency' + i, label: 'Notification Frequency #' + goalIndex + ' (set to None if you dont want it shown, or just leave the text as a empty string)', type: 'choice', choice1: 'Often', choice2: 'Normal', choice3: 'Rare', choice4: 'None', required: true, defaultValue: gNotification[i].frequency }); } // need to display the level and cost for each level and description for it // each time they tip for it, thanks them for it, there should be random thanks // option for special level (default 101 and 201 token) // option for random level (default 51 token) cb.onTip(function (tip) { var currentTip = tip['amount']; gTotalTippedAmount += currentTip; handleVirtualCurrencyTipping(tip['from_user'], currentTip, tip['from_user_in_fanclub'] || tip['from_user_is_mod']); // everytime someone tip, we are probably gonna be spamming notices, so increment message count too IncrementAdvertMessagesCount(); if(gMenuTipping) { // first check if it's inside our menu list var text = getTextFromCost(currentTip, gTipMenuContainer); // if nth can be found, check nude menu, but only check it if nude menu is activated if(gUsingNudeMenu && (text == null || text == '')) { text = getTextFromCost(currentTip, gNudeMenuContainer); } // only display notification if there's a valid tip menu if(text != null && text != '') { // if it's part of the menu, display the appropriate text cb.sendNotice(tip['from_user'] + ' tipped for ' + text, '', '#FFFFFF', '#FF0000', 'bold'); } } if(gUsingLovense) { var foundLevel = false; if(!foundLevel) { if(gUsingSpecialLovenseLevel) { if(currentTip == gLovenseLevelContainer[5].cost) { cb.sendNotice(tip['from_user'] +' tipped for ' + gLovenseLevelContainer[5].text + ' vibration', '', '#FFFFFF', '#8E44AD', 'bold'); foundLevel = true; SendRandomLovenseThanks(5, tip['from_user']); } else if(currentTip == gLovenseLevelContainer[6].cost) { cb.sendNotice(tip['from_user'] + ' tipped for ' + gLovenseLevelContainer[6].text + ' vibration', '', '#FFFFFF', '#8E44AD', 'bold'); foundLevel = true; SendRandomLovenseThanks(6, tip['from_user']); } } } if(!foundLevel) { for(var i = 4; i >= 0; --i) { if(currentTip >= gLovenseLevelContainer[i].cost) { cb.sendNotice(tip['from_user'] + ' tipped for level ' + (i + 1) + ' vibration', '', '#FFFFFF', '#8E44AD', 'bold'); foundLevel = true; SendRandomLovenseThanks(i, tip['from_user']); break; } } } } }); function SendRandomLovenseThanks(index, user) { // ensure index within limit if(index < gLovenseThankYouMessageContainer.length && gLovenseThankYouMessageContainer[index].length != 0) { // random among the possible thanks message, if there's only one we just use one at all times, if none then no thank you message, it's generic and doesnt care about anything var randomIndex = Math.round(Math.random() * (gLovenseThankYouMessageContainer[index].length - 1)); cb.sendNotice(gLovenseThankYouMessageContainer[index][randomIndex].text, user, '#FFFFFF', gLovenseThankYouMessageContainer[index][randomIndex].color, 'bold'); } } cb['onMessage'](function(msg) { var blockedUsers = ''; var user = msg['user']; var msgString = msg['m'].toLowerCase(); var isHost = (cb.room_slug == user) || (user == gSpecialUser); // gSpecialUser is treated as host too var isMod = msg['is_mod']; var isFan = msg['in_fanclub']; var isViewer = (!isHost && !isMod); var isGrey = (!msg['has_tokens']); // prevent grey from chatting?? i dont think karen wants this if (!greyChat && isGrey && !isMod && !isFan && !isHost) { msg['X-Spam'] = true; return msg }; // prevent blocked user from chatting if (IsBlockedUser(user)) { cb['sendNotice']('You have been blocked from chatting.', user, '#FFFF00', '#0000FF', 'bold'); msg['X-Spam'] = true; return msg }; // prevent any command from being shown // NOTE: !wallet is special, we ignore it cause we want other user to know you can type it if (msgString[0] == '!') { msg['X-Spam'] = true }; if (msgString == '/help' || (msgString == '/h')) { var notices = '******************************************************\x0A'; notices += '**Commands that start with ! are hidden.\x0A'; notices += '**Commands that start with / are shown to public\x0A'; notices += '******************************************************\x0A'; // shown to everyone, this are public command notices += '/wallet - Show current KarenDollars\x0A'; // mod or host command if (isMod || isHost) { notices += '!tipmenu - Broadcast tip menu to everyone\x0A'; notices += '!lovensemenu - Broadcast lovense menu\x0A'; notices += '!block <user> - Block the User.\x0A'; notices += '!unblock <user> - Unblock the user.\x0A'; notices += '!su or !showusers - Display blocked users.\x0A'; } // host command if (isHost) { notices += '!showallwallet and !saw - Show everyones wallet\x0A'; notices += '!hidekarendollars - Hide the display text of user gaining KarenDollars\x0A'; notices += '!status - Show ShutIt status\x0A'; notices += '!nudemenu - Toggle nude menu\x0A'; notices += '!lovense - Toggle lovense\x0A'; notices += '!speciallovense - Toggle special lovense\x0A'; notices += '!randomlovense - Toggle random lovense\x0A'; notices += '!addprivate <word> - Add a word to private list\x0A'; notices += '!removeprivate <word> - Remove a word from private list\x0A'; notices += '!addgif <word> - Add a gif to removal list.\x0A'; notices += '!removegif <word> - Remove a gif from removal list. \x0A'; notices += '!listprivate - Shows Broadcaster only the private word list.\x0A'; notices += '!togglemenu - Toggle tipping menu.\x0A'; } cb['sendNotice'](notices, user); }; // public commands if(msgString == '/wallet') { if((user in playerStats) && playerStats[user].virtualWallet != 0) { cb['sendNotice']('You have ' + playerStats[user].virtualWallet + ' KarenDollars (Beta feature, you cant do anything with it right now)', user, '#FFFF00', '#0000FF', 'bold'); } else if(user == cb.room_slug) { cb['sendNotice']('You owe me a date, no KarenDollars for you :ppp (Jokes aside, I am still testing it, yet to add anyway to spend the KarenDollars)', user, '#FFFF00', '#0000FF', 'bold'); } else { cb['sendNotice']('Tip any amount to get KarenDollars', user, '#FFFF00', '#0000FF', 'bold'); } } // text filtering if (isViewer) { if (CheckBannedWords(msgString)) { // redirect the msg to piglovesalmon, i need it for debugging cb['sendNotice']('Original text that was filtered from ' + user + ': ' + msg['m'], gSpecialUser, '#FFFF00', '#0000FF', 'bold'); msg['m'] = 'Gamarjoba!!!' }; }; // host command if (isHost) { // add private word if (msgString['substring'](0, 12) == '!addprivate ') { wordsPrivate['push'](msgString['substring'](12)); cb['sendNotice']('Private word ' + msgString['substring'](12) + ' added by ' + user, cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Private word ' + msgString['substring'](12) + ' added by ' + user, gSpecialUser, '#FFFF00', '#0000FF', 'bold'); }; // remove private word if (msgString['substring'](0, 15) == '!removeprivate ') { var wordIsRemoved = false; var wordToRemove = msgString['substring'](15); for(var i = 0; i < wordsPrivate.length; ++i) { if(wordsPrivate[i] == wordToRemove) { wordIsRemoved = true; wordsPrivate.splice(i, 1); } } if(wordIsRemoved) { cb['sendNotice']('Private word [' + wordToRemove + '] removed by ' + user, cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Private word [' + wordToRemove + '] removed by ' + user, gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } else { cb['sendNotice']('Failed to remove private word [' + wordToRemove + '] attempted by ' + user, cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Failed to remove private word [' + wordToRemove + '] attempted by ' + user, gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } }; // add sexual gif if (msgString['substring'](0, 8) == '!addgif ') { sexualGifList['push'](msgString['substring'](12)); cb['sendNotice']('Sexual gif ' + msgString['substring'](8) + ' added by ' + user, cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Sexual gif ' + msgString['substring'](8) + ' added by ' + user, gSpecialUser, '#FFFF00', '#0000FF', 'bold'); }; // remove sexual gif if (msgString['substring'](0, 11) == '!removegif ') { var wordIsRemoved = false; var wordToRemove = msgString['substring'](11); for(var i = 0; i < sexualGifList.length; ++i) { if(sexualGifList[i] == wordToRemove) { wordIsRemoved = true; sexualGifList.splice(i, 1); } } if(wordIsRemoved) { cb['sendNotice']('Sexual gif [' + wordToRemove + '] removed by ' + user, cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Sexual gif [' + wordToRemove + '] removed by ' + user, gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } else { cb['sendNotice']('Failed to remove sexual gif [' + wordToRemove + '] attempted by ' + user, cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Failed to remove sexual gif [' + wordToRemove + '] attempted by ' + user, gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } }; if (msgString === '!status') { cb['sendNotice'](getStatusText(), user, '#FFFF00', '#0000FF', 'bold'); }; if (msgString === '!nudemenu') { gUsingNudeMenu = !gUsingNudeMenu; cb['sendNotice']('Use nude menu: ' + (gUsingNudeMenu? 'Yes': 'No'), cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Use nude menu: ' + (gUsingNudeMenu? 'Yes': 'No'), gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } if (msgString === '!lovense') { gUsingLovense = !gUsingLovense; cb['sendNotice']('Use lovense: ' + (gUsingLovense? 'Yes': 'No'), cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Use lovense: ' + (gUsingLovense? 'Yes': 'No'), gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } if (msgString === '!speciallovense') { gUsingSpecialLovenseLevel = !gUsingSpecialLovenseLevel; cb['sendNotice']('Use special lovense level: ' + (gUsingSpecialLovenseLevel? 'Yes': 'No'), cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Use special lovense level: ' + (gUsingSpecialLovenseLevel? 'Yes': 'No'), gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } if(msgString === '!togglemenu') { gMenuTipping = !gMenuTipping; cb['sendNotice']('Use tipping menu: ' + (gMenuTipping? 'Yes': 'No'), cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Use tipping menu: ' + (gMenuTipping? 'Yes': 'No'), gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } if (msgString === '!listprivate') { ShowWords(wordsPrivate, user); }; if (msgString === '!hidekarendollars') { gHideKarenDollars = !gHideKarenDollars; cb['sendNotice']('Hide KarenDollars: ' + (gHideKarenDollars ? 'Yes' : 'No'), cb['room_slug'], '#FFFF00', '#0000FF', 'bold'); cb['sendNotice']('Hide KarenDollars: ' + (gHideKarenDollars ? 'Yes' : 'No'), gSpecialUser, '#FFFF00', '#0000FF', 'bold'); } if (msgString === '!showallwallet' || msgString === '!saw') { var walletText = '****** Current Wallet Statistic*******\x0A'; for (var key in playerStats) { if (playerStats.hasOwnProperty(key)) { // TODO fix this shit it should be just one notification walletText += '**' + key + ' has ' + playerStats[key].virtualWallet + ' KarenDollars\x0A'; } } cb['sendNotice'](walletText, user, '#FFFF00', '#0000FF', 'bold'); } }; if (isHost || isMod) { if ((msgString['substring'](0, 6) == '!block')) { var userToBlock = msgString['substring'](7); // ensure we don't block ourself... if(userToBlock != cb['room_slug'] && userToBlock != gSpecialUser) { bUsr['push'](msgString['substring'](7)); cb['sendNotice']('User: ' + msgString['substring'](7) + ' has been blocked by ' + user, '', '#FFFF00', '#0000FF', 'bold'); } }; if (msgString['substring'](0, 8) == '!unblock') { bUsr['removeItem'](msgString['substring'](9)); cb['sendNotice']('User: ' + msgString['substring'](9) + ' has been unblocked.', '', '#FFFF00', '#0000FF', 'bold'); }; if (msgString === '!showusers' || msgString === '!showuser' || msgString === '!su') { if (bUsr['length'] > 0) { blockedUsers += '[Blocked Users]:'; blockedUsers += readList(bUsr); } else { blockedUsers += '[Blocked Users]: No users blocked'; } cb['sendNotice'](blockedUsers, user, '#FFFF00', '#0000FF', 'bold'); } if (msgString === '!tipmenu') { cb['sendNotice'](getTipMenuText(), '', '#FFFFFF', '#FF0000', 'bold'); } if (msgString === '!lovensemenu') { cb['sendNotice'](getLovenseText(), '', "#FADBD8", "#000000", 'bold'); } if(msgString === '!tokenstat') { msg['X-Spam'] = true; // we want to hide this command from showing up var text = 'Total Token Earned Today: ' + gTotalTipToday + ' Tokens (Doesnt include private/group show tokens)'; cb['sendNotice'](text, 'roomHost', '#FFFFFF', '#FF0000', 'bold'); } }; // if it's a valid message, increment the counter if(msg['m'] && msg['m'] != '') { IncrementAdvertMessagesCount(); } return msg; }); function IncrementAdvertMessagesCount() { // everytime we see a message, increment everyone's message count for (var key in gAdvertInformation) { if (gAdvertInformation.hasOwnProperty(key)) { ++gAdvertInformation[key].currentMsgCount; } } } function notify(message, userGroup, backgroundColor, textColor, w) { if (backgroundColor == null) { backgroundColor = '#FFF'; } if (textColor == null) { textColor = '#000'; } if (w == null) { w = 'bold'; // leave at '' for normal } if (userGroup == 'onlyMods') { cb.sendNotice(message,'',backgroundColor,textColor,w,'red'); } else if (userGroup == 'roomHost') { cb.sendNotice(message,roomHost,backgroundColor,textColor,w); } else if (userGroup == 'modsAndHost') { cb.sendNotice(message,'',backgroundColor,textColor,w,'red'); cb.sendNotice(message,roomHost,backgroundColor,textColor,w); } else if (userGroup == null) { cb.sendNotice(message,'',backgroundColor,textColor,w); } else { cb.sendNotice(message,userGroup,backgroundColor,textColor,w); } } function IsBlockedUser(usr) { return (bUsr['contains'](usr)); } function CheckNormalString(inputString) { var remainAlpha = []; var stringArray = inputString['split'](' '); // Turn string into array at word boundaries if(wordsPrivate != null && wordsPrivate.length != 0) { for(var j = 0; j < stringArray.length; ++j) { for(var i = 0; i < wordsPrivate.length; ++i) { if(stringArray[j] == wordsPrivate[i]) { return true; } } } } if(sexualGifList != null && sexualGifList.length != 0) { for(var j = 0; j < stringArray.length; ++j) { // quick check cause all gif has ':' if it doesnt appear, no reason to continue searching if(stringArray[j][0] == ':') { for(var i = 0; i < sexualGifList.length; ++i) { if(stringArray[j] == sexualGifList[i]) { return true; } } } } } return false; } function CheckBannedWords(inputString) { if(CheckNormalString(inputString)) { return true; } } function reduce(inputString, inputList) { inputList = new RegExp(inputList['join']('|\\b')['toLowerCase']()); for (var remainingWords = [], i = inputString['length']; i--;) { inputList['test'](inputString[i]['toLowerCase']()) && remainingWords['unshift'](inputString[i]['toLowerCase']()) }; return remainingWords } function ShowWords(wordList, usr) { if(wordList != null) { var notice = ''; var toUser = ''; notice = readList(wordList); if (usr == null || usr == undefined || usr['length'] == 0) { toUser = '' } else { toUser = usr }; cb['sendNotice'](notice, toUser, '#FFFF00', '#0000FF', 'bold') } } function readList(list) { var temp = ''; for (var i = 0; i < list['length']; i++) { if (temp['length'] > 0) { temp += ',' }; temp += list[i] }; return temp } function LoadSettings() { greyChat = false; gUsingNudeMenu = (cb['settings']['nudeMenu'] == 'Yes'); gUsingLovense = (cb['settings']['lovense'] == 'Yes'); gUsingSpecialLovenseLevel = (cb['settings']['specialLovenseLevel'] == 'Yes'); // reading back user setting and setting up our final lovense cost and description for(var i = 0; i < 5; ++i) { gLovenseLevelContainer[i].cost = cb['settings'][('lovenseLevel' + (i + 1))]; gLovenseLevelContainer[i].text = cb['settings'][('lovenseText' + (i + 1))]; } gLovenseLevelContainer[5].cost = cb['settings']['specialLovense1']; gLovenseLevelContainer[5].text = cb['settings']['specialLovenseText1']; gLovenseLevelContainer[6].cost = cb['settings']['specialLovense2']; gLovenseLevelContainer[6].text = cb['settings']['specialLovenseText2']; LoadArrays(cb['settings']['privateWords'], wordsPrivate); } function LoadArrays(inputSettings, outputArray) { var temp1; var temp2; var temp3; temp1 = inputSettings; temp2 = temp1 ? temp1['split'](',') : ''; for (var i = 0; i <= temp2['length']; ++i) { temp3 = ''; if (temp2[i] != null) { temp3 = temp2[i]['replace'](/ +$/, ''); if (temp3['length'] > 0) { outputArray['push'](temp3) } } } } // Checks if setting is empty/not set -- from Bomb Bot Ultra ------------------- function isBlank(cbsetting) { var s; if (cbsetting) { s = cbsetting.trim(); } if (s == null || s == '' || s.substr(0, 9) == '[Optional') { return true; } else { return false; } } function getStatusText() { var notice = 'Allow greys to chat: ' + (greyChat ? 'Yes' : 'No'); notice += '\x0AUse nude menu: ' + (gUsingNudeMenu ? 'Yes' : 'No'); notice += '\x0AUse lovense menu: ' + (gUsingLovense ? 'Yes' : 'No'); notice += '\x0AUse special lovense level: ' + (gUsingSpecialLovenseLevel ? 'Yes' : 'No'); return notice; } function getLovenseText() { var notice = ''; if(gUsingLovense) { notice += ':lush99 Lush IS A SOUND SENSITIVE VIBRATOR THAT IS SET TO REACT TO YOUR TIPS. THERE ARE FIVE LEVELS OF INTENSITY\x0A'; for(var i = 0; i < 5; ++i) { var range = '+'; if(i != 4) { range = gLovenseLevelContainer[i].cost + '-' + (gLovenseLevelContainer[i + 1].cost - 1); } else { range = gLovenseLevelContainer[i].cost + '+'; } notice += 'Level ' + (i + 1) + ' - Tip (' + range + ') ' + gLovenseLevelContainer[i].text + '\x0A'; } if(gUsingSpecialLovenseLevel) { notice += '\x0ASpecial Level: \x0A'; notice += 'Tip (' + gLovenseLevelContainer[5].cost + ' Token) ' + gLovenseLevelContainer[5].text + '\x0A'; notice += 'Tip (' + gLovenseLevelContainer[6].cost + ' Token) ' + gLovenseLevelContainer[6].text + '\x0A'; } } return notice; } // recurring advertisement on our current tip menu function getTipMenuText() { // tip menu! var finalMessage = "Tip Menu: "; if(gMenuTipping) { if (gTipMenuContainer != null) { for (var i = 0; i < gTipMenuContainer.length; i++) { finalMessage += gTipMenuContainer[i].text + '(' + gTipMenuContainer[i].cost + ')' + ' :pixelheart '; } } // only used if nude menu is turned on if(gUsingNudeMenu) { if (gNudeMenuContainer != null) { for (var i = 0; i < gNudeMenuContainer.length; i++) { finalMessage += gNudeMenuContainer[i].text + '(' + gNudeMenuContainer[i].cost + ')' + ' :pixelheart '; } } } } return finalMessage; } // note: only usable for array of pair with text and cost function getTextFromCost(cost, arrayPair) { if(arrayPair) { for(var i = 0; i < arrayPair.length; ++i) { if(arrayPair[i].cost == cost) { return arrayPair[i].text; } } } return ''; } // this function handles the notification firing mechanism, all you have to pass in are the information on what to show (if it fires) // and the function name, cause the rest of them are handled automatically function handleAdvertFiring(text, userGroup, backgroundColor, foregroundColor, textEffect, functionName) { // nothing to show, no reason to do anything if(text == null || text == '') { return; } // if there's a need to fire it, fire it! if(gAdvertInformation[functionName].currentMsgCount >= gAdvertInformation[functionName].minMsgCount || gAdvertInformation[functionName].missedFireCount >= gAdvertInformation[functionName].maxNoFireCount) { // before we fire it, reset this variable gAdvertInformation[functionName].currentMsgCount = 0; gAdvertInformation[functionName].missedFireCount = 0; notify(text, userGroup, backgroundColor, foregroundColor, textEffect); } else { // since we didnt fire this time round, increment the counter ++gAdvertInformation[functionName].missedFireCount; } // either way we schedule the timer for firing again cb.setTimeout(functionName, gAdvertInformation[functionName].periodicTimer) } // recurring advertisement on our current tip menu function advertTipMenu() { handleAdvertFiring(getTipMenuText(), null, '#FFFFFF', '#FF0000', 'bold', advertTipMenu); } // recurring advertisement for our lovense menu function advertLovenseMenu() { handleAdvertFiring(getLovenseText(), null, "#FADBD8", "#000000", 'bold', advertLovenseMenu); } // cbf just hardcoding it function advertNotification0() { // if not supposed to show it, use a empty text instead // we need to keep the timer on though, since if its off and user decide to change it at run time // the notification won't be fired var text = (gNotification[0].frequency == gNotificationFrequency[3])? '': gNotification[0].text; handleAdvertFiring(text, null, '#CCEEFF', '#CC0000', 'bold', advertNotification0); } function advertNotification1() { // if not supposed to show it, use a empty text instead // we need to keep the timer on though, since if its off and user decide to change it at run time // the notification won't be fired var text = (gNotification[1].frequency == gNotificationFrequency[3])? '': gNotification[1].text; handleAdvertFiring(text, null, '#CCEEFF', '#CC0000', 'bold', advertNotification1); } function advertNotification2() { // if not supposed to show it, use a empty text instead // we need to keep the timer on though, since if its off and user decide to change it at run time // the notification won't be fired var text = (gNotification[2].frequency == gNotificationFrequency[3])? '': gNotification[2].text; handleAdvertFiring(text, null, '#CCEEFF', '#CC0000', 'bold', advertNotification2); } function advertNotification3() { // if not supposed to show it, use a empty text instead // we need to keep the timer on though, since if its off and user decide to change it at run time // the notification won't be fired var text = (gNotification[3].frequency == gNotificationFrequency[3])? '': gNotification[3].text; handleAdvertFiring(text, null, '#CCEEFF', '#CC0000', 'bold', advertNotification3); } function advertNotification4() { // if not supposed to show it, use a empty text instead // we need to keep the timer on though, since if its off and user decide to change it at run time // the notification won't be fired var text = (gNotification[4].frequency == gNotificationFrequency[3])? '': gNotification[4].text; handleAdvertFiring(text, null, '#CCEEFF', '#CC0000', 'bold', advertNotification4); } function advertNotification5() { // if not supposed to show it, use a empty text instead // we need to keep the timer on though, since if its off and user decide to change it at run time // the notification won't be fired var text = (gNotification[5].frequency == gNotificationFrequency[3])? '': gNotification[5].text; handleAdvertFiring(text, null, '#CCEEFF', '#CC0000', 'bold', advertNotification5); } function handleVirtualCurrencyTipping(user, tipAmount, isFanOrMod) { var initialGainedDollars = tipAmount * 5; var totalGainedDollars = initialGainedDollars; var bonusGainText = new Array(); bonusGainText.push('(+' + initialGainedDollars + ' KarenDollars, For Tipping, token * 5)'); // first tip of the day bonus (to encourage big first tip) if (!(user in playerStats)) { totalGainedDollars += initialGainedDollars; bonusGainText.push('(+' + initialGainedDollars + ' KarenDollars, First tip of the day bonus +100%)'); playerStats[user] = { totaltips: tipAmount, virtualWallet: 0 } } // fan/mod bonus (to encourage ppl joining fan) if(isFanOrMod) { totalGainedDollars += initialGainedDollars; bonusGainText.push('(+' + initialGainedDollars + ' KarenDollars, Fan/Mod bonus +100%)'); } // for now a quick and dirty way to hide it if(!gHideKarenDollars) { var totalGainText = '+' + totalGainedDollars + ' KarenDollars for ' + user + ' '; for(var i = 0; i < bonusGainText.length; ++i) { totalGainText += bonusGainText[i]; } cb.sendNotice(totalGainText, '', '#FFFFFF', '#DAA520', 'bold'); } playerStats[user].virtualWallet += totalGainedDollars; } function getNotificationFireCount(index) { // often if(gNotification[index].frequency == gNotificationFrequency[0]) { return 3; } // normal else if(gNotification[index].frequency == gNotificationFrequency[1]) { return 5; } // rare else if(gNotification[index].frequency == gNotificationFrequency[2]) { return 7; } // none else if(gNotification[index].frequency == gNotificationFrequency[3]) { return 1; // NOTE: it will be blocked inside the advert code itself } else { notify('Unrecognized frequency type', 'roomHost', "#FFFFFF", "#FF0000", ""); } } function init() { cb['sendNotice']('-----------------------------------------\x0A--- karen_lv Shut IT by piglovesalmon v1.1 \x0A -certain keyword are filtered\x0A -sexual gif are filtered \x0A-----------------------------------------'); LoadSettings(); cb['sendNotice'](getStatusText(), cb.room_slug, '#FFFF00', '#0000FF', 'bold') cb['sendNotice'](getStatusText(), gSpecialUser, '#FFFF00', '#0000FF', 'bold') // initialize our required information for notification // it's given in a key value pair where key refers to the function to trigger the notification // intialTimer refers to the initial timer before it's fired // periodicTimer refers to the periodic timer after the first firing // minMsgCount refers to the minimum number of messages before the message can fire (this prevent us from spamming the room when no one is typing) // maxNoFireCount refers to the max number of time we can avoid firing the notification before we will force it to fire gAdvertInformation[advertTipMenu] = { initialTimer: 0.2 * CONFIG_ADVERT_MINUTES, periodicTimer: CONFIG_ADVERT_MINUTES, minMsgCount: 5, maxNoFireCount: 4 }; gAdvertInformation[advertLovenseMenu] = { initialTimer: 0.0 * CONFIG_ADVERT_MINUTES, periodicTimer: CONFIG_ADVERT_MINUTES, minMsgCount: 10, maxNoFireCount: 10 }; gAdvertInformation[advertNotification0] = { initialTimer: 0.0 * CONFIG_ADVERT_MINUTES, periodicTimer: CONFIG_ADVERT_MINUTES, minMsgCount: 10, maxNoFireCount: getNotificationFireCount(0) }; gAdvertInformation[advertNotification1] = { initialTimer: 0.1 * CONFIG_ADVERT_MINUTES, periodicTimer: CONFIG_ADVERT_MINUTES, minMsgCount: 10, maxNoFireCount: getNotificationFireCount(1) }; gAdvertInformation[advertNotification2] = { initialTimer: 0.2 * CONFIG_ADVERT_MINUTES, periodicTimer: CONFIG_ADVERT_MINUTES, minMsgCount: 10, maxNoFireCount: getNotificationFireCount(2) }; gAdvertInformation[advertNotification3] = { initialTimer: 0.3 * CONFIG_ADVERT_MINUTES, periodicTimer: CONFIG_ADVERT_MINUTES, minMsgCount: 10, maxNoFireCount: getNotificationFireCount(3) }; gAdvertInformation[advertNotification4] = { initialTimer: 0.4 * CONFIG_ADVERT_MINUTES, periodicTimer: CONFIG_ADVERT_MINUTES, minMsgCount: 10, maxNoFireCount: getNotificationFireCount(4) }; gAdvertInformation[advertNotification5] = { initialTimer: 0.5 * CONFIG_ADVERT_MINUTES, periodicTimer: CONFIG_ADVERT_MINUTES, minMsgCount: 10, maxNoFireCount: getNotificationFireCount(5) }; // automatically initialize those required variable, this is basically constructor in normal c++ classes for (var key in gAdvertInformation) { if (gAdvertInformation.hasOwnProperty(key)) { gAdvertInformation[key].currentMsgCount = 0; // number of msg we have seen since we last fire it gAdvertInformation[key].missedFireCount = gAdvertInformation[key].maxNoFireCount; // number of time we skipped firing the messages (set to max to ensure it's fired) } } // start our periodic timer cb.setTimeout(advertTipMenu, gAdvertInformation[advertTipMenu].initialTimer); cb.setTimeout(advertLovenseMenu, gAdvertInformation[advertLovenseMenu].initialTimer); cb.setTimeout(advertNotification0, gAdvertInformation[advertNotification0].initialTimer); cb.setTimeout(advertNotification1, gAdvertInformation[advertNotification1].initialTimer); cb.setTimeout(advertNotification2, gAdvertInformation[advertNotification2].initialTimer); cb.setTimeout(advertNotification3, gAdvertInformation[advertNotification3].initialTimer); cb.setTimeout(advertNotification4, gAdvertInformation[advertNotification4].initialTimer); cb.setTimeout(advertNotification5, gAdvertInformation[advertNotification5].initialTimer); } String['prototype']['trim'] = function() { return this['replace'](/^\s+|\s+$/g, '') }; Array['prototype']['contains'] = function(element) { var i = this['length']; while (i--) { if (this[i] === element) { return true } }; return false }; Array['prototype']['removeItem'] = function(key) { for (i = 0; i < this['length']; i++) { if (this[i] == key) { for (i2 = i; i2 < this['length'] - 1; i2++) { this[i2] = this[i2 + 1] }; this['length'] = this['length'] - 1; return } } }; init()
© Copyright Chaturbate 2011- 2024. All Rights Reserved.