Bots Home
|
Create an App
Badhabits bot
Author:
coridise2
Description
Source Code
Launch Bot
Current Users
Created by:
Coridise2
/** Name: Badhabits Bot Author: coridise Creation Date: 11/13/16 Live Verson: 1.00 Test Version: 1.00 **/ /** A combination of Ultra bot and multiple single line tip menus, rotating notifier, Multiple tip messages, Room rules upon entry, No Grey Demands,Graphics,Stickykeys,Caps, and Timelock Greys Purpose Room Control King Tip Leader Board Notifier Private Messages in Chat The Chaturbate Dick(less) List The Nice List 3 swappable Single line tipmenu upto 20 items each Rotating notifier with 5 notices Room Rules Control Greys **/ /** Change Log 1.00 Initial release version **/ //user settings { /** setting ==> result capsToggle ==> toggles the automatic toLower funciton for all caps messages invalidToggle ==> toggles the invalid command message tipTitles ==> toggles displaying the users' tips at the beginning of their messages kingTipper ==> toggle the King Tipper feature kingTipperSpam ==> toggles spamming "tip x to become king" every 5 minutes kingMin ==> minimum tip level for a user to be King kingTimer ==> interval for kingTipperSpam leaderBoard ==> toggles the Leader Board feature leaderBoardSpam ==> toggles spamming the top 3 tippers every 5 minutes leaderTimer ==> interval for leaderBoardSpam notiferEnter ==> toggle for message on enter enterMessage ==> message on enter notifierSpam ==> toggle for message on interval spamMessage ==> message on interval spamTimer ==> length of interval notifierTip ==> toggle for message on tip tipMessage ==> message on tip tipMessageMin ==> min tip for message dickList ==> toggle for auto-silencing users on the Chaturbate Dick(less) List niceList ==> list of users the host wants to guarantee voice and graphic privileges **/ cb.settings_choices = [ {name: 'color', label: 'Enter the six digit hex color code you would like to use for the background highlight.', type: 'str', minLength: 6, maxLength: 6, defaultValue: 'C287C2'}, {name: 'capsToggle', label: 'Would you like the bot to convert all capital messages to all lowercase messages?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'invalidToggle', label: 'Would you like the bot to send the user a message when an invalid command is entered?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'tipTitles', label: 'Do you want to display users\' tip totals as titles?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'kingTipper', label: 'Do you want to use the "King Tipper" feature?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'kingTipperSpam', label: 'Do you want to periodically announce the tip required to become King?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'kingMin', label: 'Enter the minimum tip level for a user to become King:', type: 'int', minValue: 1, maxValue: 1000000, defaultValue: 25}, {name: 'kingTimer', label: 'Change this value if you would like the King announcement to happen at a different interval:', type: 'int', minValue: 1, maxValue: 60, defaultValue: 5}, {name: 'leaderBoard', label: 'Would you like to use the Leader Board feature?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'leaderBoardSpam', label: 'Do you want to periodically announce the top three tippers?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'leaderTimer', label: 'Change this value if you would like the Leaderboard announcement to happen at a different interval:', type: 'int', minValue: 1, maxValue: 60, defaultValue: 5}, // {name: 'notifierEnter', label: 'Would you like to display a message for users when they enter the room?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, // {name: 'enterMessage', label: 'Enter the message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Welcome to my room!'}, {name: 'notifierSpam', label: 'Would you like to periodicaly send a message to the room?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'spamMessage1', label: 'Enter the first message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Welcome to your favorite Badhabits! FYI: Jaymes is the boi with the shaved head and he is FTM (Female-to-Male) Transgender. Look it up or see bio for answers. Leona is the leggy, doe-eyed, dread-head and she is female.'}, {name: 'spamMessage2', label: 'Enter the second message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Leona is A GORGEOUS SEXY Doe-eyed woman! Jaymes is the FTM boi do NOT refer to him as Female!'}, {name: 'spamMessage3', label: 'Enter the third message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Send Dirty talk in a tip note!'}, {name: 'spamMessage4', label: 'Enter the fourth message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Email: cb.badhabits@gmail.com | Twitter: @two_badhabits'}, {name: 'spamMessage5', label: 'Enter the fifth message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Ask about specials on private shows, videos and sexy snapshots to hold you over in between broadcasts!'}, {name: 'spamTimer', label: 'Change this value if you would like the room announcement to happen at a different interval:', type: 'int', minValue: 1, maxValue: 60, defaultValue: 4}, {name: 'notifierTip', label: 'Would you like to display a message when a user tips?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'tipMessage1', label: 'Enter the lowest tip message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Thank you!'}, {name: 'tipMessageMin1', label: 'Enter the minimum tip amount that you would like to trigger the message', type: 'int', minValue: 1, maxValue: 1000000, defaultValue: 2}, {name: 'tipMessage2', label: 'Enter the regular tip message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: ':thanksfortipping'}, {name: 'tipMessageMin2', label: 'Enter the minimum tip amount that you would like to trigger the message', type: 'int', minValue: 1, maxValue: 1000000, defaultValue: 25}, {name: 'tipMessage3', label: 'Enter the new highest single tip message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Thank you!! We now have a new single highest tip amount!!! :thanks'}, {name: 'tipMessageMin3', label: 'Enter the current highest tip amount + 1 that you would like to trigger the message', type: 'int', minValue: 1, maxValue: 1000000, defaultValue: 100}, {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: "menu", type: "choice", choice1: "L", choice2: "J", choice3: "B", choice4: "N", defaultValue: "L", label: "Which menu to start?"}, {name: 'sepchar', type: 'choice', choice1: 'Vertical Bar', choice2: 'Hearts', defaultValue: 'Hearts', label: "Separator character"}, {name:'item1', type:'str', label:'Item 1', defaultValue: 'PM'}, {name:'item1price', type:'int', label:'Item 1 Price', defaultValue: 55}, {name:'item2', type:'str', label:'Item 2', defaultValue: 'Five Bare Bottom Spanks'}, {name:'item2price', type:'int', label:'Item 2 Price', defaultValue: 29}, {name:'item3', type:'str', label:'Item 3', defaultValue: 'Titties'}, {name:'item3price', type:'int', label:'Item 3 Price', required: false, defaultValue: 51}, {name:'item4', type:'str', label:'Item 4', required: false}, {name:'item4price', type:'int', label:'Item 4 Price', required: false}, {name:'item5', type:'str', label:'Item 5', required: false, defaultValue: 'Pussy (No Pink)'}, {name:'item5price', type:'int', label:'Item 5 Price', required: false, defaultValue: 61}, {name:'item6', type:'str', label:'Item 6', required: false, defaultValue: 'Nipple play'}, {name:'item6price', type:'int', label:'Item 6 Price', required: false, defaultValue: 65}, {name:'item7', type:'str', label:'Item 7', required: false, defaultValue: 'Dance/Shake Assets'}, {name:'item7price', type:'int', label:'Item 7 Price', required: false, defaultValue: 70}, {name:'item8', type:'str', label:'Item 8', required: false, defaultValue: 'Naughty Pussy Flash in Doggy'}, {name:'item8price', type:'int', label:'Item 8 Price', required: false, defaultValue: 111}, {name:'item9', type:'str', label:'Item 9', required: false, defaultValue: 'Finger pussy'}, {name:'item9price', type:'int', label:'Item 9 Price', required: false, defaultValue: 145}, {name:'item10', type:'str', label:'Item 10', required: false, defaultValue: 'Vibrator Pleasure'}, {name:'item10price', type:'int', label:'Item 10 Price', required: false, defaultValue: 169}, {name:'item11', type:'str', label:'Item 11', required: false, defaultValue: 'Striptease'}, {name:'item11price', type:'int', label:'Item 11 Price', required: false, defaultValue: 199}, {name:'item12', type:'str', label:'Item 12', required: false, defaultValue: 'Choose an Item to Wear'}, {name:'item12price', type:'int', label:'Item 12 Price', required: false, defaultValue: 211}, {name:'item13', type:'str', label:'Item 13', required: false, defaultValue: 'Instacum'}, {name:'item13price', type:'int', label:'Item 13 Price', required: false, defaultValue: 1111}, {name:'item14', type:'str', label:'Item 14', required: false}, {name:'item14price', type:'int', label:'Item 14 Price', required: false}, {name:'item15', type:'str', label:'Item 15', required: false}, {name:'item15price', type:'int', label:'Item 15 Price', required: false}, {name:'item16', type:'str', label:'Item 16', required: false}, {name:'item16price', type:'int', label:'Item 16 Price', required: false}, {name:'item17', type:'str', label:'Item 17', required: false, defaultValue: 'Buy my panties'}, {name:'item17price', type:'int', label:'Item 17 Price', required: false, defaultValue: 2222}, {name:'item18', type:'str', label:'Item 18', required: false}, {name:'item18price', type:'int', label:'Item 18 Price', required: false}, {name:'item19', type:'str', label:'Item 19', required: false}, {name:'item19price', type:'int', label:'Item 19 Price', required: false}, {name: 'item20', type:'str', label:'Item 20', required: false}, {name:'item20price', type:'int', label:'Item 20 Price', required: false}, {name:'Jitem1', type:'str', label:'JItem 1', defaultValue: 'PM'}, {name:'Jitem1price', type:'int', label:'JItem 1 Price', defaultValue: 55}, {name:'Jitem2', type:'str', label:'JItem 2', defaultValue: 'Five Bare Bottom Spanks'}, {name:'Jitem2price', type:'int', label:'JItem 2 Price', defaultValue: 400}, {name:'Jitem3', type:'str', label:'JItem 3', defaultValue: 'Topless Flash'}, {name:'Jitem3price', type:'int', label:'JItem 3 Price', required: false, defaultValue: 251}, {name:'Jitem4', type:'str', label:'JItem 4', required: false, defaultValue: 'Ass'}, {name:'Jitem4price', type:'int', label:'JItem 4 Price', required: false, defaultValue: 355}, {name:'Jitem5', type:'str', label:'JItem 5', required: false, defaultValue: 'Click Flash'}, {name:'Jitem5price', type:'int', label:'JItem 5 Price', required: false, defaultValue: 569}, {name:'Jitem6', type:'str', label:'JItem 6', required: false}, {name:'Jitem6price', type:'int', label:'JItem 6 Price', required: false}, {name:'Jitem7', type:'str', label:'JItem 7', required: false, defaultValue: 'Dance'}, {name:'Jitem7price', type:'int', label:'JItem 7 Price', required: false, defaultValue: 170}, {name:'Jitem8', type:'str', label:'JItem 8', required: false}, {name:'Jitem8price', type:'int', label:'JItem 8 Price', required: false}, {name:'Jitem9', type:'str', label:'JItem 9', required: false}, {name:'Jitem9price', type:'int', label:'JItem 9 Price', required: false}, {name:'Jitem10', type:'str', label:'JItem 10', required: false}, {name:'Jitem10price', type:'int', label:'JItem 10 Price', required: false}, {name:'Jitem11', type:'str', label:'JItem 11', required: false}, {name:'Jitem11price', type:'int', label:'JItem 11 Price', required: false}, {name:'Jitem12', type:'str', label:'JItem 12', required: false}, {name:'Jitem12price', type:'int', label:'JItem 12 Price', required: false}, {name:'Jitem13', type:'str', label:'JItem 13', required: false}, {name:'Jitem13price', type:'int', label:'JItem 13 Price', required: false}, {name:'Jitem14', type:'str', label:'JItem 14', required: false}, {name:'Jitem14price', type:'int', label:'JItem 14 Price', required: false}, {name:'Jitem15', type:'str', label:'JItem 15', required: false}, {name:'Jitem15price', type:'int', label:'JItem 15 Price', required: false}, {name:'Jitem16', type:'str', label:'JItem 16', required: false}, {name:'Jitem16price', type:'int', label:'JItem 16 Price', required: false}, {name:'Jitem17', type:'str', label:'JItem 17', required: false}, {name:'Jitem17price', type:'int', label:'JItem 17 Price', required: false}, {name:'Jitem18', type:'str', label:'JItem 18', required: false}, {name:'Jitem18price', type:'int', label:'JItem 18 Price', required: false}, {name:'Jitem19', type:'str', label:'JItem 19', required: false}, {name:'Jitem19price', type:'int', label:'JItem 19 Price', required: false}, {name: 'Jitem20', type:'str', label:'JItem 20', required: false}, {name:'Jitem20price', type:'int', label:'JItem 20 Price', required: false}, {name:'Bitem1', type:'str', label:'BItem 1', defaultValue: 'PM'}, {name:'Bitem1price', type:'int', label:'BItem 1 Price', defaultValue: 55}, {name:'Bitem2', type:'str', label:'BItem 2', defaultValue: 'Five Bare Bottom Spanks(Leona)'}, {name:'Bitem2price', type:'int', label:'BItem 2 Price', defaultValue: 29}, {name:'Bitem3', type:'str', label:'BItem 3', defaultValue: 'Titties'}, {name:'Bitem3price', type:'int', label:'BItem 3 Price', required: false, defaultValue: 51}, {name:'Bitem4', type:'str', label:'BItem 4', required: false, defaultValue: 'Nibble Nipples'}, {name:'Bitem4price', type:'int', label:'BItem 4 Price', required: false, defaultValue: 80}, {name:'Bitem5', type:'str', label:'BItem 5', required: false, defaultValue: 'Pussy (No Pink)'}, {name:'Bitem5price', type:'int', label:'BItem 5 Price', required: false, defaultValue: 61}, {name:'Bitem6', type:'str', label:'BItem 6', required: false, defaultValue: 'Nipple play'}, {name:'Bitem6price', type:'int', label:'BItem 6 Price', required: false, defaultValue: 65}, {name:'Bitem7', type:'str', label:'BItem 7', required: false, defaultValue: 'Dance/Shake Assets'}, {name:'Bitem7price', type:'int', label:'BItem 7 Price', required: false, defaultValue: 70}, {name:'Bitem8', type:'str', label:'BItem 8', required: false, defaultValue: 'Naughty Pussy Flash in Doggy'}, {name:'Bitem8price', type:'int', label:'BItem 8 Price', required: false, defaultValue: 111}, {name:'Bitem9', type:'str', label:'BItem 9', required: false, defaultValue: 'Finger pussy'}, {name:'Bitem9price', type:'int', label:'BItem 9 Price', required: false, defaultValue: 145}, {name:'Bitem10', type:'str', label:'BItem 10', required: false, defaultValue: 'Vibrator Pleasure'}, {name:'Bitem10price', type:'int', label:'BItem 10 Price', required: false, defaultValue: 169}, {name:'Bitem11', type:'str', label:'BItem 11', required: false, defaultValue: 'Striptease'}, {name:'Bitem11price', type:'int', label:'BItem 11 Price', required: false, defaultValue: 199}, {name:'Bitem12', type:'str', label:'BItem 12', required: false, defaultValue: 'Choose an Item to Wear'}, {name:'Bitem12price', type:'int', label:'BItem 12 Price', required: false, defaultValue: 211}, {name:'Bitem13', type:'str', label:'BItem 13', required: false, defaultValue: 'Instacum'}, {name:'Bitem13price', type:'int', label:'BItem 13 Price', required: false, defaultValue: 1111}, {name:'Bitem14', type:'str', label:'BItem 14', required: false, defaultValue: 'Pussy Licking'}, {name:'Bitem14price', type:'int', label:'BItem 14 Price', required: false, defaultValue: 222}, {name:'Bitem15', type:'str', label:'BItem 15', required: false, defaultValue: 'Suck Cock'}, {name:'Bitem15price', type:'int', label:'BItem 15 Price', required: false, defaultValue: 255}, {name:'Bitem16', type:'str', label:'BItem 16', required: false, defaultValue: 'Fuck Tease'}, {name:'Bitem16price', type:'int', label:'BItem 16 Price', required: false, defaultValue: 555}, {name:'Bitem17', type:'str', label:'BItem 17', required: false, defaultValue: 'Buy Leona panties'}, {name:'Bitem17price', type:'int', label:'BItem 17 Price', required: false, defaultValue: 2222}, {name:'Bitem18', type:'str', label:'BItem 18', required: false}, {name:'Bitem18price', type:'int', label:'BItem 18 Price', required: false}, {name:'Bitem19', type:'str', label:'BItem 19', required: false}, {name:'Bitem19price', type:'int', label:'BItem 19 Price', required: false}, {name:'Bitem20', type:'str', label:'BItem 20', required: false}, {name:'Bitem20price', type:'int', label:'BItem 20 Price', required: false}, {name:'noticecolor', type:'str', label:'Notice color (html code default red #FF0000)', defaultValue: '#FF0000'}, {name: 'chat_ad', type:'int', minValue: 1, maxValue: 999, defaultValue: 10, label: 'Delay in minutes between menu being displayed (minimum 1)'}, // {name: 'RoomRules', label: 'Use Room Rules?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name:'rule1', type:'str', minLength:1, maxLength:255, label:'Rule #1', defaultValue: 'Please be courteous to me and each other!'}, {name:'rule2', type:'str', minLength:1, maxLength:255, label:'Rule #2 (optional)', required:false, defaultValue: 'Talk to me! I love meeting new people and love even more when you introduce yourself!'}, {name:'rule3', type:'str', minLength:1, maxLength:255, label:'Rule #3 (optional)', required:false, defaultValue: 'No ALL CAPS!!!!'}, {name:'rule4', type:'str', minLength:1, maxLength:255, label:'Rule #4 (optional)', required:false, defaultValue: 'No advertising!'}, {name:'rule5', type:'str', minLength:1, maxLength:255, label:'Rule #5 (optional)', required:false, defaultValue: 'No Demanding or Directing! Tip for requests!'}, {name:'rule6', type:'str', minLength:1, maxLength:255, label:'Rule #6 (optional)', required:false, defaultValue: 'PMs are distracting please send private messages in a tip note! If you must PM it is 55 tokens!!'}, {name:'rule7', type:'str', minLength:1, maxLength:255, label:'Rule #7 (optional)', required:false, defaultValue: 'Our names are Jaymes and Leona!! NOT BB or Baby please use our names!'}, {name:'rule8', type:'str', minLength:1, maxLength:255, label:'Rule #8 (optional)', required:false, defaultValue: 'DONOT make requests that are against policy or you will be silenced!'}, {name:'rule9', type:'str', minLength:1, maxLength:255, label:'Rule #9 (optional)', required:false}, {name:'rule10', type:'str', minLength:1, maxLength:255, label:'Rule #10 (optional)', required:false}, {name:'rules_wait_time', type:'int', label:'Notification Time (in minutes)', defaultValue:15}, {name: 'msgonentry', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Display warning to greys on entry - set to no for busy rooms"}, {name: 'mutehide', type: 'choice', choice1: 'mute', choice2: 'hide', defaultValue: 'hide', label: "Mute (replaces message) or hide (no notifications)"}, {name: 're0', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute demands (open/show/zoom/see/spread/touch & boobs/tits/ass/pussy/body/vagina/nipple)?"}, {name: 're1', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute graphics?"}, {name: 're2', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute sticky keys (3+ repeating characters eg. mmmm)?"}, {name: 're3', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute demand words (pm,c2c,private,pvt,prvt)?"}, {name: 're4', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute spam words (streamingnaked,18f cam,18female,erotimo,amecam,goo)?"}, {name: 're5', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute rude words (bitch,slut,whore,ugly,fat,pee,poo,peeing,fist,fart)?"}, {name: 're6', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute baby words (bb,baby,daddy)?"}, {name: 're7', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute feet words (feet,foot,soles,toes)?"}, {name: 're8', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute non-english characters (cyrillic,arabic,chinese,accented)?"}, {name: 're9', type: 'choice', choice1: 'yes', choice2: 'no', defaultValue: 'yes', label: "Mute all caps?"}, {name: "timelock_duration", type: "int", minValue: 1, maxValue: 99, defaultValue: 5, label: "Timelock duration in minutes"}, {name: "greys_off", type: "choice", choice1: "False", choice2: "True", defaultValue: "False", label: "Turn greys off entirely"}, {name: "messages_header", required: false, type: "str", minLength: 1, maxLength: 255, defaultValue: "{0} will become the number of minutes", label: "Below are messages for customization/translation (Optional)"}, {name: "msg_welcome", type: "str", minLength: 1, maxLength: 255, defaultValue: "Please sit back and enjoy the show! You are timelocked and will be able to chat {0} minutes after joining.", label: "Welcome message for greys (timelock active)"}, {name: "msg_welcome_greys_off", type: "str", minLength: 1, maxLength: 255, defaultValue: "Welcome! Grey chat has been disabled so please sit back and enjoy the show!", label: "Welcome message for greys (greys off)"}, {name: "msg_locked", type: "str", minLength: 1, maxLength: 255, defaultValue: "You are timelocked and cannot chat for another {0} minutes. You may skip the wait by purchasing tokens.", label: "Message for chatting while timelocked"}, {name: "msg_cantchat", type: "str", minLength: 1, maxLength: 255, defaultValue: "Grey chat has been disabled. You must purchase some tokens before you will be allowed to chat.", label: "Message for chatting while grey chat is off"}, {name: "msg_greyson", type: "str", minLength: 1, maxLength: 255, defaultValue: "Grey chat has been enabled.", label: "Greys on announcement"}, {name: "msg_greysoff", type: "str", minLength: 1, maxLength: 255, defaultValue: "Grey chat has been disabled.", label: "Greys off announcement"} ] } //variables { /** Variable ==> Purpose tipperArray ==> [i][0] = User's name [i][1] = User's total tips this session numTippers ==> number of users who have given tips this session modArray ==> array of mods eModArray ==> [i] = User's name, list of users who have been given emergency mod powers numMods ==> number of moderators this session numEMods ==> number of users who have been given emergency mod powers this session niceArray ==> [i] = user's name, list of users who have been added to the nice list numNice ==> number of users who have been added to the nice list silenceArray ==> [i] = User's name, list of users who have been silenced numSilenced ==> number of users who have been added to the silence list ignoreArray ==> [i][0] = user's name, [i][1] = user's ignore level, [i][j>1] = person on the user's ignore list numIgnorers ==> number of users who have added people to their ignore lists whisperArray ==> [i][0] = user's name, [i][1] = user who most recently whispered user [i][0] numWhispers ==> number of users stored in whisperArray silenceLevel ==> 0 = anyone can talk 1 = users with tips can talk, 2 users who have tipped can talk, 3 = users who have tipped >=10 can talk graphicLevel ==> 0 = anyone can use graphics 1 = users with tips can use graphics, 2 users who have tipped can use graphics, 3 = users who have tipped >=10 can use graphics startTime ==> the time the timer was started. it is used to calculate time left timerDuration ==> length of the timer in minutes timeAdded ==> amount of time being added to a currently running timer currentKing ==> holds the user name of the current king kingTip ==> holds the value of the king tipper's tip total kingTimer ==> user defined interval for king spam leaderArray ==> array that holds the top 3 tippers' names and tip totals leaderTimer ==> user defined interval for leader spam initialize ==> runs init() once only kingTipperSpam ==> facilitates command to toggle king tipper spam notifierSpamTGL ==> facilitates command to toggle notifier spam leaderboardSpam ==> facilitates command to toggle leaderboard spam notifierMessage ==> message the user wants to send periodically **/ { var tipperArray = new Array; var numTippers = 0; var modArray = new Array; modArray[0] = cb.room_slug; var eModArray = new Array; var numMods = 1; var numEMods = 0; var dickArray = ['']; var niceArray = new Array; var numNice = 0; var silenceArray = new Array; var numSilenced = 0; var ignoreArray = new Array; var numIgnorers = 0; var whisperArray = new Array; var numWhispers = 0; var silenceLevel = 0; var graphicLevel = 1; var startTime = 0; var timerDuration = 0; var timeAdded = 0; var currentKing = ''; var kingTip = 0; var kingTimer = parseInt(cb.settings.kingTimer); var leaderArray = [['',0],['',0],['',0]]; var leaderTimer = parseInt(cb.settings.leaderTimer); var initialize = 0; var kingTipperSpam = 0; var notifierSpamTGL = 0; var leaderboardSpam = 0; var notifierMessage = cb.settings.spamMessage; var tip_amt = 0; var separator_char = "| "; var tipSingleMax = cb.settings.tipMessageMin3; var spamNum = 1; var MAX_REASONS = 9; var MAX_CHECKS = 11; var EnterMsg = ''; var seen = {}; var menu = ''; mutereasons = [ {regexp: /((?=.*fuck)|(?=.*finger)|(?=.*suck)|(?=.*show)|(?=.*zoom)|(?=.*open)|(?=.*see)|(?=.*touch)|(?=.*spread)|(?=.*lick)|(?=.*body)|(?=.*ass)|(?=.*pussy)|(?=.*boobs)|(?=.*bobs)|(?=.*tits)|(?=.*vagina)|(?=.*nipples)|(?=.*breasts)|(?=.*asshole)|(?=.*cock)|(?=.*penis)|(?=.*clit)|(?=.*face)|(?=.*f*ck))/i, notice: 'demands', index: 0}, {regexp: /:\b/, notice: 'graphics', index: 1}, {regexp: /(.)\1{2}/, notice: 'sticky keys', index: 2}, {regexp: /((?=.*pm)|(?=.*c2c)|(?=.*cam?2?cam)|(?=.*private)|(?=.*pvt)|(?=.*prvt))/i, notice: 'PM requests', index: 3}, {regexp: /((swipegirls)|(freecambook)|(skype)|(freetoken)|(kik)|(mypage)|(leaked)|(mybio)|(mycam)|(myprofile)|(mypr0file)|(myroom)|(tokengenerator)|(streamingnaked)|(erotimo)|(amecam)|(1.?f)|(bestwork)|(premiumcheat)|(ellagocam)|(visitthis)|(fucktubate)|(goo\.gl)|(goodotgl)|(\.com)|(dotcom)|(aly.sky)|(www))/i, notice: 'spam', index: 4}, {regexp: /((?=.*lesbian)|(?=.*lez)|(?=.*lezzy)|(?=.*fag)|(?=.*gay)|(?=.*clam)|(?=.*slut)|(?=.*scissors)|(?=.*dyke)|(?=.*muff*)|(?=.*munch*)|(?=.*lesbo)|(?=.*cunt)|(?=.*bitch)|(?=.*whore)|(?=.*ugly)|(?=.*fat)|(?=.*fake)|(?=.*dildo)|(?=.*pee)|(?=.*poo)|(?=.*fist)|(?=.*fart)|(?=.*puke)|(?=.*tranny))/i, notice: 'rudeness', index: 5}, {regexp: /((?=.*bb)|(?=.*b b)|(?=.*baby)|(?=.*babby)|(?=.*girl)|(?=.*daddy))/i, notice: 'bb or baby', index: 6}, {regexp: /((?=.*f.?e.?e.?t)|(?=.*f33t?)|(?=.*foot)|(?=.*soles?)|(?=.*toes?))/i, notice: 'feet', index: 7}, {regexp: /[^\x00-\x7F]+/, notice: 'non-english', index: 8}, {regexp: /\b[A-Z]{2,}\b/, notice: 'all caps', index: 9}, {regexp: /(please|plz|pls|pleas).?.?$/i, notice: 'demands', index: 0}, {regexp: /((^mast.?rbate.?.?$)|(^squirt.?.?$)|(^kiss.?.?$)|(^cum.?.?$)|(^twerk.?.?$)|(^ass.?.?$)|(^boobs?.?.?$)|(^pussy.?.?$)|(^doggy.?.?$)|(^anal.?.?$)|(^zoom.?.?$)|(^show.?.?$)|(^tits?.?.?$)|(?=.*stand up.?.?)|(?=.*face.?.?)|(?=.*watch my cam.?.?)|(?=.*watch me.?.?))/i, notice: 'demands', index: 0}, ] //color codes { var purple = "#C287C2";//original color: #B369B3 } } } // Logging var log = {}; log.DEBUG = 0; log.INFO = 1; log.WARN = 2; log.ERR = 3; log.level = log.WARN; // Default log level // Log to debug level log.debug = function(msg) { if (log.level > log.DEBUG) return; //cb.log("Debug: " + msg); tellOwner("Debug: " + log.format(msg)); }; // Log to info level log.info = function(msg) { if (log.level > log.INFO) return; tellOwner("Info: " + log.format(msg)); }; // Log to warning level log.warn = function(msg) { if (log.level > log.WARN) return; tellOwner("Warning: " + log.format(msg)); }; // Log to info level log.err = function(msg) { if (log.level > log.ERR) return; tellOwner("Error: " + log.format(msg)); }; // Format as string, using JSON to pretty print structures log.format = function(msg) { if (typeof msg === "string") return msg; else return JSON.stringify(msg, null, 4); }; //functions { /** Function ==> Purpose tipperArrayPopulate ==> adds tippers to the tipperArray findTipper ==> finds and returns the index of a user eModArrayPopulate ==> adds users to the eModArray niceArrayPopulate ==> adds users to the niceArray setSilenceLevel ==> called when /silencelevel is used. sets silenceLevel setGraphicLevel ==> called when /graphiclevel is used. sets graphiclevel silence ==> called when /silence is used. adds a user to the silenceArray unsilence ==> called when /unsilence is used. removes a user from the silenceArray startTimer ==> called when /starttimer is used. starts a timer for t minutes timer ==> called from startTimer. it's the actual timer fiveMinuteWarning ==> called from startTimer. if t > 5, sounds a warning at 5 minutes remaining oneMinuteWarning ==> called from startTimer. if t > 2, sounds a warning at 1 minute remaining timeLeft ==> called when /timeleft is used. sends the user a notice with the time remaining addTime ==> called when /addtime is used. adds t minutes to the timer, if one is running sendWhisper ==> called when /whisper or an alias of /whisper is used. sends a private message to a user in chat ignoreUser ==> called when /ignore is used. adds a member to the user's ignore list unignoreUser ==> called when /unignore is used. removes a member from the user's ignore list setIgnoreLevel ==> called when /ignorelevel is used. sets ignoreLevel for the user setTipTitles ==> called from onMessage. appends the user's tips to the beginning of the message eMod ==> called when /emod is used. adds or removes a user from the eModArray kingSpam ==> spams "tip x to be king" every 5 minutes if the user setting allows it kingSpamTimer ==> the actual timer for kingSpam leaderSpam ==> spams the leaderboard every 5 minutes leaderSpamTimer ==> the actual timer for leaderSpam showLeaderBoard ==> called when /leaderboard is used. shows the leaderboard notifierSpam ==> called from init, starts the timer for notifer spam notiferSpamTimer ==> the actual timer for notifierSpam nice ==> called from /addnice and /removenice. adds and removes users from the niceArray kingSpamToggle ==> called when /kingspam is used. toggles the spam notifierSpamToggle ==> called when /notifierspam is used. toggles the spam colorChecker ==> verifies the color code is valid **/ //MENU START function setmenu(s, mod) { if(s == 'L') { menu = s; cb.sendNotice("Menu " + menu + " has been started", cb.room_slug, purple); chatAd() } if(s == 'J') { menu = s; cb.sendNotice("Menu " + menu + " has been started", cb.room_slug, purple); chatAd(); } if(s == 'B') { menu = s; cb.sendNotice("Menu " + menu + " has been started", cb.room_slug, purple); chatAd(); } if(s == 'N') { menu = s; cb.sendNotice("Menu " + menu + " has been started", cb.room_slug, purple); cb.sendNotice("Menu has been stopped", purple); chatAd(); } else { cb.sendNotice(s + ' must be L, J, B or N. If not resend /menu with correct letter to change menu.',mod,purple); } } function chatAd() { if (menu != 'N') { var msg = 'Tip Menu: '; if (menu == 'L') { for (i=1;i<=20;i++) { if (parseInt(cb.settings['item' + i + 'price'])>0) { if (i>=2) { msg += separator_char; } msg += cb.settings['item' + i] + '(' + parseInt(cb.settings['item' + i + 'price']) + ') '; } } } if (menu == 'J') { for (i=1;i<=20;i++) { if (parseInt(cb.settings['Jitem' + i + 'price'])>0) { if (i>=2) { msg += separator_char; } msg += cb.settings['Jitem' + i] + '(' + parseInt(cb.settings['Jitem' + i + 'price']) + ') '; } } } if (menu == 'B') { for (i=1;i<=20;i++) { if (parseInt(cb.settings['Bitem' + i + 'price'])>0) { if (i>=2) { msg += separator_char; } msg += cb.settings['Bitem' + i] + '(' + parseInt(cb.settings['Bitem' + i + 'price']) + ') '; } } } cb.sendNotice(msg,'','',cb.settings['noticecolor'],'bold'); } cb.setTimeout(chatAd, (cb.settings.chat_ad * 60000)); } //MENU END //Greytimelock String.prototype.format = function() { var args = arguments; return this.replace(/\{(\d+)\}/g, function($0, $1) { return args[$1] !== void 0 ? args[$1] : $0; }); }; // Have we seen this user before? function isNew(username) { return !seen.hasOwnProperty(username); } // Do we always allow this type of user to speak? function isPermaSpeaker(user) { var username = user.user; // Broadcaster can always speak if (username == cb.room_slug) return true; // If blue, green or red they can always speak if (user.has_tokens || user.in_fanclub || user.is_mod) return true; else return false; } // If a user is grey. // Split out to allow isPermaSpeaker to change if needed at some point. function isGrey(user) { return !isPermaSpeaker(user); } // Can the user use admin commands? function isAdmin(user) { var username = user.user; // Broadcasters and mods can run admin commands if (username == cb.room_slug || user.is_mod) return true; else return false; } // Is the user allowed to chat function canSpeak(user) { var username = user.user; // If we haven't seen the user before, add them if (isNew(username)) { addUser(user); if (username != cb.room_slug) log.info("Note: Pre-existing user added (no join seen): " + username); } // If they've been marked as canSpeak, yes if (seen[username].canSpeak) return true; // If the timelock has expired, yes if (expired(seen[username].entered)) { setSpeaker(username); return true; } return false; } // Set a user function setSpeaker(username) { seen[username].canSpeak = true; } // Check if a timelock has expired function expired(date) { return elapsed(date) > cb.settings.timelock_duration; } // Get elapsed time since a date, in minutes function elapsed(date) { var now = Date.now(); var minutes = Math.floor((now - date) / (1000 * 60)); return minutes; } // Give user the welcome message function welcomeUser(username) { var msg = cb.settings.msg_welcome; var duration = cb.settings.timelock_duration; tellUser(msg.format(duration), username); } // Start tracking the user function addUser(user) { var username = user.user; var u = {}; // User info u.entered = Date.now(); u.canSpeak = isPermaSpeaker(user); seen[username] = u; log.info("Added user: " + username + " with values: "); log.info(u); log.debug("DB state:"); log.debug(seen); } // Send text to everyone function tellAll(msg) { cb.sendNotice(msg); } // Send text to a given user function tellUser(msg, username) { cb.sendNotice(msg, username); } // Send text to the broadcaster function tellOwner(msg) { tellUser(msg, cb.room_slug); } // How many minutes until a user can speak function timeLeft(username) { var ERR = -1; if (isNew(username)) { log.err("timeLeft called on invalid username: " + username); return ERR; } var entered = seen[username].entered; return cb.settings.timelock_duration - elapsed(entered); } // Does the text look like a command? function isCmd(txt) { if (txt.charAt(0) === "/") return true; else return false; } // Check if greys are off function greysOff() { return cb.settings.greys_off == "True"; } // Commands // Execute command function runCmd(msg) { var username = msg.user; var user = msg; // Msg includes user info, so we can treat it as such // Only admins can run commands if (!isAdmin(user)) { return false; } // Check for the tlg prefix, otherwise command is likely meant for another app if (msg.m.search("/tlg") !== 0) return false; // Extract the command name and any parameters var regex = /^\/tlg\s*(\S*)\s*(\S*.*)/i; var cmdSplit = msg.m.match(regex); log.debug("Command split:"); log.debug(cmdSplit); // No command found if (typeof cmdSplit === 'undefined' || cmdSplit === null) { log.err("Invalid command: " + msg.m); return false; } // Command name var cmd = cmdSplit[1]; // Command parameters var args; if (cmdSplit.length > 1) args = cmdSplit[2]; // If no command is provided just display the help if (typeof cmd === "undefined" || cmd === "") { cmdHelp(username); return false; } // Execute the command switch (cmd.toLowerCase()) { case "resetall": cmdResetAll(); break; case "resetuser": cmdResetUser(args); break; case "greysoff": cmdGreysOff(msg, args); break; case "help": cmdHelp(); break; default: tellUser("Unknown command: " + cmd, username); return false; } return true; } // Show commands function cmdHelp(username) { log.debug("Running cmdHelp"); // If msg is null (such as upon init) assume it's the broadcaster if (typeof username === "undefined") { username = cb.room_slug; } tellUser("", username); tellUser("TimeLockGreys", username); tellUser("=============", username); tellUser("", username); tellUser("/tlg greysoff - Toggle silencing greys on/off", username); tellUser("/tlg resetuser <user> - Force user to restart the timelock", username); tellUser("/tlg resetall - Force all users to restart the timelock", username); tellUser("/tlg help - Display this help message", username); tellUser("", username); } // Reset all seen data, as if starting fresh function cmdResetAll() { seen = {}; tellOwner("Reset all user info. Note: Timelocks for existing users will only start when they rejoin or attempt to speak."); } // Reset data for a specific user function cmdResetUser(username) { if (!isNew(username)) { delete seen[username]; tellOwner("Reset user info for {0}. Note: Timelocks for existing users will only start when they rejoin or attempt to speak.".format(username)); } else { tellOwner("Unknown user {0}.".format(username)); } } // Toggle the ability of greys to speak function cmdGreysOff() { if (cb.settings.greys_off === "True") { cb.settings.greys_off = "False"; tellAll(cb.settings.msg_greyson); } else { cb.settings.greys_off = "True"; tellAll(cb.settings.msg_greysoff); } } { function tipperArrayPopulate(user) { tipperArray[numTippers] = new Array; tipperArray[numTippers][0] = user; tipperArray[numTippers][1] = 0; numTippers++; } function findTipper(user) { //find the index of the user for(var i = 0; i < tipperArray.length; i++) { if(tipperArray[i][0] == user) { break; } } //the user is not in the array. add him and call findTipper if(i == tipperArray.length) { tipperArrayPopulate(user); findTipper(user); } return i; } function modArrayPopulate(user) { modArray[numMods] = user; numMods++; } function eModArrayPopulate(user) { eModArray[numEMods] = user; numEMods++; } function niceArrayPopulate(user) { niceArray[numNice] = user; numNice++; } function silenceArrayPopulate(user) { silenceArray[numSilenced] = user; numSilenced++; } function ignoreArrayPopulate(user) { ignoreArray[numIgnorers] = new Array; ignoreArray[numIgnorers][0] = user; ignoreArray[numIgnorers][1] = 0; numIgnorers++; } function findIgnorer(user) { for(i = 0; i < ignoreArray.length; i++) { if(ignoreArray[i][0] == user) { break; } } if(i == ignoreArray.length) { ignoreArrayPopulate(user); findIgnorer(user); } return i; } function whisperArrayPopulate(user) { whisperArray[numWhispers] = new Array; whisperArray[numWhispers][0] = user; whisperArray[numWhispers][1] = ''; numWhispers++; } function findWhisper(user) { //find the index of the user for(var i = 0; i < whisperArray.length; i++) { if(whisperArray[i][0] == user) { break; } } //the user is not in the array. add him and call findWhisper if(i == whisperArray.length) { whisperArrayPopulate(user); findWhisper(user); } return i; } function setSilenceLevel(s, mod) { if(parseInt(s) >= 0 && parseInt(s) <= 3) { silenceLevel = parseInt(s); cb.sendNotice("The silence level has been set to " + s + ".", cb.room_slug, purple); cb.sendNotice("The silence level has been set to " + s + ".", "", purple, "", "", 'red'); switch(parseInt(s)) { case 0: cb.sendNotice('All members can talk in chat.',cb.room_slug,purple); cb.sendNotice('All members can talk in chat.',"",purple,"","",'red'); break; case 1: cb.sendNotice('Only members with tokens can talk in chat.',cb.room_slug,purple); cb.sendNotice('Only members with tokens can talk in chat.',"",purple,"","",'red'); break; case 2: cb.sendNotice('Only members who have tipped can talk in chat.',cb.room_slug,purple); cb.sendNotice('Only members who have tipped can talk in chat.',"",purple,"","",'red'); break; case 3: cb.sendNotice('Only members who have tipped at least 10 tokens can talk in chat.',cb.room_slug,purple); cb.sendNotice('Only members who have tipped at least 10 tokens can talk in chat.',"",purple,"","",'red'); break; } } else { cb.sendNotice(s + ' is not a valid setting.\nType "/bhhelp silencelevel" to see how to use /silencelevel.',mod,purple); } } function setGraphicLevel(s, mod) { if(parseInt(s) >= 0 && parseInt(s) <= 3) { graphicLevel = parseInt(s); cb.sendNotice('The graphic level has been set to ' + s + '.',cb.room_slug,purple); cb.sendNotice('The graphic level has been set to ' + s + '.',"",purple,"","",'red'); switch(parseInt(s)) { case 0: cb.sendNotice('All members can use graphics in chat.',cb.room_slug,purple); cb.sendNotice('All members can use graphics in chat.',"",purple,"","",'red'); break; case 1: cb.sendNotice('Only members with tokens can use graphics in chat.',cb.room_slug,purple); cb.sendNotice('Only members with tokens can use graphics in chat.',"",purple,"","",'red'); break; case 2: cb.sendNotice('Only members who have tipped can use graphics in chat.',cb.room_slug,purple); cb.sendNotice('Only members who have tipped can use graphics in chat.',"",purple,"","",'red'); break; case 3: cb.sendNotice('Only members who have tipped at least 10 tokens can use graphics in chat.',cb.room_slug,purple); cb.sendNotice('Only members who have tipped at least 10 tokens can use graphics in chat.',"",purple,"","",'red'); break; } } else { cb.sendNotice(s + ' is not a valid setting.\nType "/bhhelp graphiclevel" to see how to use /graphiclevel.',mod,purple); } } function silence(user, mod) { if(cbjs.arrayContains(silenceArray,user)) { cb.sendNotice(user + ' has already been silenced.',mod,purple); } else { silenceArrayPopulate(user); cb.sendNotice(mod + ' has silenced ' + user + '.','',purple,'','','red'); } } function unsilence(user, mod) { if(cbjs.arrayContains(silenceArray,user)) { cbjs.arrayRemove(silenceArray,user); cb.sendNotice(mod + ' has unsilenced ' + user + '.','',purple,'','','red'); cb.sendNotice('You have been unsilenced by ' + mod + '. Be nice and don\'t make demands. :smile',user,purple); } else { cb.sendNotice(user + ' does not need to be unsilenced.',mod,purple); } } 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(t + ' is not a valid option for /starttimer.\nType /bhhelp starttimer to see how to use /starttimer.',mod,purple); } else if(t == null) { cb.sendNotice('You did not enter a valid option for /starttimer.\nType /bhhelp starttimer to see how to use /starttimer.',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('There is a timer running already.',mod,purple); } } function timer() { //check to see if /addTime has been used if(timeAdded == 0) { cb.sendNotice('Time is up!','',purple); startTime = 0; timerDuration = 0; } else { if(timeAdded == 5) { cb.sendNotice('There are 5 minutes remaining!','',purple); } startTimer(timeAdded); } } function fiveMinuteWarning() { if(timeAdded == 0) { cb.sendNotice('There are 5 minutes remaining!','',purple); } } function oneMinuteWarning() { if(timeAdded == 0) { cb.sendNotice('There is 1 minute remaining!','',purple); } } 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('There is no timer running.',mod,purple); } } else if(t != null) { cb.sendNotice(t + ' is not a valid option for /addtime.\nType /bhhelp addtime to see how to use /addtime.',mod,purple); } else if(t == null) { cb.sendNotice('You did not enter a valid option for /addtime.\nType /bhhelp addtime to see how to use /addtime.',mod,purple); } } function sendWhisper(message,from, mod, tokens) { if(message[1] != from) { if(!cbjs.arrayContains(ignoreArray[findIgnorer(message[1])],from) || mod == 'true') { switch(parseInt(ignoreArray[findIgnorer(message[1])][1])) { case 0: var m = from + ': '; //build the message for(var i = 2; i < message.length; i++) { if(i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(message[1])][1] = from; cb.sendNotice(m,message[1],purple); break; case 1: if(tokens || mod) { var m = from + ': '; //build the message for(var i = 2; i < message.length; i++) { if(i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(message[1])][1] = from; cb.sendNotice(m,message[1],purple); } else { cb.sendNotice(message[1] + ' is ignoring whispers from all members who don\'t have tokens.',from,purple); } break; case 2: if(tipperArray[findTipper(from)][1] > 0 || mod) { var m = from + ': '; //build the message for(var i = 2; i < message.length; i++) { if(i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(message[1])][1] = from; cb.sendNotice(m,message[1],purple); } else { cb.sendNotice(message[1] + ' is ignoring whispers from all members who haven\'t tipped any tokens.',from,purple); } break; case 3: if(tipperArray[findTipper(from)][1] > 10 || mod) { var m = from + ': '; //build the message for(var i = 2; i < message.length; i++) { if(i == 2) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(message[1])][1] = from; cb.sendNotice(m,message[1],purple); } else { cb.sendNotice(message[1] + ' is ignoring whispers from all members who haven\'t tipped at least 10 tokens.',from,purple); } break; } } else { cb.sendNotice(message[1] + ' is ignoring whispers from you. Your message was not sent.',from,purple) } } else { cb.sendNotice('Talking to yourself is a little odd...',from,purple); } } function sendReply(message, from) { if(!cbjs.arrayContains(ignoreArray[findIgnorer(whisperArray[findWhisper(from)][1])],from)) { if(whisperArray[findWhisper(from)][1] != '') { var m = from + ': '; //build the message for(var i = 1; i < message.length; i++) { if(i == 1) { m += message[i]; } else { m += ' ' + message[i]; } } whisperArray[findWhisper(whisperArray[findWhisper(from)][1])][1] = from; cb.sendNotice(m,whisperArray[findWhisper(from)][1],purple); } else { cb.sendNotice('No one has whispered you.',from,purple); } } else { cb.sendNotice(whisperArray[findWhisper(from)][1] + ' is ignoring whispers from you. Your message was not sent.',from,purple) } } function ignoreUser(user, from) { if(cbjs.arrayContains(ignoreArray[findIgnorer(from)],user)) { if(user == from) { cb.sendNotice('You can\'t ignore yourself. You may want to consult a therapist.',from,purple); } else { cb.sendNotice('You are already ignoring that user\'s whispers.',from,purple); } } else { ignoreArray[findIgnorer(from)][ignoreArray[findIgnorer(from)].length] = user; cb.sendNotice('You are now ignoring whispers from ' + user + '.',from,purple); cb.sendNotice('Remember, the room host, moderators, and fan club members will always be able to whisper you!',user,purple); } } function unignoreUser(user,from) { if(user == from) { cb.sendNotice('My, you are an odd one, aren\'t you?', from, purple); } else if(cbjs.arrayContains(ignoreArray[findIgnorer(from)],user)) { cbjs.arrayRemove(ignoreArray[findIgnorer(from)],user); cb.sendNotice('You are no longer ignoring whispers from ' + user, from, purple); } else { cb.sendNotice(user + ' is not being ignored. There is no need to unignore ' + user, from, purple); } } function setIgnoreLevel(l,user) { ignoreArray[findIgnorer(user)][1] = l; switch(parseInt(l)) { case 0: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone.',user,purple); break; case 1: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone who has tokens.',user,purple); break; case 2: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone who has tipped at least 1 token.',user,purple); break; case 3: cb.sendNotice('You have set your whisper ignore level to ' + l + '.\nYou are accepting whispers from everyone who has tipped at least 10 tokens.',user,purple); break; } cb.sendNotice('Remember, the room host, moderators, and fan club members will always be able to whisper you!',user,purple); } function setTipTitles(user, message) { if(cb.settings.kingTipper == 'Yes' && user == currentKing) { var m = ':smallCrown |' + tipperArray[findTipper(user)][1] + '| ' + message; } else { var m = '|' + tipperArray[findTipper(user)][1] + '| ' + message; } return m; } function eMod(ar,user,from) { if(ar == 'add') { if(!cbjs.arrayContains(eModArray,user)) { eModArrayPopulate(user); cb.sendNotice('Emergency moderator powers have been granted to ' + user,from,purple); cb.sendNotice('You have been granted emergency moderator powers by ' + from,user,purple); } else { cb.sendNotice(user + ' has already been granted emergency moderator powers.',from,purple); } } else if(ar == 'remove') { if(cbjs.arrayContains(eModArray,user)) { cbjs.arrayRemove(eModArray,user); cb.sendNotice('Emergency moderator powers have been removed from ' + user,from,purple); cb.sendNotice('Your emergency moderator powers have been removed by ' + from,user,purple); } else { cb.sendNotice(user + ' has not been granted emergency moderator powers.',from,purple); } } else { cb.sendNotice(ar + ' is not a valid option for /emod. Type /bhhelp emod to see how to use /emod.',from,purple); } } function help(option,from) { var valid = 0; if(option == null){option = '';} switch(option) { case '': { valid = 1; cb.sendNotice ( 'BadHabit Bot Help Menu' ,from,purple ); cb.sendNotice ( 'Type /bhhelp x, where x is one of the following choices, for more detailed information.' + '\nEx: /bhhelp commands' ,from ); cb.sendNotice ( '' ,from,purple ); cb.sendNotice ( 'commands\n' + 'dicklist\n' + 'nicelist\n' + 'about' + '\n silencelevel' + '\n graphiclevel' + '\n silence' + '\n unsilence' + '\n starttimer' + '\n addtime' + '\n timeleft' + '\n whisper' + '\n reply' + '\n ignore' + '\n unignore' + '\n ignorelevel' + '\n emod' + '\n addnice' + '\n removenice' + '\n leaderboard' + '\n kingspam' + '\n notifierspam' + '\n bhhelp' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'commands': { valid = 1; cb.sendNotice ('BadHabit Command List' ,from,purple ); cb.sendNotice ( 'Type /bhhelp x, where x is one of the following commands, for more detailed information.' + '\nEx: /bhhelp silencelevel' ,from ); cb.sendNotice ( '' ,from,purple ); cb.sendNotice ( '/silencelevel' + '\n/graphiclevel' + '\n/silence' + '\n/unsilence' + '\n/starttimer' + '\n/addtime' + '\n/timeleft' + '\n/whisper' + '\n/reply' + '\n/ignore' + '\n/unignore' + '\n/ignorelevel' + '\n/emod' + '\n/addnice' + '\n/removenice' + '\n/leaderboard' + '\n/kingspam' + '\n/notifierspam' + '\n/bhhelp' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'dicklist': { valid = 1; cb.sendNotice ('The Chaturbate Dick(less) List' ,from,purple ); cb.sendNotice ( 'Sometimes, users are real dicks in chat. ' + 'They make rude comments about the hosts\' appearances, pick fights with other users, and do various other things that warrant calling them dicks. ' + 'As a room host, I would very much like to be able to silence those dicks before they ever get the chance to be dicks in my room, ' + 'and I am quite certain that the other hosts would like to be able to do that as well.' + 'With that in mind, I created the Chaturbate dick(less) List.' + '\nWhen a user does something that qualifies him as being a dick, take a screenshot before he is silenced or banned. ' + 'Save the screenshot and upload it to your Chaturbate profile page. ' + 'Once it is uploaded, either post a message on the Badhabits Bot page in the chaturbate.com/bots section including your username, ' + 'so I can find the screenshot, and the name of the user you would like to have added to the Chaturbate Dick(less) List, ' + 'or send a Tweet @brit_and_justin with the information. ' + 'I will check the screenshot, to verify that you have found a real dick, and then add him to the Chaturbate Dick(less) List. ' + 'Users on that list will be unable to send messages in any rooms that are running Badhabits Bot! ' + 'The more rooms that are running Badhabits Bot, the more effective this list will become, so tell everyone to use it!' + '\nIf you would like to see the current Chaturbate Dick(less) List, ' + 'I post the names of the users and the screenshots of the evidence on the Chaturbate Dick(less) Blog at http://britandjustin.tumblr.com/.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'nicelist': { cb.sendNotice ('The Nice List' ,from,purple ); cb.sendNotice ( 'Sometimes, there are users whose comments are desirable, but they either do not have tokens or do not tip frequently. ' + 'When rooms get rowdy, hosts and mods are forced to do things like silence users without tokens or who have not tipped and those groups often includes the users whose comments hosts would like to see. ' + 'To fix this problem, hosts and mods can add users to the Nice List. ' + 'Users who are on the nice list can send messages regardless of the global silence setting.' ,from ); cb.sendNotice ( '' ,from,purple ); valid = 1; break; } case 'about': { valid = 1; cb.sendNotice ('About Badhabits Bot' ,from,purple ); cb.sendNotice ( 'Badhabits bot was compiled by Coridise for Jaymes and Leona Badhabit' + '\nThe purpose of Badhabits Bot is to make the lives of hosts and mods as easy as possible. It adds popular features such as Badhabitsbot, Rotating Notifier, 3 singleline Menus, 3 tip messages, Room rules upon entry, No Grey Demands,Graphics,Stickykeys,Caps, Timelock Greys, and grants quite a bit of power to moderators, and allows private messages to be sent in the main chat window.',from ); cb.sendNotice ( '' ,from,purple ); break; } case 'silencelevel': { valid = 1; cb.sendNotice ('/silencelevel Help' ,from,purple ); cb.sendNotice ( '/silencelevel is a command that is usable by moderators and room hosts.' + '\nThe syntax for using silencelevel is "/silencelevel x", where x is a number between 0 and 3.' + '\nSetting the Silence Level to 0 will grant voice privileges to all users, ' + 'setting it to 1 will revoke voice privileges from users without tokens, ' + 'setting it to 2 will revoke voice privileges from users who have not tipped, ' + 'and setting it to 3 will revoke voice privileges from users who have not tipped at least 10 tokens.' + '\nThe default setting for /silencelevel is 0.' + '\nRoom hosts, moderators, and fan club members are unaffected by the Silence Level.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'graphiclevel': { valid = 1; cb.sendNotice ('/graphiclevel Help' ,from,purple ); cb.sendNotice ( '/graphiclevel is a command that is usable by moderators and room hosts.' + '\nThe syntax for using graphiclevel is "/graphiclevel x", where x is a number between 0 and 3.' + '\nSetting the Graphic Level to 0 will grant graphic usage privileges to all users, ' + 'setting it to 1 will revoke graphic usage privileges from users without tokens, ' + 'setting it to 2 will revoke graphic usage privileges from users who have not tipped, ' + 'and setting it to 3 will revoke graphic usage privileges from users who have not tipped at least 10 tokens.' + '\nThe default setting for /graphiclevel is 0.' + '\nRoom hosts, moderators, and fan club members are unaffected by the Graphic Level.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'silence': { valid = 1; cb.sendNotice ('/silence Help' ,from,purple ); cb.sendNotice ( '/silence is a command that is usable by moderators and room hosts.' + '\nThe syntax for using silence is "/silence x", where x is the username of the user you want to silence.' + '\nThe effect of /silence is the same as Chaturbate\'s silence feature, ' + 'except that it lasts for the duration of the current session instead of for six hours.' + '\nThe effect of /silence can be reversed by using the command /unsilence.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'unsilence': { valid = 1; cb.sendNotice ('/unsilence Help' ,from,purple ); cb.sendNotice ( '/unsilence is a command that is usable by moderators and room hosts.' + '\nThe syntax for using unsilence is "/unsilence x", where x is the username of the user you want to unsilence.' + '\nunsilence simply grants voice privileges back to a user who was previously silenced.' + '\nNOTE: /unsilence WILL NOT undo the effect of Chaturbate\'s silence feature!' + '\n/unsilence WILL ONLY reverse the effect of /silence!' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'starttimer': { valid = 1; cb.sendNotice ('/starttimer Help' ,from,purple ); cb.sendNotice ( '/starttimer is a command that is usable by moderators and room hosts.' + '\nThe syntax for using starttimer is "/starttimer x", where x is the desired duration of the timer in minutes.' + '\n/starttimer will accept whole numbers only.' + '\nThe timer will make announcements at five minutes remaining and at one minute remaining.' + '\n/addtime can be used to add time to a currently running timer.' + '\n/timeleft can be used to display the amount of time remaining on the timer.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'addtime': { valid = 1; cb.sendNotice ('/addtime Help' ,from,purple ); cb.sendNotice ( '/addtime is a command that is usable by moderators and room hosts.' + '\nThe syntax for using addtime is "/addtime x", where x is the amount of time you want to add in minutes.' + '\n/addtime will accept whole numbers only.' + '\nSee the help section for starttimer for more information on timers.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'timeleft': { valid = 1; cb.sendNotice ('/timeleft Help' ,from,purple ); cb.sendNotice ( '/timeleft is a command that is usable by everyone.' + '\nThe syntax for using timeleft is /timeleft' + '\n/timeleft will display the amount of time left on the timer in the format 00:00:00' + '\nSee the help section for starttimer for more information on timers.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'whisper': { valid = 1; cb.sendNotice ('/whisper Help' ,from,purple ); cb.sendNotice ( '/whisper is a command that is usable by everyone.' + '\nThe syntax for using whisper is "/whisper x y", where x is the username of the user you want to send a whisper and y is the message you want to send.' + '\n/whisper, /w, /tell, /t, and /pm are all available commands that will send a whisper.' + '\nA whisper is a private message that will be sent in the main chat window.' + '\nOther related commands are /reply, /ignore, /unignore, and /ignorelevel.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'reply': { valid = 1; cb.sendNotice ('/reply Help' ,from,purple ); cb.sendNotice ( '/reply is a command that is usable by everyone.' + '\nThe syntax for using whisper is "/reply x", where x is message that you want to whisper to the user who most recently sent a whisper to you.' + '\n/reply and /r are available commands that will send a whisper in reply.' + '\nSee the help section for whisper for more information on whispers.' + '\nOther related commands are /whisper, /ignore, /unignore, and /ignorelevel.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'ignore': { valid = 1; cb.sendNotice ('/ignore Help' ,from,purple ); cb.sendNotice ( '/ignore is a command that is usable by everyone.' + '\nThe syntax for using ignore is "/ignore x", where x is the user from whom you wish to ignore whispers.' + '\nIgnoring a user will prevent him from sending you whispers, but it will not prevent him from talking normally in chat.' + '\n/unignore will reverse the effect of /ignore.' + '\nSee the help section for whisper for more information on whispers.' + '\nOther related commands are /whisper, /reply, /unignore, and /ignorelevel.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'unignore': { valid = 1; cb.sendNotice ('/unignore Help' ,from,purple ); cb.sendNotice ( '/unignore is a command that is usable by everyone.' + '\nThe syntax for using unignore is "/unignore x", where x is the user you wish to remove from your ignore list.' + '\nSee the help section for ignore for more information on ignoring users.' + '\nSee the help section for whisper for more information on whispers.' + '\nOther related commands are /whisper, /reply, /ignore, and /ignorelevel.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'ingorelevel': { valid = 1; cb.sendNotice ('/ignorelevel Help' ,from,purple ); cb.sendNotice ( '/ignorelevel is a command that is usable by everyone.' + '\nThe syntax for using ignorelevel is "/ignorelevel x", where x is a number between 0 and 3.' + '\nSetting the Ignore Level to 0 will allow all users to send you whispers, ' + 'setting it to 1 will only allow users with tokens to send you whispers, ' + 'setting it to 2 will only allow users who have tipped to send you whispers, ' + 'and setting it to 3 will only allow users who have tipped at least 10 tokens to send you whispers.' + '\nThe default setting for /ignorelevel is 0.' + '\nSee the help section for whisper for more information on whispers' + '\nOther related commands are /whisper, /reply, /ignore, and /unignore.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'emod': { valid = 1; cb.sendNotice ('/emod Help' ,from,purple ); cb.sendNotice ( '/emod is a command that is usable by moderators and room hosts.' + '\nThe syntax for using emod is "/emod x y", where x is either "add" or "remove" and y is the username of the user you want to either grant or revoke emergency moderator powers.' + '\n/emod allows moderators to quickly grant other users access to moderator-only commands in the event that he is having difficulty controlling the room by himself.' + '\nEmergency moderators have access to all moderator-only commands with the exceptions of /emod, /addnice, and /removenice.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'addnice': { valid = 1; cb.sendNotice ('/addnice Help' ,from,purple ); cb.sendNotice ( '/addnice is a command that is usable by moderators and room hosts.' + '\nThe syntax for using addnice is "/addnice x", where x is the username of the user you want to add to the nice list.' + '\nAdding a user to the nice list guarantees that user voice and graphic usage privileges regardless of the silence, graphic, and ignore level settings. ' + 'Using /silence or /ignore will still silence or ignore a user on the nice list.' + '\nUsers can be removed from the nice list by using the command /removenice.' + '\nSee the help sections for silencelevel, graphiclevel, and ignorelevel for more information on the global settings or the help section for nicelist for more information on the nice list.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'removenice': { valid = 1; cb.sendNotice ('/removenice Help' ,from,purple ); cb.sendNotice ( '/removenice is a command that is usable by moderators and room hosts.' + '\nThe syntax for using removenice is "/removenice x", where x is the username of the user you want to remove from the nice list.' + '\nSee the help section for nicelist for more information on the nice list.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'bhhelp': { valid = 1; cb.sendNotice ('/bhhelp Help' ,from,purple ); cb.sendNotice ( '/bhhelp is a command that is usable by everyone.' + '\nThe syntax for using bhhelp is "/bhhelp x", where x is the subsection of the help menu that you want to access.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'leaderboard': { valid = 1; cb.sendNotice ('/leaderboard Help' ,from,purple ); cb.sendNotice ( '/leaderboard is a command that is usable by everyone.' + '\nThe syntax for using leaderboard is "/leaderboard".' + '\n/leaderboard shows the top 3 tippers of the current session.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'kingspam': { valid = 1; cb.sendNotice ('/kingspam Help' ,from,purple ); cb.sendNotice ( '/kingspam is a command that is usable by moderators and room hosts.' + '\nThe syntax for using kingspam is /kingspam x, where x is either on or off. ' + 'Using this command toggles the spamming of the message "Tip x to become the new King!"' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'notifierspam': { valid = 1; cb.sendNotice ('/notifierspam Help' ,from,purple ); cb.sendNotice ( '/notifierspam is a command that is usable by moderators and room hosts.' + '\nThe syntax for using notifierspam is /notifierspam x, where x is either on or off. ' + 'Using this command toggles the spamming of the periodic message defined by the host.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } case 'leaderboardspam': { valid = 1; cb.sendNotice ('/leaderboardspam Help' ,from,purple ); cb.sendNotice ( '/leaderboardspam is a command that is usable by moderators and room hosts.' + '\nThe syntax for using leaderboardspam is /leaderboardspam x, where x is either on or off. ' + 'Using this command toggles the spamming of the top three tippers.' ,from ); cb.sendNotice ( '' ,from,purple ); break; } } if(valid == 0) { cb.sendNotice(option + ' is not a valid subsection of the help menu. Type /bhhelp to access the main help menu.',from,purple); } } function kingSpam() { cb.setTimeout(kingSpamTimer,cb.settings.kingTimer*60000); } function kingSpamTimer() { if(kingTip < parseInt(cb.settings.kingMin)) { var supplant = cb.settings.kingMin; } else { var supplant = kingTip + 1; } if(kingTipperSpam == 1) { cb.sendNotice('Tip ' + supplant + ' to become the new King!','',purple); kingSpam(); } } function leaderSpam() { cb.setTimeout(leaderSpamTimer,cb.settings.leaderTimer*60000); } function leaderSpamTimer() { if(leaderboardSpam == 1) { cb.sendNotice('Leaderboard!','',purple); cb.sendNotice ( leaderArray[0][0] + ' : ' + leaderArray[0][1] + '\n' + leaderArray[1][0] + ' : ' + leaderArray[1][1] + '\n' + leaderArray[2][0] + ' : ' + leaderArray[2][1] ); cb.sendNotice ( '' ,'',purple); leaderSpam(); } } function showLeaderBoard(from) { if(cb.settings.leaderBoard == 'Yes') { cb.sendNotice ( 'Leaderboard!' ,from,purple ); cb.sendNotice ( leaderArray[0][0] + ' : ' + leaderArray[0][1] + '\n' + leaderArray[1][0] + ' : ' + leaderArray[1][1] + '\n' + leaderArray[2][0] + ' : ' + leaderArray[2][1] ,from); cb.sendNotice ( '' ,from,purple); } else { cb.sendNotice('The room host has decided not to use the Leaderboard feature.',from,purple); } } function notifierSpam() { cb.setTimeout(notifierSpamTimer,cb.settings.spamTimer*60000); } function notifierSpamTimer() { if(notifierSpamTGL == 1) { var spamMessage; if (spamNum > 5) { spamNum = 1 }; spamMessage = cb.settings['spamMessage' + spamNum]; cb.sendNotice(spamMessage,'',purple); spamNum = spamNum + 1; if (spamNum > 5) { spamNum = 1 }; notifierSpam(); } } 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 kingSpamToggle(option, mod) { if(option == 'on') { if(kingTipperSpam == 1) { cb.sendNotice('The King Tipper spam is already turned on.',mod,purple); } else { kingTipperSpam == 1; cb.sendNotice('You have turned on King Tipper spam.',mod,purple); } } else if(option == 'off') { if(kingTipperSpam == 0) { cb.sendNotice('The King Tipper spam is already turned off.',mod,purple); } else { kingTipperSpam == 0; cb.sendNotice('You have turned off the King Tipper spam.',mod,purple); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /kingspam.\nType /bhhelp kingspam to see how to use /kingspam.',mod,purple); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /kingspam.\nType /bhhelp kingspam to see how to use /kingspam.',mod,purple); } } function notifierSpamToggle(option, mod) { if(option == 'on') { if(notifierSpamTGL == 1) { cb.sendNotice('The Notifier spam is already turned on.',mod,purple); } else { notifierSpamTGL == 1; cb.sendNotice('You have turned on the Notifier spam.',mod,purple); } } else if(option == 'off') { if(notifierSpamTGL == 0) { cb.sendNotice('The Notifier spam is already turned off.',mod,purple); } else { notifierSpamTGL == 0; cb.sendNotice('You have turned off the Notifier spam.',mod,purple); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /notifierspam.\nType /bhhelp notifierspam to see how to use /notifierspam.',mod,purple); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /notifierspam.\nType /bhhelp notifierspam to see how to use /notifierspam.',mod,purple); } } function leaderboardSpamToggle(option, mod) { if(option == 'on') { if(leaderboardSpam == 1) { cb.sendNotice('The Leaderboard spam is already turned on.',mod,purple); } else { leaderboardSpam == 1; cb.sendNotice('You have turned on the Leaderboard spam.',mod,purple); } } else if(option == 'off') { if(leaderboardSpam == 0) { cb.sendNotice('The Leaderboard spam is already turned off.',mod,purple); } else { leaderboardSpam == 0; cb.sendNotice('You have turned off the Leaderboard spam.',mod,purple); } } else if(option != null) { cb.sendNotice(option + ' is not a valid option for /leaderboardspam.\nType /bhhelp leaderboardspam to see how to use /leaderboardspam.',mod,purple); } else if(option == null) { cb.sendNotice('You did not enter a valid option for /leaderboardspam.\nType /bhhelp leaderboardspam to see how to use /leaderboardspam.',mod,purple); } } function colorChecker() { var colorString = '0123456789abcdefABCDEF'; var valid = true; var color = "C287C2"; if(cb.settings.color != null) { color = cb.settings.color; } for(var i = 0; i < 6; i++) { if(colorString.indexOf(color.charAt(i)) == -1) { valid = false; } if(valid == false) { purple = '#C287C2'; cb.sendNotice(color + ' is not a valid option for the highlight color. Hex color codes use numbers and letters only.\nUse www.color-hex.com to find the code for the color you want.\nDo not include the #.\nReverting to default color.',cb.room_slug,purple); break; } } if(valid) { purple = '#' + cb.settings.color; } } } } function displayRules(user) { var username = ''; if(user) username = user['user']; var notices = '###### ROOM RULES ######'; for(var i=1; i<=10;i++) { if(cb.settings['rule' + i]) notices += '\nRule #'+ i +': ' + cb.settings['rule'+i]; } notices += '\n######################'; cb.sendNotice(notices, username, '#E6FFFF', '#003399', 'bold'); if(!user || user == null) cb.setTimeout(displayRules, cb.settings.rules_wait_time * 60000); } //onMessage { cb.onMessage(function (msg) { var user = msg; // Msg includes user info, so we can treat it as such var username = msg.user; var txt = msg.m; log.debug("Message received:"); log.debug(msg); log.debug("User is grey? " + isGrey(user)); // Check if we should hide this message if (greysOff() && isGrey(user)) { msg["X-Spam"] = true; // Set flag to hide chat from room tellUser(cb.settings.msg_cantchat, username); log.info("Silenced message from " + username + " (greys are off)"); } else if (!canSpeak(user)) { var left = timeLeft(username); msg["X-Spam"] = true; // Set flag to hide chat from room tellUser(cb.settings.msg_locked.format(left), username); log.info("Silenced message from " + username); } // If looks like a command, hide it and try running it if (isCmd(txt)) { msg["X-Spam"] = true; // Set flag to hide chat from room runCmd(msg); } // return msg; checkmsg(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 '/menu': { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { setmenu(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/bhhelp commands" to see a full list of the available commands.',msg['user'],purple); } break; } 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 '/bhhelp': { //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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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; } //Badhabits 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 /bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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 "/bhhelp 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; } } } //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']); } return msg; }); } //onTip { cb.onTip(function (tip) { tip_amt=parseInt(tip['amount']); for (var i = 1; i <= 20; i++) { if (tip_amt == parseInt(cb.settings['item' + i + 'price'])) { cb.sendNotice(tip['from_user'] + ' tipped for ' + cb.settings['item' + i],'','',cb.settings['noticecolor'],'bold'); } } tipperArray[findTipper(tip['from_user'])][1] += parseInt(tip['amount']); if(cb.settings.kingTipper == 'Yes') { if(tip['from_user'] != currentKing && parseInt(tipperArray[findTipper(tip['from_user'])][1]) > kingTip && parseInt(tipperArray[findTipper(tip['from_user'])][1]) >= parseInt(cb.settings.kingMin)) { if(currentKing != '') { cb.sendNotice('You have been dethroned by ' + tip['from_user'] + ', but revenge is sweet...', currentKing, purple); } cb.sendNotice('We have a new King!\nAll hail ' + tip['from_user'] + '!','',purple); currentKing = tip['from_user']; kingTip = parseInt(tipperArray[findTipper(tip['from_user'])][1]); } else if(tip['from_user'] == currentKing) { kingTip = parseInt(tipperArray[findTipper(tip['from_user'])][1]); } } if(cb.settings.leaderBoard == 'Yes') { //create an array of the names var nameArray = new Array; for(var i = 0; i < leaderArray.length; i++) { nameArray[i] = leaderArray[i][0]; } //the user is not currently in the top 3 if(!cbjs.arrayContains(nameArray,tip['from_user'])) { if(tipperArray[findTipper(tip['from_user'])][1] > leaderArray[0][1]) { leaderArray[2][0] = leaderArray[1][0]; leaderArray[2][1] = leaderArray[1][1]; leaderArray[1][0] = leaderArray[0][0]; leaderArray[1][1] = leaderArray[0][1]; leaderArray[0][0] = tip['from_user']; leaderArray[0][1] = tipperArray[findTipper(tip['from_user'])][1]; } else if(tipperArray[findTipper(tip['from_user'])][1] < leaderArray[0][1] && tipperArray[findTipper(tip['from_user'])][1] > leaderArray[1][1] || tipperArray[findTipper(tip['from_user'])][1] == leaderArray[0][1]) { leaderArray[2][0] = leaderArray[1][0]; leaderArray[2][1] = leaderArray[1][1]; leaderArray[1][0] = tip['from_user']; leaderArray[1][1] = tipperArray[findTipper(tip['from_user'])][1]; } else if(tipperArray[findTipper(tip['from_user'])][1] < leaderArray[1][1] && tipperArray[findTipper(tip['from_user'])][1] > leaderArray[2][1] || tipperArray[findTipper(tip['from_user'])][1] == leaderArray[1][1]) { leaderArray[2][0] = tip['from_user']; leaderArray[2][1] = tipperArray[findTipper(tip['from_user'])][1]; } } //the user is currently in the top 3 else { //the user is already #1 if(leaderArray[0][0] == tip['from_user']) { leaderArray[0][1] = tipperArray[findTipper(tip['from_user'])][1]; } //the user is #2 and is moving to #1 if(leaderArray[1][0] == tip['from_user'] && tipperArray[findTipper(tip['from_user'])][1] > parseInt(leaderArray[0][1])) { leaderArray[1][0] = leaderArray[0][0]; leaderArray[1][1] = leaderArray[0][1]; leaderArray[0][0] = tip['from_user']; leaderArray[0][1] = parseInt(tipperArray[findTipper(tip['from_user'])][1]); } //the user is #2 and is not moving to #1 else if(leaderArray[1][0] == tip['from_user'] && tipperArray[findTipper(tip['from_user'])][1] <= parseInt(leaderArray[0][1])) { leaderArray[1][1] = parseInt(tipperArray[findTipper(tip['from_user'])][1]); } //the user is #3 and is moving to #2 else if(leaderArray[2][0] == tip['from_user'] && tipperArray[findTipper(tip['from_user'])][1] > parseInt(leaderArray[1][1])) { leaderArray[2][0] = leaderArray[1][0]; leaderArray[2][1] = leaderArray[1][1]; leaderArray[1][0] = tip['from_user']; leaderArray[1][1] = parseInt(tipperArray[findTipper(tip['from_user'])][1]); } //the user is #3 and is moving to #1 else if(leaderArray[2][0] == tip['from_user'] && tipperArray[findTipper(tip['from_user'])][1] > parseInt(leaderArray[0][1])) { leaderArray[2][0] = leaderArray[1][0]; leaderArray[2][1] = leaderArray[1][1]; leaderArray[1][0] = leaderArray[0][0]; leaderArray[1][1] = leaderArray[0][1]; leaderArray[0][0] = tip['from_user']; leaderArray[0][1] = parseInt(tipperArray[findTipper(tip['from_user'])][1]); } //the user is #3 and is not moving else if(leaderArray[2][0] == tip['from_user'] && tipperArray[findTipper(tip['from_user'])][1] <= parseInt(leaderArray[1][1])) { leaderArray[2][1] = tipperArray[findTipper(tip['from_user'])][1]; } if(leaderArray[2][0] == leaderArray[1][0] || leaderArray[2][0] == leaderArray[0][0]) { leaderArray[2][0] = ''; leaderArray[2][1] = 0; } if(leaderArray[1][0] == leaderArray[0][0]) { leaderArray[1][0] = ''; leaderArray[1][1] = 0; } } } /** if(cb.settings.notifierTip == 'Yes' && parseInt(tip['amount']) >= cb.settings.tipMessageMin) { cb.sendNotice(cb.settings.tipMessage,'',purple); } }); } **/ if(cb.settings.notifierTip == 'Yes'){ if(parseInt(tip['amount']) >= tipSingleMax) { tipSingleMax = parseInt(tip['amount']) + 1; cb.sendNotice(cb.settings.tipMessage3,'',purple); } else if(parseInt(tip['amount']) >= cb.settings.tipMessageMin2) { cb.sendNotice(cb.settings.tipMessage2,'',purple); } else if(parseInt(tip['amount']) >= cb.settings.tipMessageMin1) { cb.sendNotice(cb.settings.tipMessage1,'',purple); } } }); } //onEnter { cb.onEnter(function(user) { var i; var username = user.user; // If new, start tracking if (isNew(username)) { log.info("New user entered: " + username); log.debug(user); addUser(user); // Track enter time } else { log.info("User re-entered: " + username); log.debug(user); } // Send appropriate welcome message to greys if (isGrey(user)) { if (greysOff()) { var msg = cb.settings.msg_welcome_greys_off; tellUser(msg, username); } else { welcomeUser(username); // Send welcome msg } } if (cb.settings['msgonentry'] == 'yes') { if ((!user['has_tokens']) && (!user['is_mod']) && (!user['in_fanclub']) && (user['user'] != cb['room_slug'])) { cb.chatNotice('Welcome ' + user['user'] + '! No Grey Demands Graphics bot is running',user['user'],'',cb.settings['msgcolor'],'bold'); cb.chatNotice(EnterMsg,user['user'],'',cb.settings['msgcolor'],'bold'); cb.chatNotice('Your message will be muted and you risk being silenced for violating these rules',user['user'],'',cb.settings['msgcolor'],'bold'); } } // if(cb.settings.notifierEnter == "Yes") // { // cb.sendNotice(cb.settings.enterMessage,user['user'],purple); // } if(user['is_mod'] && !cbjs.arrayContains(modArray,user)) { modArrayPopulate(user['user']); } // If(cb.settings.RoomRules=='Yes') // { cb.sendNotice('Welcome to my room, ' + user['user'] + '. Please take a moment to read my room rules before chatting. Thank you!', user['user'], '#DBFFDB', '', 'bold'); displayRules(user); //} if (menu != 'N') { var msg = 'Tip Menu: '; if (menu == 'L') { for (i=1;i<=20;i++) { if (parseInt(cb.settings['item' + i + 'price'])>0) { if (i>=2) { msg += separator_char; } msg += cb.settings['item' + i] + '(' + parseInt(cb.settings['item' + i + 'price']) + ') '; } } } if (menu == 'J') { for (i=1;i<=20;i++) { if (parseInt(cb.settings['Jitem' + i + 'price'])>0) { if (i>=2) { msg += separator_char; } msg += cb.settings['Jitem' + i] + '(' + parseInt(cb.settings['Jitem' + i + 'price']) + ') '; } } } if (menu == 'B') { for (i=1;i<=20;i++) { if (parseInt(cb.settings['Bitem' + i + 'price'])>0) { if (i>=2) { msg += separator_char; } msg += cb.settings['Bitem' + i] + '(' + parseInt(cb.settings['Bitem' + i + 'price']) + ') '; } } } cb.sendNotice(msg, user['user'],cb.settings['noticecolor'],'bold'); } }); } function onEnterMsg(){ var EnterMsg=''; for (i=0; i<= MAX_REASONS; i++) { if (cb.settings['re' + i] == 'yes'){ EnterMsg += 'No ' + mutereasons[i].notice + ', '; } } return EnterMsg; } function checkmsg(msg) { var i, tmpmsg, reason, mutemsg; mutemsg = false; if ((!msg['has_tokens']) && (!msg['is_mod']) && (!msg['in_fanclub']) && (!is_broadcaster(msg))) { for (i=0; i<= MAX_CHECKS; i++) { if (i==4) { tmpmsg = tmpmsg.replace(/\s+/g, ''); } else { tmpmsg = msg['m']; } if ((tmpmsg.search(mutereasons[i].regexp) != -1) && (cb.settings['re' + mutereasons[i].index] == 'yes')){ mutemsg = true; reason = mutereasons[i].notice; } } if (mutemsg == true) { // msg['m'] = "*** Muted for " + reason + " ***"; if (cb.settings['mutehide'] == 'hide') { msg['X-Spam'] = true; cb.chatNotice('Your msg was hidden from chat',msg['user'],'','','bold'); } } } } function is_broadcaster(msg) { return (msg['user'] == cb.room_slug); } function init() { if (cb.settings['sendrules'] == 'yes') { EnterMsg = onEnterMsg(); } } // Leave function is required by CB, but not used by this script. cb.onLeave(function(user) { var username = user.user; log.info("User left: " + username); }); //init { var menu = cb.settings['menu'] if (cb.settings['sendrules'] == 'yes') { EnterMsg = onEnterMsg(); } if(initialize == 0) { log.debug("Initial user db: " + log.format(seen)); if(cb.settings.kingTipperSpam == 'Yes') { kingTipperSpam = 1; kingSpam(); } if(cb.settings.leaderBoardSpam == 'Yes') { leaderboardSpam = 1; leaderSpam(); } if(cb.settings.notifierSpam == 'Yes') { notifierSpamTGL = 1; notifierSpam(); } if(cb.settings.niceList != '' && cb.settings.niceList != null) { var n = cb.settings.niceList; niceArray = n.split(','); numNice = niceArray.length; } if(cb.settings.color != 'C287C2') { colorChecker(); } if (cb.settings['sepchar'] == 'Hearts') { separator_char = ":heart2 ";} // If(cb.settings.RoomRules=='Yes') // { displayRules(); //} chatAd(); cb.sendNotice('Grey users are now unable to use graphics by default. If you would like grey users to be able to use graphics, type /graphiclevel 0.', cb.room_slug, purple); initialize = 1; } }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.