Bots Home
|
Create an App
lucky star test
Author:
lillexusdawn
Description
Source Code
Launch Bot
Current Users
Created by:
Lillexusdawn
// 444 = Eiffel Kings Club (array(mm)) // 777 = Lucky Stars club (array(mg)) var version = '1.99.36 [MMB]'; var vdate = '07-May-2019'; cb.settings_choices = [ {name: 'mmBGColor', label: 'Eiffel Kings members background color - HTML colour code without starting \'#\'', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'cceeff'}, {name: 'mmMinTip', label: 'Minimum tip to become Eiffel Kings member', type: 'int', minValue: 1, defaultValue: 444}, {name: 'mmAnnounce', label: 'Text to show when someone tips to become a Eiffel Kings member, \'MEMBERNAME\' will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME - You\'re My Eiffel Tower King!'}, {name: 'mmMemberList', label: 'List of current Eiffel Kings members, separated by commas (exact CB usernames)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'mmRainText', label: 'Text to use for Eiffel Kings rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Eiffel Kings!'}, {name: 'mmRainCount', label: 'Number of lines of Cool Cats rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 5}, {name: 'mgcolordelta', label: 'Over-ride users\' text color', type: 'choice', choice1: 'no', choice2: 'yes', defaultValue: 'no'}, {name: 'mgTextColor', label: 'Lucky Star text color (if over-riding) - HTML color code without starting \'#\'', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '000000'}, {name: 'mgBGColor', label: 'Lucky Star background color - HTML color code without starting \'#\'', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'e6ccff'}, {name: 'mgMinTip', label: 'Minimum tip to become a Lucky Star', type: 'int', minValue: 1, defaultValue: 777}, {name: 'mgAnnounce', label: 'Text to show when someone tips to become a Lucky Star, \'MEMBERNAME\' will be replaced with the username of the new member (Note: graphics don\'t work in this text)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'MEMBERNAME just got Lucky!'}, {name: 'mgMemberList', label: 'List of current Lucky Charmers, separated by commas (exact CB usernames)', type: 'str', minLength: 0, maxLength: 20480, required: false, defaultValue: ''}, {name: 'mgRainText', label: 'Text to use for Lucky Stars rain lines', type: 'str', minLength: 0, maxLength: 80, required: false, defaultValue: 'Lucky Stars!'}, {name: 'mgRainCount', label: 'Number of lines of Lucky Charm rain', type: 'int', minValue: 1, maxValue: 15, defaultValue: 7}, {name: 'sneakyList', label: 'Users to bypass entry messages (exact CB usernames)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: ''}, {name: 'modList', label: 'Who\'s your Main Monkey? (exact CB username)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'mainmonkeybusiness'}, {name: 'modColor', label: 'Monkey\'s text color, without starting \'#\'', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: '202020'}, {name: 'modBGColor', label: 'Monkey\'s background color, without starting \'#\'', type: 'str', minLength: 0, maxLength: 6, required: false, defaultValue: 'ffe0b3'}, {name: 'Notice2', label: 'Notice line #1', type: 'str', minLength: 0, maxLength: 1024, required: false, defaultValue: 'Notice line 1'}, {name: 'Notice3', label: 'Notice line #2', type: 'str', minLength: 0, maxLength: 1024, required: false, defaultValue: 'Notice line 2'}, {name: 'Notice4', label: 'Notice line #3 (leave blank to skip)', type: 'str', minLength: 0, maxLength: 1024, required: false, defaultValue: ''}, {name: 'Notice5', label: 'Notice line #4 (leave blank to skip)', type: 'str', minLength: 0, maxLength: 1024, required: false, defaultValue: 'test notice (4)'}, {name: 'Notice6', label: 'Notice line #5 (leave blank to skip)', type: 'str', minLength: 0, maxLength: 1024, required: false, defaultValue: ''}, {name: 'mins', label: 'Repeat notices every how many minutes? (minimum 2, maximum 99)', type: 'int', minValue: 2, maxValue: 99, defaultValue: 10}, {name: 'print_on_tip',label: "[Leaderboard] Print top 3 after tips", type: 'choice', choice1: 'always',choice2: 'only if the top 3 changed', choice3: 'never', defaultValue: 'only if the top 3 changed'}, {name: 'print_interval', label: "[LB] Print top 3 at least once every minutes (0 to disable)", type: 'int', minValue: 0, defaultValue: 0, required: true }, {name: 'highlight', label: "[LB] Highlight tip leader in chat", type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes'}, {name: 'sepchar', type: 'choice', choice1: 'Vertical Bar', choice2: 'Hearts', choice3:'Glitter',choice4:'Flowers',choice5:'Bow',choice6:'Hearts2',choice7:'Smiley',choice8:'Text Heart', choice9:'Text Diamond', choice10:'Text Star', defaultValue: 'Glitter', label: "Tip Menu Separator character"}, {name:'item1', type:'str', required: false, label:'Tip Menu Item 1 (eg 10--flash tits)',}, {name:'item2', type:'str', required: false, label:'Item 2',}, {name:'item3', type:'str', required: false, label:'Item 3',}, {name:'item4', type:'str', required: false, label:'Item 4',}, {name:'item5', type:'str', required: false, label:'Item 5',}, {name:'item6', type:'str', required: false, label:'Item 6',}, {name:'item7', type:'str', required: false, label:'Item 7',}, {name:'item8', type:'str', required: false, label:'Item 8',}, {name:'item9', type:'str', required: false, label:'Item 9',}, {name:'item10', type:'str', required: false, label:'Item 10',}, {name:'Sitem1', type:'str', required: false, label:'Secondary Tip Menu Item 11',}, {name:'Sitem2', type:'str', required: false, label:'Item 12',}, {name:'Sitem3', type:'str', required: false, label:'Item 13',}, {name:'Sitem4', type:'str', required: false, label:'Item 14',}, {name:'Sitem5', type:'str', required: false, label:'Item 15',}, {name:'Sitem6', type:'str', required: false, label:'Item 16',}, {name:'Sitem7', type:'str', required: false, label:'Item 17',}, {name:'Sitem8', type:'str', required: false, label:'Item 18',}, {name:'Sitem9', type:'str', required: false, label:'Item 19',}, {name:'Sitem10', type:'str', required: false, label:'Item 20',}, {name:'noticecolor', type:'str', label:'Tip Menu Notice color (html code default red #FC0000)', defaultValue: '#FC0000'}, {name: 'chat_ad', type:'int', minValue: 1, maxValue: 99, defaultValue: 10, label: 'Delay in minutes between Tip Menu being displayed (minimum 2, maximum 99)'}, {name: 'quoteTip', label: 'Tip value for random LexusQuote', type: 'int', minValue: 1, defaultValue: 7}, {name: 'kingTipper', label: 'Who is your all-time HIGH TIPPER? (exact CB username)', type: 'str', minLength: 0, maxLength: 10240, required: false, defaultValue: 'mike37174'} ]; var vdev = 'mainmonkeybusiness'; var emojii = ':ldb-luckycharms1'; var emojii2 = ':ldb-coolcats1'; var emojiiBC = ':ldb-bothclubs1'; var emojiiMF = ':mmb-monkeyface1'; var emojiiMMB = ':mmb-allclubs1'; var mike3emojii = ':ldb-MVPbothclubs'; var crowngif = ':crowngif282'; var mmMembers = {}; // Eiffel Kings var mgMembers = {}; // Lucky Star var modMembers = {}; // Mods (ME) :-) var sneakers = {}; // stealth room entry var Notice1 = "Tip " + cb.settings.mmMinTip + " to become a member of the Eiffel Kings.. Tip " + cb.settings.mgMinTip + " to become a Lucky Star!\nAll of your messages will be highlighted in chat and more. Read the bio for more info. "; var titleMessage = 'Lexus\'s Lucky Stars bot (v'+version+') is now active. By MainMonkeyBusiness. Type /ldbhelp for more info. '; var dbhelp = 'Tip '+ cb.settings.mmMinTip +' to get into the Eiffel Kings club. Tip '+ cb.settings.mgMinTip +' to get into the Lucky Stars club. Read the bio for more info about Lexus\'s fan clubs. \n Type /tipmenu to see what you can tip for, and read the bio for the full tip list. Thank You. '; var timerhelp = 'Timer commands:\n /timer ## -- set timer to ## minutes \n /addtime ## -- add/subtract ## minutes to timer \n /timeleft -or- /tl -- display remaining countdown time \n /killtimer -- stop the timer \n /tdesc -- set/change timer description \n [Timer functions are built into Lexus\'s Goal Counter-MMB App]'; var dbversion = 'Lexus\'s Lucky Stars Bot: version '+version+' ('+vdate+')\nBy MainMonkeyBusiness :cool '; /** var fancytext = "background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) ); background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) ); color:transparent; -webkit-background-clip: text; background-clip: text;"; **/ var quotes = [ '"I can fap to this" -Christmas music', '"I\'m not a Christian, I just like trees"', '"This music is too dramatic to fap to"', '"I am the source of all evil"', '"Oh this is Peanut (her cat), she just wants to lay in my crotch" :lanadelbae-kittyfeetflash-mow', '"Hey, I don’t want you in my vagina, but thank you for the offer" -- singsong-idly', '"My regulars fuck" -Lana on getting tipped out of a creepy pvt', '"I don\'t want to hear this music while I hump my bear" -March 2018 :lanadelbae-humps-mow', '"My Vagina is not a clown car" -March 2018', '"It\'s like an enchanted broccoli forest down there" :Broccoli -Lana referring to her bush, March 2018', '"I can\'t fuck myself to elevator music"', '"What is this, the elevator music station?!"', '"My boobs aren\'t small, they\'re low fat" -- Lana 2018', '"Why?! Why do the Killers always come on when I\'m about to murder my vagina" -April 2018 :lanadelbae-gitachi-mow', '"Peanut, can you not eat rubber bands, I\'m trying to jack off my fuck machine, it\'s distracting me" -Lana, May 2018', '"That sounds depressing for your penis" -Lana, May 2018', '"I\'ve seen a lot of balls in my day" -- Lana 2018', '"My Vagina is not a flea market, please don\'t try to haggle"', '"Trying to be a cam girl, not a scam girl"', '"I need some girth underneath me"', '"Ya ever have someone accidently hit-and-run your butthole before?" :lanadelbae-seenoevil-mow', '"OOOh, it\'s cold in my butthole!"', '"Ya know, who doesn\'t love some hard nipples?"', '"Giant dicks to the face is my Kryptonite" :lanadelbae-dickslap-mow', '"My G-string is caught on my butt plug"', '"Oooh, this fur is tickling my pussy"', '"If your girl is all dry down there, like the Sahara desert, toss her an apple" :lanadelbae-nailedit-mow', '"Teardrops make the best lube"', '"What\'s in there? Is it fur? Cum? Oh, it\'s totally cum"', '"The key to a good hand job? Use your mouth!" :lanadelbae-gstring-mow', '"Oh my gosh, there\'s so much cream in my pussy right now!" :lanadelbae-gigglegasm-mow', '"Nope, you\'re not going to crawl into my vagina right now, sorry!" - said to her cat, Peanut', '"Don\'t tease me with a good time"', '"Certain songs make my pussy cringe"', '"My vagina is SUPER tiny today"', '"Oh my god, I have confetti in my vagina"', '"My booty always feels so lonely without things in it"', '"Pornhub... Subway... Same thing -- they both have foot-longs"', '"4th of July: that\'s the only holiday louder than I am"', '"Oh, my vagina is so tight right now. Small vagina problems"', '"It feels weird in my mouth"', '"This is a fuck-machine, not a make-love-machine" -Lana Del Bae 2018', '"I swear, my vagina is Benjamin Buttoning" - June 2018', '"I don\'t understand why hipsters want to fuck my vagina tonight"', '"I\'m just saying...worms and sexuality don\'t go well together"', '"Peanut, please stop staring at me when I masturbate, it\'s creepy!"', '"It just seems like getting cum in the pony tail would be weird" - June 2018', '"Time flies when you\'re sucking a dick"', '"I always depend on the kindness of strangers to put dicks in my mouth"', '"I am indeed very tight"', '"Seriously tho, someone eat my ass. I haven\'t had someone eat my ass in a while"', '"My life is made up of butt plugs and lucky charms"', '"It\'s really hard to find ball-less dildos on Amazon"', '"Ya know what\'s scary, is un-veined penises" :lanadelbae-woohh-mow', '"Peanut, seriously, chill the fuck out, I\'m trying to touch my vagina here"', '"My butt hole has not been invaded by any foreign objects tonight"', '"Damn, my pussy is so pink from the fuck machine dicking me down"', '"My vagina is falling out of my onesie"', '"Stop judging me peanut ... stop judging me because you can\'t wear body suits and bust out of them" :lanadelbae-ripitoff-mow', '"New things in your butt. Always an interesting experience"', '"You embarrassed my butt, now it\'s blushing!"', '"It\'s a fucking whisk inside my pussy"', '"It\'s a whole new host of festivities for my vagina"', '"It\'s like a headache in my butt (referring to a frozen butt plug)"', '"I whip my boob back and forth" - Lana July 2018', '"It\'s like a Pocahontas stream of piss"', '"\'Healthy\' Oreos taste like dirty butthole"', '"OMG it\'s like an ocean down there"', '"It\'s like my vagina is even tighter now"', '"I need to make sure it stays a TOP and not a MIDDLE" - Lana referring to the top she was wearing', '"Fur rugs are the hot pockets of cam girl accessories .. such a good concept .. terrible execution"', '"My vagina is not a bus window, please stop that"', '"The lady had nice hands. I should have asked for a happy ending"', '"We\'re gonna need a bigger hole"', '"Hey .. what do you use your freezer for?" ... Lana: "butt plugs" :lanadelbae-shrug-mow', '"God what are we listening to .. that sounds like something hipsters kill themselves to" -Lana during a cumshow about her music', '"I\'m golden... like the shower"', '"I am not trying to be face-fucked-up .. I am just trying to be face-fucked" --Lana talking about giving a Blow Job to her fuck machine', '"It\'s like being finger banged by The Flash"', 'It feels like a giant screw in my butt -- and not the good kind either!"', '"I\'ve had so many UPS guys in my box today"', '"My vagina was like Halloween candy"', '"Come here kitty... you don\'t know that you are about to get fucked in the butt (not literally!!)" -Lana 2K18', '"Once we have popped all the balloons, we will fuck one" -Lana 2K18', '"Sorry, I had so much cream in my pussy, I had to get rid of it"', '"If you\'re turned off by her cum, she\'s probably not the one"', '"I don\'t have any fucking orgasms, but I have a hair on me" - Lana after being cum-denied', '"Just waiting for my butt to dry" -Lana referring to the blacklight paint on her booty', '"You don\'t fuck me or feed me ... don\'t tell me how to live my life"', '"I was worried the black nails would make my pussy look weird"', '"I\'ve actually met guys with bi-polar penises before"', '"I\'m sorry, but it sounds like its vacuuming my pussy"', '"I love dicks in and around my mouth"', '"Thank you for giving me dicks to nibble on"', '"My butthole is tighter than an XS sweater on pair of Double D titties" :lanadelbae-booty-mow', '"I\'m so glad my vagina tastes good"', '"I dont need to smell like a baby\'s butt. I can smell like an adult"', '"It\'s like a Christmas tree in my ass"', '"Flick my bean while feeding me goldfish"', '"I don\'t like the cherry lube, it tastes like cough syrup in my vagina"', '*pops a confetti cannon* "ugh .. I just deep throated confetti" (Lana after acidently swallowing confetti)', '"I\'m so scared of all this confetti in my vagina"', '"This confetti is making my boob tickle"', '"We need to wash it ... because its smells funny"', '"It\'s rather inconvenient to squat over a heater vent though"', '"I feel like my sponsored ads are filled with butt plugs and crop tops. Which, i\'m not mad about" - Llama Del Bae March 2019', '"This confetti is making my butt tickle"', '"Ugh... I can\'t masturbate to this song. It\'s too depressing." -LDB 4/29/19' ] function range(start, end) { var foo = []; for (var i = start; i <= end; i++) { foo.push(i); } return foo; } //https://stackoverflow.com/questions/10718410/stuck-using-array-splice-to-shuffle-a-deck-array function shuffle(deck) { var newDeck = []; for (var i = 0; i < deck.length; i++) { var rand = Math.floor(Math.random() * (i + 1)); newDeck[i] = newDeck[rand]; newDeck[rand] = deck[i]; } return newDeck; } function qinit() { numr = range(0,quotemax-1); // array of quote INDEX [1 through quotemax] nums = shuffle(numr); // randomize quote index // console.log(nums); // document.write(nums); wi=-1; } quotemax = quotes.length; qinit(); function inArray(elem,array) { var len = array.length; for(var i = 0 ; i < len;i++) { if(array[i] == elem){return i;} } return -1; } function isNumber(num) { return (typeof num == 'string' || typeof num == 'number') && !isNaN(num - 0) && num !== ''; }; /* * Send delayed notice * @msg: message to send * @target: send the notice to this target * @delay: delay time in miliseconds * @weight: font weight * @group: send to group of users * noticeDelay : 300,500,1000, etc. */ function delayedNotice(delay, msg, target, bgcolor, fgcolor, weight, group) { if (msg && isNumber(delay) && delay > 0) { // Send Notice setTimeout(function(){ cb.sendNotice(msg,target,bgcolor,fgcolor,weight,group); }, delay); return true; } else { return false; } } var str1 = ''; var str2 = ''; var str3 = ''; var str4 = ''; var str5 = ''; var npos; var multi; var noticeDelta = 0; // for dual tip menus, start with menu 1 var all; // for /tipmenu cmd to skip noticedelta if set to 'all' // For auto-silencing at least some of token_wh*re_c*nts usernames var twcRegex = /t.?k.?n.?wh.?r.?_c.?nt.?/i; // timer vars var startTime = 0; var timerDuration = 0; var timeAdded = 0; var killtimer = 0; var purple = '#FFE0CC'; // Leaderboard vars var VERSION = '1.4.1', COMMAND_SHOW_LEADERBOARD = '!lb', CONFIG_COLOR_LEADER = '#9f9', INTERVAL_MULTIPLIER = 60000, UPDATE_TIME = 5000, NL = '\n', user_total_tips = {}, user_last_tip_time = {}, last_top3 = '', leader_username, update_counter = 0, interval_counter = 0, silent_room = true; // tip menu vars var HEART = '\u2665'; // ♥ BDIAMOND = '\u2666'; // ♦ BSTAR = '\u2605'; // ★ var tip_amt = 0; var separator_char = "| "; var msg; var Smsg; var MAXITEMS=10; var tipmenuprice = []; var tipmenuitem = []; var tipmenuprice2 = []; var tipmenuitem2 = []; var MAXSEP = 9; separators = [ {label:'Hearts',shortcut:':heart2'}, {label:'Glitter',shortcut:':pixelglitter'}, {label:'Flowers',shortcut:':tinyflower2'}, {label:'Bow',shortcut:':bluebow'}, {label:'Hearts2',shortcut:':pixelheart'}, {label:'Smiley',shortcut:':smile'}, {label:'Text Heart',shortcut:HEART}, {label:'Text Diamond',shortcut:BDIAMOND}, {label:'Text Star',shortcut:BSTAR}, ] var emotePattern = /^:/; var capitalised = /^[A-Z][^A-Z]*$/; var mm = cb.settings.mins; var Delay1 = (mm * 60) * 1000; // convert to milliseconds var Delay2 = ((mm + .75) * 60) * 1000; // offset message2 by 45 secs, keeps the spam down a bit var Delay3 = ((mm + .25) * 60) * 1000; var Delay4 = ((mm + .50) * 60) * 1000; var Delay5 = ((mm + 1.0) * 60) * 1000; var Delay6 = ((mm + .66) * 60) * 1000; function showNotice1() { cb.chatNotice(Notice1,'','','#800080','bold'); cb.setTimeout(showNotice1, Delay1); // 600000 = 10 mins, 720000 = 12 mins, 900000 = 15 mins } var str1 = cb.settings.Notice2; function showNotice2() { cb.chatNotice(str1,'','','#000080','bold'); cb.setTimeout(showNotice2, Delay2); } var str2 = cb.settings.Notice3; function showNotice3() { cb.chatNotice(str2,'','','#DC5500','bold'); cb.setTimeout(showNotice3, Delay3); } var str3 = cb.settings.Notice4; function showNotice4() { if (str3) { cb.chatNotice(str3,'','','#000080','bold'); cb.setTimeout(showNotice4, Delay4); } } var str4 = cb.settings.Notice5; function showNotice5() { if (str4) { cb.chatNotice(str4,'','','#DC5500','bold'); cb.setTimeout(showNotice5, Delay5); } } var str5 = cb.settings.Notice6; function showNotice6() { if (str5) { cb.chatNotice(str5,'','','#229922','bold'); cb.setTimeout(showNotice6, Delay6); } } function showTitle() { cb.chatNotice(titleMessage,'','#FFE0CC','#B00032','bold'); } ///////////////////////////////////////// handle entry messages cb.onEnter(function(user) { var u = user['user']; var message = ''; var color = '6600dd'; // skip stealth logins if (isSneaky(u)) { return; } // low to high if (isMM(u)) { // 444 message= "Eiffel Kings member "+ u; // color = cb.settings.mmBGColor; color = '880033'; // dark red } else if (isMG(u)) { // 777 message= "Lucky Stars member "+ u; // color = cb.settings.mgBGColor; color = '6600dd'; // bright purple } if ( isMM(u) && isMG(u) ) { // both message= "Lucky Stars & Eiffel Kings member "+ u; // color = cb.settings.mgBGColor; color = '3333cc'; // dark royal purple } if (message) { // #6600dd cb.sendNotice(message + ' has entered the room.','','','#'+color,'bold'); // return; } // not a club member, print generic message (only to user) [Lexus is using Kris' bot for this] // cb.sendNotice('Welcome to my room, ' + user['user'] + '. Please take a moment to read the Room Topic and my Profile below before chatting. Thank you!', user['user'], '#FAC7FF', '', 'bold'); cb.sendNotice('Type /tipmenu to see what you can tip for. Check out the bio for the full menu. Thank You. :)', user['user'], '#FAC7FF', '', 'normal'); }); ///////////////////////////////////////// cb.onMessage() ////////////////////////////////////////////////////////// cb.onMessage(function(msg) { // vars for ease of use var u = msg['user']; var m = msg['m']; var message = msg['m'].split(' '); //turn the message into an array /// LB handle user commands if ((msg.m.indexOf(COMMAND_SHOW_LEADERBOARD) == 0) && !msg['X-Spam']) { sendLeaderboard(true, msg.user); msg['X-Spam'] = true; } // highlight leader if ((cb.settings.highlight == 'yes') && (msg.user == leader_username)) { msg.background = CONFIG_COLOR_LEADER; } // schedule interval if (update_counter == 0){ scheduleInterval(); } if (!msg['X-Spam']){ silent_room = false; } /// var killtimer = 0; // needs to be reset every iteration //check to see if the user is attempting to use a timer command if(message[0].charAt(0) == '/') { //don't print this message to chat msg['X-Spam'] = true; var msgString = msg['m'].trim(); var split_index; var note; split_index = msgString.indexOf(' '); // Find first space character if (split_index > -1) { // Message might have a parameter (could just be padding) // command = msgString.substr(0, split_index).toLowerCase(); // substr (start index, length) note = msgString.substring(split_index + 1).trim(); // Could be empty } switch(message[0]) { case '/xtimer': { if(msg['is_mod'] || msg['user'] == cb.room_slug || msg['user'] == vdev) { startTimer(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters can use that command.',msg['user'],purple); } break; } case '/xaddtime': { if(msg['is_mod'] || msg['user'] == cb.room_slug || msg['user'] == vdev) { addTime(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters can use that command.',msg['user'],purple); } break; } case '/xtl': case '/xtimeleft': { timeLeft(msg['user']); break; } case '/xkilltimer': { if(msg['is_mod'] || msg['user'] == cb.room_slug || msg['user'] == vdev) { killtimer=1; startTime = 0; timeAdded = 0; timerDuration = 0; mod=0; var id3 = cb.setTimeout(fiveMinuteWarning) var id2 = cb.setTimeout(oneMinuteWarning) var id1 = cb.setTimeout(timer) cb.cancelTimeout(id1); cb.cancelTimeout(id2); cb.cancelTimeout(id3); // neither way seems to work :/ cb.setTimeout(timer,0); cb.setTimeout(fiveMinuteWarning,0); cb.setTimeout(oneMinuteWarning,0); cb.sendNotice('The timer was killed[?]',msg['user'],purple); } else { cb.sendNotice('Only moderators and broadcasters can use that command.',msg['user'],purple); } break; } //// random Lexus quote (command) case '/rlq': { if(msg['user'] == cb.room_slug || msg['user'] == vdev) { var results; var note; var rl; var prefix = ''; // note = document.querySelector('[name="note"]').value; if ( (note) && (isNumber(note)) ) { if (note > quotemax || note <0 ) { prefix = "('"+note+"' not found. Displaying random quote): "; note = Math.floor( Math.random() * (quotemax-1) ); // bad value, so pick a random quote } drn = note; qmsg = quotes[drn-1]; delayedNotice(175,u + ' tipped for a LexusQuote\u2122: [#' + drn + '/' + quotemax + '] ' + prefix + qmsg,'','','#124ba8','bold'); break; } if (note) { var results = quotes.filter(function(value) { return value.toLowerCase().indexOf(note.toLowerCase()) >= 0; }); } if (results) { var rl = results.length; } if (rl > 0) { if ( rl > 1) { // more than 1 result found, so pick random one (there will be dupes..) jk = Math.floor(Math.random() * rl); results = results[jk]; } var ia = inArray(results,quotes) qmsg = "('"+note+"': "+rl+" found) "+results; wm = ia; drn = wm + 1; } else { if (wi == quotemax-1) { qinit(); // re-shuffle quote index (or if CB cant handle it, just do i=-1 here) } wi++; wm = nums[wi]; qmsg = quotes[wm]; drn = wm + 1; if (rl == 0) { prefix = "('"+note+"' not found. Displaying random quote): "; } } delayedNotice(175,u + ' tipped for a LexusQuote\u2122: [#' + drn + '/' + quotemax + '] ' + prefix + qmsg,'','','#124ba8','bold'); } break; } //// case '/ln': { if ( u == vdev || u == cb.room_slug ) { if (note) { // cb.sendNotice( note,'','','#663399','bold'); delayedNotice(175,note,'','','#663399','bold'); } else { delayedNotice(150,'You need to include a note.',u,'','#fc0000'); } } msg['X-Spam'] = true; return msg; break; } case '/lnn': { if ( u == vdev || u == cb.room_slug ) { if (note) { // cb.sendNotice("---------------------------------------------------------",'','','#603090'); // cb.sendNotice( note,'','','#663399','bold'); // cb.sendNotice("---------------------------------------------------------",'','','#603090'); delayedNotice(175 ,"+-------------------------------------------------------+",'','','#603090'); delayedNotice(200,note,'','','#663399','bold'); delayedNotice(225,"+-------------------------------------------------------+",'','','#603090'); } else { delayedNotice(150,'You need to include a note.',u,'','#fc0000'); } } msg['X-Spam'] = true; return msg; break; } case "/liststars": { if ( u == vdev || u == cb.room_slug ) { cb.sendNotice('Current stars Members', u); var n = ""; for (var user in mgMembers) { n += "* "+user+"\n"; } delayedNotice(150,n,u); break; } } case "/listeiffelkings": { if ( u == vdev || u == cb.room_slug ) { cb.sendNotice('Current Cool eiffel kings Members', u); var n = ""; for (var user in mmMembers) { n += "* "+user+"\n"; } delayedNotice(150,n,u); break; } } case "/tipmenu": { //display the tip menu to user //var output = '***** TIP MENU *****'; //for (var key in tipMenu) { // output += '\n' + tipMenu[key] + ' [' + key + ' tokens]'; //} //output += '\n********************'; //cb.sendNotice(newLines(output), '', '', cb.settings.tip_menu_color, 'bold', ''); chatAd(u,'all'); // cheat? chatAd2(u,'all'); break; } case "/tipmenur": { if ( u == vdev || u == cb.room_slug ) { chatAd('lightblue','all'); // to room chatAd2('lightblue','all'); break; } } case "/bc": { if( msg['is_mod'] || u == vdev || u == cb.room_slug ) { if (null == note || "" == note && (" " == note && "\u00a0" == note)) { delayedNotice(175,"You can\u0027t send a blank message.\nThe correct syntax for this command is \u0022/bc message\u0022.", u); } else { delayedNotice(175,"\u25b6 Private message from Drew! :: " + note, cb.room_slug, "#fffec6", "#980098", "bold"); } break; } } } //End switch() } // Process commands, hide invalid ones -- cb.chatNotice(message, [to_user], [background], [foreground], [weight]) if (/^\//.test(m)) { if (m == '/ldbhelp' || m == '/timerhelp'){ delayedNotice(175,dbhelp,u,'','#900090','bold'); if (msg['is_mod'] || msg['user'] == cb.room_slug || msg['user'] == vdev ) { delayedNotice(200,'[mod] '+ timerhelp,u,'','#700070',''); } } if (m == '/ldbinfo'){ delayedNotice(175,'1. ♚ \u265A',u,'','','normal'); delayedNotice(200,escape('2. ♚ \u265A'),u,'','','normal'); } if (m == '/ldbversion'){ delayedNotice(175,dbversion,u,'','#2966B8','bold'); } msg['X-Spam'] = true; return msg; } ///// (high to low) -- lower club code outputs first (last in, first out) var wcm = u.toLowerCase(); //// test-app workaround! x = ''; x0 = ''; x1 = ''; if (isMM(u)) { x0 = JSON.parse(mmMembers[msg['user']].u); // get cats count if (x0 == 1) { x0=''; } // blank out 1 } if (isMG(u)) { x1 = JSON.parse(mgMembers[msg['user']].u); // get charms count if (x1 == 1) { x1=''; } } if (x0) { x='CC:'+x0+'x'; } if (x1) { x='LC:'+x1+'x'; } if (x0 && x1) { x='CC:'+x0+'x, LC:'+x1+'x'; } if (x) { x='('+x+')'; } if ( !isMod(wcm) ) { // NORMAL USERS OR BROADCASTER if (isMG(u) && !isMM(u) ) { // 777 msg['background'] = '#' + cb.settings.mgBGColor; if (cb.settings.mgcolordelta =='yes') { msg['c'] = '#' + cb.settings.mgTextColor; // change text color if option is set to YES } msg['m'] = x+" " + emojii + " " + msg['m']; // just emojii } if (isMM(u) && !isMG(u)) { // 444 msg['background'] = '#' + cb.settings.mmBGColor; if (cb.settings.mgcolordelta =='yes') { msg['c'] = '#' + cb.settings.mmTextColor; } msg['m'] = x+ " " + emojii2 + " " + msg['m']; } finalemojii = emojiiBC; if ( isMG(u) && isMM(u) ) { // both clubs msg['background'] = '#' + cb.settings.mgBGColor; // lucky stars BG color if (cb.settings.mgcolordelta =='yes') { msg['c'] = '#' + cb.settings.mgTextColor; // lucky stars text color } if (u == cb.settings.kingTipper) { finalemojii = mike3emojii; } msg['m'] = x+" " + finalemojii + " " + msg['m']; // both emojiis (and possibly crown for KT) } } ////// // MOD (i.e. MMB) text/colors (This will PRE-PEND the mod tag to any other category, i.e. [mod] [high roller], I just want the colors really) // var wcm = u.toLowerCase(); //// test-app workaround! if ( isMod(wcm) ) { // do MMB text and background colors and new monkey emote msg['background'] = '#' + cb.settings.modBGColor; // msg['background'] = 'linear-gradient(135deg, #ffe0b3 40%, #F4B970 100%)'; // works! // msg['background'] = 'linear-gradient(135deg, #efddba 30%, #f4b970 100%)'; // (10/25/2018) // msg['background'] = 'linear-gradient(315deg, #ff7878 0%, #80d680 74%)'; // (12/24/2018) xmas colors :p msg['background'] = 'linear-gradient(315deg, #bdd4e7 0%, #8693ab 74%)'; // (12/24/2018) new year's colors :p msg['background'] = 'linear-gradient(315deg, #9e8fb2 0%, #a7acd9 74%)'; // (12/24/2018) new year's colors :p more purple msg['c'] = '#' + cb.settings.modColor; // msg['c'] = fancytext; msg['m'] = x+" " + emojiiMMB + " " + msg['m']; } ////// // special colors for 50+ stars if (x1 > 49 || x0 > 49) { msg['background'] = '#ff9999'; // salmon msg['c'] = '#000000'; // black } // special colors for 100+ stars if (x1 > 99 || x0 > 99) { msg['background'] = '#202020'; // light black msg['c'] = '#b278e2'; // purple (#9265B8) } // special colors for 200+ stars if (x1 > 199 || x0 > 199) { msg['background'] = '#202020'; // light black msg['c'] = '#4992ff'; // light blue } // special colors for 300+ stars! if (x1 > 299 || x0 > 299) { msg['background'] = '#202020'; // light black msg['c'] = '#f4d142'; // light yellow } // special colors for 400+ stars! if (x1 > 399 || x0 > 399) { msg['background'] = '#202020'; // light black msg['c'] = '#baffce'; // light green } // special colors for 999+ stars! (Lexus) if (x1 > 999 || x0 > 999) { msg['background'] = '#202020'; // light black msg['c'] = ' #FF9900'; // orange } ////// // MVP text for all-time king tipper (KT gets diff gif as above) if ( u == cb.settings.kingTipper ) { // msg['m'] = "MVP " + crowngif + " " + msg['m']; msg['m'] = "MVP " + msg['m']; } ///// if (twcRegex.test(u)) { // Auto-silencing at least some of token_wh*re_c*nts usernames msg['X-Spam'] = true; } //code by asdfghjkl28, 3 uppercase words or more will be converted to lowercase (emote-safe) skips broadcater, mods, fanclub if ( (m.countWords() > 2) && (isUpperCase(m)) && !msg['is_mod'] && !msg['in_fanclub'] && msg['user'] != cb.room_slug && msg['user'] != vdev ) { var parts = msg['m'].split(" "); var cleaned = []; for (var kk = 0; kk < parts.length; kk++) { var word = parts[kk]; if (emotePattern.test(word) || capitalised.test(word)) { cleaned.push(word); } else { cleaned.push(word.toLowerCase()); } } msg['m'] = cleaned.join(' '); } return msg; }); function isUpperCase(myString) { return (myString == myString.toUpperCase()); } ///////////////////////////////////////// cb.onTip() //////////////////////////////////////////// cb.onTip(function (tip) { var amountTipped = parseInt(tip['amount']); var usr = tip['from_user']; var tipnote = tip['message']; // grab the tipe note for LexusQuote parsing /// LB stuff handleTip(tip.amount, tip.from_user); scheduleUpdate(); sortLeaderboard(); // should auto-highlight NON-fanclub member automatically instead of needing to do a "!lb" silent_room = false; /// // Make Lucky Stars (777) and announce it // if ( amountTipped == cb.settings.mgMinTip && !isMG(usr) ) { if ( amountTipped == cb.settings.mgMinTip ) { if ( !isMG(usr) ) { makeMG(usr); } doRain(cb.settings.mgRainText, cb.settings.mgRainCount); doAnnounce(cb.settings.mgAnnounce, cb.settings.mgMinTip, usr,cb.settings.mgBGColor); // } else if ( amountTipped == cb.settings.mmMinTip && !isMM(usr) ) { } else if ( amountTipped == cb.settings.mmMinTip ) { // Make Eiffel Kings (444) and announce it if ( !isMM(usr) ) { makeMM(usr); } doRain(cb.settings.mmRainText, cb.settings.mmRainCount); doAnnounce(cb.settings.mmAnnounce, cb.settings.mmMinTip, usr,cb.settings.mmBGColor); } //// random Lexus quote (tips) if ( amountTipped == cb.settings.quoteTip ) { // https://stackoverflow.com/questions/6625551/math-random-number-without-repeating-a-previous-number var results; var rl; var prefix = ''; if ( (tipnote) && (isNumber(tipnote)) ) { if (tipnote > quotemax || tipnote < 0 ) { prefix = "('"+tipnote+"' not found. Displaying random quote): "; tipnote = Math.floor(Math.random() * (quotemax-1) ); // bad value, so pick a random quote } drn = tipnote; qmsg = quotes[drn-1]; delayedNotice(150,usr + ' tipped for a LexusQuote\u2122: [#' + drn + '/' + quotemax + '] ' + prefix + qmsg,'','','#124ba8','bold'); return; } if (tipnote) { var results = quotes.filter(function(value) { return value.toLowerCase().indexOf(tipnote.toLowerCase()) >= 0; }); } if (results) { var rl = results.length; } if (rl > 0) { if ( rl > 1) { // more than 1 result found, so pick random one (there will be dupes..) jk = Math.floor(Math.random() * rl); results = results[jk]; } var ia = inArray(results,quotes) qmsg = "('"+tipnote+"': "+rl+" found) "+results; wm = ia; drn = wm + 1; } else { if (wi == quotemax-1) { qinit(); // re-shuffle quote index (or if CB cant handle it, just do i=-1 here) } wi++; wm = nums[wi]; qmsg = quotes[wm]; drn = wm + 1; if (rl == 0) { prefix = "(Displaying random quote): "; } } delayedNotice(150,usr + ' tipped for a LanaQuote\u2122: [#' + drn + '/' + quotemax + '] ' + prefix + qmsg,'','','#124ba8','bold'); } //// // tip menu handling for (var i = 1; i <= MAXITEMS; i++) { if (amountTipped == tipmenuprice[i]) { cb.sendNotice(usr + ' tipped for "' + tipmenuitem[i].trim() + '"','','',cb.settings['noticecolor'],'bold'); break; } if (amountTipped == tipmenuprice2[i]) { cb.sendNotice(usr + ' tipped for "' + tipmenuitem2[i].trim() + '"','','',cb.settings['noticecolor'],'bold'); break; } } }); function doRain(text,times) { // text += '!'; var star=''; if (times > 4) star='* '; if (times > 6) star='** '; // for (var i = 0; i < times; i++) { // cb.chatNotice(star+text); // } // rainbow colors (yellow fade to purple) if (times == cb.settings.mgRainCount) { // 777 cb.chatNotice(star+text,'','#000000','#FEDA7E','bold'); cb.chatNotice(star+text,'','#000000','#FC9063','bold'); cb.chatNotice(star+text,'','#000000','#DA5653','bold'); cb.chatNotice(star+text,'','#000000','#70102f','bold'); cb.chatNotice(star+text,'','#000000','#9265B8','bold'); cb.chatNotice(star+text,'','#000000','#553983','bold'); cb.chatNotice(star+text,'','#000000','#462aa2','bold'); } else { // 444 (blue fade) cb.chatNotice(star+text,'','#333344','#d2eafd','bold'); cb.chatNotice(star+text,'','#333344','#a6d4fa','bold'); cb.chatNotice(star+text,'','#333344','#79bff8','bold'); cb.chatNotice(star+text,'','#333344','#4daaf6','bold'); cb.chatNotice(star+text,'','#333344','#2196f3','bold'); } } // end function function doAnnounce(text,tokens,user,color) { var announcement = text.replace("MEMBERNAME", user); cb.chatNotice('** '+announcement+' ('+tokens+' tokens) **','','#191919','#'+color,'bold'); } // un-working for now (might be a test-app error?) function doText(bgc,fgc,txtm) { // I don't think msg[] is in the global scope? msg['background'] = '#' + bgc; msg['c'] = '#' + fgc; msg['m'] = "[" + txtm + "] " + msg['m']; //cb.log(msg['m']); } String.prototype.countWords = function(){ return this.split(/\s+/).length; } /////////////////////////////// array functions /////////////////////////////// function isMM(username) { return (username in mmMembers); // Cool cats } function isMG(username) { return (username in mgMembers); // Lucky charmers } function isSneaky(username) { return (username in sneakers); // stealth users } function makeMG(username) { mgMembers[username] = {'u': 1}; } function makeMM(username) { mmMembers[username] = {'u': 1}; } /////// //mods function isMod(username) { return (username in modMembers); } /// LB functions function handleTip(amount, user) { user_total_tips[user] = (user_total_tips[user] || 0) + amount; user_last_tip_time[user] = new Date().valueOf(); } function sortLeaderboard(){ var lb = []; for (var user in user_total_tips) { if (user_total_tips.hasOwnProperty(user)){ lb.push([user_total_tips[user], -user_last_tip_time[user], user]); } } if (lb.length > 0){ lb.sort(function(a, b){ var r,i; for (i=0; i < a.length; i++){ if (a[i] < b[i]){ return 1; } if (a[i] > b[i]){ return -1; } } return 0; }); leader_username = lb[0][2]; } return lb; } function formatRanking(leaderboard, rank){ if (rank < leaderboard.length) { var p = leaderboard[rank]; return p[2] + ' (' + p[0] + ' token' + (p[0]!=1 ? 's' : '') + ')'; } else { return '--'; } } function getTop3(leaderboard){ var rank, result=''; for (rank=0; rank<3; rank++){ if (rank>0){ result += '|'; } if (rank < leaderboard.length){ result += leaderboard[rank][2]; } } return result; } function sendLeaderboard(force, to_user) { var lb = sortLeaderboard(), l = to_user ? lb.length : 3, out = '### Tippers Leaderboard ###'; if (!force) { var top3 = getTop3(lb); if (top3 == last_top3){ return; } last_top3 = top3; } if (l<3) { l=3; } if (l < lb.length) { out += ' Top 3 (Type !lb to see the full leaderboard)'; } if (to_user){ // out += ' [v' + VERSION+']'; // mute version display } for (var rank=0; rank<l; rank++) { out += NL + '' + (rank+1) + '. ' + formatRanking(lb, rank); } cb.chatNotice(out, to_user,'#E9D5CE','#707','bold'); if (!to_user){ scheduleInterval(); } } function scheduleUpdate(){ var print_on_tip = cb.settings.print_on_tip; if (print_on_tip != 'never') { var counter = ++update_counter; cb.setTimeout(function(){ if (update_counter == counter){ sendLeaderboard(print_on_tip == 'always'); } }, UPDATE_TIME); } } function scheduleInterval(){ var interval = cb.settings.print_interval; if (interval > 0) { var counter = ++interval_counter; cb.setTimeout(function(){ if (interval_counter == counter){ sendLeaderboard(!silent_room); } }, interval*INTERVAL_MULTIPLIER); silent_room = true; } } /// //// new timer functions from Ultra Bot by britney_and_justin (need way to kill timer!) function startTimer(t, mod) { //there is no timer already running if(startTime == 0 && timeAdded == 0) { //verify a valid option was sent with /starttimer if(t >= 0 && t.toString().indexOf('.') == -1) { timerDuration = t; //notice of timer start if(mod != null) { cb.sendNotice(mod + ' has set a timer for ' + timerDuration + ' minutes!','',purple); } //local variable to convert noticeTime (minutes) to milliseconds var millis = timerDuration * 60000; var fiveMinutes = millis - 300000; var oneMinute = millis - 60000; //actual timer cb.setTimeout(timer,millis); //five minutes remaining announcement if(fiveMinutes > 0) { cb.setTimeout(fiveMinuteWarning,fiveMinutes); } //one minute remaining announcement cb.setTimeout(oneMinuteWarning,oneMinute); //set the start time startTime = new Date(); } else if(t != null) { cb.sendNotice('[mod] ' + t + ' is not a valid option for /timer. Check for typos.',mod,purple); } else if(t == null) { cb.sendNotice('[mod] You did not enter a valid option for /timer. Enter a number after the command. Ex.: /timer 5',mod,purple); } } //there is a timer running and time has been added else if(startTime != 0 && timeAdded != 0 && mod == null) { timeAdded = 0; timerDuration = t; //local variable to convert noticeTime (minutes) to milliseconds var millis = timerDuration * 60000; var fiveMinutes = millis - 300000; var oneMinute = millis - 60000; //actual timer cb.setTimeout(timer,millis); //five minutes remaining announcement if(fiveMinutes > 0) { cb.setTimeout(fiveMinuteWarning,fiveMinutes); } //one minute remaining announcement cb.setTimeout(oneMinuteWarning,oneMinute); } //there is a timer running and someone tried to start a new timer else if(startTime != 0 && timeAdded == 0 || startTime != 0 && timeAdded != 0 && mod != null) { cb.sendNotice('[mod] There is a timer running already.',mod,purple); } } function timer() { //check to see if /addTime has been used if(timeAdded == 0 && !killtimer) { cb.sendNotice('**** TIME IS UP!! ****','','#202020','#f0f000','bold'); startTime = 0; timerDuration = 0; } else { if(timeAdded == 5 && !killtimer) { cb.sendNotice('There are 5 minutes remaining!','',purple); } if (!killtimer) { startTimer(timeAdded); } } } function fiveMinuteWarning() { if(timeAdded == 0 && !killtimer) { cb.sendNotice('There are 5 minutes remaining!','',purple); } } function oneMinuteWarning() { if(timeAdded == 0 && !killtimer) { cb.sendNotice('There is 1 minute remaining!','',purple,'#000','bold'); } } function timeLeft(user) { if(startTime != 0) { //local variable for the current time var currentTime = new Date(); //local variable to hold the time left var timeLeft = startTime.getHours()*3600 + startTime.getMinutes()*60 + startTime.getSeconds() + timerDuration*60 - currentTime.getHours()*3600 - currentTime.getMinutes()*60 - currentTime.getSeconds(); //local variables for hours, minutes, and seconds remaining var hours = timeLeft/3600; hours = Math.floor(hours); var minutes = (timeLeft-hours*3600)/60; minutes = Math.floor(minutes); var seconds = timeLeft-hours*3600-minutes*60; //account for timeAdded minutes += timeAdded; //fix numbers after timeAdded if(hours < 0) { hours = 0; minutes = 0; } if(hours > 0) { if(hours > 9) { if(minutes > 9 && seconds > 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':' + seconds,user,purple); } else if(minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':0' + seconds,user,purple); } else if(minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':' + seconds,user,purple); } else if(minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: ' + hours + ':' + minutes + ':0' + seconds,user,purple); } } else { if(minutes > 9 && seconds > 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':' + seconds,user,purple); } else if(minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':0' + seconds,user,purple); } else if(minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':' + seconds,user,purple); } else if(minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 0' + hours + ':' + minutes + ':0' + seconds,user,purple); } } } else if(hours == 0 && minutes > 0) { if(minutes > 9 && seconds > 9) { cb.sendNotice('Time Remaining: 00:' + minutes + ':' + seconds,user,purple); } else if(minutes > 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 00:' + minutes + ':0' + seconds,user,purple); } else if(minutes <= 9 && seconds > 9) { cb.sendNotice('Time Remaining: 00:0' + minutes + ':' + seconds,user,purple); } else if(minutes <= 9 && seconds <= 9) { cb.sendNotice('Time Remaining: 00:0' + minutes + ':0' + seconds,user,purple); } } else if(hours == 0 && minutes == 0 && seconds > 0) { if(seconds > 9) { cb.sendNotice('Time Remaining: 00:00' + ':' + seconds,user,purple); } else { cb.sendNotice('Time Remaining: 00:00' + ':0' + seconds,user,purple); } } else { cb.sendNotice('hours: ' + hours + '\nminutes: ' + minutes + '\nseconds: ' + seconds); } } else { cb.sendNotice('There is no timer running.',user,purple); } } function addTime(t, mod) { if(t > 0 && t.toString().indexOf('.') == -1) { if(startTime != 0) { timeAdded = parseInt(t); //notice of timer start if(timeAdded == 1) { cb.sendNotice(mod + ' has has added 1 minute to the timer!','',purple); } else { cb.sendNotice(mod + ' has has added ' + timeAdded + ' minutes to the timer!','',purple); } } else { cb.sendNotice('[mod] There is no timer running.',mod,purple); } } else if(t != null) { cb.sendNotice('[mod]' + t + ' is not a valid option for /addtime. Check for typos.',mod,purple); } else if(t == null) { cb.sendNotice('[mod] You did not enter a valid option for /addtime. Enter a number after the command. Ex.: /addtime 5',mod,purple); } } //// ////////////////////////////////////////////////////////////////////////////////// function grabSettings() { // Get Eiffel Kings members 444 if (cb.settings.mmMemberList) { var mmMemberSettings = cb.settings.mmMemberList.split(','); for (var ii = 0; ii < mmMemberSettings.length; ii++) { npos = 0; multi = 0; clean = mmMemberSettings[ii].toLowerCase().replace(/ /g, ""); npos = clean.indexOf("*"); //username*3 - get pos of * if (npos > 0) { multi = clean.substring(npos+1); // get number temp = clean.substring(0,npos); // get username mmMembers[temp] = {'u': multi}; // // need to make new array with username:multi (?) } else { mmMembers[clean] = {'u': 1}; } } //end for() } // Get Lucky Star 777 if (cb.settings.mgMemberList) { var mgMemberSettings = cb.settings.mgMemberList.split(','); for (var ii = 0; ii < mgMemberSettings.length; ii++) { npos = 0; multi = 0; var clean = mgMemberSettings[ii].toLowerCase().replace(/ /g, ""); npos = clean.indexOf("*"); //username*3 - get pos of * if (npos > 0) { multi = clean.substring(npos+1); // get number temp = clean.substring(0,npos); // get username mgMembers[temp] = {'u': multi}; // // need to make new array with username:multi (?) } else { mgMembers[clean] = {'u': 1}; } } //end for() } // Get stealth logins if (cb.settings.sneakyList) { var ssMemberSettings = cb.settings.sneakyList.split(','); for (var ii = 0; ii < ssMemberSettings.length; ii++) { var clean = ssMemberSettings[ii].toLowerCase().replace(/ /g, ""); sneakers[clean] = {'u': 1}; } } // Get mods if (cb.settings.modList) { var modMemberSettings = cb.settings.modList.split(','); for (var ii = 0; ii < modMemberSettings.length; ii++) { var clean = modMemberSettings[ii].toLowerCase().replace(/ /g, ""); modMembers[clean] = {'u': 1}; } } cb.log('Finished grabbing settings, fire the script!'); } //////// Tip Menu Plus stuff function chatAd(option,all) { if (all == 'all') { // dont check/increment noticeDelta, just print the tipmenu } else { noticeDelta++; if (noticeDelta % 2 == 0) { // check for even iteration chatAd2(option); return; } } toUser = ''; group = ''; if (option !== 'lightblue') { toUser = option; } if (option == 'lightblue') { group = option; } if (msg!='Tip Menu: ') { delayedNotice(150,msg,toUser,'',cb.settings['noticecolor'],'bold',group); } if (!option) cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); } cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); function chatAd2(option,all) { toUser = ''; group = ''; if (option !== 'lightblue') { toUser = option; } if (option == 'lightblue') { group = option; } if (msg!='Tip Menu: ') { delayedNotice(150,'Tip Menu: '+Smsg,toUser,'',cb.settings['noticecolor'],'bold',group); } if (!option) cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); // re-run timer } // cb.setTimeout(chatAd2, ((cb.settings.chat_ad *1.3) * 60000)); // (8/17/2018) logic done in chatAd() now // init Tip Menu Plus function init() { for (i=0;i<=MAXSEP-1;i++) { if (cb.settings['sepchar'] == separators[i].label) { separator_char = separators[i].shortcut + ' '; } } msg = 'Tip Menu: '; Smsg = ' '+ separator_char + ' '; for (i=1;i<=MAXITEMS;i++) { var tmp; tmp=cb.settings['item' + i]; if (tmp) { var arr = tmp.split('--'); if (arr[1]===undefined) { cb.sendNotice('Error-You need two dashes to separate the tip amount and menu item for item no '+ i,'','',cb.settings['noticecolor'],'bold'); } else { var amt=parseInt(arr[0]); if (amt>0) { tipmenuprice[i]=amt; tipmenuitem[i]=arr[1]; if (i>=2) { msg += separator_char; } msg += arr[1] + '(' + amt + ') '; } } } } // secondary tip menu (hard-coded vars) for (i=1;i<=MAXITEMS;i++) { var tmp; tmp=cb.settings['Sitem' + i]; if (tmp) { var arr = tmp.split('--'); if (arr[1]===undefined) { cb.sendNotice('Error-You need two dashes to separate the tip amount and menu item for item no '+ i,'','',cb.settings['noticecolor'],'bold'); } else { var amt=parseInt(arr[0]); if (amt>0) { tipmenuprice2[i]=amt; tipmenuitem2[i]=arr[1]; if (i>=2) { Smsg += separator_char; } Smsg += arr[1] + '(' + amt + ') '; } } } } if (msg!= 'Tip Menu: ') { cb.sendNotice(msg + " " +Smsg,'','',cb.settings['noticecolor'],'bold'); } else { cb.sendNotice('Error-No tip menu items found','','',cb.settings['noticecolor'],'bold'); } } //// End of routines, fire the script! grabSettings(); showNotice1(); showNotice2(); showNotice3(); showNotice4(); showNotice5(); showNotice6(); showTitle(); init();
© Copyright Chaturbate 2011- 2025. All Rights Reserved.