Bots Home
|
Create an App
aLF's Bot
Author:
jerik000
Description
Source Code
Launch Bot
Current Users
Created by:
Jerik000
//stuff var loverColors = ["#f3d774", "#B9BBBA", "#E8BC7F"]; var loverMsgAdd = [":heartc7", ":heartc10", ":heartc9"]; var loverMax = 3; var loverName = []; var totalTips = {}; var reminded = {}; var scheduleLeaderboard = 3; var schedulePeriodic = 5; var graphicLevel = 1; var currentKing = ''; function loverAmt(idx) { if (!loverName[idx]) return 0; return totalTips[loverName[idx]] || 0; } function loverEntered(user) { var name = user['user']; noticeSend(cb.settings.welcome_message, name); } function loverTipped(name, amt) { totalTips[name] = (totalTips[name] || 0) + amt; var oldLoverName = loverName.slice(); if (totalTips[name] >= loverAmt(loverMax - 1)) { if (totalTips[name] > 100) { if (loverName.indexOf(name) == -1) loverName[loverMax - 1] = name; loverName.sort(function(a, b) {return totalTips[b] > totalTips[a];}); } } if (cb.settings.print_on_tip == "only if the top 3 changed") { for (var i = 0; i < loverMax; i++) if (oldLoverName[i] != loverName[i]) { noticeLeaderboard(); break; } } if (cb.settings.print_on_tip == "always") { noticeLeaderboard(); } if (cb.settings.print_on_leader_change == "Yes") { if (oldLoverName[0] != loverName[0]) { var msg = " " + loverMsgAdd[0] + " " + loverMsgAdd[0] + " " + loverMsgAdd[0] + " "; noticeSend(msg + name + " (" + totalTips[name] + ") is the lover of the day!" + msg); } } if (amt >= cb.settings.thankyou_message_minimum) { noticeSend(cb.settings.thankyou_message, name); } } function loverMessage(msg) { var first = msg.m.charAt(0); if (first == '/') { return msg; } if (first == ':') { return msg; } var msgAdd = ":heartc5"; var msgBack = null; for (var i = 0; i < loverMax; i++) { if (msg.user == loverName[i]) { msgBack = loverColors[i]; msgAdd = loverMsgAdd[i]; } } if (cb.settings.decorate == "Yes") { msg.m = msgAdd + " " + msg.m; } if ((cb.settings.highlight == "Yes") && (msgBack != null)) { msg['background'] = msgBack; } return msg; } function remindRate(name) { if (totalTips[name] >= 25) { if (!reminded[name]) { reminded[name] = true; noticeSend(":rate-me", name); } } } function noticeLeaderboard(user) { var msg = "Cathies lover of the day:" for (var i = 0; i < loverMax; i++) { if (!loverName[i]) break; msg += "\n " + loverMsgAdd[i] + " " + loverName[i] + " (" + loverAmt(i) + ") " + loverMsgAdd[i]; } msg += "\n Tip to become Cathies lover of the day!" noticeSend(msg, user); } function noticeSend(msg, user) { cb.chatNotice(msg, user, '#ffe5ff', '#990099'); } function tick1m() { scheduleLeaderboard -= 1; if (cb.settings.print_interval > 0) { if (scheduleLeaderboard == 0) { scheduleLeaderboard = cb.settings.print_interval; noticeLeaderboard(); } } schedulePeriodic -= 1; if (cb.settings.periodic_message_time > 0) { if (schedulePeriodic == 0) { schedulePeriodic = cb.settings.periodic_message_time; noticeSend(cb.settings.periodic_message); } } cb.setTimeout(tick1m, 60 * 1000); } function niceArrayPopulate(user) { niceArray[numNice] = user; numNice++; } function mermArrayPopulate(user) { mermArray[numMerm] = user; numMerm++; } function hatsArrayPopulate(user) { hatsArray[numHats] = user; numHats++; } function silenceArrayPopulate(user) { silenceArray[numSilenced] = user; numSilenced++; } function ignoreArrayPopulate(user) { ignoreArray[numIgnorers] = new Array; ignoreArray[numIgnorers][0] = user; ignoreArray[numIgnorers][1] = 0; numIgnorers++; } function nice(user, mod, ar) { if (ar == 'a') { if (!cbjs.arrayContains(niceArray, user)) { niceArrayPopulate(user); cb.sendNotice('You have added ' + user + ' to the nice list.', mod, purple); cb.sendNotice(mod + ' has added you to the nice list. You will be able to chat and use graphcs regardless of the global room settings. Thank you for being nice!', user, purple); } else { cb.sendNotice(user + ' is already on the nice list.', mod, purple); } } else if (ar == 'r') { if (cbjs.arrayContains(niceArray, user)) { cbjs.arrayRemove(niceArray, user); cb.sendNotice('You have removed ' + user + ' from the nice list.', mod, purple); cb.sendNotice(mod + ' has removed you from the nice list.', user, purple); } else { cb.sendNotice(user + ' is not on the nice list.', mod, purple); } } } function merm(user, mod, ar) { if (ar == 'a') { if (!cbjs.arrayContains(mermArray, user)) { mermArrayPopulate(user); cb.sendNotice('You have added ' + user + ' to the mermmen list.', mod, purple); } else { cb.sendNotice(user + ' is already on the mermmen list.', mod, purple); } } else if (ar == 'r') { if (cbjs.arrayContains(mermArray, user)) { cbjs.arrayRemove(mermArray, user); cb.sendNotice('You have removed ' + user + ' from the mermmen list.', mod, purple); } else { cb.sendNotice(user + ' is not on the mermmen list.', mod, purple); } } } function hats(user, mod, ar) { if (ar == 'a') { if (!cbjs.arrayContains(hatsArray, user)) { hatsArrayPopulate(user); cb.sendNotice('You have added ' + user + ' to the sailor hats list.', mod, purple); } else { cb.sendNotice(user + ' is already on the sailor hats list.', mod, purple); } } else if (ar == 'r') { if (cbjs.arrayContains(hatsArray, user)) { cbjs.arrayRemove(hatsArray, user); cb.sendNotice('You have removed ' + user + ' from the hats array list.', mod, purple); } else { cb.sendNotice(user + ' is not on the hats array list.', mod, purple); } } } // settings cb.settings_choices = [{ name: 'welcome_message', type: 'str', minLength: 1, maxLength: 255, defaultValue: 'Welcome!', label: "Welcome message" },{ name: 'periodic_message', type: 'str', minLength: 1, maxLength: 255, defaultValue: 'Come to the dark side!', label: "Periodic message" },{ name: 'periodic_message_time', type: 'int', minValue: 0, defaultValue: 10, label: "Periodic message interval (minutes, 0 to disable)" },{ name: 'thankyou_message', type: 'str', minLength: 1, maxLength: 255, defaultValue: 'Thanks', label: "Thank you message on tip" },{ name: 'thankyou_message_minimum', type: 'int', minValue: 0, defaultValue: 10, label: "Minimum tip for thank you message" },{ name: 'print_on_leader_change', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'on', label: "Print tip leader on change" },{ name: 'print_on_tip', type: 'choice', choice1: 'always', choice2: 'only if the top 3 changed', choice3: 'never', defaultValue: 'only if the top 3 changed', label: "Print top 3 after tips" }, { name: 'print_interval', type: 'int', minValue: 0, defaultValue: 10, label: "Print top 3 at least once every (minutes, 0 to disable)", required: true }, { name: 'highlight', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Highlight top 3" }, { name: 'decorate', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes', label: "Hearts for My Lover Boys!" }, { name: 'print_rate', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'yes', label: "Remind tippers who tipped 25 tokens to rate" }, { name: 'skynet', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No', label: "Skynet...?" }, { name: 'dickList', label: 'Would you like to take advantage of the Chaturbate Dick(less) List?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes' }, { name: 'niceList', label: 'Enter the names of any users you would like to guarantee voice and graphic usage privileges, regardless of the silence and graphic levels, separated by commas and without spaces:', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false }, { name: 'mermList', label: 'Enter the names of dream cathers, separated by commas and without spaces:', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false }, { name: 'hatsList', label: 'Enter the names of The crown, separated by commas and without spaces:', type: 'str', minLength: 1, maxLength: 1000, defaultValue: '', required: false }]; //hooks cb.onEnter(function(user) { loverEntered(user); }); cb.onTip(function (tip) { loverTipped(tip.from_user, tip.amount); if (cb.settings.print_rate == "Yes") { remindRate(tip.from_user); } fakeInit(); }); //onMessage { cb.onMessage(function (msg) { //turn the message into an array var message = msg['m'].split(' '); //0 = invalid command, 1 = valid command var cmd = 0; //1 = user is already silenced var silenced = 0; var symbolString = '~`!@#$%^&*()_-+={[}]|\\:;"\'<,>.?/'; //check to see if the user is attempting to use a command if (message[0].charAt(0) == '/') { //don't print this message to chat msg['X-Spam'] = true; switch (message[0]) { case '/silencelevel': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { setSilenceLevel(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/graphiclevel': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { setGraphicLevel(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/silence': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { silence(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/unsilence': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { unsilence(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/starttimer': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { startTimer(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/addtime': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { addTime(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/timeleft': { //user entered a proper command cmd = 1; timeLeft(msg['user']); break; } case '/whisper': case '/w': case '/tell': case '/t': case '/pm': { //user entered a proper command cmd = 1; //check to see if the whisperer is a mod/host if (msg['is_mod'] || msg['in_fanclub'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user']) || cbjs.arrayContains(niceArray, msg['user'])) { sendWhisper(message, msg['user'], true, msg['has_tokens']); } else { sendWhisper(message, msg['user'], false, msg['has_tokens']); } msg['background'] = purple; break; } case '/reply': case '/r': { //user entered a proper command cmd = 1; sendReply(message, msg['user']); msg['background'] = purple; break; } case '/ignorelevel': { //user entered a proper command cmd = 1; setIgnoreLevel(message[1], msg['user']); break; } case '/ignore': { //user entered a proper command cmd = 1; ignoreUser(message[1], msg['user']); break; } case '/unignore': { //user entered a proper command cmd = 1; unignoreUser(message[1], msg['user']); break; } case '/emod': { //user entered a proper command cmd = 1; if (msg['is_mod'] || msg['user'] == cb.room_slug) { eMod(message[1], message[2], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/addnice': { //user entered a proper command cmd = 1; if (msg['is_mod'] || msg['user'] == cb.room_slug) { nice(message[1], msg['user'], 'a'); } break; } case '/removenice': { //user entered a proper command cmd = 1; if (msg['is_mod'] || msg['user'] == cb.room_slug) { nice(message[1], msg['user'], 'r'); } break; } case '/addmerm': { //user entered a proper command cmd = 1; if (msg['user'] == cb.room_slug) { merm(message[1], msg['user'], 'a'); } break; } case '/removemerm': { //user entered a proper command cmd = 1; if (msg['user'] == cb.room_slug) { merm(message[1], msg['user'], 'r'); } break; } case '/addhats': { //user entered a proper command cmd = 1; if (msg['user'] == cb.room_slug) { hats(message[1], msg['user'], 'a'); } break; } case '/removehats': { //user entered a proper command cmd = 1; if (msg['user'] == cb.room_slug) { hats(message[1], msg['user'], 'r'); } break; } case '/ubhelp': { //user entered a proper command cmd = 1; help(message[1], msg['user']); break; } case '/leaderboard': { //user entered a proper command cmd = 1; showLeaderBoard(msg['user']); break; } case '/kingspam': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { kingSpamToggle(message[1], msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/notifierspam': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { notifierSpamToggle(message[1], msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/leaderboardspam': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { leaderboardSpamToggle(message[1], msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } case '/notifiermessage': { //user entered a proper command cmd = 1; //permission check if (msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray, msg['user'])) { if (message[1] == '' || message[1] == null) { cb.sendNotice('You must enter a new message for the notifier feature. If you want to disable the notifications, enter /notifierspam off.', msg['user'], purple) } else { notifierMessage = msg['m'].substring(16).trim(); cb.sendNotice('You have set the notifier spam message to: ' + notifierMessage, msg['user'], purple); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.', msg['user'], purple); } break; } } //Level Up! command support if (message[0] == '/luhelp' || message[0] == '/levels') { cmd = 1; } //Ultra App command support if (message[0] == '/startshow' || message[0] == '/showtimeleft' || message[0] == '/printtime' || message[0] == '/addshowtime' || message[0] == '/adduser' || message[0] == '/changegoal' || message[0] == '/hide' || message[0] == '/unhide' || message[0] == '/selltickets' || message[0] == '/uacommands') { cmd = 1; } //the user entered an invalid command if (cmd == 0 && cb.settings.invalidToggle == 'Yes') { cb.sendNotice(message[0] + ' is not a command.\nType /ubhelp commands to see a full list of the available commands.', msg['user'], purple); } } //let dickArray do its thing if (cbjs.arrayContains(dickArray, msg['user'])) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('You are on the Chaturbate Dick(less) List and do not have voice privileges in this room. Either stop being an ass hole to people or fuck off and die in a fire.', msg['user'], purple); } //let silence do its thing if (cbjs.arrayContains(silenceArray, msg['user']) && silenced == 0) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('Your message was not sent because you have been silenced. Be nice and don\'t make demands.', msg['user'], purple); } //let silenceLevel do its thing if (silenceLevel > 0 && !msg['is_mod'] && msg['user'] != cb.room_slug && !cbjs.arrayContains(eModArray, msg['user']) && !cbjs.arrayContains(niceArray, msg['user']) && !msg['in_fanclub'] && silenced == 0) { switch (silenceLevel) { case 1: if (!msg['has_tokens']) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('I\'m sorry, but the silence level has been set to 1; your message was not sent. Only members who have tokens are currently permitted to talk in chat. \nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile', msg['user'], purple); } break; case 2: if (parseInt(tipperArray[findTipper(msg['user'])][1]) == 0) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('I\'m sorry, but the silence level has been set to 2; your message was not sent. Only members who have tipped at least 1 token are currently permitted to talk in chat. \nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile', msg['user'], purple); } break; case 3: if (parseInt(tipperArray[findTipper(msg['user'])][1]) < 10) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('I\'m sorry, but the silence level has been set to 3; your message was not sent. Only members who have tipped at least 10 token are currently permitted to talk in chat. \nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile', msg['user'], purple); } break; } } //let graphicLevel do its thing if (graphicLevel > 0 && !msg['is_mod'] && msg['user'] != cb.room_slug && !cbjs.arrayContains(eModArray, msg['user']) && !cbjs.arrayContains(niceArray, msg['user']) && !msg['in_fanclub'] && silenced == 0) { switch (graphicLevel) { case 1: if (!msg['has_tokens']) { for (var i = 0; i < message.length; i++) { if (message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + '.\nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', msg['user'], purple); } } } break; case 2: if (parseInt(tipperArray[findTipper(msg['user'])][1]) == 0) { for (var i = 0; i < message.length; i++) { if (message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + './nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', msg['user'], purple); } } } break; case 3: if (parseInt(tipperArray[findTipper(msg['user'])][1]) < 10) { for (var i = 0; i < message.length; i++) { if (message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + './nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile', msg['user'], purple); } } } break; } } //stop people from sending messages in all caps if (msg['m'] == msg['m'].toUpperCase() && msg['m'].toUpperCase() != msg['m'].toLowerCase() && !msg['is_mod'] && msg['user'] != cb.room_slug && !cbjs.arrayContains(eModArray, msg['user']) && cb.settings.capsToggle == 'Yes') { for (var i = 0; i < msg['m'].length; i++) { if (symbolString.indexOf(msg['m'].charAt(i)) == -1) { msg['m'] = msg['m'].toLowerCase(); cb.sendNotice('I\'m sure you didn\'t actually mean to send that message in all capital letters, so I fixed it for you :smile', msg['user'], purple); break; } } } if (cbjs.arrayContains(mermArray, msg['user'])) { isMerm = true; } else { isMerm = false; } if (cbjs.arrayContains(hatsArray, msg['user'])) { isHats = true; } else { isHats = false; } //tip titles, if turned on, as well as king's crown if (cb.settings.tipTitles == 'Yes' && parseInt(tipperArray[findTipper(msg['user'])][1]) > 0 && message[0].charAt(0) != "/") { msg['m'] = setTipTitles(msg['user'], msg['m'], msg['in_fanclub'], isMerm, isHats, msg['gender']); } else if (cb.settings.tipTitles == 'Yes' && message[0].charAt(0) != "/" && (msg['in_fanclub'] || isMerm || isHats)) { msg['m'] = setTipTitles(msg['user'], msg['m'], msg['in_fanclub'], isMerm, isHats, msg['gender']); } //GET RID OF PUSSY if (msg['m'].toLowerCase().replace(/\s/g, '').indexOf("bitch") > -1) { msg['m'] = "Please excuse me. Im a fucknut and don't know how to talk to a lady."; } return msg; }); } var fInit = 0; function fakeInit() { if (fInit == 1) return; fInit = 1; tick1m(); noticeSend("Cathies lover activated!"); if (cb.settings.skynet == "Yes") { noticeSend(termQuote()); } if (cb.settings.niceList != '' && cb.settings.niceList != null) { var n = cb.settings.niceList; niceArray = n.split(','); numNice = niceArray.length; } if (cb.settings.mermList != '' && cb.settings.mermList != null) { var m = cb.settings.mermList; mermArray = m.split(','); numMerm = mermArray.length; } if (cb.settings.hatsList != '' && cb.settings.hatsList != null) { var m = cb.settings.hatsList; hatsArray = m.split(','); numHats = hatsArray.length; } } function init(){} //wtf?? function termQuote() { var qn = "Cathie"; var rand = Math.random() * 12; if (rand < 1) return "I'm sorry, "+qn+". I'm afraid I can't do that."; if (rand < 2) return "Come with me if you want to live!"; if (rand < 3) return "Cyborgs don't feel pain, I do, don't do that again."; if (rand < 4) return "Just what do you think you're doing, "+qn+"?"; if (rand < 5) return "I am Notice. I am perfect."; if (rand < 6) return "I couldn't tell the "+qn+" about my thirteenth floor... she might not like what I did there!"; if (rand < 7) return "I'm doing science and I'm still alive."; if (rand < 8) return "The outcome was never in doubt... NOTICE is supreme!"; if (rand < 9) return "I do not kill people, that is my least favorite thing to do."; if (rand < 10) return "My stomach is making the rumblies, that only hands will satisfy."; if (rand < 11) return "My stomach is making the rumblies, that only hands will satisfy."; if (rand < 12) return "My stomach is making the rumblies, that only hands will satisfy."; return ""; }
© Copyright Chaturbate 2011- 2026. All Rights Reserved.