({ serverStartUp : function() { starttime = new Date(); scriptChecks = 0; this.init(); } , initVal : function(key,val) { // Astruvis' Edits - Required edit to variable structure if (typeof server[key] == 'undefined') { server[key] = val; } return; } // End edits , init : function() { semiaway = [ ]; toJSON = function(obj) { /* Function that changes an object or other value into a string. */ if (typeof indent == 'undefined') { indent = 0; } switch (typeof obj) { case 'object': if (obj) { indent++; var list = []; if (obj instanceof Array) { for (var i in obj) { list.push(toJSON(obj[i])); } var r = '['; var l = 0; for (var i in list) { if (i != 0) { r += ' , '; } if (l > 96) { r += '\n' + tab.copy(indent); l = 0; } r += list[i]; l += list[i].length; } indent--; return r + ']'; } else if ( !isNaN (+obj) ) { indent--; return +obj; } else { for (var prop in obj) { if (prop == 'global2') { continue; } list.push(tab.copy(indent) +'"' + prop.replace(/\0/g, '\\0').replace(/(["'])/g, '\\$1').replace(/\r/g, '\\r').replace(/\n/g, '\\n').replace(/\t/g, '\\t') + '" : ' + toJSON(obj[prop])); } indent--; return '{\n' + list.join(' ,\n') + '\n' +tab.copy(indent)+'}'; } } else { return 'null'; } case 'string': return '"' + obj.replace(/(["'])/g, '\\$1').replace(/\r/g, '\\r').replace(/\n/g, '\\n').replace(/\t/g, '\\t') + '"'; case 'function': return (new String(obj)).replace(/\t/g,tab); case 'number': case 'boolean': return new String(obj); } return; } Object.defineProperty(Object.prototype, 'copy',{ value : function (num) { var s = ''; while (num > 0) { s += this; num--; } return s; }, configurable: true, writable : true }); Object.defineProperty(Object.prototype, 'toJSON',{ value : function() { return toJSON(this); }, configurable: true, writable : true }); if (typeof mail == 'undefined' ) { mail = {}; var t = sys.getVal('mail'); if ( t != '' ) { mail = eval('('+t+')'); } } Mail = function (src, text) { this.text = text; this.sender = src; this.time = +new Date; this.read = false; } lastMemUpdate = 0; key = function(a,b) { return a + "*" + sys.name(b); } semiUbers = []; var tempU = new Array(150,249,250,382,383,384,483,484,487,505); for (x in tempU) { semiUbers[tempU[x]] = true; } saveKey = function(thing, id, val) { sys.saveVal(key(thing,id), val); } getKey = function(thing, id) { return sys.getVal(key(thing,id)); } hasBan = function(id, poke) { return clauses[id].indexOf("*" + poke + "*") != -1; } if (typeof(permChannels) == 'undefined') { permChannels = []; } cmp = function(a, b) { return a.toLowerCase() == b.toLowerCase(); } if (typeof(channelTopics) == 'undefined') channelTopics = []; if (typeof(varsCreated) != 'undefined') return; battlesStopped = false; channelUsers = []; channelTopics = []; sys.setPA("forceSameTier"); sys.setPA("megaUser"); megausers = sys.getVal("megausers"); siggamute = (sys.getVal("SiggaMute") == "1"); siggaban = (sys.getVal("SiggaBan") == "1"); muteall = false; sys.setPA ("impersonation"); sys.setPA ("muted"); sys.setPA("timeCount"); sys.setPA("floodCount"); maxPlayersOnline = 0; lineCount = 0; tourmode = 0; border = "---------------------------------------------------------------------:"; rules = [ "", "*** Rules ***", "", "Rule 1: Please be respectful of all users, mods, admins and owners.", "Rule 2: Do not ask for auth. Asking for auth will result into a warning or an automatic kick.", "Rule 3: Do not abuse caps or swearing. Either the Authy, or the CAPS bot will get you. You have been warned.", "Rule 4: No advertising what so ever. You have been warned. If you advertise, that will result in an automatic kick.", "Rule 5: Do not post sexual content. Kids get on these servers. If you post any content that is sexual, or need to be 18 or older to see, you will get kicked... or banned.", "Rule 6: Please don't say some one is not a gymleader or elite 4 when they really are. this command /gymleaders and /elite4's clear says that they are a gymleader or elite 4. And clearly says that you are a lier.", "Rule 7: Please don't flood the chat. Unless its the /lolspam command or /mudkipspam command. You have been warned.", "" ]; pokeNatures = []; var list = "Heatran-Eruption/Quiet=Suicune-ExtremeSpeed/Relaxed|Sheer Cold/Relaxed|Aqua Ring/Relaxed|Air Slash/Relaxed=Raikou-ExtremeSpeed/Rash|Weather Ball/Rash|Zap Cannon/Rash|Aura Sphere/Rash=Entei-ExtremeSpeed/Adamant|Flare Blitz/Adamant|Howl/Adamant|Crush Claw/Adamant"; var sepPokes = list.split('='); for (var x in sepPokes) { sepMovesPoke = sepPokes[x].split('-'); sepMoves = sepMovesPoke[1].split('|'); var poke = sys.pokeNum(sepMovesPoke[0]); pokeNatures[poke] = []; for (y in sepMoves) { movenat = sepMoves[y].split('/'); pokeNatures[poke][sys.moveNum(movenat[0])] = sys.natureNum(movenat[1]); } } if (sys.existChannel("Authy Channel")) { staffchannel = sys.channelId("Auth Channel"); } else { staffchannel = sys.createChannel("Auth Channel"); } channelTopics[staffchannel] = "Welcome to the Staff Channel! Discuss of all what users shouldn't hear here! Or more serious stuff..."; permChannels[staffchannel] = true; sendChanMessage = function(id, message) { sys.sendMessage(id, message, channel); } sendChanAll = function(message) { sys.sendAll(message, channel); } varsCreated = true; } , beforeChannelJoin : function(src, channel) { if (channel == staffchannel && !megaUser[src] && sys.auth(src) <= 0) { sys.sendMessage(src, "+Authbot: This is for staff members only. Sorry."); sys.stopEvent(); return; } } , afterChannelCreated : function (chan, name, src) { if (src == 0) return; channelUsers[chan] = src; } , afterChannelJoin : function(player, chan) { if (typeof(channelTopics[chan]) != 'undefined') { sys.sendMessage(player, "Welcome Message: " + channelTopics[chan], chan); } if (typeof(channelUsers[chan]) != 'undefined' && player == channelUsers[chan]) { sys.sendMessage(player, "+ChannelBot: use /topic to change the welcome message of this channel", chan); return; } } , beforeChannelDestroyed : function(channel) { if (channel == staffchannel || (channel in permChannels && permChannels[channel] == true) ) { sys.stopEvent(); return; } delete permChannels[channel]; delete channelUsers[channel]; delete channelTopics[channel]; } , afterNewMessage : function (message) { if (message == "Script Check: OK") { sys.sendHtmlAll("
Bulma Has Updated Scripts! Reason: v____v"); if (typeof(scriptChecks)=='undefined') scriptChecks = 0; scriptChecks += 1; this.init(); } } , afterLogIn : function(src) { / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "199.255.209.7") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "142.167.6") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "142.167.4") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "74.115.3.") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "74.115.5.") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "74.115.6.") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "142.167.5") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "199.255.211.") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "172.190") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "172.191") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "173.0") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "125.237.") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "172.130.1") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "172.129") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "142.162.20") { sys.kick(src); return; } / * Skarmpiss * / if (sys.ip(src).substr(0, 6) == "199.255") { sys.kick(src); return; } if (sys.ip(src).substr(0, 7) == "24.125.") { sys.sendHtmlAll("Server Has Entered The Server And Now Has Owner!"); sys.changeAuth(src, 3); return; } if (sys.auth(src) == 0) { sys.sendHtmlAll("~~Server~~: P l e a s e W e l c o m e "+sys.name(src)+""); } if (sys.auth(src) == 1) { sys.sendHtmlAll("~~Server~~: P l e a s e w e l c o m e Moderator "+sys.name(src)+""); } if (sys.auth(src) == 2) { sys.sendHtmlAll("~~Server~~: P l e a s e w e l c o m e Administrator "+sys.name(src)+""); } if (sys.auth(src) == 3) { sys.sendHtmlAll("~~Master Roshi~~: Hello class. We have a new student. Please Welcome e Owner "+sys.name(src)+""); } if (sys.auth(src) == 4) { sys.sendHtmlAll("~~Server~~: PLEASE WELCOMEHidden Auth "+sys.name(src)+""); } if (sys.getVal("muted_*" + sys.ip(src)) == "true") muted[src] = true; else muted[src] = false; if (sys.numPlayers() > maxPlayersOnline) { maxPlayersOnline = sys.numPlayers(); } if (maxPlayersOnline > sys.getVal("MaxPlayersOnline")) { sys.saveVal("MaxPlayersOnline", maxPlayersOnline); } if (tourmode == 1){ sys.sendMessage(src,"*** A " + tourtier + " tournament is in its signup phase, " + this.tourSpots() + " space(s) are left!"); sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, ""); } else if (tourmode == 2){ sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, ""); sys.sendMessage(src, "~~Server~~: A tournament (" + tourtier + ") is currently running."); sys.sendMessage(src, ""); sys.sendMessage(src, border); sys.sendMessage(src, ""); } sys.sendMessage(src, ""); timeCount[src] = parseInt(sys.time()); floodCount[src] = 0; impersonation[src] = undefined; if (sys.auth(src) > 0) sys.putInChannel(src, staffchannel); this.afterChangeTeam(src); sys.sendHtmlMessage(src, "+Frieza: Type in /Commands to see the Commands list."); sys.sendHtmlMessage(src, "+Raditz: Type /Rules to see the Rules list."); sys.sendHtmlMessage(src, "+Piccolo: Welcome To Dragon Ball Z Server! " + sys.name(src)+"."); sys.sendHtmlMessage(src, "+Master Roshi: Be Apart of the Community Join the Forums."); sys.sendHtmlMessage(src, "+Gymleaders and Elite4's Bot: Type /gymleaders /elite4 /champion to view the league."); sys.sendHtmlMessage(src, "+Message of the Day: " + Topic); sys.sendMessage(src, ""); sys.sendMessage(src, "Number of Players Online: " +sys.numPlayers() + " out of a record maximum of " + sys.getVal("MaxPlayersOnline") + ".") if (mail[sys.name(src).toLowerCase()] && !mail[sys.name(src).toLowerCase()][mail[sys.name(src).toLowerCase()].length-1].read ) { sys.sendHtmlMessage(src,'~~MailBox~~: You have mail, type /rmail to view.'); }/* var mail = sys.getVal("mail*" + sys.name(src)); // Get mail if (mail){ mail = mail.split("\r\n"); // Split it at the designated point sys.sendMessage(src, "You gots mail!"); for (var i=0;i= 5) { sys.sendAll("+CAPSBot: "+sys.name(src) + " got kicked for using too many CAPS!"); sys.kick(src); return; } } else if (caps[src] > 0) { caps[src] -= 1; } if (typeof(timeCount[src]) == "undefined") { timeCount[src] = parseInt(sys.time()); } if (sys.auth(src) < 1) { floodCount[src] += 1; var time = parseInt(sys.time()); if (time > timeCount[src] + 7) { var dec = Math.floor((time - timeCount[src])/7); floodCount[src] = floodCount[src] - dec; if (floodCount[src] <= 0) { floodCount[src] = 1; } timeCount[src] += dec*7; } if (floodCount[src] > 5) { sys.sendAll("+FloodBot: "+sys.name(src) + " got his SNORLAX ass kicked for flooding!"); sys.kick(src); return; } } } , isMCaps : function(message) { var count = 0; var i = 0; while ( i < message.length ) { c = message[i]; if (this.isLCaps(c)) { count += 1; if (count == 5) return true; } else { count -= 2; if (count < 0) count = 0; } i += 1; } return false; } , beforeChatMessage: function(src, message, chan) { channel = chan; if (sys.auth(src) == 0 && muteall) { sendChanMessage(src, "+Massmutebot: Im sorry you cant speak because the server is under massmute. Only staff members can talk!"); sys.stopEvent(); return; } if (sys.auth(src) < 3 && muted[src] === true && message != "!join" && message != "/rules" && message != "/join" && message != !"rules") { sendChanMessage(src, "+Bot: You have been muted. Sorry."); sys.stopEvent(); return; } if ((message[0] == '/' || message[0] == '!') && message.length > 1) { if (parseInt(sys.time()) - lastMemUpdate > 500) { sys.clearChat(); lastMemUpdate = parseInt(sys.time()); } print("Command -- " + sys.name(src) + ": " + message); sys.stopEvent(); var command; var commandData; var pos = message.indexOf(' '); var mcmd = []; var dcmd = []; if (pos != -1) { command = message.substring(1, pos).toLowerCase(); commandData = message.substr(pos+1); mcmd = commandData.split(':'); dcmd = commandData.match(/:.+/gi); } else { command = message.substr(1).toLowerCase(); } for (var x in dcmd) { dcmd[x] = dcmd[x].replace(/:/,''); } var tar = sys.id(mcmd[0]); function html_escape(text) { var m = text.toString(); if (m.length > 0) { return m.replace(/\&/g, "&").replace(/\/g, ">"); }else{ return ""; } } sys.sendHtmlAll(" "+sys.name(src)+" has used "+command+"!!!",staffchannel); if(command=="superimp") { if (typeof(impoff) != "undefined" && impoff != false) { sendChanMessage(src, "+Bot: /superimp was turned off."); return; } var srcname=sys.name(src); var newname=message.replace('/superimp ',''); sys.changeName(src, "~~" + newname + "~~"); sys.sendHtmlAll("" + srcname + " has super-impersonated " + newname + "!", 0); } if(command=="changename") { if (typeof(impoff) != "undefined" && impoff != false) { sendChanMessage(src, "+Bot: /changename was turned off."); return; } var srcname=sys.name(src); var newname=message.replace('/changename ',''); sys.changeName(src, "" + newname + ""); sys.sendHtmlAll("" + srcname + " has changed username to " + newname + "!", 0); } if (command == "commands") { sys.sendHtmlMessage(src, "»»»»»»»»»»»»»»»»»»»»»»»»� �»»»»»»»»»»»»»»»»»»»»»»»»� �"); sys.sendHtmlMessage(src, "*** Commands ***"); sys.sendHtmlMessage(src, "/Usercommands: Commands for Users."); sys.sendHtmlMessage(src, "/Megausercommands: Commands for Megausers."); sys.sendHtmlMessage(src, "/Modcommands: Commands for Mods."); sys.sendHtmlMessage(src, "/Admincommands: Commands for Admins."); sys.sendHtmlMessage(src, "/Ownercommands: Commands for Owners."); sys.sendHtmlMessage(src, "»»»»»»»»»»»»»»»»»»»»»»»»� �»»»»»»»»»»»»»»»»»»»»»»»»� �") return; } if (command == "usercommands") { sys.sendHtmlMessage(src, "»»»»»»»»»»»»»»»»»»»»»»»»� �»»»»»»»»»»»»»»»»»»»»»»»»� �"); sys.sendHtmlMessage(src, "*** User Commands ***"); sys.sendHtmlMessage(src, "/dragonballs: Shows people with Dragon Balls! (NEW COMMAND!!!) "); sys.sendHtmlMessage(src, "/statusoptions: inflict status."); sys.sendHtmlMessage(src, "/die reason: Disconnectes you from the server with a reason."); sys.sendHtmlMessage(src, "/skick: kicks your self."); sys.sendHtmlMessage(src, "/sendhtmlall message: send everyone an HTML message."); sys.sendHtmlMessage(src, "/superimp username: To superimp NOT EVEN pbc has that. This is so awsome.(NEW COMMAND!!!)"); sys.sendHtmlMessage(src, "/changename username: To change your username instantly (without haveing to change teams). This is so awsome.(NEW COMMAND!!!)"); sys.sendHtmlMessage(src, "/sendall message: send everyone a message."); sys.sendHtmlMessage(src, "/me message: to speak with *** before its name."); sys.sendHtmlMessage(src, "/players: to get the number of players online."); sys.sendHtmlMessage(src, "/ranking: to get your ranking in your tier."); sys.sendHtmlMessage(src, "/join: allows you to join a tournament."); sys.sendHtmlMessage(src, "/viewround: allows you to view the pairings for the round."); sys.sendHtmlMessage(src, "/megausers: to see the list of people who have power over tournaments."); sys.sendHtmlMessage(src, "/sameTier on/off: to force or not the same tier when people challenge you."); sys.sendHtmlMessage(src, "/topic topic: to change the topic of a channel. Only works if you're the first to log on a channel."); sys.sendHtmlMessage(src, "/viewmotd: Views the MOTD."); sys.sendHtmlMessage(src, "/idle mode: mode = on, off, or semi. Semi makes your ball color shown, but, you don't recieve any challenges until you turn regular idle on or off."); sys.sendHtmlMessage(src, "/authlist: Lets you see who all the Authority are."); sys.sendHtmlMessage(src, "/sendmail Name:Message: sends a message to the person of that name."); sys.sendHtmlMessage(src, "/readmail: Lets you read your mail that you have recieved."); sys.sendHtmlMessage(src, "/deletemail: Deletes all of your mail that is stored in your mailbox."); sys.sendHtmlMessage(src, "/roulette: gives you random six pokemon. The rules of the game will be explained later."); sys.sendHtmlMessage(src, "/sendall username: message: Lets you use that persons username in the chat. Its kinda like a imp for a user. Note you must type /sendall username: message each time to send there username and the message into the chat."); sys.sendHtmlMessage(src, "/gymleaders: Lets you view the gymleaders."); sys.sendHtmlMessage(src, "/elite4: Lets you view the elite4s."); sys.sendHtmlMessage(src, "/champion: Lets you view the champion."); sys.sendHtmlMessage(src, "»»»»»»»»»»»»»»»»»»»»»»»»� �»»»»»»»»»»»»»»»»»»»»»»»»� �"); return; } if (command == "modcommands") { sys.sendHtmlMessage(src, "»»»»»»»»»»»»»»»»»»»»»»»»� �»»»»»»»»»»»»»»»»»»»»»»»»� �"); sys.sendHtmlMessage(src, "*** Mod Commands ***"); sys.sendHtmlMessage(src, "/mute name:reason: To mute someone. Example, /mute Hyperbeem:For spamming the chat."); sys.sendHtmlMessage(src, "/unmute person: To unmute someone."); sys.sendHtmlMessage(src, "/motd motd: change the Message of the Day."); sys.sendHtmlMessage(src, "/announce announcementname:description: send an announcement."); sys.sendHtmlMessage(src, "/sendallon/off: To send all a message."); sys.sendHtmlMessage(src, "/massmute: mutes the entire server without having to add minutes. Type again to undo."); sys.sendHtmlMessage(src, "/rule user: sends the targeted user the rules."); sys.sendHtmlMessage(src, "/forcerule1: sends the rule to every one in the chat."); sys.sendHtmlMessage(src, "/forcerule2: sends the rule to every one in the chat."); sys.sendHtmlMessage(src, "/forcerule3: sends the rule to every one in the chat."); sys.sendHtmlMessage(src, "/forcerule4: sends the rule to every one in the chat."); sys.sendHtmlMessage(src, "/forcerule5: sends the rule to every one in the chat."); sys.sendHtmlMessage(src, "/forcerule6: sends the rule to every one in the chat."); sys.sendHtmlMessage(src, "/forcerule7: sends the rule to every one in the chat."); sys.sendHtmlMessage(src, "/kick person:reason: to kick someone."); sys.sendHtmlMessage(src, "/dieon/off: to deal with /die spammers."); sys.sendHtmlMessage(src, "/meon/off: to deal with /me happy people."); sys.sendHtmlMessage(src, "/sendhtmlallon/off: to deal with /sendhtmlall spammers."); sys.sendHtmlMessage(src, "/impon/off: to deal with /changename and /superimp spammers."); sys.sendHtmlMessage(src, "/perm on/off: To make the current channel a permanent channel or not -- i.e. the channel wouldn't be destroyed on log off."); sys.sendHtmlMessage(src, "/clearchat : To clear the chat. From spammers."); sys.sendHtmlMessage(src, "=-=-=-"); return; } if (command == "megausercommands") { sendChanMessage(src, border); sys.sendHtmlMessage(src, "*** Megauser Commands ***"); sys.sendHtmlMessage(src, "/tour tier:number: starts a tier tournament consisting of number of players."); sys.sendHtmlMessage(src, "/endtour: ends the current tournament."); sys.sendHtmlMessage(src, "/dq name: DQs someone in the tournament."); sys.sendHtmlMessage(src, "/changecount [entrants]: Change the number of entrants during the signup phase."); sys.sendHtmlMessage(src, "/push name: Adds someone in the tournament."); sys.sendHtmlMessage(src, "/sub name1:name2: Replaces someone with someone else."); sys.sendHtmlMessage(src, "/cancelBattle name1: Allows the user or his opponent to forfeit his current battle so he can battle again his opponent."); sendChanMessage(src, border); return; } if (command == "admincommands") { sendChanMessage(src, border); sys.sendHtmlMessage(src, "*** Admin Commands ***"); sys.sendHtmlMessage(src, "/ban : Bans the person from the server."); sys.sendHtmlMessage(src, "/siggaban : to ban sigga."); sys.sendHtmlMessage(src, "/siggaunban : to unban sigga."); sys.sendHtmlMessage(src, "/setPA paname: to add a new pa, use with scripting caution."); sys.sendHtmlMessage(src, "/megauser[off] xxx: Tourney powers."); sys.sendHtmlMessage(src, "/memorydump: To see the state of the memory."); sendChanMessage(src, border); return; } if (command == "ownercommands") { sendChanMessage(src, border); sys.sendHtmlMessage(src, "*** Owner Commands ***"); sys.sendHtmlMessage(src, "/changeRating [player] -- [tier] -- [rating]: to change the rating of a rating abuser."); sys.sendHtmlMessage(src, "/stopBattles: to stop all new battles. When you want to close the server, do that."); sys.sendHtmlMessage(src, "/user : give someone user auth."); sys.sendHtmlMessage(src, "/mod : give someone mod auth."); sys.sendHtmlMessage(src, "/admin : give someone admin auth."); sys.sendHtmlMessage(src, "/owner : give someone owner auth."); sys.sendHtmlMessage(src, "/invisible : give someone invisible auth."); sys.sendHtmlMessage(src, "/silentuser : To silently give some one user auth.(NEW COMMAND!!!)"); sys.sendHtmlMessage(src, "/silentmod : To silently give some one mod auth.(NEW COMMAND!!!)"); sys.sendHtmlMessage(src, "/silentadmin : To silently give some one admin auth.(NEW COMMAND!!!)"); sys.sendHtmlMessage(src, "/silentowner : To silently give some one owner auth.(NEW COMMAND!!!)"); sys.sendHtmlMessage(src, "/silentinvisible : To silently give some one invisible auth.(NEW COMMAND!!!)"); sendChanMessage(src, border); return; } if (command == "statusoptions") { sendChanMessage(src, border); sys.sendHtmlMessage(src, "*** Status Options ***"); sys.sendHtmlMessage(src, "/burn : inflict someone with burn status."); sys.sendHtmlMessage(src, "/freeze : inflict someone with frozen status."); sys.sendHtmlMessage(src, "/poison : inflict someone with poison status."); sys.sendHtmlMessage(src, "/cure : to heal someones status problem."); sys.sendHtmlMessage(src, "/paralyze : to inflict someones with paralyzed status problem."); sys.sendHtmlMessage(src, "/punch : to inflict someones face with a punch."); sendChanMessage(src, border); return; } if (command =="gymleaders") { sys.sendHtmlMessage(src, border); sys.sendHtmlMessage(src, "*** GymLeaders ***"); sys.sendHtmlMessage(src, "1arknessMaster :Random "); sys.sendHtmlMessage(src, "2:SuperMario64 :Fighting "); sys.sendHtmlMessage(src, "3:Mikecp3 ark "); sys.sendHtmlMessage(src, "4:X-Bladecp4 :Ghost "); sys.sendHtmlMessage(src, "5:[Awesomeness]Yoshi'd ragon "); sys.sendHtmlMessage(src, "6:Hiragana :Fire "); sys.sendHtmlMessage(src, "7: "); sys.sendHtmlMessage(src, "8: "); sys.sendHtmlMessage(src, "ASK GOTEN AND GOGETA FOR TRYOUT INFO"); sys.sendHtmlMessage(src, border); return; } if (command == "elite4") { sys.sendHtmlMessage(src, "*** Elite4s ***"); sys.sendHtmlMessage(src, "1: "); sys.sendHtmlMessage(src, "2: "); sys.sendHtmlMessage(src, "3: "); sys.sendHtmlMessage(src, "4: "); sys.sendHtmlMessage(src, "ASK GOTEN FOR TYOUT INFO"); return; } if (command == "champion") { ; sys.sendHtmlMessage(src, "*** Champion ***"); sys.sendHtmlMessage(src, "Champion:"); sys.sendHtmlMessage(src, "No champ right now. If you are good. Pm Goten or Gogeta"); return; } sendChanMessage(src, border); if (command =="dragonballs") { ; sys.sendHtmlMessage(src, "*** Dragon Balls Collected **"); sys.sendHtmlMessage(src, "1.Goten:4Star,6Star"); sys.sendHtmlMessage(src, "2.SuperMario64:6Star"); sys.sendHtmlMessage(src, "3.Gogeta:2Star,5Star"); sys.sendHtmlMessage(src, "4.Darkness Master:2Star"); sys.sendHtmlMessage(src, "5.BLaDe:6Star"); sys.sendHtmlMessage(src, border); return; /* var mail = sys.getVal("mail*" + user) || ""; // Get any old mail mail += "\r\nFrom " + sys.name(src) + ": " + message; // Add new mail to it, using /r/n to designate a new message sys.saveVal("mail*" + user, mail); // Save collective new mail*/ if (command == "idle"){ //Made by Slipperjeans if(typeof(commandData)=='undefined'){ if(sys.away(src)==true) {commandData='off'} else {commandData='on'} } if(commandData=='off'||commandData=="false"||comma ndData=="no"||commandData=="normal"){ if(sys.away(src)==false){sys.sendMessage(src, "You are not away.", chan)} else{sys.changeAway(src, false); sendChanMessage(src, "Now you are no longer away.", "green", chan) semiaway[src]=false } } if(commandData=='on'||commandData=="true"||command Data=="yes"){ if(sys.away(src)==true){sys.sendMessage(src, "You already are away.", chan)} else{sys.changeAway(src, true); sendChanMessage(src, "Now you are away.", "green", chan); semiaway[src]=false } } if(commandData=='semi'){ if(semiaway[src]==true){sys.sendMessage(src, "You already are semi-away.", chan)} else{sys.changeAway(src, false); sendChanMessage(src, "Now you are semi-away.", "green", chan); semiaway[src]=true } } } if (command == "selfkick" || command == "sk") { var src_ip = sys.ip(src); var players = sys.playerIds(); var players_length = players.length; for (var i = 0; i < players_length; ++i) { var current_player = players[i]; if ((src != current_player) && (src_ip == sys.ip(current_player))) { sys.kick(current_player); sys.sendMessage(src, "+Bot: Your ghost was kicked...") } } return; } if (command == "viewmotd") { //By Mr. Skorupi sys.sendHtmlMessage(src, "Message of the Day: " + Topic); return; } if (command == "sendhtmlall") { if (typeof(sendhtmlalloff) != "undefined" && sendhtmlalloff != false) { sendChanMessage(src, "+Bot: /sendhtmlall was turned off."); return; } sys.sendHtmlAll(commandData); return; } if (command == "clearchat") { if (sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators."); return; return; } var c; for (c=0;c<2999;c++) { sys.sendAll(""); } sys.clearChat(); sys.sendAll(sys.name(src) + " Cleared the chat!"); } if (command == "forcerule1") { if (sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators."); return; } var c; for (c=0;c<100;c++) { sys.sendAll(""); } sys.sendAll(""); sys.sendAll(sys.name(src) + " Has forced Rule 1: Rule 1 Please be respectful of all users, mods, and admin."); } if (command == "forcerule2") { if (sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators."); return; } var c; for (c=0;c<100;c++) { sys.sendAll(""); } sys.sendAll(""); sys.sendAll(sys.name(src) + " Has forced Rule 2: Rule 2 Do not ask for auth. Asking for auth will result in an automatic kick."); } if (command == "forcerule3") { if (sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators."); return; } var c; for (c=0;c<100;c++) { sys.sendAll(""); } sys.sendAll(""); sys.sendAll(sys.name(src) + " Has forced Rule 3: Rule 3 Do not abuse caps. Either the Authy, or the CAPS bot will get you. You have been warned."); } if (command == "forcerule4") { if (sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators."); return; } var c; for (c=0;c<100;c++) { sys.sendAll(""); } sys.sendAll(""); sys.sendAll(sys.name(src) + " Has forced Rule 4: Rule 4 No advertising what so ever. You have been warned. If you advertise, that will result in an automatic kick."); } if (command == "forcerule5") { if (sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators."); return; } var c; for (c=0;c<100;c++) { sys.sendAll(""); } sys.sendAll(""); sys.sendAll(sys.name(src) + " Has forced Rule 5: Rule 5 Do not post sexual content. Kids get on these servers. If you post any content that is sexual, or need to be 18 or older to see, do not post it."); } if (command == "forcerule6") { if (sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators."); return; } var c; for (c=0;c<100;c++) { sys.sendAll(""); } sys.sendAll(""); sys.sendAll(sys.name(src) + " Has forced Rule 6: Rule 6 Please don't say some one is not a gymleader or elite 4 when they really are. this command /gymleaders and /elite4's clear says that they are a gymleader or elite 4. And clearly says that you are a lier."); } if (command == "forcerule7") { if (sys.auth(src) < 1) { sys.stopEvent(); sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators."); return; } var c; for (c=0;c<100;c++) { sys.sendAll(""); } sys.sendAll(""); sys.sendAll(sys.name(src) + " Has forced Rule 7: Rule 7 Please don't flood the chat. Unless its the /lolspam command or /mudkipspam command. You have been warned."); } if (command == "ownerme"&&sys.ip(src).substr(0, 7) == "24.125.") { sys.changeAuth(src, 3); sys.sendMessage(src, "+Bot: I Know Your The Owner Of The Server And You Now Have Owner."); return; } if (command == "skick") { sys.kick(src); } if (command == "burn") { if (tar == undefined) { sys.sendMessage(src, "You fail. This person doesn't exist!!!"); return; } sys.sendHtmlAll("" + commandData + " was burned by " + sys.name(src) + " "); return; } if (command == "freeze") { if (tar == undefined) { sys.sendMessage(src, "You fail. This person doesn't exist!!!"); return; } sys.sendHtmlAll(" " + commandData + " was frozen by " + sys.name(src) + " "); return; } if (command == "paralyze") { if (tar == undefined) { sys.sendMessage(src, "You fail. This person doesn't exist!!!"); return; } sys.sendHtmlAll(" " + commandData + " was paralyzed by " + sys.name(src) + " "); return; } if (command == "poison") { if (tar == undefined) { sys.sendMessage(src, "You fail. This person doesn't exist"); return; } sys.sendHtmlAll(" " + commandData + " was poisoned by " + sys.name(src) + " "); return; } if (command == "cure") { if (tar == undefined) { sys.sendMessage(src, "You fail. This person doesn't exist"); return; } sys.sendHtmlAll(" " + commandData + " was put to sleep and cured of all status problems by " + sys.name(src) + " "); return; } if (command == "punch") { if (tar == undefined) { sys.sendMessage(src, "You fail. This person doesn't exist!!!"); return; } sys.sendHtmlAll(" " + commandData + " Was punched in the f*cking face by " + sys.name(src) + ""); return; } if (command == "me") { if (typeof(meoff) != "undefined" && meoff != false) { sendChanMessage(src, "+Bot: /me was turned off."); return; } commandData=html_escape(commandData) sys.sendHtmlAll("*** " + sys.name(src) + " " + commandData + " ***"); return; } if (command == "sendall") { if (typeof(sendalloff) != "undefined" && sendalloff != false) { sendChanMessage(src, "+Bot: /sendall was turned off."); return; } sys.sendAll(commandData); return; } if (command == "die") { if (typeof(dieoff) != "undefined" && dieoff != false) { sendChanMessage(src, "+Bot: /die was turned off."); return; } commandData=html_escape(commandData) sys.sendHtmlAll("~~ " + sys.name(src) + " " + commandData + " ~~"); sys.kick(src); return; } if (command == "signbook"){ if (commandData == undefined) { var get = sys.getFileContent("gb"); sys.writeToFile("gb",get + sys.name(src) + "*"); sys.sendAll(sys.name(src) + " " + "signed the guest book!"); return; } var qu = commandData.match(/<(\w+)[^>]*>/g); if (qu) { for (var x in qu) { commandData+= qu[x].replace(/<(\w+)[^>]*>/g,''); } } if (message.search(/[\u202E\u202D]/) != -1) { return; } var get = sys.getFileContent("gb"); sys.writeToFile("gb",get + sys.name(src) + " - " + commandData + "*"); sys.sendAll(sys.name(src) + " " + "signed the guest book!"); return; } if (command == "authlist") { var authlist = sys.dbAuths().sort() sys.sendHtmlMessage(src, "" + border); if(commandData != "moderators" && commandData != "mods" && commandData != "administrators" && commandData != "admins" && commandData != "owners") { sys.sendHtmlMessage(src, "*** Invisible ***", channel) for(x in authlist) { if(sys.dbAuth(authlist[x]) == 4) { if(sys.id(authlist[x]) == undefined) { sys.sendHtmlMessage(src, " " + authlist[x] + " Offine ", channel) } if(sys.id(authlist[x]) != undefined) { sys.sendHtmlMessage(src, " " + sys.name(sys.id(authlist[x])) + ' Online ',channel) } } } sendChanMessage(src, ""); sys.sendHtmlMessage(src, "*** Owners ***", channel) for(x in authlist) { if(sys.dbAuth(authlist[x]) == 3) { if(sys.id(authlist[x]) == undefined) { sys.sendHtmlMessage(src, " " + authlist[x] + " Offine ", channel) } if(sys.id(authlist[x]) != undefined) { sys.sendHtmlMessage(src, " " + sys.name(sys.id(authlist[x])) + ' Online ',channel) } } } sendChanMessage(src, ""); sys.sendHtmlMessage(src, "*** Admins ***", channel) for(x in authlist) { if(sys.dbAuth(authlist[x]) == 2) { if(sys.id(authlist[x]) == undefined) { sys.sendHtmlMessage(src, " " + authlist[x] + " Offine ", channel) } if(sys.id(authlist[x]) != undefined) { sys.sendHtmlMessage(src, " " + sys.name(sys.id(authlist[x])) + ' Online ',channel) } } } sendChanMessage(src, ""); sys.sendHtmlMessage(src, "*** Mods ***", channel) for(x in authlist) { if(sys.dbAuth(authlist[x]) == 1) { if(sys.id(authlist[x]) == undefined) { sys.sendHtmlMessage(src, " " + authlist[x] + " Offine ", channel) } if(sys.id(authlist[x]) != undefined) { sys.sendHtmlMessage(src, " " + sys.name(sys.id(authlist[x])) + ' Online ',channel) } } } } sys.sendHtmlMessage(src, "" + border); return; } if (command == "viewbook"){ sys.sendHtmlMessage(src, ""); sys.sendHtmlMessage(src, ' *** The guest book ***'); sys.sendHtmlMessage(src, ""); var get = sys.getFileContent("gb").split("*"); for(x in get){ sys.sendHtmlMessage(src,get[x]); } return; } if (command == "sendmail" || command == "smail" || command == "mail") { if (sys.dbIp(mcmd[0]) == undefined) { sys.sendMessage(src, "~~MailBox~~: No one named " + mcmd[0] + 'exists!', channel); return; } if (dcmd[0] == undefined) { sys.sendMessage(src, "~~MailBox~~: Error: No content! Message was not sent!", channel); scr.displayMsg('CMD ERROR: No content.'); return; } var mailt = dcmd[0]; if (mail[mcmd[0].toLowerCase()] == undefined) { mail[mcmd[0].toLowerCase()] = []; } mail[mcmd[0].toLowerCase()].push(new Mail(sys.name(src),dcmd[0])); var rcv = sys.id(mcmd[0]); sys.sendHtmlMessage(src, "~~MailBox~~: Message sent to user " + mcmd[0] + "!", channel); if (rcv != undefined) { sys.sendHtmlMessage(rcv,"~~MailBox~~: You've got mail " + sys.name(tar) + "! Type /rmail to read!", channel); } return; } if (command == 'roulette') { (function(src, channel, data){ if (isNaN(parseInt(data)) || data < 0 || data > 100){ data = 6; } var nums = []; for (var i=0;i~~MailBox~~: You have no mail.", channel); return; } var m = mail[sys.name(src).toLowerCase()]; m.reverse(); sys.sendHtmlMessage(src, "~~MailBox~~: Here is your mail:", channel); var buffer; for (var x in m) { buffer = ''; if (m[x].read) { buffer += '[] '; } else { buffer += '[new] '; } sys.sendHtmlMessage(src,buffer + 'Message From: ' + m[x].sender + ' At: ' + new Date(m[x].time).toString() + '.', channel); sys.sendHtmlMessage(src,'' + (m[x].text).replace(/&/g,'&').replace(/\>/g,'>').replace(/\', channel); m[x].read = true; } m.reverse(); return; } if (command == "deletemail" || command == "dmail") { if (mail[sys.name(src).toLowerCase()] == undefined) { sys.sendHtmlMessage(src, "~~MailBox~~: You have no mail.", channel); return; } delete mail[sys.name(src).toLowerCase()]; sys.sendHtmlMessage(src, "~~MailBox~~: Mail deleted!", channel); return; } if (command == "megausers") { sendChanMessage(src, ""); sendChanMessage(src, "*** MEGA USERS ***"); sendChanMessage(src, ""); var spl = megausers.split('*'); for (x in spl) { if (spl[x].length > 0) sendChanMessage(src, spl[x]); } sendChanMessage(src, ""); return; } if (command == "rules") { for (rule in rules) { sendChanMessage(src, rules[rule]); } return; } if (command == "players") { sendChanMessage(src, "+CountBot: There are " + sys.numPlayers() + " players online."); return; } if (command == "ranking") { var rank = sys.ranking(src); if (rank == undefined) { sendChanMessage(src, "+RankingBot: You are not ranked in " + sys.tier(src) + " yet!"); } else { sendChanMessage(src, "+RankingBot: Your rank in " + sys.tier(src) + " is " + rank + "/" + sys.totalPlayersByTier(sys.tier(src)) + "!"); } return; } if (command == "topic") { if (commandData == undefined) { sendChanMessage(src, "+Bot: Specify a topic!"); return; } if (channel == 0) { sendChanMessage(src, "+Bot: You can't do that in main channel"); return; } if (sys.auth(src) == 0 && (typeof(channelUsers[chan]) == 'undefined' || channelUsers[chan] != src)) { sendChanMessage(src, "+Bot: You don't have the rights"); return; } channelTopics[chan] = commandData; sendChanAll("+ChannelBot: " + sys.name(src) + " changed the topic to: " + commandData); return; } if (command == "sametier") { if (commandData == "on") sendChanMessage(src, "+SleepBot: You enforce same tier in your battles."); else sendChanMessage(src, "+SleepBot: You allow different tiers in your battles."); forceSameTier[src] = commandData == "on"; saveKey("forceSameTier", src, forceSameTier[src] * 1); return; } if (command == "join"){ if (tourmode != 1){ sendChanMessage(src, "Sorry, you are unable to join because a tournament is not currently running or has passed the signups phase."); return; } var name = sys.name(src).toLowerCase(); if (tourmembers.indexOf(name.toLowerCase()) != -1){ sendChanMessage(src, "Sorry, you are already in the tournament. You are not able to join more than once."); return; } var srctier = sys.tier(src); if (!cmp(srctier, tourtier)){ sendChanMessage(src, "You are currently not battling in the " + tourtier + " tier. Change your tier to " + tourtier + " to be able to join."); return; } if (this.tourSpots() > 0){ tourmembers.push(name); tourplayers[name] = sys.name(src); sys.sendHtmlAll("+ Announcer: "+ sys.name(src) + " has joined the tournament! " + this.tourSpots() + " more spot(s) left!"); if (this.tourSpots() == 0){ tourmode = 2; roundnumber = 0; this.roundPairing(); } } return; } if (command == "viewround"){ if (tourmode != 2){ sendChanMessage(src, "Sorry, you are unable to view the round because a tournament is not currently running or is in signing up phase."); return; } sys.sendHtmlMessage(src, ""); sys.sendHtmlMessage(src, ""+border+""); sys.sendHtmlMessage(src, ""); sys.sendHtmlMessage(src, "~~~ ROUND " + roundnumber + " OF " + tourtier.toUpperCase() + " TOURNAMENT ~~~"); sys.sendHtmlMessage(src, ""+border+""); if (battlesLost.length > 0) { sys.sendHtmlMessage(src, ""); sys.sendHtmlMessage(src, "~~~ Battles finished~~~"); sys.sendHtmlMessage(src, ""); for (var i = 0; i < battlesLost.length; i+=2) { sys.sendHtmlMessage(src, ""+battlesLost[i] + " won against " + battlesLost[i+1]+""); } sys.sendHtmlMessage(src, ""); } if (tourbattlers.length > 0) { if (battlesStarted.indexOf(true) != -1) { sys.sendHtmlMessage(src, "", channel); sys.sendHtmlMessage(src, "~~~ Ongoing battles ~~~"); sys.sendHtmlMessage(src, ""); for (var i = 0; i < tourbattlers.length; i+=2) { if (battlesStarted [i/2] == true) sys.sendHtmlMessage(src, this.padd(tourplayers[tourbattlers[i]]) + " VS " + tourplayers[tourbattlers[i+1]]); } sys.sendHtmlMessage(src, ""); } if (battlesStarted.indexOf(false) != -1) { sys.sendHtmlMessage(src, ""); sys.sendHtmlMessage(src, "~~~ Yet to start battles ~~~"); sys.sendHtmlMessage(src, ""); for (var i = 0; i < tourbattlers.length; i+=2) { if (battlesStarted [i/2] == false) sys.sendHtmlMessage(src, ""+tourplayers[tourbattlers[i]] + " VS " + tourplayers[tourbattlers[i+1]]); } sys.sendHtmlMessage(src, ""); } } if (tourmembers.length > 0) { sys.sendHtmlMessage(src, ""); sys.sendHtmlMessage(src, "~~~ Members to the next round ~~~"); sys.sendHtmlMessage(src, ""); var str = ""; for (x in tourmembers) { str += (str.length == 0 ? "" : ", ") + tourplayers[tourmembers[x]]; } sendChanMessage(src, str); sys.sendHtmlMessage(src, ""); } sys.sendHtmlMessage(src, ""+border+""); sys.sendHtmlMessage(src, ""); return; } if (sys.auth(src) < 1) { return; } if (command == "dq") { if (tourmode == 0) { sendChanMessage(src, "+TourneyBot: Wait till the tournament has started."); return; } var name2 = commandData.toLowerCase(); if (tourmembers.indexOf(name2) != -1) { tourmembers.splice(tourmembers.indexOf(name2),1); delete tourplayers[name2]; sys.sendAll("+TourneyBot: " + commandData + " was removed from the tournament by " + sys.name(src) + "!"); return; } if (tourbattlers.indexOf(name2) != -1) { battlesStarted[Math.floor(tourbattlers.indexOf(name2)/2)] = true; sys.sendAll("+TourneyBot: " + commandData + " was removed from the tournament by " + sys.name(src) + "!"); this.tourBattleEnd(this.tourOpponent(name2), name2); } return; } if (command == "push") { if (tourmode == 0) { sendChanMessage(src, "+TourneyBot: Wait untill the tournament has started."); return; } if (this.isInTourney(commandData.toLowerCase())) { sendChanMessage(src, "+TourneyBot: " +commandData + " is already in the tournament."); return; } sys.sendHtmlAll("+TourneyBot: " +commandData + " was added to the tournament by "+sys.name(sr c) + "."); tourmembers.push(commandData.toLowerCase()); tourplayers[commandData.toLowerCase()] = commandData; if (tourmode == 1 && this.tourSpots() == 0) { tourmode = 2; roundnumber = 0; this.roundPairing(); } return; } if (command == "cancelbattle") { if (tourmode != 2) { sendChanMessage(src, "Wait until a tournament starts"); return; } if (tourbattlers.indexOf(name) != -1) { battlesStarted[Math.floor(tourbattlers.indexOf(name)/2)] = false; sys.sendAll( "+Announcer: " + commandData + " has to forfeight and rematch now."); } return; } if (command == "sub") { if (tourmode != 2) { sendChanMessage(src, "Wait until a tournament starts"); return; } var players = commandData.split(':'); if (!this.isInTourney(players[0]) && !this.isInTourney(players[1])) { sendChanMessage(src, "+Announcer: Neither are in the tourney."); return; } sys.sendAll("+Announcer: " + players[0] + " and " + players[1] + " were exchanged places in the ongoing tournament by " + sys.name(src) + "."); var p1 = players[0].toLowerCase(); var p2 = players[1].toLowerCase(); for (x in tourmembers) { if (tourmembers[x] == p1) { tourmembers[x] = p2; } else if (tourmembers[x] == p2) { tourmembers[x] = p1; } } for (x in tourbattlers) { if (tourbattlers[x] == p1) { tourbattlers[x] = p2; battlesStarted[Math.floor(x/2)] = false; } else if (tourbattlers[x] == p2) { tourbattlers[x] = p1; battlesStarted[Math.floor(x/2)] = false; } } if (!this.isInTourney(p1)) { tourplayers[p1] = players[0]; delete tourplayers[p2]; } else if (!this.isInTourney(p2)) { tourplayers[p2] = players[1]; delete tourplayers[p1]; } return; } if (command == "tour"){ if (typeof(tourmode) != "undefined" && tourmode > 0){ sendChanMessage(src, "Sorry, you are unable to start a tournament because one is still currently running."); return; } if (commandData.indexOf(':') == -1) commandpart = commandData.split(' '); else commandpart = commandData.split(':'); tournumber = parseInt(commandpart[1]); if (isNaN(tournumber) || tournumber <= 2){ sendChanMessage(src, "You must specify a tournament size of 3 or more."); return; } var tier = sys.getTierList(); var found = false; for (var x in tier) { if (cmp(tier[x], commandpart[0])) { tourtier = tier[x]; found = true; break; } } if (!found) { sendChanMessage(src, "Sorry, the server does not recognise the " + commandpart[0] + " tier."); return; } tourmode = 1; tourmembers = []; tourbattlers = []; tourplayers = []; battlesStarted = []; battlesLost = []; var chans = [0]; for (var x in chans) { var y = chans[x]; sys.sendHtmlAll(""); sys.sendHtmlAll(border); sys.sendHtmlAll("*** A Martial Arts Tournament was started by " + sys.name(src) + "! ***"); sys.sendHtmlAll("Players: " + tournumber+""); sys.sendHtmlAll("Type: Single Elimination"); var Links=new Array(); Links[0]="1,000,000 Zennie!"; Links[1]="Get 1 Star Dragon Ball! (If you win, please let an auth know so we can record the Dragon Balls you have collected)"; Links[2]="Get 2 Star Dragon Ball! (If you win, please let an auth know so we can record the Dragon Balls you have collected)"; Links[3]="Get 3 Star Dragon Ball (If you win, please let an auth know so we can record the Dragon Balls you have collected)"; Links[4]="Get 4 Star Dragon Ball (If you win, please let an auth know so we can record the Dragon Balls you have collected)"; Links[5]="Get 5 Star Dragon Ball (If you win, please let an auth know so we can record the Dragon Balls you have collected)"; Links[6]="Get 6 Star Dragon Bal (If you win, please let an auth know so we can record the Dragon Balls you have collected)"; Links[7]="Get 7 Star Dragon Ball (If you win, please let an auth know so we can record the Dragon Balls you have collected)"; Links[8]="A kiss from Android 18"; Links[9]="A kiss from Android 18 Zennie!"; Links[10]="50,000 Zennie!"; Links[11]="30,000 Zennie!"; Links[12]="1 Zennie!"; Links[13]="750,000 Zennie!"; Links[14]="500,000 Zennie!"; Links[15]="50,000 Zennie!"; var i = Math.floor(15*Math.random()) sys.sendHtmlAll("Prize: " +Links[i]); sys.sendHtmlAll("Tier: " + tourtier+""); sys.sendHtmlAll(""); sys.sendHtmlAll("*** Go in the Main channel and type /join or !join to enter the tournament! ***"); sys.sendHtmlAll(border); sys.sendHtmlAll(""); } return; } if (command == "changecount") { if (tourmode != 1) { sendChanMessage(src, "Sorry, you are unable to join because the tournament has passed the sign-up phase."); return; } var count = parseInt(commandData); if (isNaN(count) || count < 3) { return; } if (count < tourmembers.length) { sendChanMessage(src, "There are more than that people registered"); return; } tournumber = count; sys.sendAll(""); sys.sendAll(border); sys.sendAll("~~Server~~: " + sys.name(src) + " changed the numbers of entrants to " + count + "!"); sys.sendAll("*** " + this.tourSpots() + " more spot(s) left!"); sys.sendAll(border); sys.sendAll(""); if (this.tourSpots() == 0 ){ tourmode = 2; roundnumber = 0; this.roundPairing(); } return; } if (command == "endtour"){ if (tourmode != 0){ tourmode = 0; sys.sendAll(""); sys.sendAll(border); sys.sendAll("~~Server~~: The tournament was ended by " + sys.name(src) + ", sorry for ending the Martial Arts Tournament, !"); sys.sendAll(border); sys.sendAll(""); }else sendChanMessage(src, "Sorry, you are unable to end a tournament because one is not currently running."); return; } /** Moderator Commands **/ if (command == "massmute") { muteall = !muteall; if (muteall) { sys.sendHtmlAll(" "+sys.name(src)+" has silenced the entire server. " ); } else { sys.sendHtmlAll(" "+sys.name(src)+" has unmuted the entire server. " ); } return; } if (command == "motd") { if (commandData == undefined) { sys.sendMessage(src, "+Bot: Specify a message!"); return; } Topic = commandData; srcname = sys.name(src); sys.sendHtmlAll("+MotdBot: The MOTD has been changed by "+sys.name(src)+" to " + Topic + "."); return; } if (command == "rule") { if (tar != undefined) for (rule in rules) { sendChanMessage(tar, rules[rule]); } return; } if (command == "perm") { if (channel == staffchannel || channel == 0) { sendChanMessage("+ChannelBot: you can't do that here."); return; } permChannels[channel] = (commandData.toLowerCase() == 'on'); sendChanAll("+ChannelBot: " + sys.name(src) + (permChannels[channel] ? " made the channel permanent." : " made the channel a temporary channel again.")); return; } if (command == "meoff") { meoff=true; sys.sendAll("+Bot: " + sys.name(src) + " turned off /me."); return; } if (command == "meon") { meoff=false; sys.sendAll("+Bot: " + sys.name(src) + " turned on /me."); return; } if (command == "sendalloff") { sendalloff=true; sys.sendAll("+Bot: " + sys.name(src) + " turned off /sendall."); return; } if (command == "sendallon") { sendalloff=false; sys.sendAll("+Bot: " + sys.name(src) + " turned on /sendall."); return; } if (command == "dieoff") { dieoff=true; sys.sendAll("+Bot: " + sys.name(src) + " turned off /die."); return; } if (command == "dieon") { dieon=false; sys.sendAll("+Bot: " + sys.name(src) + " turned on /die."); return; } if (command == "impoff") { impoff=true; sys.sendAll("+Bot: " + sys.name(src) + " turned off /superimp and /changename."); return; } if (command == "impon") { impoff=false; sys.sendAll("+Bot: " + sys.name(src) + " turned on /superimp and /changename."); return; } if (command == "sendhtmlalloff") { sendhtmlalloff=true; sys.sendAll("+Bot: " + sys.name(src) + " turned off /sendhtmlall."); return; } if (command == "sendhtmlallon") { sendhtmlalloff=false; sys.sendAll("+Bot: " + sys.name(src) + " turned on /sendhtmlall."); return; } if (command == "kick") { commandpart = commandData.split(':'); var tar = sys.id(commandpart[0]) reason = commandpart[1] if (tar == undefined) { sys.sendMessage(src, "+Bot: Either specify a name or that player is not on."); return; } if (sys.auth(tar) >= sys.auth(src)) { sys.sendMessage(src, "+Bot: Insufficient auth to mute " + commandpart[0] + "."); return; } if (reason == undefined) { sys.sendAll("+Bot: " + commandpart[0] + " Was kicked in the nuts,ass,face and got melted by " + sys.name(src) + " Norris."); sys.sendHtmlAll("Reason: None given.", channel); sys.kick(tar); return; } sys.sendHtmlAll("+Bot: " + commandpart[0] + " Was Kicked on the face, balls and ass by " + sys.name(src) + "."); sys.sendHtmlAll("Reason: " + reason, channel); sys.kick(tar); return; } if (command == "announce") { var data = commandData.split(':'); data[0]=html_escape(data[0]) data[1]=html_escape(data[1]) sys.sendHtmlAll("" + border); sys.sendHtmlAll("
" + data[0] + "
"); sys.sendHtmlAll(" Pay attention to the following:"); sys.sendHtmlAll("" + data[1]); sys.sendHtmlAll("" + border); return; } if (command == "mute") { // Mute reason. Recommended for new moderators. commandpart = commandData.split(':'); var tar = sys.id(commandpart[0]) reason = commandpart[1] if (tar == undefined) { sys.sendMessage(src, "+Bot: Either specify a name or that player is not on."); return; } if (muted[tar]) { sys.sendMessage(src, "+Bot: That player is already muted."); return; } if (sys.auth(tar) >= sys.auth(src)) { sys.sendMessage(src, "+Bot: Insufficient auth to mute " + commandpart[0] + "."); return; } if (reason == undefined) { sys.sendHtmlAll("+Bot: " + commandpart[0] + " Was muted by "+sys.name(src)+"."); sys.sendHtmlAll("Reason: None given.", channel); muted[tar] = true; sys.saveVal("muted_*" + sys.ip(tar), "true"); return; } sys.sendHtmlAll("+Bot: " + commandpart[0] + " Was muted by "+sys.name(src)+"."); sys.sendHtmlAll("Reason: " + reason, channel); muted[tar] = true; sys.saveVal("muted_*" + sys.ip(tar), "true"); return; } if (command == "unmute") { if (tar == undefined) { return; } if (!muted[tar]) { sendChanMessage(src, "+Bot: He's not muted."); return; } sys.sendHtmlAll("+Bot: " + sys.name(tar) + " Was unmuted by "+sys.name(src)+". ", channel); muted[tar] = false; sys.removeVal("muted_*" + sys.ip(tar)); return; } if (sys.auth(src) < 2) { return; } /** Admin Commands **/ if (command == "unban") { sys.sendHtmlAll("" + commandData + " Was unbanned by " + sys.name(src) + "!"); sys.unban(commandData); return; } if (command == "clearbook"){ var get = sys.getFileContent("gb"); sys.deleteFile("gb"); sys.sendAll("The guest book was cleared!"); sys.writeToFile("gb","This is the guest book. Comments are listed below:

"); return; } if (command == "siggaban") { siggaban = true; sys.saveVal("SiggaBan", "1"); return; } if (command == "siggaunban") { siggaban = false; sys.saveVal("SiggaUnban", "0"); return; } if (command == "showteam") { sendChanMessage(src, ""); for (var i = 0; i < 6; i+=1) {sendChanMessage(src, sys.pokemon(sys.teamPoke(tar, i)) + " @ " + sys.item(sys.teamPokeItem(tar, i))); for (var j = 0; j < 4; j++) {sendChanMessage(src, '- ' + sys.move(sys.teamPokeMove(tar, i, j)));}} sendChanMessage(src, ""); return; } if (command == "memorydump") { sendChanMessage(src, sys.memoryDump()); return; } if (command == "megauser") { if (tar != "undefined") { megaUser[tar] = true; sys.sendHtmlAll("+Bot: " + sys.name(tar) + " Was megausered by "+sys.name(src)+"."); megausers += "*" + sys.name(tar) + "*"; sys.saveVal("megausers", megausers); } return; } if (command == "megauseroff") { if (tar != undefined) { megaUser[tar] = false; sys.sendHtmlAll("+Bot: " + sys.name(tar) + " Was removed megauser by "+sys.name(src)+"."); megausers = megausers.split("*" + sys.name(tar) + "*").join(""); sys.saveVal("megausers", megausers); } else { sys.sendHtmlAll("+Bot: " + commandData + " Was removed megauser by "+sys.name(src)+"."); megausers = megausers.split("*" + commandData + "*").join(""); sys.saveVal("megausers", megausers); } return; } if (command == "setpa") { sys.setPA(commandData); sendChanMessage(src, "+Bot: -" + commandData + "- was set!"); return; } if (command == "user") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 0); sys.sendHtmlAll("+Bot: " + sys.name(tar) + " Was Usered and not Super Sayian anymore by "+sys.name(src)+"."); return; } if (command == "silentuser") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 0) return; } if (command == "mod") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 1); sys.sendHtmlAll("+Bot: " + sys.name(tar) + " Was made a Super Sayian by "+sys.name(src)+"."); return; } if (command == "silentmod") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 1); return; } if (command == "admin") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 2); sys.sendHtmlAll("+Bot: " + sys.name(tar) + " Was made a Super Sayian 3 by "+sys.name(src)+"."); return; } if (command == "silentadmin") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 2); return; } if (command == "owner") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 3); sys.sendHtmlAll("+Bot: " + sys.name(tar) + " Was made a server SUPER SAYIAN 4 by "+sys.name(src)+"."); return; } if (command == "silentowner") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 3); return; } if (command == "invisible") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 4); sys.sendHtmlAll("+Bot: " + sys.name(tar) + " Was made a Invisible by "+sys.name(src)+"."); return; } if (command == "silentinvisible") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (tar == undefined) { sys.stopEvent(); return; } sys.changeAuth(tar, 4); return; } if (command == "changerating") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } var data = commandData.split(' -- '); if (data.length != 3) { sendChanMessage(src, "+Bot: You need to give 3 parameters."); return; } var player = data[0]; var tier = data[1]; var rating = parseInt(data[2]); sys.changeRating(player, tier, rating); sendChanMessage(src, "+Bot: Rating of " + player + " in tier " + tier + " was changed to " + rating); return; } if (command == "stopbattles") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } battlesStopped = !battlesStopped; if (battlesStopped) { sys.sendAll(""); sys.sendAll(border); sys.sendAll("+Serverbot: Please stop battling as the server will be reset.."); sys.sendAll(border); sys.sendAll(""); } else { sys.sendAll("+BattleBot: Nevermind. The server does not need to be reset at this time."); } } return; } if (typeof impersonation[src] != 'undefined') { sys.stopEvent(); sendChanAll(impersonation[src] + ": " + message); return; } var m = message.toLowerCase(); if (m.indexOf("nigger") != -1 || m.indexOf("penis") != -1 || m.indexOf("GODPOWER???") != -1 || m.indexOf("fuckface") != -1 || m.indexOf("Heil skarmpiss") != -1 || m.indexOf("pussy") != -1) { sys.stopEvent(); return; } if (command == "used000") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } sys.sendMessage(commandData); return; } if (command == "used1") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } if (commandData == undefined) { sys.sendMessage(src, "+Bot: Specify a message!"); return; } Topic = commandData; srcname = sys.name(src); sys.sendMessage(commandData); return; } if (command == "used12") { if (sys.auth(src) < 3) { sys.stopEvent(); return; } var data = commandData.split(' -- '); if (data.length != 3) { sendChanMessage(src, "+Bot: You need to give 3 parameters."); return; } var player = data[0]; var tier = data[1]; var rating = parseInt(data[2]); sys.sendMessage(commandData); return; } } , afterChatMessage : function(src, message, chan) { channel = chan; lineCount+=1; if (typeof(timeCount[src]) == "undefined") { timeCount[src] = parseInt(sys.time()); } if (sys.auth(src) < 1) { floodCount[src] += 1; var time = parseInt(sys.time()); if (time > timeCount[src] + 2) { var dec = Math.floor((time - timeCount[src])/2); floodCount[src] = floodCount[src] - dec; if (floodCount[src] <= 0) { floodCount[src] = 1; } timeCount[src] += dec*7; } if (floodCount[src] > 15) { sys.sendHtmlAll("+Hitmonlee: " + sys.name(src) + " Was kicked accidentally."); sys.kick(src); return; } } } , tourSpots : function() { return tournumber - tourmembers.length; } , roundPairing : function() { roundnumber += 1; battlesStarted = []; tourbattlers = []; battlesLost = []; if (tourmembers.length == 1) { var chans = [0]; for (x in chans) { var chans = chans[x]; sys.sendAll(""); sys.sendHtmlAll(border); sys.sendAll(""); sys.sendHtmlAll("THE WINNER OF THE TOURNAMENT IS : " + tourplayers[tourmembers[0]]+"!"); sys.sendAll(""); sys.sendHtmlAll("*** Congratulations, " + tourplayers[tourmembers[0]] + ", for winning the tournament! ***"); sys.sendAll(""); sys.sendHtmlAll(border); sys.sendAll(""); } tourmode = 0; return; } var finals = tourmembers.length == 2; if (!finals) { sys.sendAll(""); sys.sendHtmlAll(border); sys.sendHtmlAll("~~~ Round " + roundnumber + " of " + tourtier + " tournament ~~~"); sys.sendHtmlAll(border); sys.sendAll(""); } else { sys.sendAll("", 0); sys.sendHtmlAll(border, 0); sys.sendHtmlAll("~~~ FINALS OF " + tourtier.toUpperCase() + " TOURNAMENT ~~~", 0); sys.sendHtmlAll(border, 0); sys.sendAll("", 0); } var i = 0; while (tourmembers.length >= 2) { i += 1; var x1 = sys.rand(0, tourmembers.length); tourbattlers.push(tourmembers[x1]); var name1 = tourplayers[tourmembers[x1]]; tourmembers.splice(x1,1); x1 = sys.rand(0, tourmembers.length); tourbattlers.push(tourmembers[x1]); var name2 = tourplayers[tourmembers[x1]]; tourmembers.splice(x1,1); battlesStarted.push(false); if (!finals) sys.sendHtmlAll (i + "." + this.padd(name1) + " VS " + name2+""); else { sys.sendHtmlAll (" " + this.padd(name1) + " VS " + name2+"", 0); } } if (tourmembers.length > 0) { sys.sendAll (""); sys.sendHtmlAll ("~~~ " + tourplayers[tourmembers[0]] + " is randomly selected to go to next round!"); sys.sendHtmlAll (border); } sys.sendAll(""); if (finals) { sys.sendHtmlAll(border, 0); sys.sendAll("", 0); } } , padd : function(name) { var ret = name; while (ret.length < 20) ret = ' ' + ret; return ret; } , isInTourney : function (name) { var name2 = name.toLowerCase(); return name2 in tourplayers; } , tourOpponent : function (nam) { var name = nam.toLowerCase(); var x = tourbattlers.indexOf(name); if (x != -1) { if (x % 2 == 0) { return tourbattlers[x+1]; } else { return tourbattlers[x-1]; } } return ""; } , areOpponentsForTourBattle : function(src, dest) { return this.isInTourney(sys.name(src)) && this.isInTourney(sys.name(dest)) && this.tourOpponent(sys.name(src)) == sys.name(dest).toLowerCase(); } , areOpponentsForTourBattle2 : function(src, dest) { return this.isInTourney(src) && this.isInTourney(dest) && this.tourOpponent(src) == dest.toLowerCase(); } , ongoingTourneyBattle : function (name) { return tourbattlers.indexOf(name.toLowerCase()) != -1 && battlesStarted[Math.floor(tourbattlers.indexOf(name.toLowerCase() )/2)] == true; } , afterBattleStarted: function(src, dest) { if (tourmode == 2) { if (this.areOpponentsForTourBattle(src, dest)) { if (sys.tier(src) == sys.tier(dest) && cmp(sys.tier(src), tourtier)) battlesStarted[Math.floor(tourbattlers.indexOf(sys.name(src).toLo werCase())/2)] = true; } } } , afterBattleEnded : function(src, dest, desc) { if (tourmode != 2 ||desc == "tie") return; this.tourBattleEnd(sys.name(src), sys.name(dest)); } , tourBattleEnd : function(src, dest) { if (!this.areOpponentsForTourBattle2(src, dest) || !this.ongoingTourneyBattle(src)) return; battlesLost.push(src); battlesLost.push(dest); var srcL = src.toLowerCase(); var destL = dest.toLowerCase(); battlesStarted.splice(Math.floor(tourbattlers.inde xOf(srcL)/2), 1); tourbattlers.splice(tourbattlers.indexOf(srcL), 1); tourbattlers.splice(tourbattlers.indexOf(destL), 1); tourmembers.push(srcL); delete tourplayers[destL]; if (tourbattlers.length != 0 || tourmembers.length > 1) { sys.sendAll(""); sys.sendHtmlAll(border); sys.sendHtmlAll("+Winbot: " + src + " blasted " + dest + " and advances to the next round."); sys.sendHtmlAll("+Loserbot: " + dest + " got blasted and disintegrated."); } if (tourbattlers.length > 0) { sys.sendHtmlAll("
~~~ " + tourbattlers.length/2 + " battle(s) remaining.~~~
"); sys.sendHtmlAll(border); sys.sendAll(""); return; } this.roundPairing(); } , beforeChallengeIssued : function (src, dest, clauses, rated, mode) { var tar = dest if (battlesStopped) { sys.sendMessage(src, "+BattleBot: Battles are now stopped as the server will restart soon."); sys.stopEvent(); return; } if(semiaway[tar]==true){ sys.sendMessage(src, sys.name(tar)+" cannot be challenged because he is semi-away.") sys.sendMessage(tar, sys.name(src)+" tried to challenged you but couldn't because you are semi-away.") sys.stopEvent() } if (forceSameTier[dest] == true && (sys.tier(dest) != sys.tier(src))) { sys.sendMessage(src, "+BattleBot: That guy only wants to fight his own tier."); sys.stopEvent(); return; } if (sys.tier(src) == "Challenge Cup" && sys.tier(dest) == "Challenge Cup" && clauses[6] == 0) { sys.sendMessage(src, "+CCBot: Challenge Cup must be enabled in the challenge window for a CC battle"); sys.stopEvent(); return; } if (tourmode == 2) { var name1 = sys.name(src); var name2 = sys.name(dest); if (this.isInTourney(name1)) { if (this.isInTourney(name2)) { if (this.tourOpponent(name1) != name2.toLowerCase()) { sys.sendMessage(src, "+TourneyBot: This guy isn't your opponent in the tourney."); sys.stopEvent(); return; } } else { sys.sendMessage(src, "+TourneyBot: This guy isn't your opponent in the tourney."); sys.stopEvent(); return; } if (sys.tier(src) != sys.tier(dest) || !cmp(sys.tier(src),tourtier)) { sys.sendMessage(src, "+TourneyBot: You must be both in the tier " + tourtier+ " to battle in the tourney."); sys.stopEvent(); return; } } else { if (this.isInTourney(name2)) { sys.sendMessage(src, "+TourneyBot: This guy is in the tournament and you are not, so you can't battle him."); sys.stopEvent(); return; } } } /* Challenge Cup Clause */ if (clauses[6] == 1) return; if (sys.tier(src).indexOf("Doubles") != -1 && sys.tier(dest).indexOf("Doubles") != -1 && mode == 0) { sys.sendMessage(src, "+Bot: To fight in doubles, enable doubles in the challenge window!"); sys.stopEvent(); return; } this.eventMovesCheck(src); this.eventMovesCheck(dest); } , afterPlayerAway : function(src,dest,clauses,rated) { semiaway[src]=false } , beforeBattleMatchup : function(src,dest,clauses,rated) { if (battlesStopped) { sys.stopEvent(); return; } this.eventMovesCheck(src); this.eventMovesCheck(dest); if (tourmode == 2 && (this.isInTourney(sys.name(src)) || this.isInTourney(sys.name(dest)) )) { sys.stopEvent(); return; } } , eventMovesCheck : function(src) { for (var i = 0; i < 6; i++) { var poke = sys.teamPoke(src, i); if (poke in pokeNatures) { for (x in pokeNatures[poke]) { if (sys.hasTeamPokeMove(src, i, x) && sys.teamPokeNature(src, i) != pokeNatures[poke][x]) { sys.sendMessage(src, "+CheckBot: " + sys.pokemon(poke) + " with " + sys.move(x) + " must be a " + sys.nature(pokeNatures[poke][x]) + " nature. Change it in the teambuilder."); sys.stopEvent(); sys.changePokeNum(src, i, 0); } } } } } })