Bots Home
|
Create an App
gggg
Author:
funky_test
Description
Source Code
Launch Bot
Current Users
Created by:
Funky_Test
//TODO: maybe don't check for bad words when fan club writes and check for space before bad word cb.settings_choices = [ //Rotating notifier {name: 'noticeL', label: '----------------------------------Notifier-------------------------------- ', type: 'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name: 'notifierTime', label: 'Minutes between notices(0 to turn off notifier)', type: 'int', minValue: 0, maxValue: 60, defaultValue: 3}, {name: 'noticeTextColor', label: 'Text color for standard notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#FFDDDA'}, {name: 'noticeBackgroundColor', label: 'Highlight color for standard notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'notice1', label: 'Notice1', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice2', label: 'Notice2', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice3', label: 'Notice3', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice4', label: 'Notice4', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice5', label: 'Notice5', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice6', label: 'Notice6', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice7', label: 'Notice7', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice8', label: 'Notice8', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice9', label: 'Notice9', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice10', label: 'Notice10', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice11', label: 'Notice11', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice12', label: 'Notice12', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice13', label: 'Notice13', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice14', label: 'Notice14', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'notice15', label: 'Notice15', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, //Tip messages {name: 'thanksL', label: '-----------------------------Thank you messages--------------------------- ', type: 'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name: 'thanksNoticeTextColor', label: 'Text color for thank you notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'thanksNoticeBackgroundColor', label: 'Highlight color for thank you notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'thankL1', label: 'Level 1 thank you message threshold', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 15}, {name: 'thankL1Msg', label: 'Level 1 thank you message(USER will be replaced with tippers name)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'Thank you for tipping USER!', required: false}, {name: 'thankL2', label: 'Level 2 thank you message threshold', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 50}, {name: 'thankL2Msg', label: 'Level 2 thank you message(USER will be replaced with tippers name)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'Thank you for tipping USER!', required: false}, {name: 'thankL3', label: 'Level 3 thank you message threshold', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 100}, {name: 'thankL3Msg', label: 'Level 3 thank you message(USER will be replaced with tippers name)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'Thank you for tipping USER!', required: false}, {name: 'thankL4', label: 'Level 4 thank you message threshold', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 250}, {name: 'thankL4Msg', label: 'Level 4 thank you message(USER will be replaced with tippers name)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'Thank you for tipping USER!', required: false}, {name: 'thankL5', label: 'Level 5 thank you message threshold', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 500}, {name: 'thankL5Msg', label: 'Level 5 thank you message(USER will be replaced with tippers name)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'Thank you for tipping USER!', required: false}, {name: 'thankNoNoteMsg', label: 'Text to be added if no tip note', type: 'str', minLength: 0, maxLength: 256, defaultValue: '.... and where is my tip note?', required: false}, //Leaderboard {name: 'leaderboardL', label: '------------------------------Leaderboard---------------------------- ', type: 'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name: 'leaderboardNoticeTextColor', label: 'Text color for leaderboard notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'leaderboardNoticeBackgroundColor', label: 'Highlight color for leaderboard notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'leaderboardTime', label: 'Minutes between leaderboard being displayed(0 to not display leaderboard)', type: 'int', minValue: 0, maxValue: 60, defaultValue: 3}, //Fan clubs //Club 1 {name: 'Club1L', label: '---------------------------------Fan club 1------------------------------- ', type: 'choice', required: false}, {name: 'club1Name', label: 'Name of the Fan Club1', type: 'str', minLength: 0, maxLength: 50, defaultValue: '', required: false}, {name: 'club1Str', label: 'Title for the Fan Club1 members', type: 'str', minLength: 0, maxLength: 50, defaultValue: '', required: false}, {name: 'club1TipAmount', label: 'Tip amount required to join the Fan Club1(If 0 nobody will be able to join the club)', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 0}, {name: 'join1Msg', label: 'Announcement when a user joins the Fan Club1(NAME will be replaced with member\'s username)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'NAME has joined the Idiot club! :)', required: false}, {name: 'club1HighlightColor', label: 'Highlight color for Fan Club1 member\'s', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C227A2'}, {name: 'roomJoin1Msg', label: 'Announcement when a Fan Club1 member enters the room(CLUB will be replaced with club name, NAME will be replaced with member\'s username)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'CLUB member has joined the room, everyone say hi to NAME', required: false}, //{name: 'fanClub1Msg', label: 'Announcement about Fan Club1(XXX will be replaced with token amount set to join the Fan Club', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'If you would like to join the Idiot club tip XXX tokens', required: false}, //{name: 'fanClub1AnnounceTime', label: 'Minutes between Fan Club1 announcements(0 for no announcements)', type: 'int', minValue: 0, maxValue: 60, defaultValue: 5}, {name: 'club1Members', label: 'List of Current Fan Club1 members(Seperate with comma)', type: 'str', minLength: 0, maxLength: 10000, defaultValue: '', required: false}, {name: 'club1NoticeTextColor', label: 'Text color for Fan Club1 notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'club1NoticeBackgroundColor', label: 'Highlight color for Fan Club1 related notice(When joining the Fan Club and when member joins or leaves the room)', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, //Club 2 {name: 'Club2L', label: '---------------------------------Fan club 2------------------------------- ', type: 'choice', required: false}, {name: 'club2Name', label: 'Name of the Fan Club2', type: 'str', minLength: 0, maxLength: 50, defaultValue: '', required: false}, {name: 'club2Str', label: 'Title for the Fan Club2 members', type: 'str', minLength: 0, maxLength: 50, defaultValue: '', required: false}, {name: 'club2TipAmount', label: 'Tip amount required to join the Fan Club2(If 0 nobody will be able to join the club)', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 0}, {name: 'club2HighlightColor', label: 'Highlight color for Fan Club2 member\'s', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C227A2'}, {name: 'roomJoin2Msg', label: 'Announcement when a Fan Club2 member enters the room(CLUB will be replaced with club name, NAME will be replaced with member\'s username)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'CLUB member has joined the room, everyone say hi to NAME', required: false}, {name: 'join2Msg', label: 'Announcement when a user joins the Fan Club2(NAME will be replaced with member\'s username)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'NAME has joined the Idiot club! :)', required: false}, //{name: 'fanClub2Msg', label: 'Announcement about Fan Club2(XXX will be replaced with token amount set to join the Fan Club', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'If you would like to join the Idiot club tip XXX tokens', required: false}, //{name: 'fanClub2AnnounceTime', label: 'Minutes between Fan Club2 announcements(0 for no announcements)', type: 'int', minValue: 0, maxValue: 60, defaultValue: 5}, {name: 'club2Members', label: 'List of Current Fan Club2 members(Seperate with comma)', type: 'str', minLength: 0, maxLength: 10000, defaultValue: '', required: false}, {name: 'club2NoticeTextColor', label: 'Text color for Fan Club2 notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'club2NoticeBackgroundColor', label: 'Highlight color for Fan Club2 related notice(When joining the Fan Club and when member joins or leaves the room)', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, //Club 3 {name: 'Club3L', label: '---------------------------------Fan club 3------------------------------- ', type: 'choice', required: false}, {name: 'club3Name', label: 'Name of the Fan Club3', type: 'str', minLength: 0, maxLength: 50, defaultValue: '', required: false}, {name: 'club3Str', label: 'Title for the Fan Club3 members', type: 'str', minLength: 0, maxLength: 50, defaultValue: '', required: false}, {name: 'club3TipAmount', label: 'Tip amount required to join the Fan Club3(If 0 nobody will be able to join the club)', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 0}, {name: 'club3HighlightColor', label: 'Highlight color for Fan Club3 member\'s', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C227A2'}, {name: 'roomJoin3Msg', label: 'Announcement when a Fan Club3 member enters the room(CLUB will be replaced with club name, NAME will be replaced with member\'s username)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'CLUB member has joined the room, everyone say hi to NAME', required: false}, {name: 'join3Msg', label: 'Announcement when a user joins the Fan Club3(NAME will be replaced with member\'s username)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'NAME has joined the Idiot club! :)', required: false}, //{name: 'fanClub3Msg', label: 'Announcement about Fan Club3(XXX will be replaced with token amount set to join the Fan Club', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'If you would like to join the Idiot club tip XXX tokens', required: false}, //{name: 'fanClub3AnnounceTime', label: 'Minutes between Fan Club3 announcements(0 for no announcements)', type: 'int', minValue: 0, maxValue: 60, defaultValue: 5}, {name: 'club3Members', label: 'List of Current Fan Club3 members(Seperate with comma)', type: 'str', minLength: 0, maxLength: 10000, defaultValue: '', required: false}, {name: 'club3NoticeTextColor', label: 'Text color for Fan Club3 notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'club3NoticeBackgroundColor', label: 'Highlight color for Fan Club3 related notice(When joining the Fan Club and when member joins or leaves the room)', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, //Club 4 {name: 'Club4L', label: '---------------------------------Fan club 4------------------------------- ', type: 'choice', required: false}, {name: 'club4Name', label: 'Name of the Fan Club4', type: 'str', minLength: 0, maxLength: 50, defaultValue: '', required: false}, {name: 'club4Str', label: 'Title for the Fan Club4 members', type: 'str', minLength: 0, maxLength: 50, defaultValue: '', required: false}, {name: 'club4TipAmount', label: 'Tip amount required to join the Fan Club4(If 0 nobody will be able to join the club)', type: 'int', minValue: 0, maxValue: 100000, defaultValue: 0}, {name: 'club4HighlightColor', label: 'Highlight color for Fan Club4 member\'s', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C227A2'}, {name: 'roomJoin4Msg', label: 'Announcement when a Fan Club4 member enters the room(CLUB will be replaced with club name, NAME will be replaced with member\'s username)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'CLUB member has joined the room, everyone say hi to NAME', required: false}, {name: 'join4Msg', label: 'Announcement when a user joins the Fan Club4(NAME will be replaced with member\'s username)', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'NAME has joined the Idiot club! :)', required: false}, //{name: 'fanClub4Msg', label: 'Announcement about Fan Club4(XXX will be replaced with token amount set to join the Fan Club', type: 'str', minLength: 0, maxLength: 256, defaultValue: 'If you would like to join the Idiot club tip XXX tokens', required: false}, //{name: 'fanClub4AnnounceTime', label: 'Minutes between Fan Club4 announcements(0 for no announcements)', type: 'int', minValue: 0, maxValue: 60, defaultValue: 5}, {name: 'club4Members', label: 'List of Current Fan Club4 members(Seperate with comma)', type: 'str', minLength: 0, maxLength: 10000, defaultValue: '', required: false}, {name: 'club4NoticeTextColor', label: 'Text color for Fan Club4 notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'club4NoticeBackgroundColor', label: 'Highlight color for Fan Club4 related notice(When joining the Fan Club and when member joins or leaves the room)', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, //King {name: 'kingL', label: '------------------------------------King---------------------------------- ', type: 'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name: 'kingNoticeTextColor', label: 'Text color for king notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'kingNoticeBackgroundColor', label: 'Highlight color for king notice', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'kingStr', label: 'Title for king', type: 'str', minLength: 1, maxLength: 80, defaultValue: ':smallCrown'}, {name: 'kingTime', label: 'Minutes between king notices(0 to turn off notices)', type: 'int', minValue: 0, maxValue: 60, defaultValue: 3}, {name: 'kingMsg1', label: 'Message when there is no king yet(XXX will be replaced with amount needed to become king)', type: 'str', minLength: 1, maxLength: 256, defaultValue: 'Tip XXX to become tasty bacon! :jamiesbaconman'}, {name: 'kingMsg2', label: 'Message when there is a king (XXX will be replaced with amount needed to become king and KING wil be replaced with current king\'s name)', type: 'str', minLength: 1, maxLength: 256, defaultValue: 'The tasty bacon is: KING :jamiesbaconman Tip XXX to take him down!'}, //Bad words {name: 'badWordsL', label: '---------------------------------Bad words------------------------------- ', type: 'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name: 'badWords', label: 'List of bad words(Seperate with comma)', type: 'str', minLength: 0, maxLength: 10000, defaultValue: '', required: false}, {name: 'badLimit', label: 'Amount of times user can use bad word before he is silenced(this silence is active until bot restart)', type: 'int', minValue: 0, maxValue: 100, defaultValue: 3}, //Anti-spam {name: 'antiSpamL', label: '---------------------------------Anti-spam------------------------------- ', type: 'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, //Tip menu {name: 'tipMenuL', label: '----------------------------------Tip menu-------------------------------- ', type: 'choice', choice1:'Yes', choice2:'No', defaultValue:'No'}, {name: 'tipMenuNoticeTextColor', label: 'Text color for tip menu', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'tipMenuNoticeBackgroundColor', label: 'Highlight color for tip menu', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '#C287C2'}, {name: 'tipMenuTime', label: 'Minutes between tip menu being displayed(0 to not display tip menu)', type: 'int', minValue: 0, maxValue: 60, defaultValue: 3}, {name: 'tipMenuSeparator', label: 'Tip menu item separator', type: 'str', minLength: 0, maxLength: 7, required: false, defaultValue: '|'}, {name: 'item1', label: 'Item 1(10--Kiss)', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item2', label: 'Item 2', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item3', label: 'Item 3', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item4', label: 'Item 4', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item5', label: 'Item 5', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item6', label: 'Item 6', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item7', label: 'Item 7', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item8', label: 'Item 8', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item9', label: 'Item 9', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item10', label: 'Item 10', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item11', label: 'Item 11', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item12', label: 'Item 12', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item13', label: 'Item 13', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item14', label: 'Item 14', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'item15', label: 'Item 15', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, //Other {name: 'otherL', label: '-----------------------------------Other--------------------------------- ', type: 'choice', required: false}, {name: 'broadcasterHighlightColor', label: 'Highlight color for broadcaster', type: 'str', minLength: 0, maxLength: 50, required: false, defaultValue: '#C287C2'}, {name: 'extraMod', label: 'Extra mod that can use all commands(Can be any user)', type: 'str', minLength: 0, maxLength: 100, defaultValue: '', required: false}, {name: 'welcomeMsg', label: 'Welcome message for eveyone who enters the room(USER will be repleced with users\'s name)', type: 'str', minLength: 0, maxLength: 2048, defaultValue: '', required: false}, {name: 'welcomeNoticeTextColor', label: 'Text color for welcome notice', type: 'str', minLength: 0, maxLength: 50, required: false, defaultValue: '#FFDDDA'}, {name: 'welcomeNoticeBackgroundColor', label: 'Highlight color for welcome notice', type: 'str', minLength: 0, maxLength: 50, required: false, defaultValue: '#C287C2'}, {name: 'rules', label: 'Rules(seperate rules with \'|\')', type: 'str', minLength: 0, maxLength: 2048, defaultValue: '', required: false}, //Nicknames {name: 'nicknamesL', label: '-------------------------------Nicknames----------------------------- ', type: 'choice', required: false}, {name: 'user1', label: 'User1(Usage: username/title)', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user2', label: 'User2', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user3', label: 'User3', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user4', label: 'User4', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user5', label: 'User5', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user6', label: 'User6', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user7', label: 'User7', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user8', label: 'User8', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user9', label: 'User9', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user10', label: 'User10', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user11', label: 'User11', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user12', label: 'User12', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user13', label: 'User13', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user14', label: 'User14', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user15', label: 'User15', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user16', label: 'User16', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user17', label: 'User17', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user18', label: 'User18', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user19', label: 'User19', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, {name: 'user20', label: 'User20', type: 'str', minLength: 0, maxLength: 256, defaultValue: '', required: false}, ] //Rotating notifier var notifierTime = parseInt(cb.settings.notifierTime); var noticeArray = new Array; var noticeTextColor = cb.settings.noticeTextColor var noticeBackgroundColor = cb.settings.noticeBackgroundColor; var noticeIndex = 0; //Tip messages var thanksNoticeTextColor = cb.settings.thanksNoticeTextColor; var thanksNoticeBackgroundColor = cb.settings.thanksNoticeBackgroundColor; var thankL1Msg = cb.settings.thankL1Msg; var thankL2Msg = cb.settings.thankL2Msg; var thankL3Msg = cb.settings.thankL3Msg; var thankL4Msg = cb.settings.thankL4Msg; var thankL5Msg = cb.settings.thankL5Msg; //Fan clubs //Club 1 var club1Name = cb.settings.club1Name; var club1Str = cb.settings.club1Str; var club1TipAmount = parseInt(cb.settings.club1TipAmount); var join1Msg = cb.settings.join1Msg + ''; var club1Members = cb.settings.club1Members + ''; var fanClub1Msg = '';//(cb.settings.fanClub1Msg + '').replace('XXX', club1TipAmount); var fanClub1AnnounceTime = 0;//parseInt(cb.settings.fanClub1AnnounceTime); var club1MembersArray = new Array; var club1NoticeTextColor = cb.settings.club1NoticeTextColor; var club1NoticeBackgroundColor = cb.settings.club1NoticeBackgroundColor; var club1HighlightColor = cb.settings.club1HighlightColor; var numClub1Members = 0; //Club 2 var club2Name = cb.settings.club2Name; var club2Str = cb.settings.club2Str; var club2TipAmount = parseInt(cb.settings.club2TipAmount); var join2Msg = cb.settings.join2Msg + ''; var club2Members = cb.settings.club2Members + ''; var fanClub2Msg = '';//(cb.settings.fanClub2Msg + '').replace('XXX', club2TipAmount); var fanClub2AnnounceTime = 0;//parseInt(cb.settings.fanClub2AnnounceTime); var club2MembersArray = new Array; var club2NoticeTextColor = cb.settings.club2NoticeTextColor; var club2NoticeBackgroundColor = cb.settings.club2NoticeBackgroundColor; var club2HighlightColor = cb.settings.club2HighlightColor; var numClub2Members = 0; //Club 3 var club3Name = cb.settings.club3Name; var club3Str = cb.settings.club3Str; var club3TipAmount = parseInt(cb.settings.club3TipAmount); var join3Msg = cb.settings.join3Msg + ''; var club3Members = cb.settings.club3Members + ''; var fanClub3Msg = '';//(cb.settings.fanClub3Msg + '').replace('XXX', club3TipAmount); var fanClub3AnnounceTime = 0;//parseInt(cb.settings.fanClub3AnnounceTime); var club3MembersArray = new Array; var club3NoticeTextColor = cb.settings.club3NoticeTextColor; var club3NoticeBackgroundColor = cb.settings.club3NoticeBackgroundColor; var club3HighlightColor = cb.settings.club3HighlightColor; var numClub3Members = 0; //Club 4 var club4Name = cb.settings.club4Name; var club4Str = cb.settings.club4Str; var club4TipAmount = parseInt(cb.settings.club4TipAmount); var join4Msg = cb.settings.join4Msg + ''; var club4Members = cb.settings.club4Members + ''; var fanClub4Msg = '';//(cb.settings.fanClub4Msg + '').replace('XXX', club4TipAmount); var fanClub4AnnounceTime = 0;//parseInt(cb.settings.fanClub4AnnounceTime); var club4MembersArray = new Array; var club4NoticeTextColor = cb.settings.club4NoticeTextColor; var club4NoticeBackgroundColor = cb.settings.club4NoticeBackgroundColor; var club4HighlightColor = cb.settings.club4HighlightColor; var numClub4Members = 0; //King var currentKing = ''; var kingTokens = 99; var kingTime = parseInt(cb.settings.kingTime); var kingStr = cb.settings.kingStr; var kingNoticeTextColor = cb.settings.kingNoticeTextColor; var kingNoticeBackgroundColor = cb.settings.kingNoticeBackgroundColor; //Bad words var badWords = cb.settings.badWords + ''; var badWordsArray = new Array; var badWordUsersArray = new Array; var badLimit = parseInt(cb.settings.badLimit); //Leaderboard var leaderboardTime = parseInt(cb.settings.leaderboardTime); var leaderboardNoticeTextColor = cb.settings.leaderboardNoticeTextColor; var leaderboardNoticeBackgroundColor = cb.settings.leaderboardNoticeBackgroundColor; //Anti-spam var a = Math.floor(Math.random()*20)+1; var b = Math.floor(Math.random()*20)+1; var antiSpamPass = a + b + ''; var humanArray = new Array; //Tip menu var tipMenuArray = new Array; var tipMenuTime = parseInt(cb.settings.tipMenuTime); var tipMenuNoticeTextColor = cb.settings.tipMenuNoticeTextColor; var tipMenuNoticeBackgroundColor = cb.settings.tipMenuNoticeBackgroundColor; var tipMenuSeparator = cb.settings.tipMenuSeparator; //Other var extraMod = cb.settings.extraMod; var broadcasterHighlightColor = cb.settings.broadcasterHighlightColor; var noGrays = 0; var tippersArray = new Array; var numTippers = 0; var welcomeNoticeBackgroundColor = cb.settings.welcomeNoticeBackgroundColor; var welcomeNoticeTextColor = cb.settings.welcomeNoticeTextColor; var rules = cb.settings.rules + ''; var rulesArray = new Array; //Nicknames var coolArray = new Array; var numPeople = 20; function notifier() { if(cb.settings.noticeL == 'Yes' && notifierTime > 0 && noticeArray.length > 0) { if(noticeArray[noticeIndex] != "" && noticeIndex < noticeArray.length) { cb.sendNotice(noticeArray[noticeIndex],'',noticeBackgroundColor,noticeTextColor,'bold'); noticeIndex++; } else { cb.sendNotice(noticeArray[0],'',noticeBackgroundColor,noticeTextColor,'bold'); noticeIndex = 1; } cb.setTimeout(notifier,notifierTime*60000); } } function notifierArrayPopulate() { if(cb.settings.noticeL == 'Yes') { noticeArray.push(cb.settings.notice1); noticeArray.push(cb.settings.notice2); noticeArray.push(cb.settings.notice3); noticeArray.push(cb.settings.notice4); noticeArray.push(cb.settings.notice5); noticeArray.push(cb.settings.notice6); noticeArray.push(cb.settings.notice7); noticeArray.push(cb.settings.notice8); noticeArray.push(cb.settings.notice9); noticeArray.push(cb.settings.notice10); noticeArray.push(cb.settings.notice11); noticeArray.push(cb.settings.notice12); noticeArray.push(cb.settings.notice13); noticeArray.push(cb.settings.notice14); noticeArray.push(cb.settings.notice15); } } //King tipper notice function kingTipper() { var kingMsg1 = (cb.settings.kingMsg1 + '').replace(/XXX/g, kingTokens + 1); var kingMsg2 = (cb.settings.kingMsg2 + '').replace(/XXX/g, kingTokens + 1).replace(/KING/g, currentKing); if(kingTime > 0) { if(currentKing != "") { cb.sendNotice(kingMsg2,'',kingNoticeBackgroundColor,kingNoticeTextColor,'bold'); } else { cb.sendNotice(kingMsg1,'',kingNoticeBackgroundColor,kingNoticeTextColor,'bold'); } cb.setTimeout(kingTipper,kingTime*60000); } } //Leaderboard function leaderboard() { var leaderboardNotice = ''; if(cb.settings.leaderboardL == 'Yes' && leaderboardTime > 0) { tippersArray.sort(function(a, b){return b[1]-a[1]}); cb.sendNotice('****Leaderboard****','',leaderboardNoticeTextColor,leaderboardNoticeBackgroundColor,'bold'); for(var i = 0; i < 3; i++) { if(tippersArray[i] && tippersArray[i][1] != 0) { if(i == 2) { leaderboardNotice = leaderboardNotice + (i+1) + '. ' + tippersArray[i][0] + ': ' + tippersArray[i][1]; } else { leaderboardNotice = leaderboardNotice + (i+1) + '. ' + tippersArray[i][0] + ': ' + tippersArray[i][1] + '\n'; } } else { if(i == 2) { leaderboardNotice = leaderboardNotice + (i+1) + '.'; } else { leaderboardNotice = leaderboardNotice + (i+1) + '.\n'; } } } cb.sendNotice(leaderboardNotice,'',leaderboardNoticeBackgroundColor,leaderboardNoticeTextColor,'bold'); cb.setTimeout(leaderboard,leaderboardTime*60000); } } //Tip menu function tipMenuShow(user, toAll) { if(cb.settings.tipMenuL == 'Yes') { //Print tip menu var tipMenuMsg = ""; for(var i = 0; i < tipMenuArray.length; i++) { if(tipMenuArray[i]) { if(i == tipMenuArray.length - 1) { tipMenuMsg = tipMenuMsg + tipMenuArray[i][1] + '(' + tipMenuArray[i][0] + ')'; } else { tipMenuMsg = tipMenuMsg + tipMenuArray[i][1] + '(' + tipMenuArray[i][0] + ') ' + tipMenuSeparator + ' '; } } } if(tipMenuMsg != "") { if(toAll == 0) { cb.sendNotice(cb.room_slug + '\'s Tip menu:',user,tipMenuNoticeTextColor,tipMenuNoticeBackgroundColor,'bold'); cb.sendNotice(tipMenuMsg,user,tipMenuNoticeBackgroundColor,tipMenuNoticeTextColor,'bold'); } else { cb.sendNotice(cb.room_slug + '\'s Tip menu:','',tipMenuNoticeTextColor, tipMenuNoticeBackgroundColor,'bold'); cb.sendNotice(tipMenuMsg,'',tipMenuNoticeBackgroundColor,tipMenuNoticeTextColor,'bold'); if(tipMenuTime > 0) { cb.setTimeout(tipMenuShow,tipMenuTime*60000); } } } } else { cb.sendNotice('Tip menu is not active...',user,tipMenuNoticeBackgroundColor,tipMenuNoticeTextColor,'bold'); } } function buildTipMenu() { for(var i = 0; i < 15; i++) { var itemStr = cb.settings['item'+(i+1)]; if(itemStr) { var itemArray = itemStr.split('--'); if(itemArray != undefined && itemArray[0] != undefined && itemArray[1] != undefined) { tipMenuArray.push([itemArray[0],itemArray[1]]); } else { cb.sendNotice('Item ' + (i+1) + ' was not added to tip menu',cb['room_slug'],tipMenuNoticeBackgroundColor,tipMenuNoticeTextColor,'bold'); } } } } //Rules function rulesShow(user, toAll) { var rulesNotice = ''; rulesArray = rules.split('|'); rulesArray.push('Don\'t use any of these words please: ' + badWords); for(var i = 0; i < rulesArray.length; i++) { if(i == rulesArray.length - 1) { rulesNotice = rulesNotice + rulesArray[i]; } else { rulesNotice = rulesNotice + rulesArray[i] + '\n'; } } if(toAll == 1) { cb.sendNotice(rulesNotice,'',noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice(rulesNotice,user,noticeBackgroundColor,noticeTextColor,'bold'); } } function tippersArrayAdd(user) { tippersArray[numTippers] = new Array; tippersArray[numTippers][0] = user; tippersArray[numTippers][1] = 0; numTippers++; } function clubMembersArrayPopulate() { if(club1Members.length > 0) { club1MembersArray = club1Members.split(','); numClub1Members = club1MembersArray.length; } if(club2Members.length > 0) { club2MembersArray = club2Members.split(','); numClub2Members = club2MembersArray.length; } if(club3Members.length > 0) { club3MembersArray = club3Members.split(','); numClub3Members = club3MembersArray.length; } if(club4Members.length > 0) { club4MembersArray = club4Members.split(','); numClub4Members = club4MembersArray.length; } } function club1MembersArrayAdd(user,notice) { if(!isClubMember(user,1)){ club1MembersArray.push(user); numClub1Members++; if(notice){ cb.sendNotice(join1Msg.replace(/NAME/g, user),'',club1NoticeBackgroundColor,club1NoticeTextColor,'bold'); } return true; } return false; } function club1MembersArrayRemove(user) { var index = club1MembersArray.indexOf(user); if (index > -1) { club1MembersArray.splice(index, 1); numClub1Members--; return true; } return false; } function club2MembersArrayAdd(user,notice) { if(!isClubMember(user,2)){ club2MembersArray.push(user); numClub2Members++; if(notice){ cb.sendNotice(join2Msg.replace(/NAME/g, user),'',club2NoticeBackgroundColor,club2NoticeTextColor,'bold'); } return true; } return false; } function club2MembersArrayRemove(user) { var index = club2MembersArray.indexOf(user); if (index > -1) { club2MembersArray.splice(index, 1); numClub2Members--; return true; } return false; } function club3MembersArrayAdd(user,notice) { if(!isClubMember(user,3)){ club3MembersArray.push(user); numClub3Members++; if(notice){ cb.sendNotice(join3Msg.replace(/NAME/g, user),'',club3NoticeBackgroundColor,club3NoticeTextColor,'bold'); } return true; } return false; } function club3MembersArrayRemove(user) { var index = club3MembersArray.indexOf(user); if (index > -1) { club3MembersArray.splice(index, 1); numClub3Members--; return true; } return false; } function club4MembersArrayAdd(user,notice) { if(!isClubMember(user,4)){ club4MembersArray.push(user); numClub4Members++; if(notice){ cb.sendNotice(join4Msg.replace(/NAME/g, user),'',club4NoticeBackgroundColor,club4NoticeTextColor,'bold'); } return true; } return false; } function club4MembersArrayRemove(user) { var index = club4MembersArray.indexOf(user); if (index > -1) { club4MembersArray.splice(index, 1); numClub4Members--; return true; } return false; } function getTipperIndex(user) { for(var i = 0; i < tippersArray.length; i++) { if(tippersArray[i][0] == user) { break; } } if(i == tippersArray.length) { tippersArrayAdd(user); getTipperIndex(user); } return i; } function setTitles(user, message) { var msg = ""; //Add nickname for(var i = 0; i < coolArray.length; i+=2) { if(coolArray[i] == user) { msg = msg + ' ' + coolArray[i+1]; } } //Add title to club members if(isClubMember(user,1)) { msg = msg + ' ' + club1Str; } else if(isClubMember(user,2)) { msg = msg + ' ' + club2Str; } else if(isClubMember(user,3)) { msg = msg + ' ' + club3Str; } else if(isClubMember(user,4)) { msg = msg + ' ' + club4Str; } //Add title to king if(user == currentKing) { msg = msg + ' ' + kingStr; } //Add amount tipped if(isTipper(user)) { msg = msg + ' |' + tippersArray[getTipperIndex(user)][1] + '| ' + message; } else if(isClubMember(user, 0) || isCool(user)) { msg = msg + ' ' + message; } //msg = msg + ' |' + tippersArray[getTipperIndex(user)][1] + '| ' + message; return msg; } function badWordsArrayPopulate() { if(cb.settings.badWordsL == 'Yes' && badWords.length > 0) { badWordsArray = badWords.toLowerCase().split(','); } } function addBadWord(word) { var w = word.toLowerCase(); var index = badWordsArray.indexOf(w); if (index == -1) { badWordsArray.push(w); return true; } else { return false; } } function removeBadWord(word) { var w = word.toLowerCase(); var index = badWordsArray.indexOf(w); if (index > -1) { badWordsArray.splice(index, 1); return true; } return false; } function pupulateCoolArray() { for(var i = 1; i <= numPeople; i++) { var userStr = cb.settings['user'+(i)] + ''; if(userStr != "") { var userArray = userStr.split('/'); if(userArray) { coolArray.push(userArray[0]); coolArray.push(userArray[1]); } } } } function isCool(user) { for(var i = 0; i < coolArray.length; i+=2) { if(coolArray[i] == user) { return true; } } return false; } function isSilenced(user) { for(var i = 0; i < badWordUsersArray.length; i++) { if(badWordUsersArray[i][0] == user) { if(badWordUsersArray[i][1] >= badLimit) { return true; } } } return false; } function increseBadLevel(user) { for(var i = 0; i < badWordUsersArray.length; i++) { if(badWordUsersArray[i][0] == user) { badWordUsersArray[i][1]++; break; } } if(i == badWordUsersArray.length) { badWordUsersArray.push([user,1]); } } function isTipper(user) { for(var i = 0; i < tippersArray.length; i++) { if(tippersArray[i][0] == user && tippersArray[i][1] > 0) { return true; } } return false; } function isClubMember(user,clubNum) { switch(clubNum) { case 1: return club1MembersArray.indexOf(user) != -1; break; case 2: return club2MembersArray.indexOf(user) != -1; break; case 3: return club3MembersArray.indexOf(user) != -1; break; case 4: return club4MembersArray.indexOf(user) != -1; break; default: return club1MembersArray.indexOf(user) != -1 || club2MembersArray.indexOf(user) != -1 || club3MembersArray.indexOf(user) != -1 || club4MembersArray.indexOf(user) != -1; break; } } function top10() { var top10List = ''; tippersArray.sort(function(a, b){return b[1]-a[1]}); for(var i = 0; i < 10; i++) { if(tippersArray[i]) { top10List = top10List + tippersArray[i] + '\n'; } } top10List = top10List + 'Number of tippers: ' + numTippers; return top10List; } function listClub1Members() { var membersList = ''; //Sort alphabetically club1MembersArray.sort(function(a, b){if(a < b) { return -1; }if(a > b) { return 1; }return 0;}); for(var i = 0; i < club1MembersArray.length; i++) { if((i + 1) % 5 != 0 && (i + 1) != club1MembersArray.length) { membersList = membersList + club1MembersArray[i] + ' | '; } else { membersList = membersList + club1MembersArray[i] + '\n'; } } if((i + 1) % 5 != 0) { membersList = '\n' + membersList + 'Number of members: ' + numClub1Members + '\n'; } else { membersList = membersList + 'Number of members: ' + numClub1Members + '\n'; } return membersList; } function listClub2Members() { var membersList = ''; //Sort alphabetically club2MembersArray.sort(function(a, b){if(a < b) { return -1; }if(a > b) { return 1; }return 0;}); for(var i = 0; i < club2MembersArray.length; i++) { if((i + 1) % 5 != 0 && (i + 1) != club2MembersArray.length) { membersList = membersList + club2MembersArray[i] + ' | '; } else { membersList = membersList + club2MembersArray[i] + '\n'; } } if((i + 1) % 5 != 0) { membersList = '\n' + membersList + 'Number of members: ' + numClub2Members + '\n'; } else { membersList = membersList + 'Number of members: ' + numClub2Members + '\n'; } return membersList; } function listClub3Members() { var membersList = ''; //Sort alphabetically club3MembersArray.sort(function(a, b){if(a < b) { return -1; }if(a > b) { return 1; }return 0;}); for(var i = 0; i < club3MembersArray.length; i++) { if((i + 1) % 5 != 0 && (i + 1) != club3MembersArray.length) { membersList = membersList + club3MembersArray[i] + ' | '; } else { membersList = membersList + club3MembersArray[i] + '\n'; } } if((i + 1) % 5 != 0) { membersList = '\n' + membersList + 'Number of members: ' + numClub3Members + '\n'; } else { membersList = membersList + 'Number of members: ' + numClub3Members + '\n'; } return membersList; } function listClub4Members() { var membersList = ''; //Sort alphabetically club4MembersArray.sort(function(a, b){if(a < b) { return -1; }if(a > b) { return 1; }return 0;}); for(var i = 0; i < club4MembersArray.length; i++) { if((i + 1) % 5 != 0 && (i + 1) != club4MembersArray.length) { membersList = membersList + club4MembersArray[i] + ' | '; } else { membersList = membersList + club4MembersArray[i] + '\n'; } } if((i + 1) % 5 != 0) { membersList = '\n' + membersList + 'Number of members: ' + numClub4Members + '\n'; } else { membersList = membersList + 'Number of members: ' + numClub4Members + '\n'; } return membersList; } /*function fanClubsAnnounce() { if(club1TipAmount > 0 && fanClub1AnnounceTime > 0) { cb.sendNotice(fanClub1Msg,'',club1NoticeBackgroundColor,club1NoticeTextColor,'bold'); } if(club2TipAmount > 0 && fanClub2AnnounceTime > 0) { cb.sendNotice(fanClub2Msg,'',club2NoticeBackgroundColor,club2NoticeTextColor,'bold'); } if(club3TipAmount > 0 && fanClub3AnnounceTime > 0) { cb.sendNotice(fanClub3Msg,'',club3NoticeBackgroundColor,club3NoticeTextColor,'bold'); } if(club4TipAmount > 0 && fanClub4AnnounceTime > 0) { cb.sendNotice(fanClub4Msg,'',club4NoticeBackgroundColor,club4NoticeTextColor,'bold'); } cb.setTimeout(fanClubsAnnounce,fanClub4AnnounceTime*60000); }*/ function isHuman(msg) { if(msg['has_tokens'] || msg['in_fanclub'] || msg['is_mod'] || (msg['user'] == cb.room_slug) || (msg['user'] == extraMod) || isClubMember(msg['user']) || (humanArray.indexOf(msg['user']) != -1)) { return true; } return false; } cb.onMessage(function (msg) { //Anti spam if(cb.settings.antiSpamL == 'Yes' && !isHuman(msg)) { msg['X-Spam'] = true; if(msg['m'] == antiSpamPass) { humanArray.push(msg['user']); cb.sendNotice('You can chat now!',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Anti-spam is active.. you need to solve this math problem before you can chat(just write the result in chat)\nYou did not send the expected result, answer needs to be a number without anything else..\n' + a + '+' + b + '=?',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } var m = msg['m'].split(' '); var badWord = ''; //Check if message starts with / and consider it as a command if(m[0].charAt(0) == '/') { msg['X-Spam'] = true; switch(m[0]) { //Add a word to bad words list case '/add': { if(msg['is_mod'] || (msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { for(var i = 1; i < m.length; i++) { if(i == 1) { badWord = m[i]; } else { badWord = badWord + ' ' + m[i]; } } if(addBadWord(badWord)) { cb.sendNotice('Word "' + badWord + '" added to bad words list.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Word "' + badWord + '" NOT added to bad words list.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only moderators and broadcaster are able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Remove a word from bad words list case '/remove': { if(msg['is_mod'] || (msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { badWord = badWord + m[1]; if(removeBadWord(badWord)) { cb.sendNotice('Word "' + badWord + '" removed from bad words list.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Word "' + badWord + '" was NOT removed from bad words list.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only moderators and broadcaster are able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Show top 10 tippers case '/top10': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { cb.sendNotice(top10(),msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Show list of bad words case '/list': { if(msg['is_mod'] || (msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { cb.sendNotice('Banned words: ' + badWordsArray,msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Only moderators and broadcaster are able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Turn off messages from users without tokens case '/graysoff': case '/greysoff': case '/greyoff': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(msg['user'] == extraMod) { cb.sendNotice('No more grays!',cb['room_slug'],noticeBackgroundColor,noticeTextColor,'bold'); } cb.sendNotice('No more grays!',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); noGrays = 1; } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Turn on messages from users without tokens case '/grayson': case '/greyson': case '/greyon': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(msg['user'] == extraMod) { cb.sendNotice('Grays are back!',cb['room_slug'],noticeBackgroundColor,noticeTextColor,'bold'); } cb.sendNotice('Grays are back!',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); noGrays = 0; } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Add a memeber to Fan Club1 case '/addmember1': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(m[1] && club1MembersArrayAdd(m[1],false)) { cb.sendNotice('User '+ m[1] + ' was added to Fan Club1',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('User '+ m[1] + ' was NOT added to Fan Club1',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Remove a member from Fan club1 case '/removemember1': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(m[1] && club1MembersArrayRemove(m[1])) { cb.sendNotice('User '+ m[1] + ' was removed from Fan Club1',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('User '+ m[1] + ' was NOT removed from Fan Club1',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Show members of Fan Club1 case '/listmembers1': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { cb.sendNotice('List of current Fan Club1 members(Copy line bellow to use for next time when starting the bot):\n' + club1MembersArray,msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); cb.sendNotice(listClub1Members(),msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Add a memeber to Fan Club2 case '/addmember2': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(m[1] && club2MembersArrayAdd(m[1],false)) { cb.sendNotice('User '+ m[1] + ' was added to Fan Club2',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('User '+ m[1] + ' was NOT added to Fan Club2',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Remove a member from Fan club2 case '/removemember2': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(m[1] && club2MembersArrayRemove(m[1])) { cb.sendNotice('User '+ m[1] + ' was removed from Fan Club2',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('User '+ m[1] + ' was NOT removed from Fan Club2',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Show members of Fan Club2 case '/listmembers2': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { cb.sendNotice('List of current Fan Club2 members(Copy line bellow to use for next time when starting the bot):\n' + club2MembersArray,msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); cb.sendNotice(listClub2Members(),msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Add a memeber to Fan Club3 case '/addmember3': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(m[1] && club3MembersArrayAdd(m[1],false)) { cb.sendNotice('User '+ m[1] + ' was added to Fan Club3',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('User '+ m[1] + ' was NOT added to Fan Club3',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Remove a member from Fan club3 case '/removemember3': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(m[1] && club3MembersArrayRemove(m[1])) { cb.sendNotice('User '+ m[1] + ' was removed from Fan Club3',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('User '+ m[1] + ' was NOT removed from Fan Club3',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Show members of Fan Club3 case '/listmembers3': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { cb.sendNotice('List of current Fan Club3 members(Copy line bellow to use for next time when starting the bot):\n' + club3MembersArray,msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); cb.sendNotice(listClub3Members(),msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Add a memeber to Fan Club4 case '/addmember4': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(m[1] && club4MembersArrayAdd(m[1],false)) { cb.sendNotice('User '+ m[1] + ' was added to Fan Club4',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('User '+ m[1] + ' was NOT added to Fan Club4',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Remove a member from Fan club4 case '/removemember4': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { if(m[1] && club4MembersArrayRemove(m[1])) { cb.sendNotice('User '+ m[1] + ' was removed from Fan Club4',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('User '+ m[1] + ' was NOT removed from Fan Club4',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } //Show members of Fan Club4 case '/listmembers4': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { cb.sendNotice('List of current Fan Club4 members(Copy line bellow to use for next time when starting the bot):\n' + club4MembersArray,msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); cb.sendNotice(listClub4Members(),msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } case '/help': { cb.sendNotice('\nCommands:\n' +'"/add" is a command to add a bad word to the bad words list. Usage: "/add word" without quotes. Everything after /add will be added as one word[Mod]\n' +'"/remove" is a command to remove a bad word from the bad words list. Usage: "/remove word" without quotes. Word has to be one the bad words list.(Check with "/list")[Mod]\n' +'"/top10" is a command to see top 10 tippers of the night.[Broadcaster]\n' +'"/list" is a command to check what words are on the bad words list.[Mod]\n' +'"/graysoff" is a command to block users without tokens from speaking in general chat.[Broadcaster]\n' +'"/grayson" is a command to allow users without tokens to speak in general chat(If blocked previously with with this bot).[Broadcaster]\n' //+'"/addmember" is a command to add user to Fan Club. Usage: "/addmember username" without quotes.[Broadcaster]\n' //+'"/removemember" is a command to remove user from Fan Club. Usage: "/removemember username" without quotes.[Broadcaster]\n' //+'"/listmemebrs" is a command to show what memebers are currently in Fan Club(Used to copy memebers for next time).[Broadcaster]\n' +'"/menu" or "/tipmenu" is a command to show tip menu.[Anyone]\n' +'"/menu all" or "/tipmenu all" is a command to show tip menu to all users.[Mod]\n' +'"/rules" is a command to show rules.[Anyone]\n' +'"/rules all" is a command to show rules to all users.[Mod]\n' ,msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); break; } //Show tip menu case '/menu': case '/tipmenu': { if(m[1] == 'all' && (msg['is_mod'] || (msg['user'] == cb.room_slug) || (msg['user'] == extraMod))) { tipMenuShow(msg['user']); } else { if(m[1] == 'all') { cb.sendNotice('Only moderators and broadcaster are able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } tipMenuShow(msg['user'],0); } break; } //Show rules case '/rules': { if(m[1] == 'all' && (msg['is_mod'] || (msg['user'] == cb.room_slug) || (msg['user'] == extraMod))) { rulesShow(msg['user'],1); } else { if(m[1] == 'all') { cb.sendNotice('Only moderators and broadcaster are able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } rulesShow(msg['user'],0); } break; } /* case '/test': { if((msg['user'] == cb.room_slug) || (msg['user'] == extraMod)) { cb.sendNotice('Test',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } else { cb.sendNotice('Only broadcaster is able to use this command.',msg['user'],noticeBackgroundColor,noticeTextColor,'bold'); } break; } */ } } else { //Check for bad words if(badWordsArray.length > 0) { if(isSilenced(msg['user'])) { msg['X-Spam'] = true; cb.sendNotice('You have used a bad word ' + badLimit + ' times.. you are silenced :/', msg['user'], noticeBackgroundColor,noticeTextColor,'bold'); return msg; } var lcMsg = msg['m'].toLowerCase(); if(msg['user'] != cb['room_slug']){ for(var i = 0; i < badWordsArray.length; i++) { if(lcMsg.search(badWordsArray[i]) != -1) { msg['X-Spam'] = true; //Increse users bad level increseBadLevel(msg['user']); cb.sendNotice('Your message was not sent.. you have used a bad word, please read the rules, you will be silenced if you use any of the bad words ' + badLimit + ' times..', msg['user'], noticeBackgroundColor,noticeTextColor,'bold'); rulesShow(msg['user'], 0); } } } } //Add title if user has tipped before or is in Fan Club or has nickname if(isTipper(msg['user']) || isClubMember(msg['user']) || isCool(msg['user'])) { msg['m'] = setTitles(msg['user'],msg['m']); } //Check if messages from users without tokens should be blocked if(!msg['has_tokens'] && !msg['is_mod'] && !msg['in_fanclub'] && (msg['user'] != cb['room_slug']) && !isClubMember(msg['user']) && !isTipper(msg['user']) && (msg['user'] != extraMod) && noGrays == 1) { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent... room only allows users who have tokens or have tipped to chat (This is temporary)', msg['user'], noticeBackgroundColor,noticeTextColor,'bold'); } //Set text highlight for Fan Club members if(isClubMember(msg['user'],1)) { msg['background'] = club1HighlightColor; } else if(isClubMember(msg['user'],2)) { msg['background'] = club2HighlightColor; } else if(isClubMember(msg['user'],3)) { msg['background'] = club3HighlightColor; } else if(isClubMember(msg['user'],4)) { msg['background'] = club4HighlightColor; } //Set text highlight for broadcaster if(msg['user'] == cb['room_slug']) { msg['background'] = broadcasterHighlightColor; } } return msg; }); cb.onTip(function (tip) { var tipAmount = parseInt(tip['amount']); tippersArray[getTipperIndex(tip['from_user'])][1] += tipAmount; if(cb.settings.kingL == 'Yes') { //Check if there is a new king if(tip['from_user'] != currentKing && parseInt(tippersArray[getTipperIndex(tip['from_user'])][1]) > kingTokens) { if(currentKing != '') { cb.sendNotice('You have been debaconed by ' + tip['from_user'] + ', but revenge is sweet...',currentKing,kingNoticeBackgroundColor,kingNoticeTextColor,'bold'); } if(tip['from_user_gender'] == 'f') { cb.sendNotice('We have a new tasty bacon: ' + tip['from_user'] + ', everybody take a bite of her!','',kingNoticeBackgroundColor,kingNoticeTextColor,'bold'); } else { cb.sendNotice('We have a new tasty bacon: ' + tip['from_user'] + ', everybody take a bite of him!','',kingNoticeBackgroundColor,kingNoticeTextColor,'bold'); } currentKing = tip['from_user']; kingTokens = parseInt(tippersArray[getTipperIndex(tip['from_user'])][1]); } else if(tip['from_user'] == currentKing) { kingTokens = parseInt(tippersArray[getTipperIndex(tip['from_user'])][1]); } } //Check is user tipped to join any of the Fan Clubs if(tipAmount == club1TipAmount) { club1MembersArrayAdd(tip['from_user'],true); } else if(tipAmount == club2TipAmount) { club2MembersArrayAdd(tip['from_user'],true); } else if(tipAmount == club3TipAmount) { club3MembersArrayAdd(tip['from_user'],true); } else if(tipAmount == club4TipAmount) { club4MembersArrayAdd(tip['from_user'],true); } //Send thank you var thankYouMsg = ""; if(tipAmount >= parseInt(cb.settings.thankL1) && tipAmount < parseInt(cb.settings.thankL2)) { thankYouMsg = cb.settings.thankL1Msg; } else if(tipAmount >= parseInt(cb.settings.thankL2) && tipAmount < parseInt(cb.settings.thankL3)) { thankYouMsg = cb.settings.thankL2Msg; } else if(tipAmount >= parseInt(cb.settings.thankL3) && tipAmount < parseInt(cb.settings.thankL4)) { thankYouMsg = cb.settings.thankL3Msg; } else if(tipAmount >= parseInt(cb.settings.thankL4) && tipAmount < parseInt(cb.settings.thankL5)) { thankYouMsg = cb.settings.thankL4Msg; } else if(tipAmount >= parseInt(cb.settings.thankL5)) { thankYouMsg = cb.settings.thankL5Msg; } //Add message if no tip note if(tipAmount >= parseInt(cb.settings.thankL1) && tip['message'] == '') { thankYouMsg = thankYouMsg + ' ' + cb.settings.thankNoNoteMsg; } if(thankYouMsg != '') { cb.sendNotice(thankYouMsg.replace(/USER/g, tip['from_user']),'',thanksNoticeBackgroundColor,thanksNoticeTextColor,'bold'); } //Check if tipped for something on menu for (var i = 0; i < tipMenuArray.length; i++) { if (tipMenuArray[i][0] == tipAmount) { cb.sendNotice(tip['from_user'] + ' tipped for ' + tipMenuArray[i][1],'',tipMenuNoticeBackgroundColor,tipMenuNoticeTextColor,'bold'); } } }); cb.onEnter(function(user){ if(isClubMember(user['user'],1)) { cb.sendNotice((cb.settings.roomJoin1Msg + '').replace(/CLUB/g,club1Name).replace(/NAME/g,user['user']),'',club1NoticeBackgroundColor,club1NoticeTextColor,'bold'); //cb.sendNotice(club1Name + ' member '+ user['user'] + ' just entered the room!','',club1NoticeBackgroundColor,club1NoticeTextColor,'bold'); } else if(isClubMember(user['user'],2)) { cb.sendNotice((cb.settings.roomJoin2Msg + '').replace(/CLUB/g,club2Name).replace(/NAME/g,user['user']),'',club2NoticeBackgroundColor,club2NoticeTextColor,'bold'); //cb.sendNotice(club2Name + ' member '+ user['user'] + ' just entered the room!','',club2NoticeBackgroundColor,club2NoticeTextColor,'bold'); } else if(isClubMember(user['user'],3)) { cb.sendNotice((cb.settings.roomJoin3Msg + '').replace(/CLUB/g,club3Name).replace(/NAME/g,user['user']),'',club3NoticeBackgroundColor,club3NoticeTextColor,'bold'); //cb.sendNotice(club3Name + ' member '+ user['user'] + ' just entered the room!','',club3NoticeBackgroundColor,club3NoticeTextColor,'bold'); } else if(isClubMember(user['user'],4)) { cb.sendNotice((cb.settings.roomJoin4Msg + '').replace(/CLUB/g,club4Name).replace(/NAME/g,user['user']),'',club4NoticeBackgroundColor,club4NoticeTextColor,'bold'); //cb.sendNotice(club4Name + ' member '+ user['user'] + ' just entered the room!','',club4NoticeBackgroundColor,club4NoticeTextColor,'bold'); } //Welcome message to user cb.sendNotice((cb.settings.welcomeMsg + '').replace(/USER/g,user['user']),user['user'],welcomeNoticeBackgroundColor,welcomeNoticeTextColor,'bold'); if(cb.settings.antiSpamL == 'Yes' && !isHuman(user)) { cb.sendNotice('Anti-spam is active.. you need to solve this math problem before you can chat(just write the result in chat)\n' + a + '+' + b + '=?',user['user'],noticeBackgroundColor,noticeTextColor,'bold'); } }); cb.onLeave(function(user){ if(isClubMember(user['user'],1)) { cb.sendNotice(club1Name + ' member '+ user['user'] + ' just left the room!','',club1NoticeBackgroundColor,club1NoticeTextColor,'bold'); } else if(isClubMember(user['user'],2)) { cb.sendNotice(club2Name + ' member '+ user['user'] + ' just left the room!','',club2NoticeBackgroundColor,club2NoticeTextColor,'bold'); } else if(isClubMember(user['user'],3)) { cb.sendNotice(club3Name + ' member '+ user['user'] + ' just left the room!','',club3NoticeBackgroundColor,club3NoticeTextColor,'bold'); } else if(isClubMember(user['user'],4)) { cb.sendNotice(club4Name + ' member '+ user['user'] + ' just left the room!','',club4NoticeBackgroundColor,club4NoticeTextColor,'bold'); } }); function run() { clubMembersArrayPopulate(); //fanClubsAnnounce(); leaderboard(); if(cb.settings.badWordsL == 'Yes') { badWordsArrayPopulate(); } if(cb.settings.noticeL == 'Yes') { notifierArrayPopulate(); notifier(); } if(cb.settings.kingL == 'Yes') { kingTipper(); } if(cb.settings.tipMenuL == 'Yes') { buildTipMenu(); tipMenuShow(); } pupulateCoolArray(); } run();
© Copyright Chaturbate 2011- 2024. All Rights Reserved.