Bots Home
|
Create an App
sdfsdf
Author:
eberk321
Description
Source Code
Launch Bot
Current Users
Created by:
Eberk321
// Karen's Shut IT // Version: 1.0.0 // Mar 22, 2017 // // Modified by eberk321 from: // Shut IT (Modified) by Ransyd // // v1.0.0 // Removed sexual gif /* ********** * TO DO ********** -add ways to spend currency -add custom notification */ var gAllowGreyChat = true; var wordsPrivate = []; var bUsr = []; var gSpecialGroup = [ "raccoonpig", "lexluther8910", "tumor", "bobodeluxe" ]; var gHideKarenDollars = true; var gMenuTipping = true; var gTotalTipToday = 0; var EMOTE_STAR = ' :star_olivia_dellvine '; var EMOTE_STARS = EMOTE_STAR + EMOTE_STAR + EMOTE_STAR; // lottery var gLotteryCost = 1; // cost of each lottery ticket var gLotteryTime = 600; // how long before lottery is drawn (seconds) var gLotteryTimeLeft = 0; // current time left for lottery (seconds) var gLotteryPrize = 'Flash Boob'; // current lottery prize var gLotteryTicketCount = 100; // maximum number of ticket to be sold var gLotteryTicketHolder = new Array(); // holds an array of all lottery ticket holder (reset each round) var gIsLotteryMode = false; // indicate if we are in lottery mode 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", ":blow", ":lickit" ]; var TIME_ONE_SECOND = 1000; var TIME_ONE_MINUTE = 60 * TIME_ONE_SECOND; var CONFIG_ADVERT_MINUTES = 1 * TIME_ONE_MINUTE; // you need to populate this, refer to init() for more information var gAdvertInformation = new Array(); var gTipMenuContainer = [ {text:"PM", cost:"5"}, {text:"Smile", cost:"10"}, {text:"c2c 5 min", cost:"35"}, {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"} ]; 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:"Hello my dear guys!!! :kisses i miss u everyone!!!Very nice again to meet you! Let's try to remember everything that was here before :hug", frequency:gNotificationFrequency[1], oldFrequency:gNotificationFrequency[3]}, {text:":ssfoll", frequency:gNotificationFrequency[1], oldFrequency:gNotificationFrequency[3]}, {text:"", frequency:gNotificationFrequency[3], oldFrequency:gNotificationFrequency[3]}, {text:"", frequency:gNotificationFrequency[3], oldFrequency:gNotificationFrequency[3]}, {text:"", frequency:gNotificationFrequency[3], oldFrequency:gNotificationFrequency[3]}, {text:"", frequency:gNotificationFrequency[3], oldFrequency: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: 'allowGreyChat', type: 'choice', choice1: 'No', choice2: 'Yes', defaultValue: 'Yes', label: 'Allow Grey Chat? (type !togglegreychat to turn it on/off at run time)' }, { name: 'lovense', type: 'choice', choice1: 'No', choice2: 'Yes', defaultValue: 'No', 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; gTotalTipToday += 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; } } } } if(gIsLotteryMode) { // ensure user tip enough if(currentTip >= gLotteryCost) { // ensure we still have lottery ticket if(gLotteryTicketHolder.length < gLotteryTicketCount) { // ensure user haven't bought the ticket if(!inArray(tip['from_user'], gLotteryTicketHolder)) { gLotteryTicketHolder.push(tip['from_user']); // add user to the ticket holder list notify(tip['from_user'] + ' purchased a lottery ticket!!! Total lottery ticket left: ' + (gLotteryTicketCount - gLotteryTicketHolder.length)); notify('Thanks for purchasing the lottery ticket!!!', tip['from_user'], '#FFFFFF', '#FF0000'); } else { notify('Sorry, you can only purchase one lottery ticket', tip['from_user'], '#FFFFFF', '#FF0000'); } } else { notify('Sorry, lottery tickets are sold out!', tip['from_user'], '#FFFFFF', '#FF0000'); } } } }); 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 = IsSpecialUser(user); // 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'] && !isMod && !isFan && !isHost); // prevent grey from chatting if (!gAllowGreyChat && isGrey && msg['user'] != 'mc_gregor') { 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 }; if (msgString == '/help' || (msgString == '/h')) { var notices = '******************************************************\x0A'; notices += '**All commands are hidden from other user.\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'; notices += '/tokenstat - Token stats.\x0A'; notices += '/togglegreychat - Toggle grey chatting.\x0A'; // lottery command notices += '/lottery - Start lottery mode.\x0A'; notices += '/lotterystatus - See current lottery status.\x0A'; notices += '/lotterytime - Set lottery length (in seconds).\x0A'; notices += '/lotterycost - Set lottery cost.\x0A'; notices += '/lotteryprize - Set lottery prize.\x0A'; notices += '/lotterycount - Set max number of lottery ticket.\x0A'; for(var i = 0; i < gNotification.length; ++i) { notices += '/togglenotice' + i + ' - Toggle notification for message ' + gNotification[i].text + '\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)) { SendMsgToSpecialGroupAndHost('Original text that was filtered from ' + user + ': ' + msg['m']); msg['m'] = 'Gamarjoba!!!' }; }; // host command if (isHost) { // add private word if (msgString['substring'](0, 12) == '/addprivate ') { msg['X-Spam'] = true; wordsPrivate['push'](msgString['substring'](12)); SendMsgToSpecialGroupAndHost('Private word ' + msgString['substring'](12) + ' added by ' + user); }; // remove private word if (msgString['substring'](0, 15) == '/removeprivate ') { msg['X-Spam'] = true; 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) { SendMsgToSpecialGroupAndHost('Private word [' + wordToRemove + '] removed by ' + user); } else { SendMsgToSpecialGroupAndHost('Failed to remove private word [' + wordToRemove + '] attempted by ' + user); } }; // add sexual gif if (msgString['substring'](0, 8) == '/addgif ') { msg['X-Spam'] = true; sexualGifList['push'](msgString['substring'](12)); SendMsgToSpecialGroupAndHost('Sexual gif ' + msgString['substring'](8) + ' added by ' + user); }; // remove sexual gif if (msgString['substring'](0, 11) == '/removegif ') { msg['X-Spam'] = true; 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) { SendMsgToSpecialGroupAndHost('Sexual gif [' + wordToRemove + '] removed by ' + user); } else { SendMsgToSpecialGroupAndHost('Failed to remove sexual gif [' + wordToRemove + '] attempted by ' + user); } }; if (msgString === '/status') { msg['X-Spam'] = true; cb['sendNotice'](getStatusText(), user, '#FFFF00', '#0000FF', 'bold'); }; if (msgString === '/nudemenu') { msg['X-Spam'] = true; gUsingNudeMenu = !gUsingNudeMenu; SendMsgToSpecialGroupAndHost('Use nude menu: ' + (gUsingNudeMenu? 'Yes': 'No') + ' changed by ' + user); } if (msgString === '/lovense') { msg['X-Spam'] = true; gUsingLovense = !gUsingLovense; SendMsgToSpecialGroupAndHost('Use lovense: ' + (gUsingLovense? 'Yes': 'No') + ' changed by ' + user); } if (msgString === '/speciallovense') { msg['X-Spam'] = true; gUsingSpecialLovenseLevel = !gUsingSpecialLovenseLevel; SendMsgToSpecialGroupAndHost('Use special lovense level: ' + (gUsingSpecialLovenseLevel? 'Yes': 'No') + ' changed by ' + user); } if(msgString === '/togglemenu') { msg['X-Spam'] = true; gMenuTipping = !gMenuTipping; SendMsgToSpecialGroupAndHost('Use tipping menu: ' + (gMenuTipping? 'Yes': 'No') + ' changed by ' + user); } if (msgString === '/listprivate') { msg['X-Spam'] = true; ShowWords(wordsPrivate, user); }; if (msgString === '/hidekarendollars') { msg['X-Spam'] = true; gHideKarenDollars = !gHideKarenDollars; SendMsgToSpecialGroupAndHost('Hide KarenDollars: ' + (gHideKarenDollars ? 'Yes' : 'No') + ' changed by ' + user); } if (msgString === '/showallwallet' || msgString === '/saw') { msg['X-Spam'] = true; 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(msgString === '/tokenstat') { msg['X-Spam'] = true; var text = 'Total Token Earned Today: ' + gTotalTipToday + ' Tokens (Doesnt include private/group show tokens)'; SendMsgToSpecialGroupAndHost(text); } if(msgString === '/togglegreychat') { msg['X-Spam'] = true; gAllowGreyChat = !gAllowGreyChat; var text = ''; if(gAllowGreyChat) { text = 'Allow Grey Chat: Yes'; } else { text = 'Allow Grey Chat: No'; } SendMsgToSpecialGroupAndHost(text + ' changed by ' + user); } if(msgString === '/lottery') { msg['X-Spam'] = true; if(!gIsLotteryMode) { gIsLotteryMode = true; gLotteryTimeLeft = gLotteryTime; notify('Lottery ticket sale started! Tip ' + gLotteryCost + ' token or more to get a lottery ticket.\nLottery prize is: ' + gLotteryPrize); } } if(msgString === '/lotteryend') { msg['X-Spam'] = true; if(gIsLotteryMode) { gIsLotteryMode = false; gLotteryTicketHolder = new Array(); SendMsgToSpecialGroupAndHost('Force lottery end by ' + user); } } if(msgString === '/lotterystatus') { msg['X-Spam'] = true; var text = 'Lottery Cost: ' + gLotteryCost + ' tokens\n'; text += 'Lottery Ticket Quantity: ' + gLotteryTicketCount + ' ticket\n'; text += 'Lottery Duration: ' + gLotteryTime + ' seconds\n'; text += 'Lottery Prize: ' + gLotteryPrize + '\n'; SendMsgToSpecialGroupAndHost(text); } if ((msgString['substring'](0, 12) == '/lotterytime')) { msg['X-Spam'] = true; gLotteryTime = msgString['substring'](13); SendMsgToSpecialGroupAndHost('Lottery duration changed to ' + gLotteryTime + ' seconds by ' + user); }; if ((msgString['substring'](0, 12) == '/lotterycost')) { msg['X-Spam'] = true; gLotteryCost = msgString['substring'](13); SendMsgToSpecialGroupAndHost('Lottery cost changed to ' + gLotteryCost + ' tokens by ' + user); }; if ((msgString['substring'](0, 13) == '/lotteryprize')) { msg['X-Spam'] = true; gLotteryPrize = msgString['substring'](14); SendMsgToSpecialGroupAndHost('Lottery prize changed to ' + gLotteryPrize + ' by ' + user); }; if ((msgString['substring'](0, 13) == '/lotterycount')) { msg['X-Spam'] = true; gLotteryTicketCount = msgString['substring'](14); SendMsgToSpecialGroupAndHost('Max lottery ticket count changed to ' + gLotteryTicketCount + ' by ' + user); }; for(var i = 0; i < gNotification.length; ++i) { if(msgString === ('/togglenotice' + i)) { msg['X-Spam'] = true; var text = 'Changing notification for message (' + gNotification[i].text + ') to ' + gNotification[i].oldFrequency; var temp = gNotification[i].frequency; gNotification[i].frequency = gNotification[i].oldFrequency; gNotification[i].oldFrequency = temp; SendMsgToSpecialGroupAndHost(text + ' changed by ' + user); break; } } } if (isHost || isMod) { if ((msgString['substring'](0, 6) == '/block')) { msg['X-Spam'] = true; var userToBlock = msgString['substring'](7); // ensure we don't block ourself... if(userToBlock != cb['room_slug'] && !IsSpecialUser(userToBlock)) { bUsr['push'](msgString['substring'](7)); var text = 'User: ' + msgString['substring'](7) + ' has been blocked by ' + user; SendMsgToSpecialGroupAndHost(text); } }; if (msgString['substring'](0, 8) == '/unblock') { msg['X-Spam'] = true; bUsr['removeItem'](msgString['substring'](9)); var text = 'User: ' + msgString['substring'](9) + ' has been unblocked by ' + user; SendMsgToSpecialGroupAndHost(text ); }; if (msgString === '/showusers' || msgString === '/showuser' || msgString === '/su') { msg['X-Spam'] = true; 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') { msg['X-Spam'] = true; cb['sendNotice'](getTipMenuText(), '', '#FFFFFF', '#FF0000', 'bold'); } if (msgString === '/lovensemenu') { msg['X-Spam'] = true; cb['sendNotice'](getLovenseText(), '', "#FADBD8", "#000000", 'bold'); } } // if it's a valid message, increment the counter if(msg['m'] && msg['m'] != '' && msg['X-Spam'] != true) { 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,cb.room_slug,backgroundColor,textColor,w); } else if (userGroup == 'modsAndHost') { cb.sendNotice(message,'',backgroundColor,textColor,w,'red'); cb.sendNotice(message,cb.room_slug,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() { gAllowGreyChat = (cb['settings']['allowGreyChat'] == 'Yes'); 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']; for(var i = 0; i < gNotification.length; ++i) { gNotification[i].text = cb['settings'][('notice' + (i))]; gNotification[i].frequency = cb['settings'][('noticeFrequency' + (i))]; } 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: ' + (gAllowGreyChat ? '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) { // 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; // nothing to show, no reason to do display it if(text != null && text != '') { 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); } function advertLottery() { var text = ''; if(gIsLotteryMode) { var writeTiming = false; // we display timer if it's less than 10 sec if(gLotteryTimeLeft < 10) { writeTiming = true; } // every 30 sec we show time left else if(!(gLotteryTimeLeft % 30)) { writeTiming = true; } if(writeTiming) { text = gLotteryTimeLeft + ' seconds before lottery ends. Tip ' + gLotteryCost + ' token or more to purchase a lottery ticket!\nLottery Prize is: ' + gLotteryPrize; } gLotteryTimeLeft -= 1; // reduce timer by 1 // when timer ends or if all ticket sold out, search for a lottery winner and end lottery if(gLotteryTimeLeft <= 0 || gLotteryTicketHolder.length == gLotteryTicketCount) { // pick a random number var winnerIndex = Math.floor(Math.random() * (gLotteryTicketCount - 0.1)); if(winnerIndex < gLotteryTicketHolder.length) { text = 'We have a winner! ' + EMOTE_STARS + gLotteryTicketHolder[winnerIndex] + EMOTE_STARS + ' won the lottery prize: ' + gLotteryPrize; } else { text = 'No one won the lottery, please try again!'; } gLotteryTicketHolder = new Array(); // reset ticket holder gIsLotteryMode = false; } } handleAdvertFiring(text, null, '#FFFFFF', '#FF0000', 'bold', advertLottery); } // 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--- KarenLV Ultimate Bot by eberk321 v1.1 \x0A -certain keyword are filtered\x0A -sexual gif are filtered \x0A-----------------------------------------'); LoadSettings(); SendMsgToSpecialGroup(getStatusText()); // 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[advertLottery] = { initialTimer: TIME_ONE_SECOND, periodicTimer: TIME_ONE_SECOND, minMsgCount: 0, maxNoFireCount: 0 }; 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(advertLottery, gAdvertInformation[advertLottery].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 } } }; // note: only usable for array of pair with text and cost function IsSpecialUser(name) { if(name == cb.room_slug) { return true; } for(var i = 0; i < gSpecialGroup.length; ++i) { if(gSpecialGroup[i] == name) { return true; } } return false; } function SendMsgToSpecialGroup(message) { for(var i = 0; i < gSpecialGroup.length; ++i) { cb['sendNotice'](message, gSpecialGroup[i], '#FFFF00', '#0000FF', 'bold'); } } function SendMsgToSpecialGroupAndHost(message) { cb['sendNotice'](message, cb.room_slug, '#FFFF00', '#0000FF', 'bold'); SendMsgToSpecialGroup(message); } function inArray(str, arry) { return (getArrayIndex(str, arry) != -1); } function getArrayIndex(str, arry) { if (arry) { for (var i = 0; i < arry.length; i++) { if (arry[i] == str) { return i; } } } return -1; } init()
© Copyright Chaturbate 2011- 2025. All Rights Reserved.