Bots Home
|
Create an App
SophiasClassroom
Author:
erik91383
Description
Source Code
Launch Bot
Current Users
Created by:
Erik91383
/* Copyright erik913, April 2017 Designed for Sophia and use in her chatroom. This file is part of ${PROJECT_NAME}. ${PROJECT_NAME} is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ${PROJECT_NAME} is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ${PROJECT_NAME}. If not, see <http://www.gnu.org/licenses/>. */ var group1 = [], group2 = [], group3 = [], group4 = [], group5 = [], group6 = []; var corner = [], jail = [], detention = []; var roomUsers = []; var space = '\u2007'; var color = "", detentionStr = "", modelColor = ""; var grossTip = 0, currentLevel = 0, groupLevel = 0; var theCorner = false, theJail = false, outCorner = false, outJail = false, detentionChat = false, addNew = false; var bcp = { aqua: "#00FFFF", black: "#000000", blue: "#0000FF", fuchsia: "#FF00FF", gray: "#808080", grey: "#808080", green: "#008000", lime: "#00FF00", maroon: "#800000", navy: "#000080", olive: "#808000", orange: "#FFA500", purple: "#800080", red: "#FF0000", silver: "#C0C0C0", teal: "#008080", white: "#FFFFFF", yellow: "#FFFF00" }; cb.settings_choices = [ {name: 'announceEntry', type: 'choice', label: 'Annouce Entry of Group Members?', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'yourName', type: 'str', minLength: 1, maxLength: 50, label: 'Your Name', defaultValue: 'Miss Sophia'}, {name: 'modelTitle', type: 'str', minLength: 1, maxLength: 50, required: false, label: 'Title for yourself?(Leave Blank if not Wanted)'}, {name: 'modelText', type: 'choice', choice1: 'Black', choice2: 'Blue', choice3: 'Fuchsia', choice4: 'Gray', choice5: 'Green', choice6: 'Maroon', choice7: 'Navy', choice8: 'Olive', choice9: 'Orange', choice10: 'Purple', choice11: 'Red', choice12: 'Teal', label: 'Color for your text in chat?'}, {name: 'groupA', type: 'str', minLength: 1, maxLength: 255, label: 'Group 1', defaultValue: 'Best Student Ever'}, {name: 'tipA', type: 'int', minValue: 1, maxValue: 100000, label: 'Group 1 tip Amount', defaultValue: 12222}, {name: 'groupAA', type: 'str', minLength: 1, maxLenth: 10240, required: false, label: "Users in Group 1 (Seperate users with a ','. If none, leave blank.)", defaultValue: ''}, {name: 'groupAGIF', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'GIF for Group 1', defaultValue: ':soppbestever'}, {name: 'groupB', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'Group 2', defaultValue: 'Student of the Year'}, {name: 'tipB', type: 'int', required: false, minValue: 1, maxValue: 100000, label: 'Group 2 tip Amount (Leave blank if none)', defaultValue: 4444}, {name: 'groupBA', type: 'str', minLength: 1, maxLenth: 10240, required: false, label: "Users in Group 2 (Seperate users with a ','. If none, leave blank.)", defaultValue: ''}, {name: 'groupBGIF', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'GIF for Group 2', defaultValue: ':soppbestyear'}, {name: 'groupC', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'Group 3', defaultValue: 'Student of the Semester'}, {name: 'tipC', type: 'int', required: false, minValue: 1, maxValue: 100000, label: 'Group 3 tip Amount (Leave blank if none)', defaultValue: 2222}, {name: 'groupCA', type: 'str', minLength: 1, maxLenth: 10240, required: false, label: "Users in Group 3 (Seperate users with a ','. If none, leave blank.)", defaultValue: ''}, {name: 'groupCGIF', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'GIF for Group 3', defaultValue: ':soppbestsemester'}, {name: 'groupD', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'Group 4', defaultValue: "Teacher's Pet"}, {name: 'tipD', type: 'int', required: false, minValue: 1, maxValue: 100000, label: 'Group 4 tip Amount (Leave blank if none)', defaultValue: 1222}, {name: 'groupDA', type: 'str', minLength: 1, maxLenth: 10240, required: false, label: "Users in Group 4 (Seperate users with a ','. If none, leave blank.)", defaultValue: ''}, {name: 'groupDGIF', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'GIF for Group 4', defaultValue: ':soppteacherspet'}, {name: 'groupE', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'Group 5', defaultValue: 'Class Clown'}, {name: 'tipE', type: 'int', required: false, minValue: 1, maxValue: 100000, label: 'Group 5 tip Amount (Leave blank if none)', defaultValue: 888}, {name: 'groupEA', type: 'str', minLength: 1, maxLenth: 10240, required: false, label: "Users in Group 5 (Seperate users with a ','. If none, leave blank.)", defaultValue: ''}, {name: 'groupEGIF', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'GIF for Group 5', defaultValue: ':soppclassclown'}, {name: 'groupF', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'Group 6', defaultValue: 'Trouble Maker'}, {name: 'tipF', type: 'int', required: false, minValue: 1, maxValue: 100000, label: 'Group 6 tip Amount (Leave blank if none)', defaultValue: 777}, {name: 'groupFA', type: 'str', minLength: 1, maxLenth: 10240, required: false, label: "Users in Group 6 (Seperate users with a ','. If none, leave blank.)", defaultValue: ''}, {name: 'groupFGIF', type: 'str', required: false, minLength: 1, maxLength: 255, label: 'GIF for Group 6', defaultValue: ':sopptroublemaker'}, {name: 'timeout', type: 'choice', label: 'Have a timeout timer?', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'timeoutTimer', type: 'int', required: false, minValue: 1, maxValue: 60, label: 'Amount of time spent in trouble?(Minutes)', defaultValue: 2}, {name: 'detentionTimer', type: 'int', required: false, minValue: 1, maxValue: 60, label: 'Frequency to show detention list? (Minutes)', defaultValue: 8}, {name: 'cornerGIFB', type: 'str', required: false, minLength: 2, maxLength: 255, label: 'GIF for Corner (Guys)?', defaultValue: ':corner232'}, {name: 'cornerGIFG', type: 'str', required: false, minLength: 2, maxLength: 255, label: 'GIF for Corner (Girls)?', defaultValue: ':corner005'}, {name: 'cornerGIFO', type: 'str', required: false, minLength: 2, maxLength: 255, label: 'GIF for Corner (Others)?', defaultValue: ':corner002'}, {name: 'jailGIF', type: 'str', required: false, minLength: 2, maxLength: 255, label: 'GIF for Jail?', defaultValue: ':jail'}, ]; cb.onTip(function(tip){ grossTip = parseInt(tip['amount']) var userName = (tip['from_user']) addNew = true var group = checkGroup(userName) if(grossTip == cb.settings.tipA){ if(currentLevel > 0){ currentUser(userName,group) } if (addNew == true){ addUser(userName, cb.settings.groupA) } } else if(grossTip == cb.settings.tipB){ if(currentLevel > 0){ currentUser(userName,group) } if (addNew == true){ addUser(userName, cb.settings.groupB) } } else if(grossTip == cb.settings.tipC){ if(currentLevel > 0){ currentUser(userName,group) } if (addNew == true){ addUser(userName, cb.settings.groupC) } } else if(grossTip == cb.settings.tipD){ if(currentLevel > 0){ currentUser(userName,group) } if (addNew == true){ addUser(userName, cb.settings.groupD) } } else if(grossTip == cb.settings.tipE){ if(currentLevel > 0){ currentUser(userName,group) } if (addNew == true){ addUser(userName, cb.settings.groupE) } } else if(grossTip == cb.settings.tipF){ if(currentLevel > 0){ currentUser(userName,group) } if (addNew == true){ addUser(userName, cb.settings.groupF) } } }); cb.onMessage(function(msg){ var userName = msg['user'] var group = checkGroup(userName) var trouble = checkTrouble(userName) var gender = checkSex(msg['gender']) if((msg['m'].substring(0,1)!='/')){ if(trouble == 'Corner'){ msg['c'] = color if(gender == 'm'){ msg['m'] = cb.settings.cornerGIFB + " " + msg['m'] } else if(gender == 'f'){ msg['m'] = cb.settings.cornerGIFG + " " + msg['m'] } else if(gender == 's' || 'c' || 'o'){ msg['m'] = cb.settings.cornerGIFO + " " + msg['m'] } return msg } else if(trouble == 'Jail'){ msg['c'] = color msg['m'] = cb.settings.jailGIF + " " + msg['m'] return msg } else if(trouble == "" && (group)){ msg['c'] = color msg['m'] = "|" + group + "| " + msg['m'] return msg } } if((msg['m'].substring(0,1)!='/') && (msg['user']==cb.room_slug)){ getColor() msg['c'] = modelColor if (cb.settings.modelTitle != ""){ msg['m'] = "|" + cb.settings.modelTitle + "| " + msg['m'] } return msg } if((msg['m'].substring(0,1)=='/')&&((msg['is_mod'])||(msg['user']==cb.room_slug))){ if(msg['m'].substring(0,6)=='/addc '){ msg['X-Spam']=true; var words = msg['m'].split(" "); if (words[1].length == 0){ cb.chatNotice("There must be a username in order to add to this group.",msg['user'],'',bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) == -1){ cb.chatNotice("This is not a valid username.",msg['user'],"",bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) >- 1){ if (words[1] == cb.room_slug){ cb.chatNotice(msg['user'] + ", You can't put " + cb.settings.yourName + " in the corner. Shame on you!\n :sopp10","","",bcp.red,"bold") } else if(words[1] == msg['user']){ cb.chatNotice("You're crazy for trying to put yourself in the corner, " + msg['user'],"","",bcp.red,"bold") } else{ theCorner = true inCorner(words[1],msg['user']) if(cb.settings.timeout == 'Yes'){ cb.setTimeout(function(){inTrouble(words[1]);},(cb.settings.timeoutTimer*60000)) } } } return msg } } if((msg['m'].substring(0,1)=='/')&&((msg['is_mod'])||(msg['user']==cb.room_slug)) && cb.settings.timeout == 'No'){ if(msg['m'].substring(0,9)=='/removec '){ msg['X-Spam']=true; var words = msg['m'].split(" "); if (words[1].length == 0){ cb.chatNotice("There must be a username in order to remove someone from this group.",msg['user'],'',bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) == -1){ cb.chatNotice("This is not a valid username.",msg['user'],"",bcp.red,"bold") } else if(words[1] == msg['user']){ cb.chatNotice("You can't remove yourself from the corner, " + msg['user'] + "!","","",bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) >- 1){ outCorner = true removeCorner(words[1],msg['user']) } return msg } } if((msg['m'].substring(0,1)=='/')&&((msg['is_mod'])||(msg['user']==cb.room_slug))){ if(msg['m'].substring(0,6)=='/addj '){ msg['X-Spam']=true; var words = msg['m'].split(" "); if (words[1].length == 0){ cb.chatNotice("There must be a username in order to add to this group.",msg['user'],'',bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) == -1){ cb.chatNotice("This is not a valid username.",msg['user'],"",bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) >- 1){ if (words[1] == cb.room_slug){ cb.chatNotice(msg['user'] + ", You can't put " + cb.settings.yourName + " in jail. Shame on you!\n :sopp10","","",bcp.red,"bold") } else if(words[1] == msg['user']){ cb.chatNotice("You're crazy for trying to put yourself in jail, " + msg['user'],"","",bcp.red,"bold") } else{ theJail = true inCorner(words[1],msg['user']) if(cb.settings.timeout == 'Yes'){ cb.setTimeout(function(){inTrouble(words[1]);},(cb.settings.timeoutTimer*60000)) } } } return msg } } if((msg['m'].substring(0,1)=='/')&&((msg['is_mod'])||(msg['user']==cb.room_slug)) && cb.settings.timeout == 'No'){ if(msg['m'].substring(0,9)=='/removej '){ msg['X-Spam']=true; var words = msg['m'].split(" "); if (words[1].length == 0){ cb.chatNotice("There must be a username in order to remove someone from this group.",msg['user'],'',bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) == -1){ cb.chatNotice("This is not a valid username.",msg['user'],"",bcp.red,"bold") } else if(words[1] == msg['user']){ cb.chatNotice("You can't remove yourself from jail, " + msg['user'] + "!","","",bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) >- 1){ outJail = true removeCorner(words[1],msg['user']) } return msg } } if((msg['m'].substring(0,1)=='/')&&((msg['is_mod'])||(msg['user']==cb.room_slug))){ if(msg['m'].substring(0,6)=='/addd '){ msg['X-Spam']=true; var words = msg['m'].split(" "); if (words[1].length == 0){ cb.chatNotice("There must be a username in order to add to this group.",msg['user'],'',bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) == -1){ cb.chatNotice("This is not a valid username.",msg['user'],"",bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) >- 1){ if (words[1] == cb.room_slug){ cb.chatNotice(msg['user'] + ", You can't put " + cb.settings.yourName + " in detention. Shame on you!\n :sopp10","","",bcp.red,"bold") } else if(words[1] == msg['user']){ cb.chatNotice("You're crazy for trying to put yourself in detention, " + msg['user'],"","",bcp.red,"bold") } else{ var dStr = buildStr(words[1]) detention.push(dStr) buildDetention() cb.chatNotice(words[1] + " must stay after class with the principal to be punished!","","",bcp.black,"bold") } } return msg } } if((msg['m'].substring(0,1)=='/')&&((msg['is_mod'])||(msg['user']==cb.room_slug))){ if(msg['m'].substring(0,9)=='/removed '){ msg['X-Spam']=true; var words = msg['m'].split(" "); if (words[1].length == 0){ cb.chatNotice("There must be a username in order to remove someone from this group.",msg['user'],'',bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) == -1){ cb.chatNotice("This is not a valid username.",msg['user'],"",bcp.red,"bold") } else if(words[1] == msg['user']){ cb.chatNotice("You can't remove yourself from detention, " + msg['user'] + "!","","",bcp.red,"bold") } else if(words[1].length >0 && roomUsers.indexOf(words[1]) >- 1){ var dStr = buildStr(words[1]) detention.splice(detention.indexOf(dStr),1) if(detention.length == 0){ detentionChat = false } buildDetention() cb.chatNotice(words[1] + " has behaved and does not need to stay after class.","","",bcp.black,"bold") } return msg } } if((msg['m'].substring(0,1)=='/')&&((msg['is_mod'])||(msg['user']==cb.room_slug))){ if(msg['m'].substring(0,11)=='/showgroups'){ msg['X-Spam']=true; cb.chatNotice(cb.settings.groupA +": " + group1.join(", ")+"\n"+ cb.settings.groupB +": " + group2.join(", ")+"\n"+ cb.settings.groupC +": " + group3.join(", ")+"\n"+ cb.settings.groupD +": " + group4.join(", ")+"\n"+ cb.settings.groupE +": " + group5.join(", ")+"\n"+ cb.settings.groupF +": " + group6.join(", "),msg['user'],"",bcp.black,'bold') } } if((msg['m'].substring(0,1)=='/')&&((msg['is_mod'])||(msg['user']==cb.room_slug))){ if(msg['m'].substring(0,6)=='/tools'){ msg['X-Spam']=true; cb.chatNotice("Type /addc x where 'x' is the username to send a user to the corner.\n"+ "Type /removec x to remove a user from the corner.\n"+ "Type /addj x where 'x' is the username to send a user to jail.\n"+ "Type /removej x to remove a user from jail.\n"+ "Type /addd x where 'x' is the username to add a user to the detention list.\n"+ "Type /removed x to remove a user from the detention list.\n"+ "Type /showgroups to see all users in each group.\n",msg['user'],"",bcp.black,'bold') } } }); cb.onEnter(function(user){ var userName = user['user'] var group = checkGroup(userName); if ((typeof(cb.settings.announceEntry)!='undefined')&&(cb.settings.announceEntry=='Yes')&&(checkGroup(userName))){ cb.chatNotice(group + ", " + userName + ", has joined the room!","","",color,"bold") } if (user['has_tokens']){ roomUsers.push(user['user']) } if (user['is_mod'] || user['user'] == cb.room_slug){ cb.chatNotice("Type /tools for commands.",userName,"",bcp.red,"bold") } }); cb.onLeave(function(user){ if (roomUsers.indexOf(user['user']) >- 1){ roomUsers.splice(roomUsers.indexOf(user['user']),1) } }); function getGroups(){ buildGroups(cb.settings.groupAA,group1) buildGroups(cb.settings.groupBA,group2) buildGroups(cb.settings.groupCA,group3) buildGroups(cb.settings.groupDA,group4) buildGroups(cb.settings.groupEA,group5) buildGroups(cb.settings.groupFA,group6) }; function buildGroups(array,group){ if((typeof(array)!='undefined')&&(array.length>1)){ var str = array.toLowerCase(); var temp = str.split(/,/); for(var i=0;i<temp.length;i++){ group.push(temp[i]); } } }; function buildStr(str){ var l = str.length for(var i = 0; i<= (33-l); i++){ str = str + space } str = str + "|" return str }; function buildDetention (){ var str = detention.toString() str = str.replace(/,/g, "\n|") detentionStr = str if(detention.length == 1 && detentionChat == false){ cb.setTimeout(showDetention,(cb.settings.detentionTimer*60000)) detentionChat = true } } function showDetention(){ if (detention.length >=1){ cb.chatNotice("-------------------------------------------------------\n"+ "| Detention List for after class Punishment: |\n"+ "|" + detentionStr + "\n" + "-------------------------------------------------------","","",bcp.black,'bold') cb.setTimeout(showDetention,(cb.settings.detentionTimer*60000)) } }; function getColor(){ var color = cb.settings.modelText.toLowerCase() if (color == 'black') modelColor = bcp.black if (color == 'blue') modelColor = bcp.blue if (color == 'fuchsia') modelColor = bcp.fuchsia if (color == 'gray') modelColor = bcp.gray if (color == 'green') modelColor = bcp.green if (color == 'maroon') modelColor = bcp.maroon if (color == 'navy') modelColor = bcp.navy if (color == 'olive') modelColor = bcp.olive if (color == 'orange') modelColor = bcp.orange if (color == 'purple') modelColor = bcp.purple if (color == 'red') modelColor = bcp.red if (color == 'teal') modelColor = bcp.teal } function checkSex (sex){ switch (sex) { case 'm': return 'm'; break; case 'f': return 'f'; break; case 's': return 's'; break; case 'c': return 'c'; break; default: return 'u'; break; } }; function checkGroup(userName){ if(group1.indexOf(userName)>-1){ currentLevel = 1 color = bcp.green return cb.settings.groupA } else if(group2.indexOf(userName)>-1){ currentLevel = 2 color = bcp.purple return cb.settings.groupB } else if(group3.indexOf(userName)>-1){ currentLevel = 3 color = bcp.blue return cb.settings.groupC } else if(group4.indexOf(userName)>-1){ currentLevel = 4 color = bcp.fuchsia return cb.settings.groupD } else if(group5.indexOf(userName)>-1){ currentLevel = 5 color = bcp.orange return cb.settings.groupE } else if(group6.indexOf(userName)>-1){ currentLevel = 6 color = bcp.red return cb.settings.groupF } else groupLevel = 0 currentLevel = 0 return "" }; function currentUser(user, group){ if(grossTip == cb.settings.tipA){ groupLevel = 1 } else if(grossTip == cb.settings.tipB){ groupLevel = 2 } else if(grossTip == cb.settings.tipC){ groupLevel = 3 } else if(grossTip == cb.settings.tipD){ groupLevel = 4 } else if(grossTip == cb.settings.tipE){ groupLevel = 5 } else if(grossTip == cb.settings.tipF){ groupLevel = 6 } if(groupLevel == currentLevel){ cb.chatNotice(user + ", you're already a member of this group!\n Are you just trying to impress me?","","",color,'bold') addNew = false } else if(groupLevel > currentLevel){ cb.chatNotice(user + " is no longer a " + group + " and is a dissapointment to " + cb.settings.yourName,"","",color,'bold') removeUser(group,user) } else if(groupLevel < currentLevel){ cb.chatNotice(user + " is no longer a " + group + " and is trying to impress " + cb.settings.yourName,"","",color,'bold') removeUser(group,user) } }; function removeCorner(user,msg){ var check = checkTrouble(user) if(check == 'Jail'){ if (outCorner == true){ cb.chatNotice(user + " is in jail not the corner.",msg,"",bcp.black,"bold") outCorner = false } else if (outJail == true){ jail.splice(jail.indexOf(user),1) cb.chatNotice(user + " is no longer in Jail. Behave from now on!","","",bcp.black,"bold") outJail = false } } else if(check == 'Corner'){ if (outJail == true){ cb.chatNotice(user + " is in the corner not jail.",msg,"",bcp.black,"bold") outJail = false } else if(outCorner == true){ corner.splice(corner.indexOf(user),1) cb.chatNotice(user + " is no long in the Corner. Behave from now on!","","",bcp.black,"bold") outCorner = false } } else if(check == "") if (outCorner == true){ cb.chatNotice(user + " is not in the corner.",msg,"",bcp.black,"bold") outCorner = false } else if (outJail == true){ cb.chatNotice(user + " is not in jail.",msg,"",bcp.black,"bold") outJail = false } }; function inCorner(user,msg){ var check = checkTrouble(user) if(check == 'Corner'){ if (theCorner == true){ cb.chatNotice(user + " is already in the corner!",msg,"",bcp.black,"bold") theCorner = false } else if (theJail == true){ cb.chatNotice(user + " has been moved from the corner to jail!","","",bcp.black,"bold") corner.splice(corner.indexOf(user),1) jail.push(user) theJail = false } } else if(check == 'Jail'){ if (theCorner == true){ cb.chatNotice(user + " has been moved from jail to the corner!","","",bcp.black,"bold") jail.splice(jail.indexOf(user),1) corner.push(user) theCorner = false } else if (theJail == true){ cb.chatNotice(user + " is already in jail!",msg,"",bcp.black,"bold") theJail = false } } else if(check == "") if (theCorner == true){ cb.chatNotice(user + " has been put in the corner!","","",bcp.black,"bold") corner.push(user) theCorner = false } else if (theJail == true){ jail.push(user) cb.chatNotice(user + " has been put in jail!","","",bcp.black,"bold") theJail = false } }; function checkTrouble(userName){ if(corner.indexOf(userName)>-1){ return 'Corner' } else if(jail.indexOf(userName)>-1){ return 'Jail' } else return "" }; function inTrouble(user){ var check = checkTrouble(user) if(check == 'Corner'){ corner.splice(corner.indexOf(user),1) cb.chatNotice(user + " is no longer in the corner. Behave from now on!","","",bcp.black,"bold") } else if(check == 'Jail'){ jail.splice(jail.indexOf(user),1) cb.chatNotice(user + " is no longer in jail. Behave from now on!","","",bcp.black,"bold") } }; function removeUser(group, user){ if (group == cb.settings.groupA){ group1.splice(group1.indexOf(user),1) } else if (group == cb.settings.groupB){ group2.splice(group2.indexOf(user),1) } else if (group == cb.settings.groupC){ group3.splice(group3.indexOf(user),1) } else if (group == cb.settings.groupD){ group4.splice(group4.indexOf(user),1) } else if (group == cb.settings.groupE){ group5.splice(group5.indexOf(user),1) } else if (group == cb.settings.groupF){ group6.splice(group6.indexOf(user),1) } }; function addUser(user, group){ if(group == cb.settings.groupA){ group1.push(user) color = bcp.green var gif = cb.settings.groupAGIF } if(group == cb.settings.groupB){ group2.push(user) color = bcp.purple var gif = cb.settings.groupBGIF } if(group == cb.settings.groupC){ group3.push(user) color = bcp.blue var gif = cb.settings.groupCGIF } if(group == cb.settings.groupD){ group4.push(user) color = bcp.fuchsia var gif = cb.settings.groupDGIF } if(group == cb.settings.groupE){ group5.push(user) color = bcp.orange var gif = cb.settings.groupEGIF } if(group == cb.settings.groupF){ group6.push(user) color = bcp.red var gif = cb.settings.groupFGIF } cb.chatNotice("There is a new " + group + " in the class. Welcome, " + user + "!\n" + gif,"","",color,"bold") }; function init(){ getGroups() roomUsers.push(cb.room_slug) }; init()
© Copyright Chaturbate 2011- 2024. All Rights Reserved.