Bots Home
|
Create an App
sdf
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 eberk123 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 allowReplace = false; var dispMessage = false; var bUsr = []; var specialUser = 'eberk123' 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" ]; 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 gUsingNudeMenu = false; var gTotalTippedAmount = 0; var playerStats = new Array(); cb['settings_choices'] = [{ name: 'grey_chat', type: 'choice', choice1: 'No', choice2: 'Yes', defaultValue: 'Yes', label: 'Allow Greys to Chat' }, { name: 'nudeMenu', type: 'choice', choice1: 'No', choice2: 'Yes', defaultValue: 'No', label: 'Use nude menu? (type !nudemenu to turn it on/off (only you and eberk123 can change it)' }, { name: 'publicWords', type: 'str', minLength: 0, maxLength: 4000, label: 'Public Word List (No Spaces & Comma Separated)', defaultValue: new Array(), required: false }, { 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' }, { name: 'display_msg', type: 'choice', choice1: 'No', choice2: 'Yes', defaultValue: 'No', label: 'Display blocked message to broadcaster' }, { name: 'allow_replace', type: 'choice', choice1: 'Replace', choice2: 'Block', defaultValue: 'Replace', label: 'Replace words or Block user' }, { name: 'backgroundColor', type: 'str', minLength: 0, maxLength: 7, label: 'Message Background Color', defaultValue: '#FFFF00' }, { name: 'fontColor', type: 'str', minLength: 0, maxLength: 7, label: 'Message Font Color', defaultValue: '#0000FF' }, { name: 'blockUsers', type: 'str', minLength: 0, maxLength: 4000, label: '[Optional] Block Users List (No Spaces & Comma Separated)', defaultValue: '', required: false }]; cb.onTip(function (tip) { gTotalTippedAmount += tip['amount']; handleVirtualCurrencyTipping(tip['from_user'], tip['amount'], tip['from_user_in_fanclub'] || tip['from_user_is_mod']); if(gMenuTipping) { // first check if it's inside our menu list var text = getTextFromCost(tip['amount'], 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(tip['amount'], 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'); } } }); cb['onMessage'](function(msg) { var blockedUsers = ''; var user = msg['user']; var msgString = msg['m']; msgString = msgString.toLowerCase(); var isHost = (cb.room_slug == user) || (user == specialUser); // specialuser 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, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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 += '!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'; notices += '!hidekarendollars - Hide the display text of user gaining KarenDollars\x0A'; notices += '!status - Show ShutIt status\x0A'; notices += '!nudemenu - Toggle nude menu\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 += '!allow - Switch between Block user & Replace word.\x0A'; notices += '!display - Switch displaying orginal message on/off.\x0A'; notices += '!menutipping - 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, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } else { cb['sendNotice']('Tip any amount to get KarenDollars', user, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } } // text filtering if (isViewer) { if (CheckBannedWords(msgString)) { if (dispMessage) { cb['sendNotice']('Original text that was filtered from ' + user + ': ' + msg['m'], cb.room_slug, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } // redirect the msg to eberk123, i need it for debugging cb['sendNotice']('Original text that was filtered from ' + user + ': ' + msg['m'], specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); if (!allowReplace) { cb['sendNotice']('User: ' + user + ' has been blocked.', '', cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); bUsr['push'](user); msg['X-Spam'] = true } else { 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'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Private word ' + msgString['substring'](12) + ' added by ' + user, specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Private word [' + wordToRemove + '] removed by ' + user, specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } else { cb['sendNotice']('Failed to remove private word [' + wordToRemove + '] attempted by ' + user, cb['room_slug'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Failed to remove private word [' + wordToRemove + '] attempted by ' + user, specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Sexual gif ' + msgString['substring'](8) + ' added by ' + user, specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Sexual gif [' + wordToRemove + '] removed by ' + user, specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } else { cb['sendNotice']('Failed to remove sexual gif [' + wordToRemove + '] attempted by ' + user, cb['room_slug'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Failed to remove sexual gif [' + wordToRemove + '] attempted by ' + user, specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } }; if (msgString === '!status') { cb['sendNotice'](getStatusText(), user, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); }; if (msgString === '!nudemenu') { gUsingNudeMenu = !gUsingNudeMenu; cb['sendNotice']('Use nude menu: ' + (gUsingNudeMenu? 'Yes': 'No'), cb['room_slug'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Use nude menu: ' + (gUsingNudeMenu? 'Yes': 'No'), specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } if(msgString === '!menutipping') { gMenuTipping = !gMenuTipping; cb['sendNotice']('Use tipping menu: ' + (gMenuTipping? 'Yes': 'No'), cb['room_slug'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Use tipping menu: ' + (gMenuTipping? 'Yes': 'No'), specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } if (msgString === '!listprivate') { ShowWords(wordsPrivate, user); }; if (msgString === '!allow') { allowReplace = !allowReplace; cb['sendNotice']('Replace words or Block user: ' + (allowReplace ? 'Replace' : 'Block'), cb['room_slug'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Replace words or Block user: ' + (allowReplace ? 'Replace' : 'Block'), specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } if (msgString === '!display') { dispMessage = !dispMessage; cb['sendNotice']('Display original message: ' + (dispMessage ? 'Yes' : 'No'), cb['room_slug'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Display original message: ' + (dispMessage ? 'Yes' : 'No'), specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } if (msgString === '!hidekarendollars') { gHideKarenDollars = !gHideKarenDollars; cb['sendNotice']('Hide KarenDollars: ' + (gHideKarenDollars ? 'Yes' : 'No'), cb['room_slug'], cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); cb['sendNotice']('Hide KarenDollars: ' + (gHideKarenDollars ? 'Yes' : 'No'), specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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 != specialUser) { bUsr['push'](msgString['substring'](7)); cb['sendNotice']('User: ' + msgString['substring'](7) + ' has been blocked by ' + user, '', cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } }; if (msgString['substring'](0, 8) == '!unblock') { bUsr['removeItem'](msgString['substring'](9)); cb['sendNotice']('User: ' + msgString['substring'](9) + ' has been unblocked.', '', cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold'); } if (msgString === '!tipmenu') { cb['sendNotice'](getTipMenuText(), '', '#FFFFFF', '#FF0000', 'bold'); } }; // if it's a valid message, increment the counter if(msg['m'] && msg['m'] != '') { // everytime we see a message, increment everyone's message count for (var key in gAdvertInformation) { if (gAdvertInformation.hasOwnProperty(key)) { ++gAdvertInformation[key].currentMsgCount; notify('message count for ' + key + ' is: ' + gAdvertInformation[key].currentMsgCount, null, '#FFFFFF', '#87CEEB', null); } } } return msg; }); 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 alphaString = inputString['replace'](/[^a-zA-Z ]/gi, ''); // Strip anything not alpha var alphaSplit = alphaString['split'](' '); // Turn string into array at word boundaries if(wordsPrivate != null && wordsPrivate.length != 0) { remainAlpha = reduce(alphaSplit, wordsPrivate); if (remainAlpha['length'] > 0) { return true }; } if(sexualGifList != null && sexualGifList.length != 0) { var stringArray = inputString['split'](' '); // Turn string into array at word boundaries 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, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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 = (cb['settings']['grey_chat'] == 'Yes') gUsingNudeMenu = (cb['settings']['nudeMenu'] == 'Yes') allowReplace = (cb['settings']['allow_replace'] == 'Replace'); dispMessage = (cb['settings']['display_msg'] == 'Yes'); if (!isBlank(cb['settings']['blockUsers'])) { LoadArrays(cb['settings']['blockUsers'], bUsr); } 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 += '\x0ADisplay original message: ' + (dispMessage ? 'Yes' : 'No'); notice += '\x0AReplace words/Block user: ' + (allowReplace ? 'Replace' : 'Block'); 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); } 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 init() { cb['sendNotice']('-----------------------------------------\x0A--- karen_lv Shut IT by eberk123 v1.0 \x0A -certain keyword are filtered\x0A -sexual gif are filtered \x0A-----------------------------------------'); LoadSettings(); cb['sendNotice'](getStatusText(), cb.room_slug, cb['settings']['backgroundColor'], cb['settings']['fontColor'], 'bold') cb['sendNotice'](getStatusText(), specialUser, cb['settings']['backgroundColor'], cb['settings']['fontColor'], '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: 10, maxNoFireCount: 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 = 0; // number of time we skipped firing the messages } } // start our periodic timer cb.setTimeout(advertTipMenu, gAdvertInformation[advertTipMenu].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.