Bots Home
|
Create an App
paseltest
Author:
tslilyrox
Description
Source Code
Launch Bot
Current Users
Created by:
Tslilyrox
/** Name: Ultra Bot Author: britney_and_justin (reworked by LilyRox) Creation Date: 3/17/14 Date Last Edited: 12/13/16 Live Verson: 1.13 Test Version: 1.13 **/ /** Purpose Room Control King Tip Leader Board Notifier Private Messages in Chat The Chaturbate Dick(less) List The Nice List **/ /** Change Log 1.13 Made a change so that a person can't whisper the entire room. Change made as a result of comments from Carlos and 4Science Made it impossible to use /silence on moderators and room hosts. Change made as a result of a bug pointed out by lo_ol 1.12 Add an option to enable or disable whispering, defaults to off 1.11 Change made as a result of a suggestion by rz /silence and /unsilence now notify all mods that the command was issued. 1.10 Change made as a result of a suggestion by rz Added a setting to change the background highlight color 1.09 Changes made as a result of bugs pointed out by DeHaan Fixed typos in the help section. Changed silencelevel and graphiclevel to avoid potential flooding 1.08 Change made as a result of a bug pointed out by Dionne Added a check to make sure that a message consisting entirely of numbers does not trigger the "caps lock" feedback 1.07 Change made as a result of a request from Lewis Goddard and wodinsday Added a setting for the host to toggle the automatic changing of "caps lock" messages to lower case 1.06 Change made as a result of a suggestion from bate_n_switch and mnpugdog Changing the silence or graphic level will no longer send a message to the entire room; it will only send a message to mods and casters. 1.05 Once again, thanks to acrazyguy for suggesting this change. Tip titles will no longer accidentally stop commands from going through 1.04 Changes made as a result of suggestions from acrazyguy. Thank you! Lightened the purple highlight to increase text contrast Added a toggle for "invalid command" warnings 1.03 Fixed bugs with leaderboard, king tipper, and ultra app command support 1.02 Added Level Up command support Added Ultra App command support Added a check to stop the bot from yelling about all caps if the message is all symbols 1.01 Fixed a bug with leaderboard Fixed a bug with king tipper 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 enableWhispers ==> enables whispering in chat **/ 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: 'Yes'}, {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: 'spamMessage', label: 'Enter the message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Be nice!'}, {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: 5}, {name: 'notifierTip', label: 'Would you like to display a message when a user tips?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'tipMessage', label: 'Enter the message you would like to display.', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Thank you!'}, {name: 'tipMessageMin', label: 'Enter the minimum tip amount that you would like to trigger the message', type: 'int', minValue: 1, maxValue: 1000000, defaultValue: 10}, {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: 'enableWhispers', label: 'Enable whispering (Private message to a user in chat)', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'} ] } //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 **/ { startOnce = 1; var sizeOfPlayerArray = 1002; var arrPointsStringFinal = ""; function Create2DArray(rows) { var arr = []; for (var i = 0; i < rows; i++) { arr[i] = []; } return arr; } var diceValue = 0; var arrPoints = Create2DArray(sizeOfPlayerArray); for (var i = 0; i < sizeOfPlayerArray; i++) { arrPoints[i][0] = 'undef'; for (var xw = 1; xw < 14; xw++) { arrPoints[i][xw] = 0; } } freeSpaceEle = arrPoints.indexOf('undef'); //cb.chatNotice(freeSpaceEle); //Save Data arrPoints[0][0] = "tslilyrox"; arrPoints[0][1] = 300; arrPoints[0][2] = 0; arrPoints[0][3] = 0; arrPoints[0][4] = 0; arrPoints[0][5] = 0; arrPoints[0][6] = 0; arrPoints[0][7] = 0; arrPoints[0][8] = 0; arrPoints[0][9] = 0; arrPoints[0][10] = 0; arrPoints[0][11] = 0; arrPoints[0][12] = 0; arrPoints[0][13] = 0; arrPoints[1][0] = "undef"; arrPoints[1][1] = 0; arrPoints[1][2] = 0; arrPoints[1][3] = 0; arrPoints[1][4] = 0; arrPoints[1][5] = 0; arrPoints[1][6] = 0; arrPoints[1][7] = 0; arrPoints[1][8] = 0; arrPoints[1][9] = 0; arrPoints[1][10] = 0; arrPoints[1][11] = 0; arrPoints[1][12] = 0; arrPoints[1][13] = 0; arrPoints[2][0] = "undef"; arrPoints[2][1] = 0; arrPoints[2][2] = 0; arrPoints[2][3] = 0; arrPoints[2][4] = 0; arrPoints[2][5] = 0; arrPoints[2][6] = 0; arrPoints[2][7] = 0; arrPoints[2][8] = 0; arrPoints[2][9] = 0; arrPoints[2][10] = 0; arrPoints[2][11] = 0; arrPoints[2][12] = 0; arrPoints[2][13] = 0; arrPoints[3][0] = "undef"; arrPoints[3][1] = 0; arrPoints[3][2] = 0; arrPoints[3][3] = 0; arrPoints[3][4] = 0; arrPoints[3][5] = 0; arrPoints[3][6] = 0; arrPoints[3][7] = 0; arrPoints[3][8] = 0; arrPoints[3][9] = 0; arrPoints[3][10] = 0; arrPoints[3][11] = 0; arrPoints[3][12] = 0; arrPoints[3][13] = 0; arrPoints[4][0] = "undef"; arrPoints[4][1] = 0; arrPoints[4][2] = 0; arrPoints[4][3] = 0; arrPoints[4][4] = 0; arrPoints[4][5] = 0; arrPoints[4][6] = 0; arrPoints[4][7] = 0; arrPoints[4][8] = 0; arrPoints[4][9] = 0; arrPoints[4][10] = 0; arrPoints[4][11] = 0; arrPoints[4][12] = 0; arrPoints[4][13] = 0; arrPoints[5][0] = "undef"; arrPoints[5][1] = 0; arrPoints[5][2] = 0; arrPoints[5][3] = 0; arrPoints[5][4] = 0; arrPoints[5][5] = 0; arrPoints[5][6] = 0; arrPoints[5][7] = 0; arrPoints[5][8] = 0; arrPoints[5][9] = 0; arrPoints[5][10] = 0; arrPoints[5][11] = 0; arrPoints[5][12] = 0; arrPoints[5][13] = 0; arrPoints[6][0] = "undef"; arrPoints[6][1] = 0; arrPoints[6][2] = 0; arrPoints[6][3] = 0; arrPoints[6][4] = 0; arrPoints[6][5] = 0; arrPoints[6][6] = 0; arrPoints[6][7] = 0; arrPoints[6][8] = 0; arrPoints[6][9] = 0; arrPoints[6][10] = 0; arrPoints[6][11] = 0; arrPoints[6][12] = 0; arrPoints[6][13] = 0; arrPoints[7][0] = "undef"; arrPoints[7][1] = 0; arrPoints[7][2] = 0; arrPoints[7][3] = 0; arrPoints[7][4] = 0; arrPoints[7][5] = 0; arrPoints[7][6] = 0; arrPoints[7][7] = 0; arrPoints[7][8] = 0; arrPoints[7][9] = 0; arrPoints[7][10] = 0; arrPoints[7][11] = 0; arrPoints[7][12] = 0; arrPoints[7][13] = 0; arrPoints[8][0] = "undef"; arrPoints[8][1] = 0; arrPoints[8][2] = 0; arrPoints[8][3] = 0; arrPoints[8][4] = 0; arrPoints[8][5] = 0; arrPoints[8][6] = 0; arrPoints[8][7] = 0; arrPoints[8][8] = 0; arrPoints[8][9] = 0; arrPoints[8][10] = 0; arrPoints[8][11] = 0; arrPoints[8][12] = 0; arrPoints[8][13] = 0; arrPoints[9][0] = "undef"; arrPoints[9][1] = 0; arrPoints[9][2] = 0; arrPoints[9][3] = 0; arrPoints[9][4] = 0; arrPoints[9][5] = 0; arrPoints[9][6] = 0; arrPoints[9][7] = 0; arrPoints[9][8] = 0; arrPoints[9][9] = 0; arrPoints[9][10] = 0; arrPoints[9][11] = 0; arrPoints[9][12] = 0; arrPoints[9][13] = 0; arrPoints[10][0] = "undef"; arrPoints[10][1] = 0; arrPoints[10][2] = 0; arrPoints[10][3] = 0; arrPoints[10][4] = 0; arrPoints[10][5] = 0; arrPoints[10][6] = 0; arrPoints[10][7] = 0; arrPoints[10][8] = 0; arrPoints[10][9] = 0; arrPoints[10][10] = 0; arrPoints[10][11] = 0; arrPoints[10][12] = 0; arrPoints[10][13] = 0; arrPoints[11][0] = "undef"; arrPoints[11][1] = 0; arrPoints[11][2] = 0; arrPoints[11][3] = 0; arrPoints[11][4] = 0; arrPoints[11][5] = 0; arrPoints[11][6] = 0; arrPoints[11][7] = 0; arrPoints[11][8] = 0; arrPoints[11][9] = 0; arrPoints[11][10] = 0; arrPoints[11][11] = 0; arrPoints[11][12] = 0; arrPoints[11][13] = 0; arrPoints[12][0] = "undef"; arrPoints[12][1] = 0; arrPoints[12][2] = 0; arrPoints[12][3] = 0; arrPoints[12][4] = 0; arrPoints[12][5] = 0; arrPoints[12][6] = 0; arrPoints[12][7] = 0; arrPoints[12][8] = 0; arrPoints[12][9] = 0; arrPoints[12][10] = 0; arrPoints[12][11] = 0; arrPoints[12][12] = 0; arrPoints[12][13] = 0; arrPoints[13][0] = "undef"; arrPoints[13][1] = 0; arrPoints[13][2] = 0; arrPoints[13][3] = 0; arrPoints[13][4] = 0; arrPoints[13][5] = 0; arrPoints[13][6] = 0; arrPoints[13][7] = 0; arrPoints[13][8] = 0; arrPoints[13][9] = 0; arrPoints[13][10] = 0; arrPoints[13][11] = 0; arrPoints[13][12] = 0; arrPoints[13][13] = 0; arrPoints[14][0] = "undef"; arrPoints[14][1] = 0; arrPoints[14][2] = 0; arrPoints[14][3] = 0; arrPoints[14][4] = 0; arrPoints[14][5] = 0; arrPoints[14][6] = 0; arrPoints[14][7] = 0; arrPoints[14][8] = 0; arrPoints[14][9] = 0; arrPoints[14][10] = 0; arrPoints[14][11] = 0; arrPoints[14][12] = 0; arrPoints[14][13] = 0; arrPoints[15][0] = "undef"; arrPoints[15][1] = 0; arrPoints[15][2] = 0; arrPoints[15][3] = 0; arrPoints[15][4] = 0; arrPoints[15][5] = 0; arrPoints[15][6] = 0; arrPoints[15][7] = 0; arrPoints[15][8] = 0; arrPoints[15][9] = 0; arrPoints[15][10] = 0; arrPoints[15][11] = 0; arrPoints[15][12] = 0; arrPoints[15][13] = 0; arrPoints[16][0] = "undef"; arrPoints[16][1] = 0; arrPoints[16][2] = 0; arrPoints[16][3] = 0; arrPoints[16][4] = 0; arrPoints[16][5] = 0; arrPoints[16][6] = 0; arrPoints[16][7] = 0; arrPoints[16][8] = 0; arrPoints[16][9] = 0; arrPoints[16][10] = 0; arrPoints[16][11] = 0; arrPoints[16][12] = 0; arrPoints[16][13] = 0; arrPoints[17][0] = "undef"; arrPoints[17][1] = 0; arrPoints[17][2] = 0; arrPoints[17][3] = 0; arrPoints[17][4] = 0; arrPoints[17][5] = 0; arrPoints[17][6] = 0; arrPoints[17][7] = 0; arrPoints[17][8] = 0; arrPoints[17][9] = 0; arrPoints[17][10] = 0; arrPoints[17][11] = 0; arrPoints[17][12] = 0; arrPoints[17][13] = 0; arrPoints[18][0] = "undef"; arrPoints[18][1] = 0; arrPoints[18][2] = 0; arrPoints[18][3] = 0; arrPoints[18][4] = 0; arrPoints[18][5] = 0; arrPoints[18][6] = 0; arrPoints[18][7] = 0; arrPoints[18][8] = 0; arrPoints[18][9] = 0; arrPoints[18][10] = 0; arrPoints[18][11] = 0; arrPoints[18][12] = 0; arrPoints[18][13] = 0; arrPoints[19][0] = "undef"; arrPoints[19][1] = 0; arrPoints[19][2] = 0; arrPoints[19][3] = 0; arrPoints[19][4] = 0; arrPoints[19][5] = 0; arrPoints[19][6] = 0; arrPoints[19][7] = 0; arrPoints[19][8] = 0; arrPoints[19][9] = 0; arrPoints[19][10] = 0; arrPoints[19][11] = 0; arrPoints[19][12] = 0; arrPoints[19][13] = 0; arrPoints[20][0] = "undef"; arrPoints[20][1] = 0; arrPoints[20][2] = 0; arrPoints[20][3] = 0; arrPoints[20][4] = 0; arrPoints[20][5] = 0; arrPoints[20][6] = 0; arrPoints[20][7] = 0; arrPoints[20][8] = 0; arrPoints[20][9] = 0; arrPoints[20][10] = 0; arrPoints[20][11] = 0; arrPoints[20][12] = 0; arrPoints[20][13] = 0; arrPoints[21][0] = "undef"; arrPoints[21][1] = 0; arrPoints[21][2] = 0; arrPoints[21][3] = 0; arrPoints[21][4] = 0; arrPoints[21][5] = 0; arrPoints[21][6] = 0; arrPoints[21][7] = 0; arrPoints[21][8] = 0; arrPoints[21][9] = 0; arrPoints[21][10] = 0; arrPoints[21][11] = 0; arrPoints[21][12] = 0; arrPoints[21][13] = 0; arrPoints[22][0] = "undef"; arrPoints[22][1] = 0; arrPoints[22][2] = 0; arrPoints[22][3] = 0; arrPoints[22][4] = 0; arrPoints[22][5] = 0; arrPoints[22][6] = 0; arrPoints[22][7] = 0; arrPoints[22][8] = 0; arrPoints[22][9] = 0; arrPoints[22][10] = 0; arrPoints[22][11] = 0; arrPoints[22][12] = 0; arrPoints[22][13] = 0; arrPoints[23][0] = "undef"; arrPoints[23][1] = 0; arrPoints[23][2] = 0; arrPoints[23][3] = 0; arrPoints[23][4] = 0; arrPoints[23][5] = 0; arrPoints[23][6] = 0; arrPoints[23][7] = 0; arrPoints[23][8] = 0; arrPoints[23][9] = 0; arrPoints[23][10] = 0; arrPoints[23][11] = 0; arrPoints[23][12] = 0; arrPoints[23][13] = 0; arrPoints[24][0] = "undef"; arrPoints[24][1] = 0; arrPoints[24][2] = 0; arrPoints[24][3] = 0; arrPoints[24][4] = 0; arrPoints[24][5] = 0; arrPoints[24][6] = 0; arrPoints[24][7] = 0; arrPoints[24][8] = 0; arrPoints[24][9] = 0; arrPoints[24][10] = 0; arrPoints[24][11] = 0; arrPoints[24][12] = 0; arrPoints[24][13] = 0; arrPoints[25][0] = "undef"; arrPoints[25][1] = 0; arrPoints[25][2] = 0; arrPoints[25][3] = 0; arrPoints[25][4] = 0; arrPoints[25][5] = 0; arrPoints[25][6] = 0; arrPoints[25][7] = 0; arrPoints[25][8] = 0; arrPoints[25][9] = 0; arrPoints[25][10] = 0; arrPoints[25][11] = 0; arrPoints[25][12] = 0; arrPoints[25][13] = 0; arrPoints[26][0] = "undef"; arrPoints[26][1] = 0; arrPoints[26][2] = 0; arrPoints[26][3] = 0; arrPoints[26][4] = 0; arrPoints[26][5] = 0; arrPoints[26][6] = 0; arrPoints[26][7] = 0; arrPoints[26][8] = 0; arrPoints[26][9] = 0; arrPoints[26][10] = 0; arrPoints[26][11] = 0; arrPoints[26][12] = 0; arrPoints[26][13] = 0; arrPoints[27][0] = "undef"; arrPoints[27][1] = 0; arrPoints[27][2] = 0; arrPoints[27][3] = 0; arrPoints[27][4] = 0; arrPoints[27][5] = 0; arrPoints[27][6] = 0; arrPoints[27][7] = 0; arrPoints[27][8] = 0; arrPoints[27][9] = 0; arrPoints[27][10] = 0; arrPoints[27][11] = 0; arrPoints[27][12] = 0; arrPoints[27][13] = 0; arrPoints[28][0] = "undef"; arrPoints[28][1] = 0; arrPoints[28][2] = 0; arrPoints[28][3] = 0; arrPoints[28][4] = 0; arrPoints[28][5] = 0; arrPoints[28][6] = 0; arrPoints[28][7] = 0; arrPoints[28][8] = 0; arrPoints[28][9] = 0; arrPoints[28][10] = 0; arrPoints[28][11] = 0; arrPoints[28][12] = 0; arrPoints[28][13] = 0; arrPoints[29][0] = "undef"; arrPoints[29][1] = 0; arrPoints[29][2] = 0; arrPoints[29][3] = 0; arrPoints[29][4] = 0; arrPoints[29][5] = 0; arrPoints[29][6] = 0; arrPoints[29][7] = 0; arrPoints[29][8] = 0; arrPoints[29][9] = 0; arrPoints[29][10] = 0; arrPoints[29][11] = 0; arrPoints[29][12] = 0; arrPoints[29][13] = 0; arrPoints[30][0] = "undef"; arrPoints[30][1] = 0; arrPoints[30][2] = 0; arrPoints[30][3] = 0; arrPoints[30][4] = 0; arrPoints[30][5] = 0; arrPoints[30][6] = 0; arrPoints[30][7] = 0; arrPoints[30][8] = 0; arrPoints[30][9] = 0; arrPoints[30][10] = 0; arrPoints[30][11] = 0; arrPoints[30][12] = 0; arrPoints[30][13] = 0; arrPoints[31][0] = "undef"; arrPoints[31][1] = 0; arrPoints[31][2] = 0; arrPoints[31][3] = 0; arrPoints[31][4] = 0; arrPoints[31][5] = 0; arrPoints[31][6] = 0; arrPoints[31][7] = 0; arrPoints[31][8] = 0; arrPoints[31][9] = 0; arrPoints[31][10] = 0; arrPoints[31][11] = 0; arrPoints[31][12] = 0; arrPoints[31][13] = 0; arrPoints[32][0] = "undef"; arrPoints[32][1] = 0; arrPoints[32][2] = 0; arrPoints[32][3] = 0; arrPoints[32][4] = 0; arrPoints[32][5] = 0; arrPoints[32][6] = 0; arrPoints[32][7] = 0; arrPoints[32][8] = 0; arrPoints[32][9] = 0; arrPoints[32][10] = 0; arrPoints[32][11] = 0; arrPoints[32][12] = 0; arrPoints[32][13] = 0; arrPoints[33][0] = "undef"; arrPoints[33][1] = 0; arrPoints[33][2] = 0; arrPoints[33][3] = 0; arrPoints[33][4] = 0; arrPoints[33][5] = 0; arrPoints[33][6] = 0; arrPoints[33][7] = 0; arrPoints[33][8] = 0; arrPoints[33][9] = 0; arrPoints[33][10] = 0; arrPoints[33][11] = 0; arrPoints[33][12] = 0; arrPoints[33][13] = 0; arrPoints[34][0] = "undef"; arrPoints[34][1] = 0; arrPoints[34][2] = 0; arrPoints[34][3] = 0; arrPoints[34][4] = 0; arrPoints[34][5] = 0; arrPoints[34][6] = 0; arrPoints[34][7] = 0; arrPoints[34][8] = 0; arrPoints[34][9] = 0; arrPoints[34][10] = 0; arrPoints[34][11] = 0; arrPoints[34][12] = 0; arrPoints[34][13] = 0; arrPoints[35][0] = "undef"; arrPoints[35][1] = 0; arrPoints[35][2] = 0; arrPoints[35][3] = 0; arrPoints[35][4] = 0; arrPoints[35][5] = 0; arrPoints[35][6] = 0; arrPoints[35][7] = 0; arrPoints[35][8] = 0; arrPoints[35][9] = 0; arrPoints[35][10] = 0; arrPoints[35][11] = 0; arrPoints[35][12] = 0; arrPoints[35][13] = 0; arrPoints[36][0] = "undef"; arrPoints[36][1] = 0; arrPoints[36][2] = 0; arrPoints[36][3] = 0; arrPoints[36][4] = 0; arrPoints[36][5] = 0; arrPoints[36][6] = 0; arrPoints[36][7] = 0; arrPoints[36][8] = 0; arrPoints[36][9] = 0; arrPoints[36][10] = 0; arrPoints[36][11] = 0; arrPoints[36][12] = 0; arrPoints[36][13] = 0; arrPoints[37][0] = "undef"; arrPoints[37][1] = 0; arrPoints[37][2] = 0; arrPoints[37][3] = 0; arrPoints[37][4] = 0; arrPoints[37][5] = 0; arrPoints[37][6] = 0; arrPoints[37][7] = 0; arrPoints[37][8] = 0; arrPoints[37][9] = 0; arrPoints[37][10] = 0; arrPoints[37][11] = 0; arrPoints[37][12] = 0; arrPoints[37][13] = 0; arrPoints[38][0] = "undef"; arrPoints[38][1] = 0; arrPoints[38][2] = 0; arrPoints[38][3] = 0; arrPoints[38][4] = 0; arrPoints[38][5] = 0; arrPoints[38][6] = 0; arrPoints[38][7] = 0; arrPoints[38][8] = 0; arrPoints[38][9] = 0; arrPoints[38][10] = 0; arrPoints[38][11] = 0; arrPoints[38][12] = 0; arrPoints[38][13] = 0; arrPoints[39][0] = "undef"; arrPoints[39][1] = 0; arrPoints[39][2] = 0; arrPoints[39][3] = 0; arrPoints[39][4] = 0; arrPoints[39][5] = 0; arrPoints[39][6] = 0; arrPoints[39][7] = 0; arrPoints[39][8] = 0; arrPoints[39][9] = 0; arrPoints[39][10] = 0; arrPoints[39][11] = 0; arrPoints[39][12] = 0; arrPoints[39][13] = 0; arrPoints[40][0] = "undef"; arrPoints[40][1] = 0; arrPoints[40][2] = 0; arrPoints[40][3] = 0; arrPoints[40][4] = 0; arrPoints[40][5] = 0; arrPoints[40][6] = 0; arrPoints[40][7] = 0; arrPoints[40][8] = 0; arrPoints[40][9] = 0; arrPoints[40][10] = 0; arrPoints[40][11] = 0; arrPoints[40][12] = 0; arrPoints[40][13] = 0; arrPoints[41][0] = "undef"; arrPoints[41][1] = 0; arrPoints[41][2] = 0; arrPoints[41][3] = 0; arrPoints[41][4] = 0; arrPoints[41][5] = 0; arrPoints[41][6] = 0; arrPoints[41][7] = 0; arrPoints[41][8] = 0; arrPoints[41][9] = 0; arrPoints[41][10] = 0; arrPoints[41][11] = 0; arrPoints[41][12] = 0; arrPoints[41][13] = 0; arrPoints[42][0] = "undef"; arrPoints[42][1] = 0; arrPoints[42][2] = 0; arrPoints[42][3] = 0; arrPoints[42][4] = 0; arrPoints[42][5] = 0; arrPoints[42][6] = 0; arrPoints[42][7] = 0; arrPoints[42][8] = 0; arrPoints[42][9] = 0; arrPoints[42][10] = 0; arrPoints[42][11] = 0; arrPoints[42][12] = 0; arrPoints[42][13] = 0; arrPoints[43][0] = "undef"; arrPoints[43][1] = 0; arrPoints[43][2] = 0; arrPoints[43][3] = 0; arrPoints[43][4] = 0; arrPoints[43][5] = 0; arrPoints[43][6] = 0; arrPoints[43][7] = 0; arrPoints[43][8] = 0; arrPoints[43][9] = 0; arrPoints[43][10] = 0; arrPoints[43][11] = 0; arrPoints[43][12] = 0; arrPoints[43][13] = 0; arrPoints[44][0] = "undef"; arrPoints[44][1] = 0; arrPoints[44][2] = 0; arrPoints[44][3] = 0; arrPoints[44][4] = 0; arrPoints[44][5] = 0; arrPoints[44][6] = 0; arrPoints[44][7] = 0; arrPoints[44][8] = 0; arrPoints[44][9] = 0; arrPoints[44][10] = 0; arrPoints[44][11] = 0; arrPoints[44][12] = 0; arrPoints[44][13] = 0; arrPoints[45][0] = "undef"; arrPoints[45][1] = 0; arrPoints[45][2] = 0; arrPoints[45][3] = 0; arrPoints[45][4] = 0; arrPoints[45][5] = 0; arrPoints[45][6] = 0; arrPoints[45][7] = 0; arrPoints[45][8] = 0; arrPoints[45][9] = 0; arrPoints[45][10] = 0; arrPoints[45][11] = 0; arrPoints[45][12] = 0; arrPoints[45][13] = 0; arrPoints[46][0] = "undef"; arrPoints[46][1] = 0; arrPoints[46][2] = 0; arrPoints[46][3] = 0; arrPoints[46][4] = 0; arrPoints[46][5] = 0; arrPoints[46][6] = 0; arrPoints[46][7] = 0; arrPoints[46][8] = 0; arrPoints[46][9] = 0; arrPoints[46][10] = 0; arrPoints[46][11] = 0; arrPoints[46][12] = 0; arrPoints[46][13] = 0; arrPoints[47][0] = "undef"; arrPoints[47][1] = 0; arrPoints[47][2] = 0; arrPoints[47][3] = 0; arrPoints[47][4] = 0; arrPoints[47][5] = 0; arrPoints[47][6] = 0; arrPoints[47][7] = 0; arrPoints[47][8] = 0; arrPoints[47][9] = 0; arrPoints[47][10] = 0; arrPoints[47][11] = 0; arrPoints[47][12] = 0; arrPoints[47][13] = 0; arrPoints[48][0] = "undef"; arrPoints[48][1] = 0; arrPoints[48][2] = 0; arrPoints[48][3] = 0; arrPoints[48][4] = 0; arrPoints[48][5] = 0; arrPoints[48][6] = 0; arrPoints[48][7] = 0; arrPoints[48][8] = 0; arrPoints[48][9] = 0; arrPoints[48][10] = 0; arrPoints[48][11] = 0; arrPoints[48][12] = 0; arrPoints[48][13] = 0; arrPoints[49][0] = "undef"; arrPoints[49][1] = 0; arrPoints[49][2] = 0; arrPoints[49][3] = 0; arrPoints[49][4] = 0; arrPoints[49][5] = 0; arrPoints[49][6] = 0; arrPoints[49][7] = 0; arrPoints[49][8] = 0; arrPoints[49][9] = 0; arrPoints[49][10] = 0; arrPoints[49][11] = 0; arrPoints[49][12] = 0; arrPoints[49][13] = 0; arrPoints[50][0] = "undef"; arrPoints[50][1] = 0; arrPoints[50][2] = 0; arrPoints[50][3] = 0; arrPoints[50][4] = 0; arrPoints[50][5] = 0; arrPoints[50][6] = 0; arrPoints[50][7] = 0; arrPoints[50][8] = 0; arrPoints[50][9] = 0; arrPoints[50][10] = 0; arrPoints[50][11] = 0; arrPoints[50][12] = 0; arrPoints[50][13] = 0; arrPoints[51][0] = "undef"; arrPoints[51][1] = 0; arrPoints[51][2] = 0; arrPoints[51][3] = 0; arrPoints[51][4] = 0; arrPoints[51][5] = 0; arrPoints[51][6] = 0; arrPoints[51][7] = 0; arrPoints[51][8] = 0; arrPoints[51][9] = 0; arrPoints[51][10] = 0; arrPoints[51][11] = 0; arrPoints[51][12] = 0; arrPoints[51][13] = 0; arrPoints[52][0] = "undef"; arrPoints[52][1] = 0; arrPoints[52][2] = 0; arrPoints[52][3] = 0; arrPoints[52][4] = 0; arrPoints[52][5] = 0; arrPoints[52][6] = 0; arrPoints[52][7] = 0; arrPoints[52][8] = 0; arrPoints[52][9] = 0; arrPoints[52][10] = 0; arrPoints[52][11] = 0; arrPoints[52][12] = 0; arrPoints[52][13] = 0; arrPoints[53][0] = "undef"; arrPoints[53][1] = 0; arrPoints[53][2] = 0; arrPoints[53][3] = 0; arrPoints[53][4] = 0; arrPoints[53][5] = 0; arrPoints[53][6] = 0; arrPoints[53][7] = 0; arrPoints[53][8] = 0; arrPoints[53][9] = 0; arrPoints[53][10] = 0; arrPoints[53][11] = 0; arrPoints[53][12] = 0; arrPoints[53][13] = 0; arrPoints[54][0] = "undef"; arrPoints[54][1] = 0; arrPoints[54][2] = 0; arrPoints[54][3] = 0; arrPoints[54][4] = 0; arrPoints[54][5] = 0; arrPoints[54][6] = 0; arrPoints[54][7] = 0; arrPoints[54][8] = 0; arrPoints[54][9] = 0; arrPoints[54][10] = 0; arrPoints[54][11] = 0; arrPoints[54][12] = 0; arrPoints[54][13] = 0; arrPoints[55][0] = "undef"; arrPoints[55][1] = 0; arrPoints[55][2] = 0; arrPoints[55][3] = 0; arrPoints[55][4] = 0; arrPoints[55][5] = 0; arrPoints[55][6] = 0; arrPoints[55][7] = 0; arrPoints[55][8] = 0; arrPoints[55][9] = 0; arrPoints[55][10] = 0; arrPoints[55][11] = 0; arrPoints[55][12] = 0; arrPoints[55][13] = 0; arrPoints[56][0] = "undef"; arrPoints[56][1] = 0; arrPoints[56][2] = 0; arrPoints[56][3] = 0; arrPoints[56][4] = 0; arrPoints[56][5] = 0; arrPoints[56][6] = 0; arrPoints[56][7] = 0; arrPoints[56][8] = 0; arrPoints[56][9] = 0; arrPoints[56][10] = 0; arrPoints[56][11] = 0; arrPoints[56][12] = 0; arrPoints[56][13] = 0; arrPoints[57][0] = "undef"; arrPoints[57][1] = 0; arrPoints[57][2] = 0; arrPoints[57][3] = 0; arrPoints[57][4] = 0; arrPoints[57][5] = 0; arrPoints[57][6] = 0; arrPoints[57][7] = 0; arrPoints[57][8] = 0; arrPoints[57][9] = 0; arrPoints[57][10] = 0; arrPoints[57][11] = 0; arrPoints[57][12] = 0; arrPoints[57][13] = 0; arrPoints[58][0] = "undef"; arrPoints[58][1] = 0; arrPoints[58][2] = 0; arrPoints[58][3] = 0; arrPoints[58][4] = 0; arrPoints[58][5] = 0; arrPoints[58][6] = 0; arrPoints[58][7] = 0; arrPoints[58][8] = 0; arrPoints[58][9] = 0; arrPoints[58][10] = 0; arrPoints[58][11] = 0; arrPoints[58][12] = 0; arrPoints[58][13] = 0; arrPoints[59][0] = "undef"; arrPoints[59][1] = 0; arrPoints[59][2] = 0; arrPoints[59][3] = 0; arrPoints[59][4] = 0; arrPoints[59][5] = 0; arrPoints[59][6] = 0; arrPoints[59][7] = 0; arrPoints[59][8] = 0; arrPoints[59][9] = 0; arrPoints[59][10] = 0; arrPoints[59][11] = 0; arrPoints[59][12] = 0; arrPoints[59][13] = 0; arrPoints[60][0] = "undef"; arrPoints[60][1] = 0; arrPoints[60][2] = 0; arrPoints[60][3] = 0; arrPoints[60][4] = 0; arrPoints[60][5] = 0; arrPoints[60][6] = 0; arrPoints[60][7] = 0; arrPoints[60][8] = 0; arrPoints[60][9] = 0; arrPoints[60][10] = 0; arrPoints[60][11] = 0; arrPoints[60][12] = 0; arrPoints[60][13] = 0; arrPoints[61][0] = "undef"; arrPoints[61][1] = 0; arrPoints[61][2] = 0; arrPoints[61][3] = 0; arrPoints[61][4] = 0; arrPoints[61][5] = 0; arrPoints[61][6] = 0; arrPoints[61][7] = 0; arrPoints[61][8] = 0; arrPoints[61][9] = 0; arrPoints[61][10] = 0; arrPoints[61][11] = 0; arrPoints[61][12] = 0; arrPoints[61][13] = 0; arrPoints[62][0] = "undef"; arrPoints[62][1] = 0; arrPoints[62][2] = 0; arrPoints[62][3] = 0; arrPoints[62][4] = 0; arrPoints[62][5] = 0; arrPoints[62][6] = 0; arrPoints[62][7] = 0; arrPoints[62][8] = 0; arrPoints[62][9] = 0; arrPoints[62][10] = 0; arrPoints[62][11] = 0; arrPoints[62][12] = 0; arrPoints[62][13] = 0; arrPoints[63][0] = "undef"; arrPoints[63][1] = 0; arrPoints[63][2] = 0; arrPoints[63][3] = 0; arrPoints[63][4] = 0; arrPoints[63][5] = 0; arrPoints[63][6] = 0; arrPoints[63][7] = 0; arrPoints[63][8] = 0; arrPoints[63][9] = 0; arrPoints[63][10] = 0; arrPoints[63][11] = 0; arrPoints[63][12] = 0; arrPoints[63][13] = 0; arrPoints[64][0] = "undef"; arrPoints[64][1] = 0; arrPoints[64][2] = 0; arrPoints[64][3] = 0; arrPoints[64][4] = 0; arrPoints[64][5] = 0; arrPoints[64][6] = 0; arrPoints[64][7] = 0; arrPoints[64][8] = 0; arrPoints[64][9] = 0; arrPoints[64][10] = 0; arrPoints[64][11] = 0; arrPoints[64][12] = 0; arrPoints[64][13] = 0; arrPoints[65][0] = "undef"; arrPoints[65][1] = 0; arrPoints[65][2] = 0; arrPoints[65][3] = 0; arrPoints[65][4] = 0; arrPoints[65][5] = 0; arrPoints[65][6] = 0; arrPoints[65][7] = 0; arrPoints[65][8] = 0; arrPoints[65][9] = 0; arrPoints[65][10] = 0; arrPoints[65][11] = 0; arrPoints[65][12] = 0; arrPoints[65][13] = 0; arrPoints[66][0] = "undef"; arrPoints[66][1] = 0; arrPoints[66][2] = 0; arrPoints[66][3] = 0; arrPoints[66][4] = 0; arrPoints[66][5] = 0; arrPoints[66][6] = 0; arrPoints[66][7] = 0; arrPoints[66][8] = 0; arrPoints[66][9] = 0; arrPoints[66][10] = 0; arrPoints[66][11] = 0; arrPoints[66][12] = 0; arrPoints[66][13] = 0; arrPoints[67][0] = "undef"; arrPoints[67][1] = 0; arrPoints[67][2] = 0; arrPoints[67][3] = 0; arrPoints[67][4] = 0; arrPoints[67][5] = 0; arrPoints[67][6] = 0; arrPoints[67][7] = 0; arrPoints[67][8] = 0; arrPoints[67][9] = 0; arrPoints[67][10] = 0; arrPoints[67][11] = 0; arrPoints[67][12] = 0; arrPoints[67][13] = 0; arrPoints[68][0] = "undef"; arrPoints[68][1] = 0; arrPoints[68][2] = 0; arrPoints[68][3] = 0; arrPoints[68][4] = 0; arrPoints[68][5] = 0; arrPoints[68][6] = 0; arrPoints[68][7] = 0; arrPoints[68][8] = 0; arrPoints[68][9] = 0; arrPoints[68][10] = 0; arrPoints[68][11] = 0; arrPoints[68][12] = 0; arrPoints[68][13] = 0; arrPoints[69][0] = "undef"; arrPoints[69][1] = 0; arrPoints[69][2] = 0; arrPoints[69][3] = 0; arrPoints[69][4] = 0; arrPoints[69][5] = 0; arrPoints[69][6] = 0; arrPoints[69][7] = 0; arrPoints[69][8] = 0; arrPoints[69][9] = 0; arrPoints[69][10] = 0; arrPoints[69][11] = 0; arrPoints[69][12] = 0; arrPoints[69][13] = 0; arrPoints[70][0] = "undef"; arrPoints[70][1] = 0; arrPoints[70][2] = 0; arrPoints[70][3] = 0; arrPoints[70][4] = 0; arrPoints[70][5] = 0; arrPoints[70][6] = 0; arrPoints[70][7] = 0; arrPoints[70][8] = 0; arrPoints[70][9] = 0; arrPoints[70][10] = 0; arrPoints[70][11] = 0; arrPoints[70][12] = 0; arrPoints[70][13] = 0; arrPoints[71][0] = "undef"; arrPoints[71][1] = 0; arrPoints[71][2] = 0; arrPoints[71][3] = 0; arrPoints[71][4] = 0; arrPoints[71][5] = 0; arrPoints[71][6] = 0; arrPoints[71][7] = 0; arrPoints[71][8] = 0; arrPoints[71][9] = 0; arrPoints[71][10] = 0; arrPoints[71][11] = 0; arrPoints[71][12] = 0; arrPoints[71][13] = 0; arrPoints[72][0] = "undef"; arrPoints[72][1] = 0; arrPoints[72][2] = 0; arrPoints[72][3] = 0; arrPoints[72][4] = 0; arrPoints[72][5] = 0; arrPoints[72][6] = 0; arrPoints[72][7] = 0; arrPoints[72][8] = 0; arrPoints[72][9] = 0; arrPoints[72][10] = 0; arrPoints[72][11] = 0; arrPoints[72][12] = 0; arrPoints[72][13] = 0; arrPoints[73][0] = "undef"; arrPoints[73][1] = 0; arrPoints[73][2] = 0; arrPoints[73][3] = 0; arrPoints[73][4] = 0; arrPoints[73][5] = 0; arrPoints[73][6] = 0; arrPoints[73][7] = 0; arrPoints[73][8] = 0; arrPoints[73][9] = 0; arrPoints[73][10] = 0; arrPoints[73][11] = 0; arrPoints[73][12] = 0; arrPoints[73][13] = 0; arrPoints[74][0] = "undef"; arrPoints[74][1] = 0; arrPoints[74][2] = 0; arrPoints[74][3] = 0; arrPoints[74][4] = 0; arrPoints[74][5] = 0; arrPoints[74][6] = 0; arrPoints[74][7] = 0; arrPoints[74][8] = 0; arrPoints[74][9] = 0; arrPoints[74][10] = 0; arrPoints[74][11] = 0; arrPoints[74][12] = 0; arrPoints[74][13] = 0; arrPoints[75][0] = "undef"; arrPoints[75][1] = 0; arrPoints[75][2] = 0; arrPoints[75][3] = 0; arrPoints[75][4] = 0; arrPoints[75][5] = 0; arrPoints[75][6] = 0; arrPoints[75][7] = 0; arrPoints[75][8] = 0; arrPoints[75][9] = 0; arrPoints[75][10] = 0; arrPoints[75][11] = 0; arrPoints[75][12] = 0; arrPoints[75][13] = 0; arrPoints[76][0] = "undef"; arrPoints[76][1] = 0; arrPoints[76][2] = 0; arrPoints[76][3] = 0; arrPoints[76][4] = 0; arrPoints[76][5] = 0; arrPoints[76][6] = 0; arrPoints[76][7] = 0; arrPoints[76][8] = 0; arrPoints[76][9] = 0; arrPoints[76][10] = 0; arrPoints[76][11] = 0; arrPoints[76][12] = 0; arrPoints[76][13] = 0; arrPoints[77][0] = "undef"; arrPoints[77][1] = 0; arrPoints[77][2] = 0; arrPoints[77][3] = 0; arrPoints[77][4] = 0; arrPoints[77][5] = 0; arrPoints[77][6] = 0; arrPoints[77][7] = 0; arrPoints[77][8] = 0; arrPoints[77][9] = 0; arrPoints[77][10] = 0; arrPoints[77][11] = 0; arrPoints[77][12] = 0; arrPoints[77][13] = 0; arrPoints[78][0] = "undef"; arrPoints[78][1] = 0; arrPoints[78][2] = 0; arrPoints[78][3] = 0; arrPoints[78][4] = 0; arrPoints[78][5] = 0; arrPoints[78][6] = 0; arrPoints[78][7] = 0; arrPoints[78][8] = 0; arrPoints[78][9] = 0; arrPoints[78][10] = 0; arrPoints[78][11] = 0; arrPoints[78][12] = 0; arrPoints[78][13] = 0; arrPoints[79][0] = "undef"; arrPoints[79][1] = 0; arrPoints[79][2] = 0; arrPoints[79][3] = 0; arrPoints[79][4] = 0; arrPoints[79][5] = 0; arrPoints[79][6] = 0; arrPoints[79][7] = 0; arrPoints[79][8] = 0; arrPoints[79][9] = 0; arrPoints[79][10] = 0; arrPoints[79][11] = 0; arrPoints[79][12] = 0; arrPoints[79][13] = 0; arrPoints[80][0] = "undef"; arrPoints[80][1] = 0; arrPoints[80][2] = 0; arrPoints[80][3] = 0; arrPoints[80][4] = 0; arrPoints[80][5] = 0; arrPoints[80][6] = 0; arrPoints[80][7] = 0; arrPoints[80][8] = 0; arrPoints[80][9] = 0; arrPoints[80][10] = 0; arrPoints[80][11] = 0; arrPoints[80][12] = 0; arrPoints[80][13] = 0; arrPoints[81][0] = "undef"; arrPoints[81][1] = 0; arrPoints[81][2] = 0; arrPoints[81][3] = 0; arrPoints[81][4] = 0; arrPoints[81][5] = 0; arrPoints[81][6] = 0; arrPoints[81][7] = 0; arrPoints[81][8] = 0; arrPoints[81][9] = 0; arrPoints[81][10] = 0; arrPoints[81][11] = 0; arrPoints[81][12] = 0; arrPoints[81][13] = 0; arrPoints[82][0] = "undef"; arrPoints[82][1] = 0; arrPoints[82][2] = 0; arrPoints[82][3] = 0; arrPoints[82][4] = 0; arrPoints[82][5] = 0; arrPoints[82][6] = 0; arrPoints[82][7] = 0; arrPoints[82][8] = 0; arrPoints[82][9] = 0; arrPoints[82][10] = 0; arrPoints[82][11] = 0; arrPoints[82][12] = 0; arrPoints[82][13] = 0; arrPoints[83][0] = "undef"; arrPoints[83][1] = 0; arrPoints[83][2] = 0; arrPoints[83][3] = 0; arrPoints[83][4] = 0; arrPoints[83][5] = 0; arrPoints[83][6] = 0; arrPoints[83][7] = 0; arrPoints[83][8] = 0; arrPoints[83][9] = 0; arrPoints[83][10] = 0; arrPoints[83][11] = 0; arrPoints[83][12] = 0; arrPoints[83][13] = 0; arrPoints[84][0] = "undef"; arrPoints[84][1] = 0; arrPoints[84][2] = 0; arrPoints[84][3] = 0; arrPoints[84][4] = 0; arrPoints[84][5] = 0; arrPoints[84][6] = 0; arrPoints[84][7] = 0; arrPoints[84][8] = 0; arrPoints[84][9] = 0; arrPoints[84][10] = 0; arrPoints[84][11] = 0; arrPoints[84][12] = 0; arrPoints[84][13] = 0; arrPoints[85][0] = "undef"; arrPoints[85][1] = 0; arrPoints[85][2] = 0; arrPoints[85][3] = 0; arrPoints[85][4] = 0; arrPoints[85][5] = 0; arrPoints[85][6] = 0; arrPoints[85][7] = 0; arrPoints[85][8] = 0; arrPoints[85][9] = 0; arrPoints[85][10] = 0; arrPoints[85][11] = 0; arrPoints[85][12] = 0; arrPoints[85][13] = 0; arrPoints[86][0] = "undef"; arrPoints[86][1] = 0; arrPoints[86][2] = 0; arrPoints[86][3] = 0; arrPoints[86][4] = 0; arrPoints[86][5] = 0; arrPoints[86][6] = 0; arrPoints[86][7] = 0; arrPoints[86][8] = 0; arrPoints[86][9] = 0; arrPoints[86][10] = 0; arrPoints[86][11] = 0; arrPoints[86][12] = 0; arrPoints[86][13] = 0; arrPoints[87][0] = "undef"; arrPoints[87][1] = 0; arrPoints[87][2] = 0; arrPoints[87][3] = 0; arrPoints[87][4] = 0; arrPoints[87][5] = 0; arrPoints[87][6] = 0; arrPoints[87][7] = 0; arrPoints[87][8] = 0; arrPoints[87][9] = 0; arrPoints[87][10] = 0; arrPoints[87][11] = 0; arrPoints[87][12] = 0; arrPoints[87][13] = 0; arrPoints[88][0] = "undef"; arrPoints[88][1] = 0; arrPoints[88][2] = 0; arrPoints[88][3] = 0; arrPoints[88][4] = 0; arrPoints[88][5] = 0; arrPoints[88][6] = 0; arrPoints[88][7] = 0; arrPoints[88][8] = 0; arrPoints[88][9] = 0; arrPoints[88][10] = 0; arrPoints[88][11] = 0; arrPoints[88][12] = 0; arrPoints[88][13] = 0; arrPoints[89][0] = "undef"; arrPoints[89][1] = 0; arrPoints[89][2] = 0; arrPoints[89][3] = 0; arrPoints[89][4] = 0; arrPoints[89][5] = 0; arrPoints[89][6] = 0; arrPoints[89][7] = 0; arrPoints[89][8] = 0; arrPoints[89][9] = 0; arrPoints[89][10] = 0; arrPoints[89][11] = 0; arrPoints[89][12] = 0; arrPoints[89][13] = 0; arrPoints[90][0] = "undef"; arrPoints[90][1] = 0; arrPoints[90][2] = 0; arrPoints[90][3] = 0; arrPoints[90][4] = 0; arrPoints[90][5] = 0; arrPoints[90][6] = 0; arrPoints[90][7] = 0; arrPoints[90][8] = 0; arrPoints[90][9] = 0; arrPoints[90][10] = 0; arrPoints[90][11] = 0; arrPoints[90][12] = 0; arrPoints[90][13] = 0; arrPoints[91][0] = "undef"; arrPoints[91][1] = 0; arrPoints[91][2] = 0; arrPoints[91][3] = 0; arrPoints[91][4] = 0; arrPoints[91][5] = 0; arrPoints[91][6] = 0; arrPoints[91][7] = 0; arrPoints[91][8] = 0; arrPoints[91][9] = 0; arrPoints[91][10] = 0; arrPoints[91][11] = 0; arrPoints[91][12] = 0; arrPoints[91][13] = 0; arrPoints[92][0] = "undef"; arrPoints[92][1] = 0; arrPoints[92][2] = 0; arrPoints[92][3] = 0; arrPoints[92][4] = 0; arrPoints[92][5] = 0; arrPoints[92][6] = 0; arrPoints[92][7] = 0; arrPoints[92][8] = 0; arrPoints[92][9] = 0; arrPoints[92][10] = 0; arrPoints[92][11] = 0; arrPoints[92][12] = 0; arrPoints[92][13] = 0; arrPoints[93][0] = "undef"; arrPoints[93][1] = 0; arrPoints[93][2] = 0; arrPoints[93][3] = 0; arrPoints[93][4] = 0; arrPoints[93][5] = 0; arrPoints[93][6] = 0; arrPoints[93][7] = 0; arrPoints[93][8] = 0; arrPoints[93][9] = 0; arrPoints[93][10] = 0; arrPoints[93][11] = 0; arrPoints[93][12] = 0; arrPoints[93][13] = 0; arrPoints[94][0] = "undef"; arrPoints[94][1] = 0; arrPoints[94][2] = 0; arrPoints[94][3] = 0; arrPoints[94][4] = 0; arrPoints[94][5] = 0; arrPoints[94][6] = 0; arrPoints[94][7] = 0; arrPoints[94][8] = 0; arrPoints[94][9] = 0; arrPoints[94][10] = 0; arrPoints[94][11] = 0; arrPoints[94][12] = 0; arrPoints[94][13] = 0; arrPoints[95][0] = "undef"; arrPoints[95][1] = 0; arrPoints[95][2] = 0; arrPoints[95][3] = 0; arrPoints[95][4] = 0; arrPoints[95][5] = 0; arrPoints[95][6] = 0; arrPoints[95][7] = 0; arrPoints[95][8] = 0; arrPoints[95][9] = 0; arrPoints[95][10] = 0; arrPoints[95][11] = 0; arrPoints[95][12] = 0; arrPoints[95][13] = 0; arrPoints[96][0] = "undef"; arrPoints[96][1] = 0; arrPoints[96][2] = 0; arrPoints[96][3] = 0; arrPoints[96][4] = 0; arrPoints[96][5] = 0; arrPoints[96][6] = 0; arrPoints[96][7] = 0; arrPoints[96][8] = 0; arrPoints[96][9] = 0; arrPoints[96][10] = 0; arrPoints[96][11] = 0; arrPoints[96][12] = 0; arrPoints[96][13] = 0; arrPoints[97][0] = "undef"; arrPoints[97][1] = 0; arrPoints[97][2] = 0; arrPoints[97][3] = 0; arrPoints[97][4] = 0; arrPoints[97][5] = 0; arrPoints[97][6] = 0; arrPoints[97][7] = 0; arrPoints[97][8] = 0; arrPoints[97][9] = 0; arrPoints[97][10] = 0; arrPoints[97][11] = 0; arrPoints[97][12] = 0; arrPoints[97][13] = 0; arrPoints[98][0] = "undef"; arrPoints[98][1] = 0; arrPoints[98][2] = 0; arrPoints[98][3] = 0; arrPoints[98][4] = 0; arrPoints[98][5] = 0; arrPoints[98][6] = 0; arrPoints[98][7] = 0; arrPoints[98][8] = 0; arrPoints[98][9] = 0; arrPoints[98][10] = 0; arrPoints[98][11] = 0; arrPoints[98][12] = 0; arrPoints[98][13] = 0; arrPoints[99][0] = "undef"; arrPoints[99][1] = 0; arrPoints[99][2] = 0; arrPoints[99][3] = 0; arrPoints[99][4] = 0; arrPoints[99][5] = 0; arrPoints[99][6] = 0; arrPoints[99][7] = 0; arrPoints[99][8] = 0; arrPoints[99][9] = 0; arrPoints[99][10] = 0; arrPoints[99][11] = 0; arrPoints[99][12] = 0; arrPoints[99][13] = 0; var cratePrize = 0; var playerArrayLocation = -1; var freeSpaceEle = 0; var userIndex = 0; var betIntNum = 0; var processBetText = ""; 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; //color codes { var purple = "#C287C2";//original color: #B369B3 var green = "#47FF69"; } } } //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 **/ { function playerInArrayLocation(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return i; } } return -1; // Not found } 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 "/ubhelp 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 "/ubhelp 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 if(!cbjs.arrayContains(modArray,user) && user != cb.room_slug) { silenceArrayPopulate(user); cb.sendNotice(mod + ' has silenced ' + user + '.','',purple,'','','red'); } if(cbjs.arrayContains(modArray,user) || user == cb.room_slug) { cb.sendNotice(user + ' is either a moderator or the room host and cannot be silenced.',mod,purple); } } 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 /ubhelp 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 /ubhelp 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 /ubhelp 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 /ubhelp addtime to see how to use /addtime.',mod,purple); } } function sendWhisper(message,from, mod, tokens) { if(message[1] != from && message[1] != " ") { 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 if(message[1] == from) { cb.sendNotice('Talking to yourself is a little odd...',from,purple); } else if(message[1] == " ") { cb.sendNotice('You failed to enter a recipient for your message.',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) { if(message.includes(":donatorstatustrans")) { message= message.replace(/:donatorstatustrans/g, ''); var m = ':donatorstatustrans ' + ':crowntest1 |' + tipperArray[findTipper(user)][1] + '| ' + message; } else { var m = ':crowntest1 |' + 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 /ubhelp emod to see how to use /emod.',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) { cb.sendNotice(notifierMessage,'',purple); 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 /ubhelp 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 /ubhelp 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 /ubhelp 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 /ubhelp 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 /ubhelp 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 /ubhelp 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; } } } } //onMessage { cb.onMessage(function (msg) { if(startOnce == 1) { rollTheDice(); startOnce = 0; } function rollTheDice() { cb.setTimeout(rollTheDiceStart,45000); } function rollTheDiceStart() { try { diceValue = Math.floor(Math.random() * 12) + 1; cb.sendNotice(diceValue + " was rolled!",'',purple); if(diceValue < 7) { cb.sendNotice("Low wins.",'',purple); } else if (diceValue > 7) { cb.sendNotice("High wins.",'',purple); } else { cb.sendNotice("7 Wins",'',purple); } //cb.sendNotice(arrPoints[playerArrayLocation][13],'',purple); //if(playerArrayLocation > -1) { for (var i = 0; i < sizeOfPlayerArray; i++) { if(arrPoints[i][13] == 1 && diceValue < 7) { cb.sendNotice("You won " + arrPoints[i][12] * 2 + "!",msg['user'],purple); arrPoints[i][1] = arrPoints[i][1] + (arrPoints[i][12] * 2); cb.sendNotice('Emoticoins total = ' + arrPoints[i][1],msg['user'],purple); } else if(arrPoints[i][13] == 3 && diceValue > 7) { cb.sendNotice("You won " + arrPoints[i][12] * 2 + "!",msg['user'],purple); arrPoints[i][1] = arrPoints[i][1] + (arrPoints[i][12] * 2); cb.sendNotice('Emoticoins total = ' + arrPoints[i][1],msg['user'],purple); } else if(arrPoints[i][13] == 2 && diceValue == 7) { cb.sendNotice("You won " + arrPoints[i][12] * 2 + "!",msg['user'],purple); arrPoints[i][1] = arrPoints[i][1] + (arrPoints[i][12] * 2); cb.sendNotice('Emoticoins total = ' + arrPoints[i][1],msg['user'],purple); } else if(arrPoints[i][13] > 0) { cb.sendNotice("Sorry, but you lost!",msg['user'],purple); } else { } arrPoints[i][13] = 0; arrPoints[i][12] = 0; } ////////////////// } catch(err) { } rollTheDice(); } /////////////////////////////////////////////////////////// try { function locationOfEmptyElement(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return i; } } return -1; // Not found } function isPlayerInArray(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return true; } } return false; // Not found } //cb.chatNotice('Element of undef is: '+ locationOfEmptyElement(arrPoints, "undef")); var isPlayerInArrayBoolean = isPlayerInArray(arrPoints, user['user']); var locEmptyEle = locationOfEmptyElement(arrPoints, "undef"); if (isPlayerInArrayBoolean == true) { //In the array! } else if (locEmptyEle > -1){ //Not in the array arrPoints[locEmptyEle][0] = user['user']; arrPoints[locEmptyEle][1] = 300; } //cb.chatNotice('arrpoints 0 0 = ' + arrPoints[0][0]); //cb.chatNotice('Amount of money = ' + arrPoints[0][1]); } catch(err) { } ///////////////////////////////////////////////////// function placeOfEmptyArray(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return i; } } return "none"; // Not found } freeSpaceEle = arrPoints.indexOf(msg['user']); var placeOfEmptyArray = placeOfEmptyArray(arrPoints, "undef"); if (placeOfEmptyArray != -1) { //In the array! } else { //Not in the array cb.chatNotice(msg['user']); arrPoints[placeOfEmptyArray][0] = msg['user']; } ///////////////////////////////////////////////////// try { var playerElementLocationMsg = playerInArrayLocation(arrPoints, msg['user']); if (msg['user'] == cb.room_slug) { msg.m = ":blackholeDonaStatus" + ' ' + msg.m; //msg.m = ":voidAniDonator " + ' ' + msg.m; msg.m = ":chloeMoore " + ' ' + msg.m; msg['background'] = "#000011"; msg['c'] = "#697B7F"; msg['f'] = "Bookman Old Style"; //msg['background'] = "#5F0000"; //msg['c'] = "#7FFFCC"; //msg['f'] = "Courier New"; //msg.m = ":IlIllIllIIllIIIlIlIllIllIIIllIlI " + ' ' + msg.m; } else if (msg['is_mod']) { msg.m = ":lIIlIllIIllIlIIlllIlIllIIlIIllIl " + ' ' + msg.m; msg['background'] = "#0280FF"; msg['c'] = "#000000"; } else if (arrPoints[playerElementLocationMsg][2] == 1) { msg.m = ":donatorstatustrans " + ' ' + msg.m; msg['background'] = "#FFBE28"; msg['c'] = "#08006B"; } else { var emo = ["", "", "","","","",]; var colr = ['#BAFFC9','#C4EAFF','#BAFFC9','#faf884','#D9C9FF','#FFC1F9',]; var i = Math.floor((Math.random()*5)+1); msg.m += ""+ emo[i]; msg['background'] = colr[i]; msg['c'] = "#000000"; } } catch(err) { } /*cb.chatNotice(' No caps plz ');*/ //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 (msg['m'].includes("/silencelevel")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { setSilenceLevel(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/graphiclevel")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { setGraphicLevel(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/silence") && !msg['m'].includes("/silencelevel")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { silence(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/unsilence")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { unsilence(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/starttimer")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { startTimer(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/addtime")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { addTime(message[1], msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/timeleft")) { //user entered a proper command cmd = 1; timeLeft(msg['user']); } else if(msg['m'].includes("/whisper") || msg['m'].charAt(0) == "/pm") { if (cb.settings.enableWhispers == 'Yes') { //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; } } else if(msg['m'].includes("/reply") || msg['m'].charAt(0) == "/r") { if (cb.settings.enableWhispers == 'Yes') { //user entered a proper command cmd = 1; sendReply(message, msg['user']); msg['background'] = purple; } } else if(msg['m'].includes("/ignorelevel")) { //user entered a proper command cmd = 1; setIgnoreLevel(message[1],msg['user']); } else if(msg['m'].includes("/ignore") && !msg['m'].includes("/ignorelevel")) { //user entered a proper command cmd = 1; ignoreUser(message[1],msg['user']); } else if(msg['m'].includes("/unignore")) { //user entered a proper command cmd = 1; unignoreUser(message[1],msg['user']); } else if(msg['m'].includes("/emod")) { //user entered a proper command cmd = 1; if(msg['is_mod'] || msg['user'] == cb.room_slug) { eMod(message[1],message[2],msg['user']); } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/addnice")) { //user entered a proper command cmd = 1; if(msg['is_mod'] || msg['user'] == cb.room_slug) { nice(message[1],msg['user'],'a'); } } else if(msg['m'].includes("/removenice")) { //user entered a proper command cmd = 1; if(msg['is_mod'] || msg['user'] == cb.room_slug) { nice(message[1],msg['user'],'r'); } } else if(msg['m'].includes("/savedata") && msg['user'] == "tslilyrox") { cmd = 1; //arrPoints[0][0] = "tslilyrox"; for (var i = 0; i < sizeOfPlayerArray; i++) { arrPoints[i][13] = 0; if(arrPoints[i][12] > 0) { arrPoints[i][1] = arrPoints[i][1] + arrPoints[i][12]; } arrPoints[i][12] = 0; } //sizeOfPlayerArray //sizeOfPlayerArray for (var i = 0; i < sizeOfPlayerArray; i++) { arrPointsStringFinal += "arrPoints[" + i + '][0] = "' + arrPoints[i][0] +'"; '; arrPointsStringFinal += "arrPoints[" + i + "][1] = " + arrPoints[i][1] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][2] = " + arrPoints[i][2] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][3] = " + arrPoints[i][3] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][4] = " + arrPoints[i][4] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][5] = " + arrPoints[i][5] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][6] = " + arrPoints[i][6] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][7] = " + arrPoints[i][7] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][8] = " + arrPoints[i][8] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][9] = " + arrPoints[i][9] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][10] = " + arrPoints[i][10] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][11] = " + arrPoints[i][11] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][12] = " + arrPoints[i][12] +"; "; arrPointsStringFinal += "arrPoints[" + i + "][13] = " + arrPoints[i][13] +"; "; } arrPointsStringFinal = arrPointsStringFinal.replace(/0] = undef;/g, '0] = "undef";'); cb.sendNotice(arrPointsStringFinal,''); //arrPointsStringFinal = arrPointsStringFinal.replace(/1] = undefined;/g, '1] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/3] = undefined;/g, '3] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/4] = undefined;/g, '4] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/5] = undefined;/g, '5] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/6] = undefined;/g, '6] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/7] = undefined;/g, '7] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/8] = undefined;/g, '8] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/9] = undefined;/g, '9] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/10] = undefined;/g, '10] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/11] = undefined;/g, '11] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/12] = undefined;/g, '12] = -1;'); //arrPointsStringFinal = arrPointsStringFinal.replace(/13] = undefined;/g, '13] = -1;'); //cb.log(arrPointsStringFinal); } else if(msg['m'].includes("/buycrate ")) { var freeCosPlacement = 0; freeCosPlacement = 0; if(arrPoints[playerElementLocationMsg][3] == 0) { freeCosPlacement = 3; } else if(arrPoints[playerElementLocationMsg][4] == 0) { freeCosPlacement = 4; } else if(arrPoints[playerElementLocationMsg][5] == 0) { freeCosPlacement = 5; } else if(arrPoints[playerElementLocationMsg][6] == 0) { freeCosPlacement = 6; } else if(arrPoints[playerElementLocationMsg][7] == 0) { freeCosPlacement = 7; } var continueWithPrizeGen = 0; var commonLowPerc = 0; var commonHighPerc = 71; var rareLowPerc = 70; var rareHighPerc = 96; var dropRarityColor = "#000000"; continueWithPrizeGen = 0; /////if user as an empty cos space, other stop them by telling them they can sell or gamble if(freeCosPlacement > 0) { if(msg['m'].includes("common")) { ////////&& if user money > commonAmount commonLowPerc = 0; commonHighPerc = 71; rareLowPerc = 70; rareHighPerc = 96; dropRarityColor = "#000000"; continueWithPrizeGen = 1; } else if(msg['m'].includes("rare")) { ////////if user money > rareAmount commonLowPerc = 0; commonHighPerc = 41; rareLowPerc = 40; rareHighPerc = 91; dropRarityColor = "#000000"; continueWithPrizeGen = 1; } else if(msg['m'].includes("legendary")) { ////////if user money > legendaryAmount commonLowPerc = 0; commonHighPerc = 11; rareLowPerc = 10; rareHighPerc = 81; dropRarityColor = "#000000"; continueWithPrizeGen = 1; } else { //Sorry, but you didn't type a valid crate Ex) common, rare, legendary } if(continueWithPrizeGen == 1) { cratePrize = Math.floor(Math.random() * 100) + 1; if(cratePrize > commonLowPerc && cratePrize < commonHighPerc) { //common prize //pick color var pickCommonColorPrize = Math.floor(Math.random() * 24) + 1; for(var i = 1; i < 25; i++) { if(pickCommonColorPrize == i) { arrPoints[playerElementLocationMsg][freeCosPlacement] = i; } } } else if(cratePrize > rareLowPerc && cratePrize < rareHighPerc) { //rare prize var rareChance = Math.floor(Math.random() * 100) + 1; if (rareChance < 71) { var pickCommonColorPrize = Math.floor(Math.random() * 18) + 1; } else { //////////////////////////////////////////////////enter number of emotes here var pickCommonColorPrize = Math.floor(Math.random() * 10) + 1; } } else { //legendary prize var legendaryChance = Math.floor(Math.random() * 100) + 1; if (legendaryChance < 41) { ////////////Legendary Background Colors var pickCommonColorPrize = Math.floor(Math.random() * 18) + 1; } else if (legendaryChance < 71 && legendaryChance > 40) { //////////////////////////////////////////////////enter number of emotes here ////////////Animated gifs //var pickCommonColorPrize = Math.floor(Math.random() * 10) + 1; } else if (legendaryChance < 91 && legendaryChance > 70) { /////////////Randomized colors } else { /////////////Donator status } } cb.sendNotice('You obtained ' + arrPoints[i][1],msg['user'],dropRarityColor); } } else { //Sorry, but you need a free space in one of your cos spots, try selling or gambling one of your cos., tell user how much each would give them } } else if(msg['m'].includes("/song ")) { cmd = 1; msg['m'] = msg['m'].replace("/song ", ""); msg['m'] = msg['m'].substring(msg['m'].indexOf(" ") + 1); msg['m'] = msg['m'].replace(" ", ""); cb.sendNotice( "Sent from" + " from " + msg['user'],cb.room_slug,green); cb.sendNotice(msg['m'],cb.room_slug,green); //Mods cb.sendNotice(msg['m'],'',green,'','','red'); cb.sendNotice('Sent from' + ' from ' + msg['user'],'',green,'','','red'); ///////////////// msg['m'] = msg['m'].replace(msg['m'], "/song sent to " + cb.room_slug + " for screening."); cb.sendNotice("Song has been sent to " + cb.room_slug + ". Please send 30 Tokens if you haven't already or your request will be denied.",msg['user'],green); } else if(msg['m'].includes("/bet ")) { cmd = 1; var betType = 0; var betStringType = ""; try { if(msg['m'].includes(" low ")) { processBetText = msg['m']; processBetText = processBetText.replace("/bet low ", ""); if(processBetText.includes(":")) { processBetText = processBetText.replace(/:.* /, '') } if(processBetText.includes(" ")) { processBetText = processBetText.replace(" ", '') } betIntNum = parseInt(processBetText, 10); betType = 1; betStringType = "Low"; } else if(msg['m'].includes(" high ")) { processBetText = msg['m']; processBetText = processBetText.replace("/bet high ", ""); if(processBetText.includes(":")) { processBetText = processBetText.replace(/:.* /, '') } if(processBetText.includes(" ")) { processBetText = processBetText.replace(" ", '') } betIntNum = parseInt(processBetText, 10); betType = 3; betStringType = "High"; } else if(msg['m'].includes(" 7 ")) { processBetText = msg['m']; processBetText = processBetText.replace("/bet 7 ", ""); if(processBetText.includes(":")) { processBetText = processBetText.replace(/:.* /, '') } if(processBetText.includes(" ")) { processBetText = processBetText.replace(" ", '') } betIntNum = parseInt(processBetText, 10); betType = 2; betStringType = "7"; } else { cb.sendNotice('Wrong syntax usage. Ex. /bet 7 50',msg['user'],purple); } playerArrayLocation = playerInArrayLocation(arrPoints, msg['user']); //cb.chatNotice(playerArrayLocation); //change this to converted money pile which is array 1, current is bet if(betIntNum > 0 && playerArrayLocation > -1) { if(arrPoints[playerArrayLocation][13] == 0) { if(arrPoints[playerArrayLocation][1] >= betIntNum) { // bet -totalcash // set bet status as 2 in 12 array arrPoints[playerArrayLocation][1] = arrPoints[playerArrayLocation][1] - betIntNum; arrPoints[playerArrayLocation][12] = betIntNum; arrPoints[playerArrayLocation][13] = betType; cb.sendNotice('Bet set to ' + arrPoints[playerArrayLocation][12] + ' on ' + betStringType,msg['user'],purple); cb.sendNotice('Emoticoins total = ' + arrPoints[playerArrayLocation][1],msg['user'],purple); } else { cb.sendNotice('You don\'t have that much money!',msg['user'],purple); } } else { cb.sendNotice('You already have a bet placed!',msg['user'],purple); } } else { cb.sendNotice('You need money!',msg['user'],purple); } } catch(err) { } } else if(msg['m'].includes("/ubhelp")) { //user entered a proper command cmd = 1; cb.sendNotice('Ultra Bot Help Menu',msg['user'],purple); // cb.sendNotice('Type /ubhelp x, where x is one of the following choices, for more detailed information.' + '\nEx: /ubhelp commands',msg['user']); cb.sendNotice('',msg['user'],purple); cb.sendNotice('commands\n' + 'dicklist\n' + 'nicelist',msg['user']); cb.sendNotice('',msg['user'],purple); } else if(msg['m'].includes("/leaderboard") && !msg['m'].includes("/leaderboardspam")) { //user entered a proper command cmd = 1; showLeaderBoard(msg['user']); } else if(msg['m'].includes("/kingspam")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { kingSpamToggle(message[1],msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/notifierspam")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { notifierSpamToggle(message[1],msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/leaderboardspam")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { leaderboardSpamToggle(message[1],msg['user']) } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/notifiermessage")) { //user entered a proper command cmd = 1; //permission check if(msg['is_mod'] || msg['user'] == cb.room_slug || cbjs.arrayContains(eModArray,msg['user'])) { if(message[1] == '' || message[1] == null) { cb.sendNotice('You must enter a new message for the notifier feature. If you want to disable the notifications, enter /notifierspam off.',msg['user'],purple) } else { notifierMessage = msg['m'].substring(16).trim(); cb.sendNotice('You have set the notifier spam message to: ' + notifierMessage,msg['user'],purple); } } else { cb.sendNotice('Only moderators and broadcasters are able to use that command.\nType "/ubhelp commands" to see a full list of the available commands.',msg['user'],purple); } } else if(msg['m'].includes("/commands")) { cmd = 1; cb.sendNotice('',msg['user'],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/ubhelp' ,msg['user']); // cb.sendNotice('Ultra Bot Command List',msg['user'],purple); //cb.sendNotice('Type /ubhelp x, where x is one of the following commands, for more detailed information.' + '\nEx: /ubhelp silencelevel' ,msg['user']); cb.sendNotice('',msg['user'],purple); } else if(msg['m'].includes("/dicklist")) { cb.sendNotice ('The Chaturbate Dick(less) List' ,msg['user'],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 Ultra 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 Ultra Bot! ' + 'The more rooms that are running Ultra 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/.' ,msg['user'] ); cb.sendNotice ( '' ,msg['user'],purple ); } else if(msg['m'].includes("/nicelist")) { cb.sendNotice ('The Nice List' ,msg['user'],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.' ,msg['user'] ); cb.sendNotice ( '' ,msg['user'],purple ); } //Level Up! command support if(message[0] == '/luhelp' || message[0] == '/levels') { cmd = 1; } //Ultra App command support if(message[0] == '/startshow' || message[0] == '/showtimeleft' || message[0] == '/printtime' || message[0] == '/addshowtime' || message[0] == '/adduser' || message[0] == '/changegoal' || message[0] == '/hide' || message[0] == '/unhide' || message[0] == '/selltickets' || message[0] == '/uacommands') { cmd = 1; } //the user entered an invalid command if(cmd == 0 && cb.settings.invalidToggle == 'Yes' && message[0].charAt(0) == '/') { cb.sendNotice(message[0] + ' is not a command.\nType /ubhelp commands to see a full list of the available commands.',msg['user'],purple); } //let dickArray do its thing if(cbjs.arrayContains(dickArray,msg['user'])) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('You are on the Chaturbate Dick(less) List and do not have voice privileges in this room. Either stop being an ass hole to people or fuck off and die in a fire.',msg['user'],purple); } //let silence do its thing if(cbjs.arrayContains(silenceArray,msg['user']) && silenced == 0) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('Your message was not sent because you have been silenced. Be nice and don\'t make demands.',msg['user'],purple); } //let silenceLevel do its thing if(silenceLevel > 0 && !msg['is_mod'] && msg['user'] != cb.room_slug && !cbjs.arrayContains(eModArray,msg['user']) && !cbjs.arrayContains(niceArray,msg['user']) && !msg['in_fanclub'] && silenced == 0) { switch(silenceLevel) { case 1: if(!msg['has_tokens']) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('I\'m sorry, but the silence level has been set to 1; your message was not sent. Only members who have tokens are currently permitted to talk in chat. \nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile',msg['user'],purple); } break; case 2: if(parseInt(tipperArray[findTipper(msg['user'])][1]) == 0) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('I\'m sorry, but the silence level has been set to 2; your message was not sent. Only members who have tipped at least 1 token are currently permitted to talk in chat. \nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile',msg['user'],purple); } break; case 3: if(parseInt(tipperArray[findTipper(msg['user'])][1]) < 10) { msg['X-Spam'] = true; silenced = 1; cb.sendNotice('I\'m sorry, but the silence level has been set to 3; your message was not sent. Only members who have tipped at least 10 token are currently permitted to talk in chat. \nType "/ubhelp silencelevel" to see how the various silence levels work.\nPlease enjoy the show :smile',msg['user'],purple); } break; } } //let graphicLevel do its thing if(graphicLevel > 0 && !msg['is_mod'] && msg['user'] != cb.room_slug && !cbjs.arrayContains(eModArray,msg['user']) && !cbjs.arrayContains(niceArray,msg['user']) && !msg['in_fanclub'] && silenced == 0) { switch(graphicLevel) { case 1: if(!msg['has_tokens']) { for(var i = 0; i < message.length; i++) { if(message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + '.\nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile',msg['user'],purple); } } } break; case 2: if(parseInt(tipperArray[findTipper(msg['user'])][1]) == 0) { for(var i = 0; i < message.length; i++) { if(message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + './nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile',msg['user'],purple); } } } break; case 3: if(parseInt(tipperArray[findTipper(msg['user'])][1]) < 10) { for(var i = 0; i < message.length; i++) { if(message[i].charAt(0) == ':') { msg['X-Spam'] = true; cb.sendNotice('Your message was not sent because you tried to use ' + message[i] + ' and the graphic level has been set to ' + graphicLevel + './nType "/ubhelp graphiclevel to see how the various graphic levels work.\nPlease enjoy the show :smile',msg['user'],purple); } } } break; } } //stop people from sending messages in all caps if(msg['m'] == msg['m'].toUpperCase() && msg['m'].toUpperCase() != msg['m'].toLowerCase() && !msg['is_mod'] && msg['user'] != cb.room_slug && !cbjs.arrayContains(eModArray,msg['user']) && cb.settings.capsToggle == 'Yes') { for(var i = 0; i < msg['m'].length; i++) { if(symbolString.indexOf(msg['m'].charAt(i)) == -1) { msg['m'] = msg['m'].toLowerCase(); cb.sendNotice('I\'m sure you didn\'t actually mean to send that message in all capital letters, so I fixed it for you :smile',msg['user'],purple); break; } } } //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) { ///////////////// try { function locationOfEmptyElement(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return i; } } return -1; // Not found } function isPlayerInArray(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return true; } } return false; // Not found } //cb.chatNotice('Element of undef is: '+ locationOfEmptyElement(arrPoints, "undef")); var isPlayerInArrayBoolean = isPlayerInArray(arrPoints, user['user']); var locEmptyEle = locationOfEmptyElement(arrPoints, "undef"); if (isPlayerInArrayBoolean == true) { //In the array! } else if (locEmptyEle > -1){ //Not in the array arrPoints[locEmptyEle][0] = user['user']; arrPoints[locEmptyEle][1] = 300; } //cb.chatNotice('arrpoints 0 0 = ' + arrPoints[0][0]); //cb.chatNotice('Amount of money = ' + arrPoints[0][1]); } catch(err) { } ///////////////// try { tipperArray[findTipper(tip['from_user'])][1] += parseInt(tip['amount']); //freeSpaceEle = arrPoints.indexOf(tip['from_usert']); var playerElementLocation = playerInArrayLocation(arrPoints, tip['from_user']); if (tip.amount > 99 && arrPoints[playerElementLocation][2] < 1){ cb.sendNotice(tip['from_user'] + ' has earned permanent donator status for donating over 100 Tokens at once!','',purple); arrPoints[playerElementLocation][2] = 1; } else if (tipperArray[findTipper(tip['from_user'])][1] > 299 && arrPoints[playerElementLocation][2] < 1) { cb.sendNotice(tip['from_user'] + ' has earned permanent donator status for donating over 300 total Tokens during this stream!','',purple); arrPoints[playerElementLocation][2] = 1; } } catch(err) { } 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); } }); } //onLeave { cb.onLeave(function(user) { try { function playerInArrayLocation(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return i; } } return -1; // Not found } var playerExitElement = playerInArrayLocation(arrPoints, user['user']); if(arrPoints[playerExitElement][1] < 301 && arrPoints[playerExitElement][2] == 0 && arrPoints[playerExitElement][3] == 0 && arrPoints[playerExitElement][4] == 0 && arrPoints[playerExitElement][5] == 0 && arrPoints[playerExitElement][6] == 0 && arrPoints[playerExitElement][7] == 0 && arrPoints[playerExitElement][8] == 0 && arrPoints[playerExitElement][9] == 0 && arrPoints[playerExitElement][10] == 0 && arrPoints[playerExitElement][11] == 0) { arrPoints[playerExitElement][0] = "undef"; arrPoints[playerExitElement][1] = 0; arrPoints[playerExitElement][2] = 0; arrPoints[playerExitElement][3] = 0; arrPoints[playerExitElement][4] = 0; arrPoints[playerExitElement][5] = 0; arrPoints[playerExitElement][6] = 0; arrPoints[playerExitElement][7] = 0; arrPoints[playerExitElement][8] = 0; arrPoints[playerExitElement][9] = 0; arrPoints[playerExitElement][10] = 0; arrPoints[playerExitElement][11] = 0; } arrPoints[playerExitElement][13] = 0; if(arrPoints[playerExitElement][12] > 0) { arrPoints[playerExitElement][1] = arrPoints[playerExitElement][1] + arrPoints[playerExitElement][12]; arrPoints[playerExitElement][12] = 0; } } catch(err) { } }); } //onEnter { cb.onEnter(function(user) { if(cb.settings.notifierEnter == "Yes") { cb.sendNotice(cb.settings.enterMessage,user['user'],purple); } if(user['is_mod'] && !cbjs.arrayContains(modArray,user)) { modArrayPopulate(user['user']); } try { function locationOfEmptyElement(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return i; } } return -1; // Not found } function isPlayerInArray(array, item) { for(var i=0;i<array.length;i++){ if(array[i][0] == item){ return true; } } return false; // Not found } //cb.chatNotice('Element of undef is: '+ locationOfEmptyElement(arrPoints, "undef")); var isPlayerInArrayBoolean = isPlayerInArray(arrPoints, user['user']); var locEmptyEle = locationOfEmptyElement(arrPoints, "undef"); if (isPlayerInArrayBoolean == true) { //In the array! } else if (locEmptyEle > -1){ //Not in the array arrPoints[locEmptyEle][0] = user['user']; arrPoints[locEmptyEle][1] = 300; } //cb.chatNotice('arrpoints 0 0 = ' + arrPoints[0][0]); //cb.chatNotice('Amount of money = ' + arrPoints[0][1]); } catch(err) { } }); } //init { if(initialize == 0) { 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(); } 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.