Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // *Give credit to Max if used, also to Intel_iX for some script edits! Also Ian for some little snippets!* //
- ({
- serverStartUp : function() {
- this.init();
- }
- ,
- initVal : function(key,val) { // Astruvis' Edits - Required edit to variable structure
- if (typeof server[key] == 'undefined') {
- server[key] = val; }
- return; }
- ,
- init : function() {
- 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;
- }
- cmp = function(a, b) {
- return a.toLowerCase() == b.toLowerCase();
- }
- if (typeof(varsCreated) != 'undefined')
- return;
- if (typeof server == 'undefined') {
- server = []; }
- script.initVal('pollmode',0);
- script.initVal('pollstr','');
- script.initVal('pollvotes',[]);
- battlesStopped = false;
- channelUsers = [];
- channelTopics = [];
- sys.setPA("forceSameTier");
- sys.setPA("megaUser");
- megausers = sys.getVal("megausers");
- muteall = false;
- sys.setPA ("impersonation");
- sys.setPA ("muted");
- sys.setPA("caps");
- sys.setPA("timeCount");
- sys.setPA("floodCount");
- }
- ,
- afterNewMessage : function (message) {
- if (message == "Script Check: OK") {
- sys.sendHtmlAll("<timestamp/><font color=black><b>Script Check</f></b>:<font color=green> OK");
- this.init();
- }
- }
- ,
- afterLogIn : function(src) {
- /* Hyperbeem */
- if (sys.ip(src).substr(0, 6) == "67.166.") {
- sys.kick(src);
- return;
- }
- sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>CommandBot</b>:</f> <font color=black>Use /commands to see the commands!");
- sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>LeagueBot</b>:</f> <font color=black>Use /league to see the league list!");
- if (sys.auth(src) > 1) {
- sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>AdminBot</b>:</f> <font color=black> Type /admincp to see what an owner can do. <i><font color=red> FEATURE COMING SOON");
- return;
- }
- sys.sendHtmlAll("<font color= " + sys.getColor(src) + "><timestamp/><b> " + sys.name(src) + "</b><font color=black> has joined Unova League!");
- if (sys.getVal("muted*" + sys.ip(src)) == "true")
- muted[src] = true;
- if (sys.numPlayers() > maxPlayersOnline) {
- maxPlayersOnline = sys.numPlayers();
- }
- if (maxPlayersOnline > sys.getVal("MaxPlayersOnline")) {
- sys.saveVal("MaxPlayersOnline", maxPlayersOnline);
- }
- sys.sendMessage(src, "");
- sys.sendMessage(src, "");
- this.afterChangeTeam(src);
- }
- ,
- beforeChatMessage: function(src, message) {
- if (sys.auth(src) < 4 && muted[src] == true) {
- sys.stopEvent();
- sys.sendMessage(src, "~~Bot~~: Hush, your muted!");
- return;
- }
- if (sys.auth(src) == 0 && muteall) {
- sys.sendMessage(src, "~~Bot~~: Shutup. The chat was silenced.");
- 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 = [];
- if (pos != -1) {
- command = message.substring(1, pos).toLowerCase();
- commandData = message.substr(pos+1);
- mcmd = commandData.split(':');
- } else {
- command = message.substr(1).toLowerCase();
- }
- var tar = sys.id(commandData);
- function sendChanMessage(src, msg) {
- sys.sendMessge(src, msg, chan); }
- var userCommands = ({
- "usercommands" : function () {
- sys.sendMessage(src, "");
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** User Commands ***</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/die <font color=limegreen>action</b></f>: <font color=black>die in your own special way</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/me <font color=blue>message</b></f>: <font color=black>to speak with *** before its name</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/roulette</b></f>: <font color=black>to get a number 1-40</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/game</b></f>: <font color=black>to play a game of rock paper scissors</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/quiz</b></f>: <font color=black>to take the Unova League Quiz!</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/disrespected <font color=red>person</b></f>: <font color=black>if you think a mute was unfair.</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/catch</b></f>: <font color=black>to catch a pokemon. It can be shiny!</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/authlist</b></f>: <font color=black>to show the authlist</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/rules</b></f>: <font color=black>to show the rules</f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/players</f></b>: <font color=black>to get the number of players online");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/league</f></b>: <font color=black>view the league list.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/torture <font color=red>person</f></b>: <font color=black>to torture someone, its fun too! if your a mod, it kicks the person!");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/viewjournal</b></f>: <font color=black>to view the book of wonderful comments");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/signjournal <font color=blue>quote</b></f>: <font color=black>be apart of the wonderful journal!");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/vote <font color=purple>option</f></b>: <font color=black>to vote for an option during a poll.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendAll <font color=blue>message</f></b>: <font color=black>to send a message to everyone.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendHtmlAll <font color=blue>message</f></b>: <font color=black>to send a message to everyone using HTML.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/print <font color=blue>message</f></b>: <font color=black>print a message on the server screen.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/attack <font color=red>person</f></b>: <font color=black>attack someone with a Pokemon Move.");
- sys.sendHtmlMessage(src, "<hr>");
- return;
- }
- ,
- admincp: function () {
- sys.sendHtmlMessage(src, "<font color=red><b> Admin Panel </b></font>");
- sys.sendHtmlMessage(src, "<b><font color=black>/<font color=red>un<font color=black>ban <font color=red>person</f></b>: ban/unban someone.");
- sys.sendHtmlMessage(src, "<b><font color=black>/authOptions</f></b>: see what to do when authing someone.");
- sys.sendHtmlMessage(src, "<b><font color=black>/silent<font color=red>kick<font color=black></b>/<font color=blue><b>ban <font color=red>person</f></b>: silentkick/silentban someone.");
- return;
- }
- ,
- commands: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Commands ***");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/usercommands</f></b>: <font color=black>for users");
- if (sys.auth(src) < 1) {
- return;
- }
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/modcommands</f></b>: <font color=black>for moderators");
- if (sys.auth(src) < 2) {
- return;
- }
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/admincommands</f></b>: <font color=black>for administrators");
- if (sys.auth(src) < 3) {
- return;
- }
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/ownercommands</f></b>: <font color=black>for owners");
- if (sys.auth(src) < 4) {
- return;
- }
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/invisiblecommands</f></b>: <font color=black>for invisible auth");
- sys.sendHtmlMessage(src, "<hr>");
- return; }
- ,
- eval: function () {
- sys.eval(commandData);}
- ,
- vote: function () {
- if (!server.pollmode) {
- sys.sendMessage(src,'~~Bot~~: Error, no poll open.');
- return; }
- if (isNaN(mcmd[0]*1)) {
- sys.sendMessage(src,'~~Bot~~: Error, please use /vote option (where option is a number.)');
- return; }
- server.pollvotes[sys.ip(src)] = mcmd[0]*1;
- sys.sendAll('~~Bot~~: ' + sys.name(src) + ' has voted!');
- return; }
- ,
- game: function () {
- sys.sendHtmlAll("<hr>");
- sys.sendHtmlAll("<font color=" + sys.getColor(src) + "><b>" + sys.name(src) + " </b><font color=black>has started a game of rock paper scissors! PM " + sys.name(src) + " if you want to play him!");
- sys.sendHtmlAll("<hr>");
- sys.sendMessage(src, "~~Bot~~: When someone decides to join, please type /startgame");
- return;
- }
- ,
- print: function () {
- sys.sendAll("~~Bot~~: " + sys.name(src) + " has printed " + commandData + " on the server screen!");
- print(commandData);
- return;
- }
- ,
- attack: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "~~Bot~~: You fail. That person is either not on or does not exist");
- return;
- }
- var attack=Math.floor(401*Math.random());
- var attack=sys.move(attack);
- sys.sendAll("~~Bot~~: " + sys.name(src) + " has used " + attack + " on " + sys.name(tar) + "!");
- return;
- }
- ,
- undefined: function () {
- sys.sendMessage(src, "~~Bot~~: The command " + command + " doesnt exist");
- return;
- }
- ,
- startgame: function () {
- sys.sendMessage(src, "~~Bot~~: Type /rps to get a result. Then have ur opponent do that.");
- return;
- }
- ,
- rps: function () {
- var Cards=new Array();
- Cards[0]="Rock";
- Cards[1]="Paper";
- Cards[2]="Scissors";
- var i = Math.floor(3*Math.random())
- sys.sendMessage(src, sys.name(src) + "'s result: " + Cards[i]);
- sys.sendMessage(src, "~~Bot~~: Send your partner the card you got, and have them send you their card. Type /winner to go on.");
- sys.sendMessage(src, "~~Bot~~: If it resulted in a tie, type /rps AGAIN");
- return;
- }
- ,
- winner: function () {
- sys.sendMessage(src, "Who won?");
- sys.sendMessage(src, "Type /won [name] to show who won your card game.");
- return;
- }
- ,
- won: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "~~Bot~~: This person is not on the server, therefore, this person lost.");
- return;
- }
- sys.sendHtmlAll("<hr>");
- sys.sendHtmlAll("From " + sys.name(src) + "'s rps game, " + commandData + " won!");
- sys.sendHtmlAll("<hr>");
- return;
- }
- ,
- disrespected: function () { // users
- if (tar == undefined) {
- sys.sendMessage(src, "~~Bot~~: That person doesnt exist!");
- return;
- }
- sys.sendMessage(src, "~~Bot~~: " + commandData + " will be unmute now.");
- muted[src] == false;
- sys.sendAll("~~Bot~~: " + commandData + " was unmuted by " + sys.name(src) + ". If you think this is unfair, get Max. He will disable that person's use of this command.");
- return;
- }
- ,
- roulette: function () { // roulette snip, not made for gamble minigame
- var Rand = sys.rand(0, 41)
- sys.sendMessage(src, 'Your number is: ' + Rand);
- return;
- }
- ,
- quiz: function () { // the script is NOT finished.
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=red><b> Question 1:</b><font color=black> What is the server named?");
- sys.sendMessage(src, "To answer, type /answer#");
- sys.sendMessage(src, "1: Unova");
- sys.sendMessage(src, "2: Unova League");
- sys.sendMessage(src, "3: Isshu League");
- sys.sendMessage(src, "4: Pokemon League");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- 1: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 2: function () {
- sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question2 to move on!");}
- ,
- 3: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 4: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- question2: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=red><b> Question 2:</b><font color=black> What is the server owner named?");
- sys.sendMessage(src, "To answer, type /answer#");
- sys.sendMessage(src, "5: Max");
- sys.sendMessage(src, "6: Blade");
- sys.sendMessage(src, "7: Ian");
- sys.sendMessage(src, "8: NONE OF THE ABOVE");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- 6: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 5: function () {
- sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question3 to move on!");}
- ,
- 7: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 8: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- question3: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=red><b> Question 3:</b><font color=black> What was the <b>ORIGINAL</b> name of the Server?");
- sys.sendMessage(src, "To answer, type /answer#");
- sys.sendMessage(src, "9: Pokemon Stadium");
- sys.sendMessage(src, "10: Isshu Flames");
- sys.sendMessage(src, "11: Isshu League");
- sys.sendMessage(src, "12: Unova League");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- 12: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 9: function () {
- sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question4 to move on!");}
- ,
- 10: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 11: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- question4: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=red><b> Question 4:</b><font color=black> What is the first Pokemon in alphabetical order?");
- sys.sendMessage(src, "To answer, type /answer#");
- sys.sendMessage(src, "13: Bulbasaur");
- sys.sendMessage(src, "14: Abomnasnow");
- sys.sendMessage(src, "15: Alakazam");
- sys.sendMessage(src, "16: Gengar");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- 13: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 14: function () {
- sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question5 to continue!");}
- ,
- 15: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 16: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- question5: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=red><b> Question 5:</b><font color=black> What type does Jacob use?");
- sys.sendMessage(src, "To answer, type /answer#");
- sys.sendMessage(src, "17: Fire");
- sys.sendMessage(src, "18: Water");
- sys.sendMessage(src, "19: Dragon");
- sys.sendMessage(src, "20: Ice");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- 18: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 17: function () {
- sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question6 to continue!");}
- ,
- 19: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 20: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- question6: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=red><b> Question 6:</b><font color=black> Who is the Popular Dragon Tamer named?");
- sys.sendMessage(src, "To answer, type /answer#");
- sys.sendMessage(src, "21: Lance");
- sys.sendMessage(src, "22: Loreli");
- sys.sendMessage(src, "23: Steven");
- sys.sendMessage(src, "24: Wallace");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- 22: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 21: function () {
- sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question7 to continue!");}
- ,
- 23: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 24: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- question7: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=red><b> Question 7:</b><font color=black> What type does Skyla use?");
- sys.sendMessage(src, "To answer, type /answer#");
- sys.sendMessage(src, "25: Rock");
- sys.sendMessage(src, "26: Flying");
- sys.sendMessage(src, "27: Steel");
- sys.sendMessage(src, "28: Rock");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- 25: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 26: function () {
- sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question8 to continue!");}
- ,
- 27: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 28: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- question8: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=red><b> Question 8:</b><font color=black> What Pokemon does Ash first catch in Unova?");
- sys.sendMessage(src, "To answer, type /answer#");
- sys.sendMessage(src, "29: Boldore");
- sys.sendMessage(src, "30: Emolga");
- sys.sendMessage(src, "31: Pidove");
- sys.sendMessage(src, "32: Roggenrola");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- 29: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 31: function () {
- sys.sendMessage(src, "~~QuizBot~~: Correct answer! Quiz is still being worked on!");}
- ,
- 30: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- 32: function () {
- sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
- ,
- me:function () {
- sys.sendHtmlAll("<font color=" + sys.getColor(src) + "><timestamp/><i> *** <b>" + sys.name(src) + "</b> " + commandData + " ***</i>"); }
- ,
- die:function () {
- sys.sendHtmlAll("<font color=" + sys.getColor(src) + "><timestamp/> ~ <b>" + sys.name(src) + "</b> " + commandData + " ~");
- sys.kick(src)
- return;
- }
- ,
- league: function () {
- sys.sendHtmlMessage(src, "<table border=1><tr><th><div style=background-color:red;width:200px;>Gyms</th><th><div style=background-color:darkblue;width:200px;>Elites</th></tr><tr> <td><div style=background-color:limegreen;width:200px;> Gym 1: Jacob </td> <td><div style=background-color:skyblue;width:200px;> Elite 1: Altair </td></tr><tr> <td><div style=background-color:red;width:200px;> Gym 2: Thunder </td> <td><div style=background-color:brown;width:200px;>Elite 2: Kelly </td></tr><tr> <td><div style=background-color:blue;width:200px;> Gym 3: Collosus </td> <td><div style=background-color:blue;width:200px;> Elite 3: Tyson </td></tr><tr> <td><div style=background-color:brown;width:200px;> Gym 4: Grimsely </td> <td><div style=background-color:orange;width:200px;> Elite 4: Max </td></tr><tr> <td><div style=background-color:green;width:200px;> Gym 5: Ian </td> <td><div style=background-color:darkblue;width:200px;> Champion: Blade</tr><tr> <td><div style=background-color:hotpink;width:200px;> Gym 6: Skyla </td></tr><tr> <td><div style=background-color:red;width:200px;> Gym 7: Pablo </td></tr><tr> <td><div style=background-color:purple;width:200px;> Gym 8: Josh </td></tr></table>");
- return;
- }
- ,
- sendall: function () {
- sys.sendAll(commandData); }
- ,
- sendhtmlall : function () {
- sys.sendHtmlAll(commandData); }
- ,
- torture : function () {
- if (tar == undefined) {
- sys.sendMessage(src, "~~Bot~~: You fail. That person is either not on or does not exist");
- return;
- }
- var Links=new Array();
- Links[1]="~~Bot~~: " + commandData + " has died from a falling meteorite!";
- Links[2]="~~Bot~~: " + commandData + " has been picked up and chucked down a hole :D";
- Links[3]="~~Bot~~: " + commandData + " has been told to go to his room and died of bordum";
- Links[4]="~~Bot~~: " + commandData + " has had a heart attack and fell of the Grand Canyon";
- Links[5]="~~Bot~~: " + commandData + " got to gotten hit by a car and died in the hospital";
- var i = Math.floor(5*Math.random())
- sys.sendAll(Links[i]);
- return; }
- ,
- 'catch' : function () {
- var num=Math.floor(650*Math.random());
- var pokemon=sys.pokemon(num);
- var nature=Math.floor(25*Math.random());
- var nature=sys.nature(nature);
- var shiny=Math.floor(8192*Math.random());
- var hpiv=Math.floor(32*Math.random());
- var spaiv=Math.floor(32*Math.random());
- var atkiv=Math.floor(32*Math.random());
- var defiv=Math.floor(32*Math.random());
- var spdiv=Math.floor(32*Math.random());
- var speiv=Math.floor(32*Math.random());
- if (shiny!=8191)
- {
- sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a " +pokemon + " with a " + nature + " nature!");
- sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
- sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
- }
- if (shiny==8191)
- {
- sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a shiny " + pokemon + " with a " + nature + " nature!");
- sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
- sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
- sys.sendAll("~~CaptureBot~~: This is truly a rare event");
- }
- }
- ,
- rules : function () {
- sys.sendMessage(src, "*** Server Rules ***");
- sys.sendMessage(src, "Rule #1 - Do Not Abuse CAPS:");
- sys.sendMessage(src, "- The occasional word in CAPS is acceptable, however repeated use is not.");
- sys.sendMessage(src, "Rule #2 - No Flooding the Chat:");
- sys.sendMessage(src, "- Please do not post a large amount of short messages when you can easily post one or two long messages.");
- sys.sendMessage(src, "Rule #3 - Do not Challenge Spam:");
- sys.sendMessage(src, "- If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.");
- sys.sendMessage(src, "Rule #4 - Don't ask for battles in the main chat:");
- sys.sendMessage(src, "- There is a 'Find Battle' tab that you can use to find a battle immediately. If after a while you cannot find a match, then you can ask for one in the chat.");
- sys.sendMessage(src, "Rule #5 - No Trolling/Flaming/Insulting of Any kind:");
- sys.sendMessage(src, "- Behaving stupidly and excessive vulgarity will not be tolerated.");
- sys.sendMessage(src, "Rule #6 - Please only speak English:");
- sys.sendMessage(src, "- Most people speak a different language, which is ok. But please speak english.");
- sys.sendMessage(src, "Rule #7 - No Advertising:");
- sys.sendMessage(src, "- There will be absolutely no advertising on the server.");
- sys.sendMessage(src, "Rule #8 - No Obscene or Pornographic Content Allowed:");
- sys.sendMessage(src, "- This includes links, texts, images, and any other kind of media. This will result in a instant ban.");
- sys.sendMessage(src, "Rule #9 - Do not ask for Auth:");
- sys.sendMessage(src," - Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.");
- sys.sendMessage(src,"Rule #10 - Do not Insult Auth:");
- sys.sendMessage(src, "- Insulting Auth will result in a instant ban.");
- sys.sendMessage(src,"Rule #11 - Do not Impersonate the Server or Any Owners:");
- sys.sendMessage(src, "- Impersonating them gets you at a high chance of a mute.");
- sys.sendMessage(src,"Rule #12 - Do not ask for the Server Scripts:");
- sys.sendMessage(src, "- Do NOT ask for the scripts. They are for certain people.");
- sys.sendMessage(src,"Rule #13 - Do not curse:");
- sys.sendMessage(src, "- Im serious. Dont. No one likes it. Hey, someone gets in lots of trouble for it, not my fault.");
- sys.sendMessage(src, "*** Site Rules ***");
- sys.sendMessage(src, "Rule #1 - Behave yourself, act appropriately:");
- sys.sendMessage(src, "- This is includes flaming, insulting, trolling of ANY KIND");
- sys.sendMessage(src,"Rule # 2 - Do not advertize:");
- sys.sendMessage(src,"- Do not advertize any other server or pages. Youtube or game, music pages are okay, but an excesive advertizing of them, could cause problems.");
- sys.sendMessage(src,"Rule #3 - No Obscene or Pornographic Content Allowed:");
- sys.sendMessage(src,"- This includes links, texts, images, and any other kind of obscene media. This will result in a instant ban.");
- sys.sendMessage(src,"Rule #4 - Do not ask for Auth:");
- sys.sendMessage(src,"- Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.");
- }
- ,
- authlist : function () {
- var authlist = sys.dbAuths().sort()
- sys.sendMessage(src, "");
- if(commandData == "owners") {
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Owners ***")
- for(var x in authlist) {
- if(sys.dbAuth(authlist[x]) == 3) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/oAway.png> " + authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) !=undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><img src=themes/classic/client/oAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sendChanMessage(src, "");
- }
- if(commandData == "admins" || commandData == "administrators") {
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Administrators ***")
- for(var x in authlist) {
- if(sys.dbAuth(authlist[x]) == 2) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/aAway.png> " + authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) !=undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><img src=themes/classic/client/aAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sys.sendMessage(src, "");
- }
- if(commandData == "mods" || commandData == "moderators") {
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Moderators ***")
- for(var x in authlist) {
- if(sys.dbAuth(authlist[x]) == 1) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/mAway.png> " + authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) !=undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><img src=themes/classic/client/mAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sys.sendMessage(src, "");
- }
- if(commandData != "moderators" && commandData != "mods" &&commandData != "administrators" && commandData != "admins" && commandData != "owners") {
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Owners ***")
- for (var x in authlist) {
- if (sys.dbAuth(authlist[x]) == 3) {
- if (sys.id(authlist[x]) == undefined) {
- sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/oAway.png> " + authlist[x]+ " (Offline)")
- }
- if (sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src,'<timestamp/><img src=themes/classic/client/oAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sys.sendMessage(src, "");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Administrators ***")
- for( var x in authlist) {
- if (sys.dbAuth(authlist[x]) == 2) {
- if (sys.id(authlist[x]) == undefined) {
- sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/aAway.png> " + authlist[x] + " (Offline)")
- }
- if (sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><img src=themes/classic/client/aAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sys.sendMessage(src, "");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Moderators ***")
- for(x in authlist) {
- if(sys.dbAuth(authlist[x]) == 1) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/mAway.png> " + authlist[x]+ " (Offline)")
- }
- if(sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src,'<timestamp/><img src=themes/classic/client/mAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- }
- return;
- }
- ,
- players: function () {
- sys.sendMessage(src, "CountBot: There are " + sys.numPlayers() +" players online.");
- return;
- }
- ,
- viewjournal : function (){
- sys.sendHtmlMessage(src, "");
- sys.sendHtmlMessage(src, '<timestamp/> <font color="blue">*** The Unova Journal ***</font>');
- sys.sendHtmlMessage(src, "");
- var get = sys.getFileContent("gb").split("*");
- for(x in get){
- sys.sendHtmlMessage(src,get[x]);
- }
- return; }
- ,
- signjournal : function () {
- 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,'</$1>'); }
- }
- 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; }
- });
- var modCommands = ({
- modcommands: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Mod Commands ***");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/imp <font color=red>thing</f></b>: <font color=black>to impersonate something");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/impOff</f></b>: <font color=black>to stop impersonating.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=red>end<font color=green>silence</b>: <font color=black> Silence/Desilence the chat.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/newpoll <font color=purple><b>question: <font color=red>option/option/option</f></b><font color=green></b>: </b><font color=black>start a new poll.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/pollclose</f></b>: <font color=black>to end a poll.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/kick <font color=red>person</f></b>: <font color=black> to kick someone");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/kickmsg <font color=blue>message</f></b>: <font color=black> to change the kickmessage");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=orange>un<font color=green>mute <font color=red>person</f></b>: <font color=black>Mute/Unmute someone.");
- sys.sendHtmlMessage(src, "<hr>");
- return; }
- ,
- pollclose: function () {
- if (server.pollmode == 0) {
- sys.sendMessage(src, "~~Bot~~: Poll is already closed. ");
- return;}
- server.pollmode = 0;
- sys.sendAll("~~Bot~~: Poll was closed by " + sys.name(src) + ".");
- var nu = [];
- var tally = [];
- for (var z in server.pollvotes) {
- if (tally[server.pollvotes[z]] == undefined) {
- tally[server.pollvotes[z]] = 1; }
- else {
- tally[server.pollvotes[z]] += 1; }
- }
- for (var z in tally) {
- if (server.polloptions[z - 1] != undefined) {
- sys.sendAll('~~Bot~~: Votes for option #'+z+'('+ server.polloptions[z - 1] +') - ' + tally[z]); }
- }
- server.pollmode = 1;
- return; }
- ,
- newpoll: function () {
- if (mcmd[0] == undefined || mcmd[1] == undefined) {
- sys.sendMessage(src,'~~Bot~~: You fail.');
- return; }
- server.pollvotes = [];
- server.polloptions = mcmd[1].split('/');
- if (server.polloptions.length == 1) {
- sys.sendMessage(src,'~~Bot~~: Error.');
- return; }
- sys.sendAll('~~Bot~~: Poll; ' + mcmd[0]);
- sys.sendAll('~~Bot~~: Please vote! Use /vote option');
- for ( var z in server.polloptions ) {
- sys.sendAll('~~Bot~~: Option #'+(z*1+1)+': '+ server.polloptions[z]); }
- server.pollmode = 1;
- return; }
- ,
- imp: function () {
- impersonation[src] = commandData;
- sys.sendMessage(src, "Bot: Now you are " + impersonation[src] +"!");
- return;
- }
- ,
- torture : function () {
- if (tar == undefined) {
- sys.sendMessage(src, "~~Bot~~: You fail. That person is either not on or does not exist");
- return;
- }
- var Links=new Array();
- Links[1]="~~Bot~~: " + commandData + " has died from a falling meteorite!";
- Links[2]="~~Bot~~: " + commandData + " has been picked up and chucked down a hole :D";
- Links[3]="~~Bot~~: " + commandData + " has been told to go to his room and died of bordum";
- Links[4]="~~Bot~~: " + commandData + " has had a heart attack and fell of the Grand Canyon";
- Links[5]="~~Bot~~: " + commandData + " got to gotten hit by a car and died in the hospital";
- var i = Math.floor(5*Math.random())
- sys.sendAll(Links[i]);
- sys.kick(tar)
- return; }
- ,
- impoff : function () {
- delete impersonation[src];
- sys.sendMessage(src, "Bot: Now you are yourself!");
- return;
- }
- ,
- kickmsg: function () {
- kickmessage = commandData;
- sys.sendAll("The kick message has been changed.");
- return;
- }
- ,
- kick : function () {
- if (tar == undefined) {
- return;
- }
- if (!kickmessage) {kickmessage = sys.getFileContent("kickmessage.txt");}
- sys.sendAll("~~Bot~~: " + sys.name(tar) + " " + kickmessage);
- sys.kick(tar);
- return;
- }
- ,
- mute: function () {
- if (tar == undefined) {
- return;
- }
- sys.sendAll("Bot: " + commandData + " was muted by " +sys.name(src) + "!");
- muted[tar] = true;
- return
- }
- ,
- silence: function () {
- sys.sendAll("~~Bot~~: The chat has been silenced by " + sys.name(src) + ".");
- muteall = true;
- return;
- }
- ,
- endsilence: function () {
- sys.sendAll("~~Bot~~: The chat was de-silenced!");
- muteall = false;
- return;
- }
- ,
- unmute:function () {
- if (tar == undefined) {
- return;
- }
- sys.sendAll("Bot: " + commandData + " was unmuted by " +sys.name(src) + "!");
- muted[tar] = false;
- return;
- }
- })
- var adminCommands = ({
- admincommands : function () {
- if (sys.auth(src) < 2) {
- sys.sendMessage(src, "CommandBot: Your are not of the right authority to view these comamnds.");
- return;
- }
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Admin Commands ***");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/reset</f></b>: <font color=black>to reset the server variables");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/masskick</f></b>: <font color=black>to clean up the server");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changeannouncement <font color=blue>message</f></b>: <font color=black>change announcement");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/setPA <font color=gold>paname</f></b>: <font color=black>to add a new pa");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearjournal</f></b>: <font color=black>to clear the journal");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=orange>un<font color=green>ban <font color=red>person</f></b>: <font color=black>to ban/unban someone");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearchat</f></b>: <font color=black>to clear the chat");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/resetannouncement</f></b>: <font color=black>reset announcement");
- sys.sendHtmlMessage(src, "<hr>");
- return;
- }
- ,
- reset : function () {
- this.serverStartUp();
- sys.sendAll("+Server: The server script variables were reset.");
- return;
- }
- ,
- changeannouncement: function () {
- sys.setAnnouncement(commandData);}
- ,
- resetannouncement: function () {
- sys.setAnnouncement("Announcement reset by<font color=" + sys.getColor(src) + "><b> " + sys.name(src));}
- ,
- changemotd:function () {
- Topic = commandData;
- sys.sendAll("The MOTD has been changed.");}
- ,
- ban:function () {
- if(sys.dbIp(commandData) == undefined) {
- sys.sendMessage(src, "+Bot: No player exists by this name!");
- return;
- }
- if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
- sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
- return;
- }
- var ip = sys.dbIp(commandData);
- var alias=sys.aliases(ip)
- var y=0;
- var z;
- for(var x in alias) {
- z = sys.dbAuth(alias[x])
- if (z > y) {
- y=z
- }
- }
- if(y>=sys.auth(src)) {
- sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
- return;
- }
- var banlist=sys.banList()
- for(a in banlist) {
- if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
- sys.sendMessage(src, "+Bot: He/she's already banned!");
- return;
- }
- }
- sys.sendHtmlAll('<b><font color=red>' + commandData + ' was banned by ' + sys.name(src) + '!</font></b>');
- if(tar != undefined) {
- sys.kick(tar)
- }
- sys.ban(commandData)
- sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
- return;
- }
- ,
- unban: function () {
- if(sys.dbIp(commandData) == undefined) {
- sys.sendMessage(src, "+Bot: No player exists by this name!");
- return;
- }
- var banlist=sys.banList()
- for(a in banlist) {
- if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
- sys.unban(commandData)
- sys.sendMessage(src, "+Bot: You unbanned " + commandData + "!");
- sys.appendToFile('bans.txt', sys.name(src) + ' unbanned ' +commandData + "n")
- return;
- }
- }
- sys.sendMessage(src, "+Bot: He/she's not banned!");
- return;
- }
- ,
- silentkick : function () {
- if (sys.auth(src) < 3) {
- return;
- }
- if (tar == undefined) {
- return;
- }
- sys.kick(tar);
- return;
- }
- ,
- clearchat:function () {
- var c;
- for (c=0;c<2999;c++) {
- sys.sendAll("");
- }
- sys.clearChat();
- sys.sendAll(sys.name(src) + " cleared the chat!");
- return;
- }
- ,
- setpa:function () {
- sys.setPA(commandData);
- sys.sendMessage(src, "Bot: -" + commandData + "- was set!");
- return;
- }
- ,
- clearjournal:function () {
- 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:<br><br>");
- return;
- }
- ,
- 'secret-command':function () {
- var pos = commandData.indexOf(' ');
- if (pos == -1) {
- return;
- }
- sys.sendMessage("Bot: The secret-command has been disabled by Max, sorry.");
- return;
- }
- ,
- masskick:function () {
- for (var i = 1; i < 200 && sys.numPlayers() > 0; i++) {
- if (sys.loggedIn(i)) {
- sys.kick(i);
- }
- }
- return;
- }
- });
- var ownerCommands = ({
- ownercommands : function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Owner Commands ***");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/silentkick<font color=red> person</f></b>: <font color=black>to silently kick someone");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/silentban<font color=red> person</f></b>: <font color=black>to silently ban someone");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/id <font color=red>person</f></b>: <font color=black>show the id of someone.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/authoptions</f></b>: <font color=black>see what you do to auth people.");
- sys.sendHtmlMessage(src, "<hr>");
- return;
- }
- ,
- authoptions: function () {
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b> *** Auth Options ***</b></f>");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>user <font color=red>person</f></b>: <font color=black> to user someone.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>mod <font color=red>person</f></b>: <font color=black> to mod someone.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>admin <font color=red>person</f></b>: </b><font color=black> to admin someone.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>owner <font color=red>person</f></b>:<font color=black> to owner someone.");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>invisible <font color=red>person</f></b>:<font color=black> to invisible someone.");
- sys.sendHtmlMessage(src, "<hr>");
- }
- ,
- id: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "~~Bot~~: That person doesnt exist or isnt on the Server!");
- return;
- }
- sys.sendMessage(src, sys.name(tar) + "s ID: " + tar);
- return;
- }
- ,
- user: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.sendAll("+Bot: " + commandData + " was usered.");
- sys.changeAuth(tar, 0);
- return;
- }
- ,
- mod: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.sendAll("+Bot: " + commandData + " was made a moderator.");
- sys.changeAuth(tar, 1);
- return;
- }
- ,
- admin: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.sendAll("+Bot: " + commandData + " is now an admin.");
- sys.changeAuth(tar, 2);
- }
- ,
- owner: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.sendAll("+Bot: " + commandData + " is now a server owner!");
- sys.changeAuth(tar, 3);
- }
- ,
- invisible: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.sendAll("+Bot: " + commandData + " now has invisible authority!");
- sys.changeAuth(tar, 4);
- return;
- }
- ,
- suser: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.changeAuth(tar, 0);
- }
- ,
- smod: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.changeAuth(tar, 1);
- }
- ,
- sadmin: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.changeAuth(tar, 2);
- }
- ,
- sowner: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.changeAuth(tar, 3);
- return;
- }
- ,
- sinvisible: function () {
- if (tar == undefined) {
- sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
- return;
- }
- sys.changeAuth(tar, 4);
- return;
- }
- ,
- clearpass: function () {
- if (sys.auth < 4) {
- sys.sendMessage(src, "~~Bot~~: You need to be an invisible authority to clear someones password.");
- return;
- }
- sys.clearPass(commandData);
- sys.sendAll("~~Bot~~: " + commandData + "'s password has been cleared by " + sys.name(src) + ".");
- return;
- }
- ,
- invisiblecommands : function () {
- if (sys.auth(src) < 4) {
- sys.sendMessage(src, "~~Bot~~: Sir these are NOT for you");
- return;
- }
- sys.sendHtmlMessage(src, "<hr>");
- sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Invisible Commands ***");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/eval<font color=gold> script</f></b>: <font color=black> evaluate a script");
- sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearpass<font color=red> person</f></b>: <font color=black> clear a password");
- sys.sendHtmlMessage(src, "<hr>");}
- ,
- eval: function () {
- sys.eval(commandData);}
- ,
- silentban:function () {
- if(sys.dbIp(commandData) == undefined) {
- sys.sendMessage(src, "+Bot: No player exists by this name!");
- return;
- }
- if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
- sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
- return;
- }
- var ip = sys.dbIp(commandData);
- var alias=sys.aliases(ip)
- var y=0;
- var z;
- for(var x in alias) {
- z = sys.dbAuth(alias[x])
- if (z > y) {
- y=z
- }
- }
- if(y>=sys.auth(src)) {
- sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
- return;
- }
- var banlist=sys.banList()
- for(a in banlist) {
- if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
- sys.sendMessage(src, "+Bot: He/she's already banned!");
- return;
- }
- }
- if(tar != undefined) {
- sys.kick(tar)
- }
- sys.ban(commandData)
- sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
- return;
- }
- });
- var getCommand = ({
- '0': function (name) {
- if (name in userCommands) {
- return userCommands[name]; }
- }
- ,
- '1': function (name) {
- if (name in modCommands) {
- return modCommands[name]; }
- else if (name in userCommands) {
- return userCommands[name]; }
- }
- ,
- '2' : function (name) {
- if (name in adminCommands) {
- return adminCommands[name]; }
- else if (name in modCommands) {
- return modCommands[name]; }
- else if (name in userCommands) {
- return userCommands[name]; }
- }
- ,
- '3' : function (name) {
- if (name in ownerCommands) {
- return ownerCommands[name]; }
- else if (name in adminCommands) {
- return adminCommands[name]; }
- else if (name in modCommands) {
- return modCommands[name]; }
- else if (name in userCommands) {
- return userCommands[name]; }
- }
- ,
- '4' : function (name) {
- if (name in ownerCommands) {
- return ownerCommands[name]; }
- else if (name in adminCommands) {
- return adminCommands[name]; }
- else if (name in modCommands) {
- return modCommands[name]; }
- else if (name in userCommands) {
- return userCommands[name]; }
- }
- });
- var cmd = getCommand[sys.auth(src)](command);
- if (!cmd) {
- sys.sendMessage(src, getCommand[3](command) ? "+Bot: You aren't allowed to use that command." : "+Bot: That command doesn't exist." );
- return; }
- cmd();
- return;
- }
- if (typeof impersonation[src] != 'undefined') {
- sys.stopEvent();
- sys.sendAll(impersonation[src] + ": " + message);
- return;
- }
- }
- ,
- beforeChallengeIssued : function (src, dest, clauses) {
- /* Challenge Cup Clause */
- if (clauses[7] == 1)
- return;
- if (clauseOn[dest] == true) {
- for (var i = 0; i < 6; i++) {
- if (hasBan(dest, sys.teamPoke(src,i))) {
- sys.sendMessage(src, "ClauseBot: Your opponent is afraid of " + sys.pokemon(sys.teamPoke(src,i)));
- sys.stopEvent();
- return;
- }
- }
- }
- if (clauseOn[src] == true) {
- for (var i = 0; i < 6; i++) {
- if (hasBan(src, sys.teamPoke(dest,i))) {
- sys.sendMessage(src, "ClauseBot: You are afraid of some pokemon of the opponent, so I won't let you challenge them.");
- sys.stopEvent();
- return;
- }
- }
- }
- /* Regular tier checks that can't be made using the built-in server tier system */
- if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
- if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
- sys.sendMessage(src, "+Bot: SonicBoom and Dragon Rage are banned in Little Cup!");
- sys.stopEvent();
- }
- if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
- sys.sendMessage(src, "+Bot: Your opponent has banned moves SonicBoom or Dragon Rage in Little Cup tier!");
- sys.stopEvent();
- }
- if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
- sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup!");
- sys.stopEvent();
- }
- if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
- sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup and your opponent has it!");
- sys.stopEvent();
- }
- }
- }
- ,
- beforeBattleMatchup : function(src,dest,clauses)
- {
- if (clauseOn[dest] == true) {
- for (var i = 0; i < 6; i++) {
- if (hasBan(dest, sys.teamPoke(src,i))) {
- sys.stopEvent();
- return;
- }
- }
- }
- if (clauseOn[src] == true) {
- for (var i = 0; i < 6; i++) {
- if (hasBan(src, sys.teamPoke(dest,i))) {
- sys.stopEvent();
- return;
- }
- }
- }
- /* Regular tier checks that can't be made using the built-in server tier system */
- if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
- if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
- sys.stopEvent();
- }
- if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
- sys.stopEvent();
- }
- if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
- sys.stopEvent();
- }
- if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
- sys.stopEvent();
- }
- }
- }
- ,
- beforeBattleStarted : function(src, dest) {
- /* If this is little cup, the levels are changed to be level 5 */
- if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
- lilCupLevels[src] = [sys.teamPokeLevel(src, 0), sys.teamPokeLevel(src,1), sys.teamPokeLevel(src, 2), sys.teamPokeLevel(src, 3), sys.teamPokeLevel(src, 4),sys.teamPokeLevel(src, 5)];
- lilCupLevels[dest] = [sys.teamPokeLevel(dest, 0),sys.teamPokeLevel(dest, 1), sys.teamPokeLevel(dest, 2), sys.teamPokeLevel(dest, 3),sys.teamPokeLevel(dest, 4), sys.teamPokeLevel(dest, 5)];
- for (var i = 0; i < 6; i+=1) {
- if (sys.teamPokeLevel(src, i) > 5)
- sys.changePokeLevel(src, i, 5);
- if (sys.teamPokeLevel(dest, i) > 5)
- sys.changePokeLevel(dest, i, 5);
- }
- }
- }
- ,
- afterBattleEnded: function(src, dest) {
- /* If this is little cup, the levels are to be changed back! */
- if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup" && lilCupLevels[src]!= undefined && lilCupLevels[dest] != undefined) {
- for (var i = 0; i < 6; i+=1) {
- if (sys.teamPokeLevel(src, i) != lilCupLevels[src][i])
- sys.changePokeLevel(src, i,lilCupLevels[src][i]);
- if (sys.teamPokeLevel(dest, i) != lilCupLevels[dest][i])
- sys.changePokeLevel(dest, i,lilCupLevels[dest][i]);
- }
- }
- }
- ,
- beforeLogOut : function (src) {
- sys.sendHtmlAll("<font color= " + sys.getColor(src) + "><timestamp/><b> " + sys.name(src) + "</b><font color=black> has left Unova League!");
- if (muted[src] == true) {
- sys.saveVal("muted*" + sys.ip(src), "true");
- } else {
- sys.removeVal("muted*" + sys.ip(src));
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement