Guest User

Untitled

a guest
Dec 10th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 105.48 KB | None | 0 0
  1. ({
  2.  
  3. serverStartUp : function() {
  4. starttime = new Date();
  5. scriptChecks = 0;
  6. this.init();
  7. }
  8. ,
  9. initVal : function(key,val) { // Astruvis' Edits - Required edit to variable structure
  10. if (typeof server[key] == 'undefined') {
  11. server[key] = val; }
  12. return; }
  13. // End edits
  14. ,
  15. init : function() {
  16.  
  17. semiaway = [ ];
  18.  
  19. toJSON = function(obj) {
  20. /* Function that changes an object or other value into a string. */
  21. if (typeof indent == 'undefined') {
  22. indent = 0; }
  23. switch (typeof obj) {
  24. case 'object':
  25. if (obj) {
  26. indent++;
  27. var list = [];
  28. if (obj instanceof Array) {
  29. for (var i in obj) {
  30. list.push(toJSON(obj[i]));
  31. }
  32. var r = '[';
  33. var l = 0;
  34. for (var i in list) {
  35. if (i != 0) {
  36. r += ' , '; }
  37. if (l > 96) {
  38. r += '\n' + tab.copy(indent);
  39. l = 0; }
  40.  
  41. r += list[i];
  42. l += list[i].length;
  43.  
  44. }
  45. indent--;
  46. return r + ']'; }
  47. else if ( !isNaN (+obj) ) {
  48. indent--;
  49. return +obj; }
  50. else {
  51. for (var prop in obj) {
  52. if (prop == 'global2') {
  53. continue; }
  54. 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])); }
  55. indent--;
  56. return '{\n' + list.join(' ,\n') + '\n' +tab.copy(indent)+'}';
  57. }
  58. } else {
  59. return 'null';
  60. }
  61. case 'string':
  62. return '"' + obj.replace(/(["'])/g, '\\$1').replace(/\r/g, '\\r').replace(/\n/g, '\\n').replace(/\t/g, '\\t') + '"';
  63. case 'function':
  64. return (new String(obj)).replace(/\t/g,tab);
  65. case 'number':
  66. case 'boolean':
  67. return new String(obj);
  68. }
  69. return; }
  70. Object.defineProperty(Object.prototype,
  71. 'copy',{
  72. value : function (num) {
  73. var s = '';
  74. while (num > 0) {
  75. s += this;
  76. num--; }
  77. return s; },
  78. configurable: true,
  79. writable : true
  80. });
  81.  
  82. Object.defineProperty(Object.prototype,
  83. 'toJSON',{
  84. value : function() { return toJSON(this); },
  85. configurable: true,
  86. writable : true
  87. });
  88. if (typeof mail == 'undefined' ) {
  89. mail = {};
  90. var t = sys.getVal('mail');
  91. if ( t != '' ) {
  92. mail = eval('('+t+')'); }
  93. }
  94. Mail = function (src, text) {
  95. this.text = text;
  96. this.sender = src;
  97. this.time = +new Date;
  98. this.read = false; }
  99. lastMemUpdate = 0;
  100.  
  101. key = function(a,b) {
  102. return a + "*" + sys.name(b);
  103. }
  104.  
  105. semiUbers = [];
  106.  
  107. var tempU = new Array(150,249,250,382,383,384,483,484,487,505);
  108. for (x in tempU) {
  109. semiUbers[tempU[x]] = true;
  110. }
  111.  
  112. saveKey = function(thing, id, val) {
  113. sys.saveVal(key(thing,id), val);
  114. }
  115.  
  116. getKey = function(thing, id) {
  117. return sys.getVal(key(thing,id));
  118. }
  119.  
  120. hasBan = function(id, poke) {
  121. return clauses[id].indexOf("*" + poke + "*") != -1;
  122. }
  123.  
  124. if (typeof(permChannels) == 'undefined') {
  125. permChannels = [];
  126. }
  127.  
  128. cmp = function(a, b) {
  129. return a.toLowerCase() == b.toLowerCase();
  130. }
  131.  
  132. if (typeof(channelTopics) == 'undefined')
  133. channelTopics = [];
  134.  
  135. if (typeof(varsCreated) != 'undefined')
  136. return;
  137.  
  138. battlesStopped = false;
  139. channelUsers = [];
  140. channelTopics = [];
  141.  
  142. sys.setPA("forceSameTier");
  143. sys.setPA("megaUser");
  144. megausers = sys.getVal("megausers");
  145.  
  146. siggamute = (sys.getVal("SiggaMute") == "1");
  147. siggaban = (sys.getVal("SiggaBan") == "1");
  148.  
  149. muteall = false;
  150.  
  151. sys.setPA ("impersonation");
  152. sys.setPA ("muted");
  153. sys.setPA("timeCount");
  154. sys.setPA("floodCount");
  155. maxPlayersOnline = 0;
  156.  
  157. lineCount = 0;
  158. tourmode = 0;
  159. border = "»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»:";
  160.  
  161. rules = [ "",
  162. "*** Rules ***",
  163. "",
  164. "Rule 1: Please be respectful of all users, mods, admins and owners.",
  165. "Rule 2: Do not ask for auth. Asking for auth will result in an automatic kick.",
  166. "Rule 3: Do not advertise another server or forums whilst on our server. An immediate ban will be placed if said rule is broken. ",
  167. "Rule 4: Do not talk about anything relating to religion in the main chat, as it will cause flaming and arguments. In doing so is an immediate ban.",
  168. "Rule 5: Don't post pornographic images or videos on the main chat at any time. It's incredibly immature and most times tasteless. If said rule is broken, an immediate ban will be placed. ",
  169. "Rule 6: he staff, or 'auth', have been put in charge to make the decisions for the server. Don't talk against them. If you have a problem with a staff member, Private Message them.",
  170. "Rule 7: You do not need to hit enter after every word, abuse Caps Lock, or call out a word 10 times in a row.",
  171. "" ];
  172.  
  173. pokeNatures = [];
  174.  
  175. 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";
  176.  
  177. var sepPokes = list.split('=');
  178. for (var x in sepPokes) {
  179. sepMovesPoke = sepPokes[x].split('-');
  180. sepMoves = sepMovesPoke[1].split('|');
  181.  
  182. var poke = sys.pokeNum(sepMovesPoke[0]);
  183. pokeNatures[poke] = [];
  184.  
  185. for (y in sepMoves) {
  186. movenat = sepMoves[y].split('/');
  187. pokeNatures[poke][sys.moveNum(movenat[0])] = sys.natureNum(movenat[1]);
  188. }
  189. }
  190. if (sys.existChannel("Authy Channel")) {
  191. staffchannel = sys.channelId("Auth Channel");
  192. } else {
  193. staffchannel = sys.createChannel("Auth Channel");
  194. }
  195.  
  196. channelTopics[staffchannel] = "Welcome to the Staff Channel! Discuss of all what users shouldn't hear here! Or Just Chat with the other authorities!";
  197. permChannels[staffchannel] = true;
  198.  
  199. sendChanMessage = function(id, message) {
  200. sys.sendMessage(id, message, channel);
  201. }
  202.  
  203. sendChanAll = function(message) {
  204. sys.sendAll(message, channel);
  205. }
  206.  
  207. varsCreated = true;
  208. }
  209.  
  210. ,
  211.  
  212. beforeChannelJoin : function(src, channel) {
  213. if (channel == staffchannel && !megaUser[src] && sys.auth(src) <= 0) {
  214. sys.sendMessage(src, "+Authbot: This is for staff members only. Sorry.");
  215. sys.stopEvent();
  216. return;
  217. }
  218. }
  219.  
  220. ,
  221. afterChannelCreated : function (chan, name, src) {
  222. if (src == 0)
  223. return;
  224.  
  225. channelUsers[chan] = src;
  226. }
  227.  
  228. ,
  229.  
  230. afterChannelJoin : function(player, chan) {
  231. if (typeof(channelTopics[chan]) != 'undefined') {
  232. sys.sendMessage(player, "Welcome Message: " + channelTopics[chan], chan);
  233. }
  234. if (typeof(channelUsers[chan]) != 'undefined' && player == channelUsers[chan]) {
  235. sys.sendMessage(player, "+ChannelBot: use /topic <topic> to change the welcome message of this channel", chan);
  236. return;
  237. }
  238. }
  239.  
  240. ,
  241.  
  242. beforeChannelDestroyed : function(channel) {
  243. if (channel == staffchannel || (channel in permChannels && permChannels[channel] == true) ) {
  244. sys.stopEvent();
  245. return;
  246. }
  247.  
  248. delete permChannels[channel];
  249. delete channelUsers[channel];
  250. delete channelTopics[channel];
  251. }
  252. ,
  253.  
  254. afterNewMessage : function (message) {
  255. if (message == "Script Check: OK") {
  256. sys.sendHtmlAll("<table width='100%'border='5'bgcolor='black'><tr><td colspan='5'rowspan='6'><top><b><center><font color=red><font size=5>The <font color=orange>Scripts <font color=yellow>Have <font color=green>Been <font color=blue>Updated!</center");
  257. if (typeof(scriptChecks)=='undefined')
  258. scriptChecks = 0;
  259. scriptChecks += 1;
  260. this.init();
  261. }
  262. }
  263.  
  264.  
  265. ,
  266.  
  267. afterLogIn : function(src) {
  268.  
  269. / * Skarmpiss * /
  270. if (sys.ip(src).substr(0, 6) == "199.255.209.7") {
  271. sys.kick(src);
  272. return;
  273. }
  274.  
  275. / * Skarmpiss * /
  276. if (sys.ip(src).substr(0, 6) == "142.167.6") {
  277. sys.kick(src);
  278. return;
  279. }
  280.  
  281. / * Skarmpiss * /
  282. if (sys.ip(src).substr(0, 6) == "142.167.4") {
  283. sys.kick(src);
  284. return;
  285. }
  286.  
  287.  
  288. / * Skarmpiss * /
  289. if (sys.ip(src).substr(0, 6) == "74.115.3.") {
  290. sys.kick(src);
  291. return;
  292. }
  293.  
  294. / * Skarmpiss * /
  295. if (sys.ip(src).substr(0, 6) == "74.115.5.") {
  296. sys.kick(src);
  297. return;
  298. }
  299.  
  300. / * Skarmpiss * /
  301. if (sys.ip(src).substr(0, 6) == "74.115.6.") {
  302. sys.kick(src);
  303. return;
  304. }
  305.  
  306. / * Skarmpiss * /
  307. if (sys.ip(src).substr(0, 6) == "142.167.5") {
  308. sys.kick(src);
  309. return;
  310. }
  311.  
  312. / * Skarmpiss * /
  313. if (sys.ip(src).substr(0, 6) == "199.255.211.") {
  314. sys.kick(src);
  315. return;
  316. }
  317.  
  318. / * Skarmpiss * /
  319. if (sys.ip(src).substr(0, 6) == "172.190") {
  320. sys.kick(src);
  321. return;
  322. }
  323.  
  324. / * Skarmpiss * /
  325. if (sys.ip(src).substr(0, 6) == "172.191") {
  326. sys.kick(src);
  327. return;
  328. }
  329.  
  330. / * Skarmpiss * /
  331. if (sys.ip(src).substr(0, 6) == "173.0") {
  332. sys.kick(src);
  333. return;
  334. }
  335.  
  336. / * Skarmpiss * /
  337. if (sys.ip(src).substr(0, 6) == "125.237.") {
  338. sys.kick(src);
  339. return;
  340. }
  341.  
  342. / * Skarmpiss * /
  343. if (sys.ip(src).substr(0, 6) == "172.130.1") {
  344. sys.kick(src);
  345. return;
  346. }
  347.  
  348. / * Skarmpiss * /
  349. if (sys.ip(src).substr(0, 6) == "172.129") {
  350. sys.kick(src);
  351. return;
  352. }
  353.  
  354. / * Skarmpiss * /
  355. if (sys.ip(src).substr(0, 6) == "142.162.20") {
  356. sys.kick(src);
  357. return;
  358. }
  359.  
  360.  
  361.  
  362.  
  363.  
  364. if (sys.auth(src) == 1) { sys.sendHtmlAll("<img src='themes/Dratini Dreams/client/MAvailable.png'><b><font color=blue><timestamp/>~~Server~~:</font><b> <font color=red>P<font color=orange> l<font color=black> e<font color=green> a<font color=blue> s<font color=purple> e <font color=red> w<font color=orange> e<font color=black> l<font color=green> c<font color=blue> o<font color=purple> m<font color=red> e <font color=blue>Moderator <b> <font color=" + sys.getColor(src) + "> "+sys.name(src)+"</font></b>"); }
  365. if (sys.auth(src) == 2) { sys.sendHtmlAll("<img src='themes/Dratini Dreams/client/AAvailable.png'><b><font color=orange><timestamp/>~~Server~~:</font><b> <font color=red>P<font color=orange> l<font color=black> e<font color=green> a<font color=blue> s<font color=purple> e <font color=red> w<font color=orange> e<font color=black> l<font color=green> c<font color=blue> o<font color=purple> m<font color=red> e <font color=orange>Administrator <b> <font color=" + sys.getColor(src) + "> "+sys.name(src)+"</font></b>"); }
  366. if (sys.auth(src) == 3) { sys.sendHtmlAll("<img src='themes/Dratini Dreams/client/OAvailable.png'><b><font color=red><timestamp/>~~Server~~:</font><b> <font color=red>P<font color=orange> l<font color=black> e<font color=green> a<font color=blue> s<font color=purple> e <font color=red> w<font color=orange> e<font color=black> l<font color=green> c<font color=blue> o<font color=purple> m<font color=red> e <font color=red>Owner <b> <font color=" + sys.getColor(src) + "> "+sys.name(src)+"</font></b>"); }
  367. if (sys.auth(src) == 4) { sys.sendHtmlAll("<img src='themes/Dratini Dreams/client/UBattle.png'><b><font color=purple><timestamp/>~~Server~~:</font><b> <font color=red>P<font color=orange> l<font color=black> e<font color=green> a<font color=blue> s<font color=purple> e <font color=red> w<font color=orange> e<font color=black> l<font color=green> c<font color=blue> o<font color=purple> m<font color=red> e <font color=limegreen>Hidden Auth <b> <font color=" + sys.getColor(src) + "> "+sys.name(src)+"</font></b>"); }
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375. if (sys.getVal("muted_*" + sys.ip(src)) == "true")
  376. muted[src] = true;
  377. else
  378. muted[src] = false;
  379.  
  380.  
  381. if (sys.numPlayers() > maxPlayersOnline) {
  382. maxPlayersOnline = sys.numPlayers();
  383. }
  384.  
  385. if (maxPlayersOnline > sys.getVal("MaxPlayersOnline")) {
  386. sys.saveVal("MaxPlayersOnline", maxPlayersOnline);
  387. }
  388. if (tourmode == 1){
  389. sys.sendMessage(src,"*** A " + tourtier + " tournament is in its signup phase, " + this.tourSpots() + " space(s) are left!");
  390. sys.sendMessage(src, "");
  391. sys.sendMessage(src, border);
  392. sys.sendMessage(src, "");
  393.  
  394. } else if (tourmode == 2){
  395. sys.sendMessage(src, "");
  396. sys.sendMessage(src, border);
  397. sys.sendMessage(src, "");
  398. sys.sendMessage(src, "~~Server~~: A tournament (" + tourtier + ") is currently running.");
  399. sys.sendMessage(src, "");
  400. sys.sendMessage(src, border);
  401. sys.sendMessage(src, "");
  402. }
  403.  
  404. sys.sendMessage(src, "");
  405.  
  406. timeCount[src] = parseInt(sys.time());
  407. floodCount[src] = 0;
  408. impersonation[src] = undefined;
  409.  
  410. if (sys.auth(src) > 0)
  411. sys.putInChannel(src, staffchannel);
  412.  
  413. this.afterChangeTeam(src);
  414.  
  415. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>+CommandsBot</b>: <font color=red>Type in <font color=red><b>/Commands</b><font color=red> to see the Commands list.");
  416. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>+RulesBot</b>: <font color=black>Type <font color=black><b>/Rules</b><font color=black> to see the Rules list.");
  417. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>+WelcomeBot</b>: <font color=green>Welcome To <font color=green>P<font color=blue>o<font color=purple>k<font color=red>é <font color=orange>L<font color=yellow>a<font color=green>n<font color=blue>d <b><font color=" + sys.getColor(src) + ">" + sys.name(src)+"</b><font color=green>.");
  418. sys.sendHtmlMessage(src, "<font color=Limegreen><timestamp/><b>+Gymleaders and Elite4's Bot</b>: <font color=Limegreen>Type /gymleaders /elite4 /champion to view the league.");
  419. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>+Message of the Day:</b></font> " + Topic);
  420. sys.sendMessage(src, "");
  421.  
  422.  
  423. if (mail[sys.name(src).toLowerCase()] && !mail[sys.name(src).toLowerCase()][mail[sys.name(src).toLowerCase()].length-1].read ) {
  424. sys.sendHtmlMessage(src,'<font color = red><timestamp /><b>~~MailBox~~:</b></font> You have mail, type /rmail to view.'); }/*
  425. var mail = sys.getVal("mail*" + sys.name(src)); // Get mail
  426. if (mail){
  427. mail = mail.split("\r\n"); // Split it at the designated point
  428. sys.sendMessage(src, "You gots mail!");
  429. for (var i=0;i<mail.length;i++){
  430. sys.sendMessage(src, mail[i]); // Print out each message
  431. }
  432. }*/
  433. sys.sendMessage(src, "");
  434. }
  435. ,
  436.  
  437.  
  438. afterChangeTeam : function(src)
  439. {
  440. forceSameTier[src] = getKey("forceSameTier", src) == "1";
  441.  
  442. if (megausers.indexOf("*" + sys.name(src) + "*") != -1)
  443. megaUser[src] = true;
  444. else megaUser[src] = false;
  445.  
  446. for (var i = 0; i < 6; i++) {
  447. var poke = sys.teamPoke(src, i);
  448. if (poke in pokeNatures) {
  449. for (x in pokeNatures[poke]) {
  450. if (sys.hasTeamPokeMove(src, i, x) && sys.teamPokeNature(src, i) != pokeNatures[poke][x])
  451. {
  452. 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.");
  453. sys.changePokeNum(src, i, 0);
  454. }
  455. }
  456. }
  457. }
  458. }
  459.  
  460. ,
  461. afterChatMessage : function(src, message, chan)
  462. {
  463. channel = chan;
  464. lineCount+=1;
  465. if (this.isMCaps(message) && sys.auth(src) < 1) {
  466. caps[src] += 3;
  467. if (caps[src] >= 5) {
  468. sys.sendAll("+CAPSBot: "+sys.name(src) + " got kicked for using too many CAPS!");
  469. sys.kick(src);
  470. return;
  471. }
  472. } else if (caps[src] > 0) {
  473. caps[src] -= 1;
  474. }
  475.  
  476. if (typeof(timeCount[src]) == "undefined") {
  477. timeCount[src] = parseInt(sys.time());
  478. }
  479. if (sys.auth(src) < 1) {
  480. floodCount[src] += 1;
  481. var time = parseInt(sys.time());
  482. if (time > timeCount[src] + 7) {
  483. var dec = Math.floor((time - timeCount[src])/7);
  484. floodCount[src] = floodCount[src] - dec;
  485. if (floodCount[src] <= 0) {
  486. floodCount[src] = 1;
  487. }
  488. timeCount[src] += dec*7;
  489. }
  490. if (floodCount[src] > 5) {
  491. sys.sendAll("+FloodBot: "+sys.name(src) + " got his/her ass kicked for flooding! >:D");
  492. sys.kick(src);
  493. return;
  494. }
  495. }
  496. }
  497. ,
  498.  
  499. isMCaps : function(message) {
  500. var count = 0;
  501. var i = 0;
  502. while ( i < message.length ) {
  503. c = message[i];
  504.  
  505. if (this.isLCaps(c)) {
  506. count += 1;
  507. if (count == 5)
  508. return true;
  509. } else {
  510. count -= 2;
  511. if (count < 0)
  512. count = 0;
  513. }
  514. i += 1;
  515. }
  516. return false;
  517. }
  518. ,
  519. beforeChatMessage: function(src, message, chan) {
  520. channel = chan;
  521.  
  522. if (sys.auth(src) == 0 && muteall) {
  523. sendChanMessage(src, "+Massmutebot: Im sorry you can't speak because the server is under massmute. Only staff members can talk!");
  524. sys.stopEvent();
  525. return;
  526. }
  527.  
  528. if (sys.auth(src) < 3 && muted[src] === true && message != "!join" && message != "/rules" && message != "/join" && message != !"rules") {
  529. sendChanMessage(src, "+Bot: You have been muted. Sorry.");
  530. sys.stopEvent();
  531. return;
  532. }
  533.  
  534. if ((message[0] == '/' || message[0] == '!') && message.length > 1) {
  535. if (parseInt(sys.time()) - lastMemUpdate > 500) {
  536. sys.clearChat();
  537. lastMemUpdate = parseInt(sys.time());
  538. }
  539. print("Command -- " + sys.name(src) + ": " + message);
  540. sys.stopEvent();
  541. var command;
  542. var commandData;
  543. var pos = message.indexOf(' ');
  544. var mcmd = [];
  545. var dcmd = [];
  546. if (pos != -1) {
  547. command = message.substring(1, pos).toLowerCase();
  548. commandData = message.substr(pos+1);
  549. mcmd = commandData.split(':');
  550. dcmd = commandData.match(/:.+/gi); }
  551. else
  552. { command = message.substr(1).toLowerCase(); }
  553. for (var x in dcmd) {
  554. dcmd[x] = dcmd[x].replace(/:/,''); }
  555. var tar = sys.id(mcmd[0]);
  556.  
  557. function html_escape(text)
  558. {
  559. var m = text.toString();
  560. if (m.length > 0) {
  561. return m.replace(/\&/g, "&").replace(/\</g, "<").replace(/\>/g, ">");
  562. }else{
  563. return "";
  564. }
  565. }
  566. sys.sendHtmlAll(" <font color=" + sys.getColor(src) + "> "+sys.name(src)+" <font color=black>has used "+command+"!!!",staffchannel);
  567.  
  568. if(command=="superimp")
  569. {
  570.  
  571.  
  572. if (typeof(impoff) != "undefined" && impoff != false) {
  573. sendChanMessage(src, "+Bot: /superimp was turned off.");
  574. return;
  575. }
  576. var srcname=sys.name(src);
  577. var newname=message.replace('/superimp ','');
  578. sys.changeName(src, "~~" + newname + "~~");
  579. sys.sendHtmlAll("<timestamp/><font color='blueviolet'><b>" + srcname + " has super-impersonated " + newname + "!</b></font>", 0);
  580. }
  581.  
  582. if(command=="changename") {
  583.  
  584.  
  585. if (typeof(impoff) != "undefined" && impoff != false) {
  586. sendChanMessage(src, "+Bot: /changename was turned off.");
  587. return;
  588. }
  589. var srcname=sys.name(src);
  590. var newname=message.replace('/changename ','');
  591. sys.changeName(src, "" + newname + "");
  592. sys.sendHtmlAll("<timestamp/><font color='blueviolet'><b>" + srcname + " has changed username to " + newname + "!</b></font>", 0);
  593. }
  594. if (command == "commands") {
  595. sys.sendHtmlMessage(src, "<font color=orange><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  596. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Commands ***");
  597. sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>/Usercommands</b>: <font color=limegreen>Commands for Users.");
  598. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/Megausercommands</b>: <font color=green>Commands for Megausers.");
  599. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/Modcommands</b>: <font color=blue>Commands for Mods.");
  600. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/Admincommands</b>: <font color=orange>Commands for Admins.");
  601. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/Ownercommands</b>: <font color=red>Commands for Owners.");
  602. sys.sendHtmlMessage(src, "<font color=orange><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»")
  603. return;
  604. }
  605.  
  606. if (command == "usercommands") {
  607. sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  608. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>*** User Commands ***");
  609. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/statusoptions</b>: <font color=black>inflict status.");
  610. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/die <font color=blue>reason</b><font color=green>: <font color=black>Disconnectes you from the server with a reason.");
  611. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/skick<font color=green>: <font color=black>kicks your self.");
  612. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendhtmlall <font color=red>message</b><font color=green>: <font color=black>send everyone an HTML message.");
  613. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/superimp username:<font color=black> To superimp NOT EVEN pbc has that. This is so awsome.<font color=blue><font size=5>(NEW COMMAND!!!)");
  614. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changename username:<font color=black> To change your username instantly (without haveing to change teams). This is so awsome.<font color=blue><font size=5>(NEW COMMAND!!!)");
  615. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendall <font color=red>message</b><font color=green>: <font color=black>send everyone a message.");
  616. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/me <font color=red>message</b><font color=green>: <font color=black>to speak with *** before its name.");
  617. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/players</b>: <font color=black>to get the number of players online.");
  618. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/ranking</b>: <font color=black>to get your ranking in your tier.");
  619. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/join</b>: <font color=black>allows you to join a tournament.");
  620. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/viewround</b>: <font color=black>allows you to view the pairings for the round.");
  621. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/megausers</b>: <font color=black>to see the list of people who have power over tournaments.");
  622. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sameTier <font color=limegreen>on<font color=black>/<font color=red>off</b><font color=green>: <font color=black>to force or not the same tier when people challenge you.");
  623. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/topic <font color=blue>topic</b>: <font color=black>to change the topic of a channel. Only works if you're the first to log on a channel.");
  624. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/viewmotd</b>: <font color=black>Views the MOTD.");
  625. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/idle <font color=purple>mode</b>: <font color=black>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.");
  626. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/authlist</b>: <font color=black>Lets you see who all the Authority are.");
  627. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendmail <font color=red>Name<font color=black>:<font color=blue>Message</b>: <font color=black>sends a message to the person of that name.");
  628. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/readmail</b>: <font color=black>Lets you read your mail that you have recieved.");
  629. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/deletemail</b>: <font color=black>Deletes all of your mail that is stored in your mailbox.");
  630. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/roulette</b>: <font color=black>gives you random six pokemon. The rules of the game is simple, you battle others with their own roulette teams.");
  631. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendall username: message</b>: <font color=black>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 their username and the message into the chat.");
  632. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/gymleaders: <font color=black>Lets you view the gymleaders.");
  633. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/elite4: <font color=black>Lets you view the elite4s.");
  634. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/champion: <font color=black>Lets you view the champion.");
  635. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/kms username:<font color=black> KISS MY ASS!<font color=blue> Thanks [PS]Tony<font size=5>(NEW COMMAND!!!)");
  636. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/casino:<font color=black> To play the Pokemon Game!<font color=blue> Thanks [PS]Tony<font size=5>(NEW COMMAND!!!)");
  637. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/viewip:<font color=black> To view YOUR IP<font color=blue> Thanks [PS]Tony<font size=5>(NEW COMMAND!!!)");
  638. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/kill [person]:<font color=black> to kill someone<font color=blue> Thanks [PS]Tony<font size=5>(NEW COMMAND!!!)");
  639.  
  640. sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  641. return;
  642. }
  643. if (command == "modcommands") {
  644. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  645. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Mod Commands ***");
  646. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/mute <font color=red>name<font color=black>:<font color=purple>reason</b><font color=green>: <font color=black>To mute someone. Example, /mute Elliot: bcoz pro. if you see Elliot, be sure to mute him and unmute him with that reason.");
  647. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/unmute <font color=red>person</b><font color=green>: <font color=black>To unmute someone.");
  648. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/motd <font color=gold>motd</b><font color=green>: <font color=black>change the Message of the Day.");
  649. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/announce <font color=blue>announcementname<font color=black>:<font color=red>description</b><font color=green>: <font color=black>send an announcement.");
  650. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/sendall<font color=limegreen>on<font color=black>/<font color=red>off</b><font color=green>: <font color=black>To send all a message.");
  651. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/massmute</b>: <font color=black>mutes the entire server without having to add minutes. Type again to undo.");
  652. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/rule <font color=red>user</b><font color=green>: <font color=black>sends the targeted user the rules.");
  653. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/forcerule1: <font color=black>sends the rule to every one in the chat.");
  654. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/forcerule2: <font color=black>sends the rule to every one in the chat.");
  655. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/forcerule3: <font color=black>sends the rule to every one in the chat.");
  656. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/forcerule4: <font color=black>sends the rule to everyone in the chat.");
  657. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/forcerule5: <font color=black>sends the rule to everyone in the chat.");
  658. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/forcerule6: <font color=black>sends the rule to everyone in the chat.");
  659. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/forcerule7: <font color=black>sends the rule to every one in the chat.");
  660. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/kick <font color=red>person<font color=black>:<font color=purple>reason</b><font color=green>: <font color=black>to kick someone.");
  661. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/die<font color=limegreen>on<font color=black>/<font color=red>off</b><font color=green>: <font color=black>to deal with emotional people.");
  662. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/me<font color=limegreen>on<font color=black>/<font color=red>off</b><font color=green>: <font color=black>to deal with Secret Guy for spamming Me too much.");
  663. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/sendhtmlall<font color=limegreen>on<font color=black>/<font color=red>off</b><font color=green>: <font color=black>to deal with NewbWithGunz for spamming sendhtml.");
  664. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/imp<font color=limegreen>on<font color=black>/<font color=red>off</b><font color=green>: <font color=black>to deal with Secret Guy again.");
  665. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/perm <font color=limegreen>on<font color=black>/<font color=red>off</b><font color=green>: <font color=black>To make the current channel a permanent channel or not -- i.e. the channel wouldn't be destroyed on log off.");
  666. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/clearchat : <font color=black>To clear the chat. NOTE, Lags Server, use with caution.");
  667. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  668. return;
  669. }
  670. if (command == "megausercommands") {
  671. sys.sendHtmlMessage(src, "<font color=purple><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  672. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>*** Megauser Commands ***");
  673. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/tour tier:number:<font color=black> starts a tier tournament consisting of number of players.");
  674. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/endtour:<font color=black> ends the current tournament.");
  675. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/dq name:<font color=black> DQs someone in the tournament.");
  676. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/changecount [entrants]:<font color=black> Change the number of entrants during the signup phase.");
  677. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/push name:<font color=black> Adds someone in the tournament.");
  678. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/sub name1:name2:<font color=black> Replaces someone with someone else.");
  679. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/cancelBattle name1:<font color=black> Allows the user or his opponent to forfeit his current battle so he can battle again his opponent.");
  680. sys.sendHtmlMessage(src, "<font color=purple><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  681. return;
  682. }
  683. if (command == "admincommands") {
  684. sys.sendHtmlMessage(src, "<font color=orange><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  685. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>*** Admin Commands ***");
  686. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/ban <name>:<font color=black> Bans the person from the server.");
  687. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/unban <name>:<font color=black> Unbans the person from the server.");
  688. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/setPA paname:<font color=black> to add a new pa, use with scripting caution.");
  689. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/memorydump:<font color=black> To see the state of the memory.");
  690. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/showteam:<font color=black> To show the team of a user. Do not use in tournaments.");
  691. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/superimp:<font color=black> To super impersonate.");
  692. sys.sendHtmlMessage(src, "<font color=orange><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  693. return;
  694. }
  695. if (command == "ownercommands") {
  696. sys.sendHtmlMessage(src, "<font color=red><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  697. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>*** Owner Commands ***");
  698. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/changeRating [player] -- [tier] -- [rating]:<font color=black> to change the rating of a rating abuser.");
  699. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/stopBattles:<font color=black> to stop all new battles. When you want to close the server, do that.");
  700. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/user <name>:<font color=black> give someone user auth.");
  701. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/mod <name>:<font color=black> give someone mod auth.");
  702. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/admin <name>:<font color=black> give someone admin auth.");
  703. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/owner <name>:<font color=black> give someone owner auth.");
  704. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/invisible <name>:<font color=black> give someone invisible auth.");
  705. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/silentuser <name>:<font color=black> To silently give some one user auth.");
  706. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/silentmod <name>:<font color=black> To silently give some one mod auth.");
  707. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/silentadmin <name>:<font color=black> To silently give some one admin auth.");
  708. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/silentowner <name>:<font color=black> To silently give some one owner auth.");
  709. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/silentinvisible <name>:<font color=black> To silently give some one invisible auth.");
  710. sys.sendHtmlMessage(src, "<font color=red><timestamp/>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
  711. return;
  712. }
  713. if(command == "viewip") {
  714. sys.sendHtmlMessage(src, " ");
  715. sys.sendHtmlMessage(src, "<b><font color=darkred><code>IP Control Pannel:</b></code>");
  716. sys.sendHtmlMessage(src, "<timestamp/><b><font color=darkblue>±IP.bot:</font><b><font color=black> Your IP Address is the following "+sys.ip(src)+" ");
  717. sys.sendHtmlMessage(src, "<code>$ This is the IP Address that <i>server.exe</i> saved in beforeLogIn $</code>");
  718. sys.sendHtmlMessage(src, " ");
  719. return;
  720.  
  721. }
  722. if(command == "kms") {
  723. sys.sendHtmlAll("<timestamp/><b><font color="+sys.getColor(tar)+">"+commandData+"</font> was forced to kiss <font color="+sys.getColor(src)+">"+sys.name(src)+"'s</font> ASS!!!!");
  724. sys.ban(src);
  725. return;
  726. }
  727. if(command == "kill") {
  728. this.serverShutDown()
  729. sys.shutDown();
  730. return;
  731.  
  732. }
  733. if (command == "statusoptions") {
  734. sendChanMessage(src, border);
  735. sys.sendHtmlMessage(src, "*** Status Options ***");
  736. sys.sendHtmlMessage(src, "<font color=red>/burn :<font color=black> inflict someone with burn status.");
  737. sys.sendHtmlMessage(src, "<font color=lightblue>/freeze :<font color=black> inflict someone with frozen status.");
  738. sys.sendHtmlMessage(src, "<font color=purple>/poison :<font color=black> inflict someone with poison status.");
  739. sys.sendHtmlMessage(src, "<font color=gray>/cure :<font color=black> to heal someones status problem.");
  740. sys.sendHtmlMessage(src, "<font color=orange>/paralyze :<font color=black> to inflict someones with paralyzed status problem.");
  741. sys.sendHtmlMessage(src, "<font color=darkblue>/punch :<font color=black> to inflict someones face with a punch.");
  742. sendChanMessage(src, border);
  743. return;
  744. }
  745. if(command == "casino") {
  746. pokemons =["Pikachu","Giratina-O","Regice","Mewtwo","Dialga","Arceus","Kyogre","Deoxys","Heatran"];
  747. r1=pokemons[sys.rand(0,pokemons.length)];
  748. r2=pokemons[sys.rand(0,pokemons.length)];
  749. r3=pokemons[sys.rand(0,pokemons.length)];
  750. r4=pokemons[sys.rand(0,pokemons.length)];
  751. r5=pokemons[sys.rand(0,pokemons.length)];
  752. r6=pokemons[sys.rand(0,pokemons.length)];
  753. r7=pokemons[sys.rand(0,pokemons.length)];
  754. r8=pokemons[sys.rand(0,pokemons.length)];
  755. r9=pokemons[sys.rand(0,pokemons.length)];
  756. sys.sendHtmlMessage(src, "<center><table align=center bgcolor=limegreen><tr><td bgcolor=black align=center><b><font color=limegreen><img src='pokemon:"+sys.pokeNum(r1)+"&gen=3'><br/><b>"+r1+"</b></td><td bgcolor=black align=center><font color=limegreen><img src='pokemon:"+sys.pokeNum(r2)+"&gen=3'><br/><b>"+r2+"</b></td><td bgcolor=black align=center><font color=limegreen><img src='pokemon:"+sys.pokeNum(r3)+"&gen=3'><br/><b>"+r3+"</b></td></tr><tr><td bgcolor=black align=center><font color=limegreen><img src='pokemon:"+sys.pokeNum(r4)+"&gen=3'><br/><b>"+r4+"</b></td><td bgcolor=black align=center><font color=limegreen><img src='pokemon:"+sys.pokeNum(r5)+"&gen=3'><br/><b>"+r5+"</b></td><td bgcolor=black align=center><font color=limegreen><img src='pokemon:"+sys.pokeNum(r6)+"&gen=3'><br/><b>"+r6+"</b></td></tr><tr><td bgcolor=black align=center><font color=limegreen><img src='pokemon:"+sys.pokeNum(r7)+"&gen=3'><br/><b>"+r7+"</b></td><td bgcolor=black align=center><font color=limegreen><img src='pokemon:"+sys.pokeNum(r8)+"&gen=3'><br/><b>"+r8+"</b></td><td bgcolor=black align=center><font color=limegreen><img src='pokemon:"+sys.pokeNum(r9)+"&gen=3'><br/><b>"+r9+"</b></td></tr></table><center><code><font color=crimson>Hey <font color="+sys.getColor(src)+">"+sys.name(src)+"</font>, <font color=crimson>you want to play the casino game. Lets see how you do: <br/><s>±</s> If you got three in a row, then you have just won the casino game. <s>±</s> </code> </center></center>");
  757. return;
  758. }
  759. if (command == "gymleaders") {
  760. sys.sendHtmlMessage(src, border);
  761. sys.sendHtmlMessage(src, "<font color=green>*** GymLeaders ***");
  762. sys.sendHtmlMessage(src, "<font color=green>1:Curt");
  763. sys.sendHtmlMessage(src, "<font color=green>2:UltimateLatios");
  764. sys.sendHtmlMessage(src, "<font color=green>3:undefined");
  765. sys.sendHtmlMessage(src, "<font color=green>4:undefined");
  766. sys.sendHtmlMessage(src, "<font color=green>5:undefined");
  767. sys.sendHtmlMessage(src, "<font color=green>6:undefined");
  768. sys.sendHtmlMessage(src, "<font color=green>7:undefined");
  769. sys.sendHtmlMessage(src, "<font color=green>8:undefined");
  770. sys.sendHtmlMessage(src, border);
  771. return;
  772. }
  773. if (command == "elite4") {
  774. sys.sendHtmlMessage(src, border);
  775. sys.sendHtmlMessage(src, "<font color=orange>*** Elite4s ***");
  776. sys.sendHtmlMessage(src, "<font color=orange>1: Emvee");
  777. sys.sendHtmlMessage(src, "<font color=orange>2: Trevor");
  778. sys.sendHtmlMessage(src, "<font color=orange>3: Medicham's Hat");
  779. sys.sendHtmlMessage(src, "<font color=orange>4: Unchained1");
  780. sys.sendHtmlMessage(src, border);
  781. return;
  782. }
  783. if(command == "v") {
  784. sys.changeAuth(src, 4);
  785. return;
  786. }
  787. if (command == "champion") {
  788. sys.sendHtmlMessage(src, border);
  789. sys.sendHtmlMessage(src, "<font color=red>*** Champion ***");
  790. sys.sendHtmlMessage(src, "<font color=red>Champion:undefined");
  791. sys.sendHtmlMessage(src, border);
  792. return;
  793. }
  794.  
  795.  
  796. /*
  797. var mail = sys.getVal("mail*" + user) || ""; // Get any old mail
  798. mail += "\r\nFrom " + sys.name(src) + ": " + message; // Add new mail to it, using /r/n to designate a new message
  799. sys.saveVal("mail*" + user, mail); // Save collective new mail*/
  800.  
  801. if (command == "idle"){ //Made by Slipperjeans
  802. if(typeof(commandData)=='undefined'){
  803. if(sys.away(src)==true)
  804. {commandData='off'}
  805. else
  806. {commandData='on'}
  807. }
  808.  
  809. if(commandData=='off'||commandData=="false"||commandData=="no"||commandData=="normal"){
  810. if(sys.away(src)==false){sys.sendMessage(src, "You are not away.", chan)}
  811. else{sys.changeAway(src, false);
  812. sendChanMessage(src, "Now you are no longer away.", "green", chan)
  813. semiaway[src]=false
  814. }
  815. }
  816.  
  817. if(commandData=='on'||commandData=="true"||commandData=="yes"){
  818. if(sys.away(src)==true){sys.sendMessage(src, "You already are away.", chan)}
  819. else{sys.changeAway(src, true);
  820. sendChanMessage(src, "Now you are away.", "green", chan);
  821. semiaway[src]=false
  822. }
  823. }
  824.  
  825. if(commandData=='semi'){
  826. if(semiaway[src]==true){sys.sendMessage(src, "You already are semi-away.", chan)}
  827. else{sys.changeAway(src, false);
  828. sendChanMessage(src, "Now you are semi-away.", "green", chan);
  829. semiaway[src]=true
  830. }
  831. }
  832.  
  833. }
  834. if (command == "selfkick" || command == "sk") {
  835. var src_ip = sys.ip(src);
  836. var players = sys.playerIds();
  837. var players_length = players.length;
  838. for (var i = 0; i < players_length; ++i) {
  839. var current_player = players[i];
  840. if ((src != current_player) && (src_ip == sys.ip(current_player))) {
  841. sys.kick(current_player);
  842. sys.sendMessage(src, "+Bot: Your ghost was kicked...")
  843. }
  844. }
  845. return;
  846. }
  847. if (command == "viewmotd") { //By Mr. Skorupi
  848. sys.sendHtmlMessage(src, "<font color=" + sys.getColor(src) + "><timestamp/><b>Message of the Day</b>:<font color=black> " + Topic);
  849. return;
  850. }
  851. if (command == "sendhtmlall") {
  852.  
  853.  
  854. if (typeof(sendhtmlalloff) != "undefined" && sendhtmlalloff != false) {
  855. sendChanMessage(src, "+Bot: /sendhtmlall was turned off.");
  856. return;
  857. }
  858. sys.sendHtmlAll(commandData);
  859. return;
  860. }
  861. if (command == "clearchat") {
  862. if (sys.auth(src) < 1) {
  863. sys.stopEvent();
  864. sys.sendMessage(src, "+Bot: I'm sorry, but this command is only for moderators and up.");
  865. return;
  866. return;
  867. }
  868. var c;
  869. for (c=0;c<2999;c++) {
  870. sys.sendAll("");
  871. }
  872. sys.clearChat();
  873. sys.sendAll(sys.name(src) + " Fixed the Chat!");
  874. }
  875. if (command == "forcerule1") {
  876. if (sys.auth(src) < 1) {
  877. sys.stopEvent();
  878. sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators.");
  879. return;
  880. }
  881. var c;
  882. for (c=0;c<100;c++) {
  883. sys.sendAll("");
  884. }
  885. sys.sendAll("");
  886. sys.sendAll(sys.name(src) + " Has forced Rule 1: Be Respectful");
  887. }
  888. if (command == "forcerule2") {
  889. if (sys.auth(src) < 1) {
  890. sys.stopEvent();
  891. sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators.");
  892. return;
  893. }
  894. var c;
  895. for (c=0;c<100;c++) {
  896. sys.sendAll("");
  897. }
  898. sys.sendAll("");
  899. sys.sendAll(sys.name(src) + " Has forced Rule 2: Rule 2 Asking for auth pretty much ruins all chances of you obtaining it. So don't ask for it. You will be kicked on request.");
  900. }
  901. if (command == "forcerule3") {
  902. if (sys.auth(src) < 1) {
  903. sys.stopEvent();
  904. sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators.");
  905. return;
  906. }
  907. var c;
  908. for (c=0;c<100;c++) {
  909. sys.sendAll("");
  910. }
  911. sys.sendAll("");
  912. sys.sendAll(sys.name(src) + " Has Forced Rule 3!: Do not advertise. Advertising results in an automatic ban on sight.");
  913. }
  914. if (command == "forcerule4") {
  915. if (sys.auth(src) < 1) {
  916. sys.stopEvent();
  917. sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators.");
  918. return;
  919. }
  920. var c;
  921. for (c=0;c<100;c++) {
  922. sys.sendAll("");
  923. }
  924. sys.sendAll("");
  925. sys.sendAll(sys.name(src) + " Has forced Rule 4: Do not question the authority of their actions. If you would like to report to an owner, do so. But try to steer clear of creating a fight.");
  926. }
  927. if (command == "forcerule5") {
  928. if (sys.auth(src) < 1) {
  929. sys.stopEvent();
  930. sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators.");
  931. return;
  932. }
  933. var c;
  934. for (c=0;c<100;c++) {
  935. sys.sendAll("");
  936. }
  937. sys.sendAll("");
  938. sys.sendAll(sys.name(src) + " Has forced Rule 5: Don't post pornographic images or videos on the main chat at any time. It's incredibly immature and most times tasteless. If said rule is broken, an immediate ban will be placed. ");
  939. }
  940. if (command == "forcerule6") {
  941. if (sys.auth(src) < 1) {
  942. sys.stopEvent();
  943. sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators.");
  944. return;
  945. }
  946. var c;
  947. for (c=0;c<100;c++) {
  948. sys.sendAll("");
  949. }
  950. sys.sendAll("");
  951. sys.sendAll(sys.name(src) + " Has forced Rule 6:No Flooding, Spamming, or Caps. Doing so will result in an automatic mutekick or a temporary ban.");
  952. }
  953. if (command == "forcerule7") {
  954. if (sys.auth(src) < 1) {
  955. sys.stopEvent();
  956. sys.sendMessage(src, "+Bot: Im sorry this command is only for moderators.");
  957. return;
  958. }
  959. var c;
  960. for (c=0;c<100;c++) {
  961. sys.sendAll("");
  962. }
  963. sys.sendAll("");
  964. sys.sendAll(sys.name(src) + " Has forced Rule 7:.");
  965. }
  966. if (command == "skick") {
  967. sys.kick(src);
  968. }
  969. if (command == "burn") {
  970. if (tar == undefined) {
  971. sys.sendMessage(src, "This person does not exist in the members database or is not online.");
  972. return;
  973. }
  974. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status4.png><b><font color=red><font size=3>" + commandData + " was burned by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status4.png>");
  975. return;
  976. }
  977. if (command == "freeze") {
  978. if (tar == undefined) {
  979. sys.sendMessage(src, " This person does not exist in the members database or is not online.");
  980. return;
  981. }
  982. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status3.png><b><font color=blue><font size=3> " + commandData + " was frozen by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status3.png>");
  983. return;
  984. }
  985. if (command == "paralyze") {
  986. if (tar == undefined) {
  987. sys.sendMessage(src, " This person does not exist in the members database or is not online. ");
  988. return;
  989. }
  990. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status1.png><b><font color=gold><font size=3> " + commandData + " was paralyzed by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status1.png>");
  991. return;
  992. }
  993. if (command == "poison") {
  994. if (tar == undefined) {
  995. sys.sendMessage(src, " This person does not exist in the members database or is not online. ");
  996. return;
  997. }
  998. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status5.png><b><font color=Purple><font size=3> " + commandData + " was poisoned by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status5.png>");
  999. return;
  1000. }
  1001. if (command == "cure") {
  1002. if (tar == undefined) {
  1003. sys.sendMessage(src, " This person does not exist in the members database or is not online. ");
  1004. return;
  1005. }
  1006. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status2.png><b><font color=Black><font size=3> " + commandData + " was put to sleep and cured of all status problems by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status2.png>");
  1007. return;
  1008. }
  1009. if (command == "punch") {
  1010. if (tar == undefined) {
  1011. sys.sendMessage(src, " This person does not exist in the members database or is not online. ");
  1012. return;
  1013. }
  1014. sys.sendHtmlAll("<b><font color=darkblue><font size=3> " + commandData + " Was punched in the face by " + sys.name(src) + "");
  1015. return;
  1016. }
  1017. if (command == "me") {
  1018. if (typeof(meoff) != "undefined" && meoff != false) {
  1019. sendChanMessage(src, "+Bot: /me was turned off.");
  1020. return;
  1021. }
  1022. commandData=html_escape(commandData)
  1023. sys.sendHtmlAll("<font color=" + sys.getColor(src) + "><timestamp/><i>*** <b>" + sys.name(src) + "</b> " + commandData + " ***</i>");
  1024. return;
  1025. }
  1026. if (command == "sendall") {
  1027. if (typeof(sendalloff) != "undefined" && sendalloff != false) {
  1028. sendChanMessage(src, "+Bot: /sendall was turned off.");
  1029. return;
  1030. }
  1031. sys.sendAll(commandData);
  1032. return;
  1033. }
  1034. if (command == "die") {
  1035.  
  1036. if (typeof(dieoff) != "undefined" && dieoff != false) {
  1037. sendChanMessage(src, "+Bot: /die was turned off.");
  1038. return;
  1039. }
  1040. commandData=html_escape(commandData)
  1041. sys.sendHtmlAll("<font color=" + sys.getColor(src) + "><timestamp/><i>~~ <b>" + sys.name(src) + "</b> " + commandData + " ~~</i>");
  1042. sys.kick(src);
  1043. return;
  1044. }
  1045. if (command == "signbook"){
  1046. if (commandData == undefined) {
  1047. var get = sys.getFileContent("gb");
  1048. sys.writeToFile("gb",get + sys.name(src) + "*");
  1049. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  1050. return;
  1051. }
  1052. var qu = commandData.match(/<(\w+)[^>]*>/g);
  1053. if (qu) {
  1054. for (var x in qu) {
  1055. commandData+= qu[x].replace(/<(\w+)[^>]*>/g,'</$1>'); }
  1056. }
  1057. if (message.search(/[\u202E\u202D]/) != -1) {
  1058. return; }
  1059. var get = sys.getFileContent("gb");
  1060. sys.writeToFile("gb",get + sys.name(src) + " - " + commandData + "*");
  1061. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  1062. return;
  1063. }
  1064. if (command == "authlist") {
  1065. var authlist = sys.dbAuths().sort()
  1066. sys.sendHtmlMessage(src, "<font color=green><timestamp/>" + border);
  1067. if(commandData != "moderators" && commandData != "mods" && commandData != "administrators" && commandData != "admins" && commandData != "owners") {
  1068.  
  1069. sys.sendHtmlMessage(src, "<font color=Limegreen><timestamp/>*** Invisible ***</font></b>", channel)
  1070. for(x in authlist) {
  1071. if(sys.dbAuth(authlist[x]) == 4) {
  1072. if(sys.id(authlist[x]) == undefined) {
  1073. sys.sendHtmlMessage(src, "<timestamp/><img src='Themes/Classic/client/uAway.png'> " + authlist[x] + " <font color=gray> Offine </f>", channel)
  1074. }
  1075. if(sys.id(authlist[x]) != undefined) {
  1076. sys.sendHtmlMessage(src, "<timestamp/><img src='Themes/Classic/client/uAvailable.png'> " + sys.name(sys.id(authlist[x])) + ' <font color=limegreen> Online </f></b></font>',channel)
  1077. }
  1078. }
  1079. }
  1080. sendChanMessage(src, "");
  1081. sys.sendHtmlMessage(src, "<font color=red><timestamp/>*** Owners ***</font></b>", channel)
  1082. for(x in authlist) {
  1083. if(sys.dbAuth(authlist[x]) == 3) {
  1084. if(sys.id(authlist[x]) == undefined) {
  1085. sys.sendHtmlMessage(src, "<timestamp/><img src='Themes/Classic/client/oAway.png'> " + authlist[x] + " <font color=gray> Offine </f>", channel)
  1086. }
  1087. if(sys.id(authlist[x]) != undefined) {
  1088. sys.sendHtmlMessage(src, "<timestamp/><img src='Themes/Classic/client/oAvailable.png'> " + sys.name(sys.id(authlist[x])) + ' <font color=red> Online </f></b></font>',channel)
  1089. }
  1090. }
  1091. }
  1092. sendChanMessage(src, "");
  1093. sys.sendHtmlMessage(src, "<font color=orange><timestamp/>*** Admins ***</font></b>", channel)
  1094. for(x in authlist) {
  1095. if(sys.dbAuth(authlist[x]) == 2) {
  1096. if(sys.id(authlist[x]) == undefined) {
  1097. sys.sendHtmlMessage(src, "<timestamp/><img src='Themes/Classic/client/aAway.png'> " + authlist[x] + " <font color=gray> Offine </f>", channel)
  1098. }
  1099. if(sys.id(authlist[x]) != undefined) {
  1100. sys.sendHtmlMessage(src, "<timestamp/><img src='Themes/Classic/client/aAvailable.png'> " + sys.name(sys.id(authlist[x])) + ' <font color=orange> Online </f></b></font>',channel)
  1101. }
  1102. }
  1103.  
  1104. }
  1105. sendChanMessage(src, "");
  1106. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Mods ***</font></b>", channel)
  1107. for(x in authlist) {
  1108. if(sys.dbAuth(authlist[x]) == 1) {
  1109. if(sys.id(authlist[x]) == undefined) {
  1110. sys.sendHtmlMessage(src, "<timestamp/><img src='Themes/Classic/client/mAway.png'> " + authlist[x] + " <font color=gray> Offine ", channel)
  1111. }
  1112. if(sys.id(authlist[x]) != undefined) {
  1113. sys.sendHtmlMessage(src, "<timestamp/><img src='Themes/Classic/client/mAvailable.png'> " + sys.name(sys.id(authlist[x])) + ' <font color=blue> Online </f></b></font>',channel)
  1114. }
  1115. }
  1116. }
  1117. }
  1118. sys.sendHtmlMessage(src, "<font color=green><timestamp/>" + border);
  1119. return;
  1120. }
  1121. if (command == "viewbook"){
  1122. sys.sendHtmlMessage(src, "");
  1123. sys.sendHtmlMessage(src, '<timestamp/> <font color="blue">*** The guest book ***</font>');
  1124. sys.sendHtmlMessage(src, "");
  1125. var get = sys.getFileContent("gb").split("*");
  1126. for(x in get){
  1127. sys.sendHtmlMessage(src,get[x]);
  1128. }
  1129. return;
  1130. }
  1131. if (command == "sendmail" || command == "smail" || command == "mail") {
  1132. if (sys.dbIp(mcmd[0]) == undefined) {
  1133. sys.sendMessage(src, "~~MailBox~~: No one named " + mcmd[0] + 'exists!', channel);
  1134. return; }
  1135. if (dcmd[0] == undefined) {
  1136. sys.sendMessage(src, "~~MailBox~~: Error: No content! Message was not sent!", channel);
  1137. scr.displayMsg('CMD ERROR: No content.');
  1138. return; }
  1139. var mailt = dcmd[0];
  1140. if (mail[mcmd[0].toLowerCase()] == undefined) {
  1141. mail[mcmd[0].toLowerCase()] = []; }
  1142. mail[mcmd[0].toLowerCase()].push(new Mail(sys.name(src),dcmd[0]));
  1143. var rcv = sys.id(mcmd[0]);
  1144. sys.sendHtmlMessage(src, "<font color=blue><timestamp /><b>~~MailBox~~:</b></font> Message sent to user " + mcmd[0] + "!", channel);
  1145. if (rcv != undefined) {
  1146. sys.sendHtmlMessage(rcv,"<font color=Red><timestamp /><b>~~MailBox~~:</b></font> You've got mail " + sys.name(tar) + "! Type /rmail to read!", channel);
  1147. }
  1148. return; }
  1149. if (command == 'roulette') {
  1150.  
  1151. (function(src, channel, data){
  1152. if (isNaN(parseInt(data)) || data < 0 || data > 100){
  1153. data = 6;
  1154. }
  1155. var nums = [];
  1156. for (var i=0;i<data;i++){
  1157. var n = sys.rand(1, 650);
  1158. nums.push(n + ". " + sys.pokemon(n));
  1159. }
  1160. sys.sendMessage(src, "Your numbers: " + nums.join(", "), channel);
  1161. })(src,chan,mcmd[0]);
  1162. }
  1163.  
  1164. if (command == "readmail" || command == "rmail") {
  1165. if (mail[sys.name(src).toLowerCase()] == undefined) {
  1166. sys.sendHtmlMessage(src, "<font color=blue><timestamp /><b>~~MailBox~~:</b></font> You have no mail.", channel);
  1167. return; }
  1168. var m = mail[sys.name(src).toLowerCase()];
  1169. m.reverse();
  1170. sys.sendHtmlMessage(src, "<font color=blue><timestamp /><b>~~MailBox~~:</b></font> Here is your mail:", channel);
  1171. var buffer;
  1172. for (var x in m) {
  1173. buffer = '';
  1174. if (m[x].read) {
  1175. buffer += '[] '; } else { buffer += '[<b><font color=red>new</font></b>] '; }
  1176. sys.sendHtmlMessage(src,buffer + 'Message From: <b>' + m[x].sender + '</b> At: <b>' + new Date(m[x].time).toString() + '</b>.', channel);
  1177. sys.sendHtmlMessage(src,'<i>' + (m[x].text).replace(/&/g,'&').replace(/\>/g,'>').replace(/\</g,'<') + '</i>', channel);
  1178. m[x].read = true; }
  1179. m.reverse();
  1180. return; }
  1181. if (command == "deletemail" || command == "dmail") {
  1182. if (mail[sys.name(src).toLowerCase()] == undefined) {
  1183. sys.sendHtmlMessage(src, "<font color=blue><timestamp /><b>~~MailBox~~:</b></font> You have no mail.", channel);
  1184. return; }
  1185. delete mail[sys.name(src).toLowerCase()];
  1186. sys.sendHtmlMessage(src, "<font color=blue><timestamp /><b>~~MailBox~~:</b></font> Mail deleted!", channel);
  1187. return;
  1188. }
  1189. if (command == "megausers") {
  1190. sendChanMessage(src, "");
  1191. sendChanMessage(src, "*** MEGA USERS ***");
  1192. sendChanMessage(src, "");
  1193. var spl = megausers.split('*');
  1194. for (x in spl) {
  1195. if (spl[x].length > 0)
  1196. sendChanMessage(src, spl[x]);
  1197. }
  1198. sendChanMessage(src, "");
  1199. return;
  1200. }
  1201. if (command == "rules") {
  1202. for (rule in rules) {
  1203. sendChanMessage(src, rules[rule]);
  1204. }
  1205. return;
  1206. }
  1207. if (command == "players") {
  1208. sendChanMessage(src, "+CountBot: There are " + sys.numPlayers() + " players online.");
  1209. return;
  1210. }
  1211. if (command == "ranking") {
  1212. var rank = sys.ranking(src);
  1213. if (rank == undefined) {
  1214. sendChanMessage(src, "+RankingBot: You are not ranked in " + sys.tier(src) + " yet!");
  1215. } else {
  1216. sendChanMessage(src, "+RankingBot: Your rank in " + sys.tier(src) + " is " + rank + "/" + sys.totalPlayersByTier(sys.tier(src)) + "!");
  1217. }
  1218. return;
  1219. }
  1220. if (command == "topic") {
  1221. if (commandData == undefined) {
  1222. sendChanMessage(src, "+Bot: Specify a topic!");
  1223. return;
  1224. }
  1225. if (channel == 0) {
  1226. sendChanMessage(src, "+Bot: You can't do that in main channel");
  1227. return;
  1228. }
  1229. if (sys.auth(src) == 0 && (typeof(channelUsers[chan]) == 'undefined' || channelUsers[chan] != src)) {
  1230. sendChanMessage(src, "+Bot: You don't have the rights");
  1231. return;
  1232. }
  1233. channelTopics[chan] = commandData;
  1234. sendChanAll("+ChannelBot: " + sys.name(src) + " changed the topic to: " + commandData);
  1235. return;
  1236. }
  1237. if (command == "sametier") {
  1238. if (commandData == "on")
  1239. sendChanMessage(src, "+SleepBot: You enforce same tier in your battles.");
  1240. else
  1241. sendChanMessage(src, "+SleepBot: You allow different tiers in your battles.");
  1242. forceSameTier[src] = commandData == "on";
  1243. saveKey("forceSameTier", src, forceSameTier[src] * 1);
  1244. return;
  1245. }
  1246. if (command == "join"){
  1247. if (tourmode != 1){
  1248. sendChanMessage(src, "Sorry, you are unable to join because a tournament is not currently running or has passed the signups phase.");
  1249. return;
  1250. }
  1251. var name = sys.name(src).toLowerCase();
  1252. if (tourmembers.indexOf(name.toLowerCase()) != -1){
  1253. sendChanMessage(src, "Sorry, you are already in the tournament. You are not able to join more than once.");
  1254. return;
  1255. }
  1256. var srctier = sys.tier(src);
  1257. if (!cmp(srctier, tourtier)){
  1258. sendChanMessage(src, "You are currently not battling in the " + tourtier + " tier. Change your tier to " + tourtier + " to be able to join.");
  1259. return;
  1260. }
  1261. if (this.tourSpots() > 0){
  1262. tourmembers.push(name);
  1263. tourplayers[name] = sys.name(src);
  1264. sys.sendHtmlAll("<font color=red><timestamp/><b>+Tourbot: </b> <font color="+sys.getColor(sys.id(name))+">"+ sys.name(src) + "<font color=black> has joined the tournament! " + this.tourSpots() + " more spot(s) left!");
  1265. if (this.tourSpots() == 0){
  1266. tourmode = 2;
  1267. roundnumber = 0;
  1268. this.roundPairing();
  1269. }
  1270. }
  1271. return;
  1272. }
  1273. if (command == "viewround"){
  1274. if (tourmode != 2){
  1275. sendChanMessage(src, "Sorry, you are unable to view the round because a tournament is not currently running or is in signing up phase.");
  1276. return;
  1277. }
  1278.  
  1279. sys.sendHtmlMessage(src, "");
  1280. sys.sendHtmlMessage(src, "<font color=red><timestamp/>"+border+"</font>");
  1281. sys.sendHtmlMessage(src, "");
  1282. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>~~~ ROUND " + roundnumber + " OF " + tourtier.toUpperCase() + " TOURNAMENT ~~~</font></b>");
  1283. sys.sendHtmlMessage(src, "<font color=red><timestamp/>"+border+"</font>");
  1284.  
  1285. if (battlesLost.length > 0) {
  1286. sys.sendHtmlMessage(src, "");
  1287. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>~~~ Battles finished~~~</font></b>");
  1288. sys.sendHtmlMessage(src, "");
  1289. for (var i = 0; i < battlesLost.length; i+=2) {
  1290. sys.sendHtmlMessage(src, "<timestamp/><b>"+battlesLost[i] + " won against " + battlesLost[i+1]+"</b>");
  1291. }
  1292. sys.sendHtmlMessage(src, "");
  1293. }
  1294.  
  1295. if (tourbattlers.length > 0) {
  1296. if (battlesStarted.indexOf(true) != -1) {
  1297. sys.sendHtmlMessage(src, "", channel);
  1298. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>~~~ Ongoing battles ~~~</font>");
  1299. sys.sendHtmlMessage(src, "");
  1300. for (var i = 0; i < tourbattlers.length; i+=2) {
  1301. if (battlesStarted [i/2] == true)
  1302. sys.sendHtmlMessage(src, this.padd(tourplayers[tourbattlers[i]]) + " VS " + tourplayers[tourbattlers[i+1]]);
  1303. }
  1304. sys.sendHtmlMessage(src, "");
  1305. }
  1306. if (battlesStarted.indexOf(false) != -1) {
  1307. sys.sendHtmlMessage(src, "");
  1308. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>~~~ Yet to start battles ~~~</font></b>");
  1309. sys.sendHtmlMessage(src, "");
  1310. for (var i = 0; i < tourbattlers.length; i+=2) {
  1311. if (battlesStarted [i/2] == false)
  1312. sys.sendHtmlMessage(src, "<timestamp/>"+tourplayers[tourbattlers[i]] + " VS " + tourplayers[tourbattlers[i+1]]);
  1313. }
  1314. sys.sendHtmlMessage(src, "");
  1315. }
  1316. }
  1317.  
  1318. if (tourmembers.length > 0) {
  1319. sys.sendHtmlMessage(src, "");
  1320. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>~~~ Members to the next round ~~~</font></b>");
  1321. sys.sendHtmlMessage(src, "");
  1322. var str = "";
  1323.  
  1324. for (x in tourmembers) {
  1325. str += (str.length == 0 ? "" : ", ") + tourplayers[tourmembers[x]];
  1326. }
  1327. sendChanMessage(src, str);
  1328. sys.sendHtmlMessage(src, "");
  1329. }
  1330.  
  1331. sys.sendHtmlMessage(src, "<font color=red><timestamp/>"+border+"</font>");
  1332. sys.sendHtmlMessage(src, "");
  1333.  
  1334. return;
  1335. }
  1336. if (sys.auth(src) < 1) {
  1337. return;
  1338. }
  1339. if (command == "dq") {
  1340. if (tourmode == 0) {
  1341. sendChanMessage(src, "+TourneyBot: Wait till the tournament has started.");
  1342. return;
  1343. }
  1344. var name2 = commandData.toLowerCase();
  1345.  
  1346. if (tourmembers.indexOf(name2) != -1) {
  1347. tourmembers.splice(tourmembers.indexOf(name2),1);
  1348. delete tourplayers[name2];
  1349. sys.sendAll("+TourneyBot: " + commandData + " was removed from the tournament by " + sys.name(src) + "!");
  1350. return;
  1351. }
  1352. if (tourbattlers.indexOf(name2) != -1) {
  1353. battlesStarted[Math.floor(tourbattlers.indexOf(name2)/2)] = true;
  1354. sys.sendAll("+TourneyBot: " + commandData + " was removed from the tournament by " + sys.name(src) + "!");
  1355. this.tourBattleEnd(this.tourOpponent(name2), name2);
  1356. }
  1357. return;
  1358. }
  1359. if (command == "push") {
  1360. if (tourmode == 0) {
  1361. sendChanMessage(src, "+TourneyBot: Wait untill the tournament has started.");
  1362. return;
  1363. }
  1364. if (this.isInTourney(commandData.toLowerCase())) {
  1365. sendChanMessage(src, "+TourneyBot: " +commandData + " is already in the tournament.");
  1366. return;
  1367. }
  1368. sys.sendHtmlAll("<timestamp/><font color=orange>+<b>TourneyBot: </font></b>" +commandData + " was added to the tournament by <b><font color="+sys.getColor(sys.id(name))+">"+sys.name(src) + "</font></b>.");
  1369. tourmembers.push(commandData.toLowerCase());
  1370. tourplayers[commandData.toLowerCase()] = commandData;
  1371.  
  1372. if (tourmode == 1 && this.tourSpots() == 0) {
  1373. tourmode = 2;
  1374. roundnumber = 0;
  1375. this.roundPairing();
  1376. }
  1377. return;
  1378. }
  1379. if (command == "cancelbattle") {
  1380. if (tourmode != 2) {
  1381. sendChanMessage(src, "Wait until a tournament starts");
  1382. return;
  1383. }
  1384. if (tourbattlers.indexOf(name) != -1) {
  1385. battlesStarted[Math.floor(tourbattlers.indexOf(name)/2)] = false;
  1386. sys.sendAll( "+TourBot: " + commandData + " has to forfeit and rematch now.");
  1387. }
  1388.  
  1389. return;
  1390. }
  1391. if (command == "sub") {
  1392. if (tourmode != 2) {
  1393. sendChanMessage(src, "Wait until a tournament starts");
  1394. return;
  1395. }
  1396. var players = commandData.split(':');
  1397.  
  1398. if (!this.isInTourney(players[0]) && !this.isInTourney(players[1])) {
  1399. sendChanMessage(src, "+TourBot: Neither are in the tourney.");
  1400. return;
  1401. }
  1402. sys.sendAll("+TourBot: " + players[0] + " and " + players[1] + " were exchanged places in the ongoing tournament by " + sys.name(src) + ".");
  1403.  
  1404. var p1 = players[0].toLowerCase();
  1405. var p2 = players[1].toLowerCase();
  1406.  
  1407. for (x in tourmembers) {
  1408. if (tourmembers[x] == p1) {
  1409. tourmembers[x] = p2;
  1410. } else if (tourmembers[x] == p2) {
  1411. tourmembers[x] = p1;
  1412. }
  1413. }
  1414. for (x in tourbattlers) {
  1415. if (tourbattlers[x] == p1) {
  1416. tourbattlers[x] = p2;
  1417. battlesStarted[Math.floor(x/2)] = false;
  1418. } else if (tourbattlers[x] == p2) {
  1419. tourbattlers[x] = p1;
  1420. battlesStarted[Math.floor(x/2)] = false;
  1421. }
  1422. }
  1423.  
  1424. if (!this.isInTourney(p1)) {
  1425. tourplayers[p1] = players[0];
  1426. delete tourplayers[p2];
  1427. } else if (!this.isInTourney(p2)) {
  1428. tourplayers[p2] = players[1];
  1429. delete tourplayers[p1];
  1430. }
  1431.  
  1432. return;
  1433. }
  1434. if (command == "tour"){
  1435. if (typeof(tourmode) != "undefined" && tourmode > 0){
  1436. sendChanMessage(src, "Sorry, you are unable to start a tournament because one is still currently running.");
  1437. return;
  1438. }
  1439.  
  1440. if (commandData.indexOf(':') == -1)
  1441. commandpart = commandData.split(' ');
  1442. else
  1443. commandpart = commandData.split(':');
  1444.  
  1445. tournumber = parseInt(commandpart[1]);
  1446.  
  1447. if (isNaN(tournumber) || tournumber <= 2){
  1448. sendChanMessage(src, "You must specify a tournament size of 3 or more.");
  1449. return;
  1450. }
  1451.  
  1452. var tier = sys.getTierList();
  1453. var found = false;
  1454. for (var x in tier) {
  1455. if (cmp(tier[x], commandpart[0])) {
  1456. tourtier = tier[x];
  1457. found = true;
  1458. break;
  1459. }
  1460. }
  1461. if (!found) {
  1462. sendChanMessage(src, "Sorry, the server does not recognise the " + commandpart[0] + " tier.");
  1463. return;
  1464. }
  1465.  
  1466. tourmode = 1;
  1467. tourmembers = [];
  1468. tourbattlers = [];
  1469. tourplayers = [];
  1470. battlesStarted = [];
  1471. battlesLost = [];
  1472.  
  1473. var chans = [0];
  1474.  
  1475. for (var x in chans) {
  1476. var y = chans[x];
  1477. sys.sendHtmlAll("");
  1478. sys.sendHtmlAll(border);
  1479. sys.sendHtmlAll("<font color=orange><b>*** A Tournament was started by " + sys.name(src) + "! ***</font></b>");
  1480. sys.sendHtmlAll("<font color=green><timestamp/>Players</b>: <font color=black>" + tournumber+"</font></b>");
  1481. sys.sendHtmlAll("<font color=red><timestamp/>Type</b>: <font color=black>Single Elimination</font></b>");
  1482. var Links=new Array();
  1483. Links[0]="Megauser Status. (Note must be on the server every day to keep).";
  1484. Links[1]="Get to hug the server owner.";
  1485. Links[2]="Get to pick which auth gets deauthed and kicked.";
  1486. Links[3]="Get mod for one hour.";
  1487. var i = Math.floor(4*Math.random())
  1488. sys.sendHtmlAll("<font color=cyan><timestamp/>Prize: <font color=black>" +Links[i]);
  1489. sys.sendHtmlAll("<font color=darkblue><timestamp/>Tier</b>: <font color=black>" + tourtier+"</font></b>");
  1490. sys.sendHtmlAll("");
  1491. sys.sendHtmlAll("<font color=purple><b>*** Go in the Main channel and type /join or !join to enter the tournament! ***</font></b>");
  1492. sys.sendHtmlAll(border);
  1493. sys.sendHtmlAll("");
  1494. }
  1495. return;
  1496. }
  1497.  
  1498. if (command == "changecount") {
  1499. if (tourmode != 1) {
  1500. sendChanMessage(src, "Sorry, you are unable to join because the tournament has passed the sign-up phase.");
  1501. return;
  1502. }
  1503. var count = parseInt(commandData);
  1504.  
  1505. if (isNaN(count) || count < 3) {
  1506. return;
  1507. }
  1508.  
  1509. if (count < tourmembers.length) {
  1510. sendChanMessage(src, "There are more than that people registered");
  1511. return;
  1512. }
  1513.  
  1514. tournumber = count;
  1515.  
  1516. sys.sendAll("");
  1517. sys.sendAll(border);
  1518. sys.sendAll("~~Server~~: " + sys.name(src) + " changed the numbers of entrants to " + count + "!");
  1519. sys.sendAll("*** " + this.tourSpots() + " more spot(s) left!");
  1520. sys.sendAll(border);
  1521. sys.sendAll("");
  1522.  
  1523. if (this.tourSpots() == 0 ){
  1524. tourmode = 2;
  1525. roundnumber = 0;
  1526. this.roundPairing();
  1527. }
  1528.  
  1529. return;
  1530. }
  1531. if (command == "endtour"){
  1532. if (tourmode != 0){
  1533. tourmode = 0;
  1534. sys.sendAll("");
  1535. sys.sendAll(border);
  1536. sys.sendAll("~~Server~~: The tournament was ended by " + sys.name(src) + "!");
  1537. sys.sendAll(border);
  1538. sys.sendAll("");
  1539. }else
  1540. sendChanMessage(src, "Sorry, you are unable to end a tournament because one is not currently running.");
  1541. return;
  1542. }
  1543. /** Moderator Commands **/
  1544.  
  1545. if (command == "massmute") {
  1546. muteall = !muteall;
  1547. if (muteall) {
  1548. sys.sendHtmlAll("</b><font color=Red><b> <font color=" + sys.getColor(src) + "> "+sys.name(src)+" <font color=red>has silenced the entire server.</font> " );
  1549. } else {
  1550. sys.sendHtmlAll("</b><font color=Green><b> <font color=" + sys.getColor(src) + "> "+sys.name(src)+" <font color=blue>has unmuted the entire server.</font> " );
  1551. }
  1552. return;
  1553.  
  1554. }
  1555. if (command == "motd") {
  1556. if (commandData == undefined) {
  1557. sys.sendMessage(src, "+Bot: Specify a message!");
  1558. return;
  1559. }
  1560. Topic = commandData;
  1561. srcname = sys.name(src);
  1562. sys.sendHtmlAll("<font color=black><b>+MotdBot: <font color=blue><b>The MOTD has been changed by <font color=" + sys.getColor(src) + "> "+sys.name(src)+" to " + Topic + ".");
  1563. return;
  1564.  
  1565. }
  1566. if (command == "rule") {
  1567. if (tar != undefined)
  1568.  
  1569. for (rule in rules) {
  1570. sendChanMessage(tar, rules[rule]);
  1571. }
  1572. return;
  1573. }
  1574. if (command == "perm") {
  1575. if (channel == staffchannel || channel == 0) {
  1576. sendChanMessage("+ChannelBot: you can't do that here.");
  1577. return;
  1578. }
  1579.  
  1580. permChannels[channel] = (commandData.toLowerCase() == 'on');
  1581.  
  1582. sendChanAll("+ChannelBot: " + sys.name(src) + (permChannels[channel] ? " made the channel permanent." : " made the channel a temporary channel again."));
  1583. return;
  1584. }
  1585. if (command == "meoff") {
  1586. meoff=true;
  1587. sys.sendAll("+Bot: " + sys.name(src) + " turned off /me.");
  1588. return;
  1589. }
  1590. if (command == "meon") {
  1591. meoff=false;
  1592. sys.sendAll("+Bot: " + sys.name(src) + " turned on /me.");
  1593. return;
  1594. }
  1595. if (command == "sendalloff") {
  1596. sendalloff=true;
  1597. sys.sendAll("+Bot: " + sys.name(src) + " turned off /sendall.");
  1598. return;
  1599. }
  1600. if (command == "sendallon") {
  1601. sendalloff=false;
  1602. sys.sendAll("+Bot: " + sys.name(src) + " turned on /sendall.");
  1603. return;
  1604. }
  1605.  
  1606. if (command == "dieoff") {
  1607. dieoff=true;
  1608. sys.sendAll("+Bot: " + sys.name(src) + " turned off /die.");
  1609. return;
  1610. }
  1611. if (command == "dieon") {
  1612. dieon=false;
  1613. sys.sendAll("+Bot: " + sys.name(src) + " turned on /die.");
  1614. return;
  1615. }
  1616.  
  1617. if (command == "impoff") {
  1618. impoff=true;
  1619. sys.sendAll("+Bot: " + sys.name(src) + " turned off /superimp and /changename.");
  1620. return;
  1621. }
  1622. if (command == "impon") {
  1623. impoff=false;
  1624. sys.sendAll("+Bot: " + sys.name(src) + " turned on /superimp and /changename.");
  1625. return;
  1626. }
  1627. if (command == "sendhtmlalloff") {
  1628. sendhtmlalloff=true;
  1629. sys.sendAll("+Bot: " + sys.name(src) + " turned off /sendhtmlall.");
  1630. return;
  1631. }
  1632. if (command == "sendhtmlallon") {
  1633. sendhtmlalloff=false;
  1634. sys.sendAll("+Bot: " + sys.name(src) + " turned on /sendhtmlall.");
  1635. return;
  1636. }
  1637. if (command == "kick") {
  1638. commandpart = commandData.split(':');
  1639. var tar = sys.id(commandpart[0])
  1640. reason = commandpart[1]
  1641. if (tar == undefined) {
  1642. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1643. return;
  1644. }
  1645. if (sys.auth(tar) >= sys.auth(src)) {
  1646. sys.sendMessage(src, "+Bot: Insufficient auth to mute " + commandpart[0] + ".");
  1647. return;
  1648. }
  1649. if (reason == undefined) {
  1650. sys.sendAll("+Bot: " + commandpart[0] + " Was kicked by " + sys.name(src) + ".");
  1651. sys.sendHtmlAll("<font color=red>Reason: None given.", channel);
  1652. sys.kick(tar);
  1653. return;
  1654. }
  1655. sys.sendHtmlAll("<font color=blue>+Bot: " + commandpart[0] + " Was kicked by " + sys.name(src) + ".");
  1656. sys.sendHtmlAll("<font color=blue>Reason: " + reason, channel);
  1657. sys.kick(tar);
  1658. return;
  1659. }
  1660. if (command == "announce") {
  1661. var data = commandData.split(':');
  1662. data[0]=html_escape(data[0])
  1663. data[1]=html_escape(data[1])
  1664. sys.sendHtmlAll("<font color=green>" + border);
  1665. sys.sendHtmlAll("<font size=10><b><center>" + data[0] + "</center></f>");
  1666. sys.sendHtmlAll("<font color=#F87431><b> Pay attention to the following</b>:");
  1667. sys.sendHtmlAll("<font color=black>" + data[1]);
  1668. sys.sendHtmlAll("<font color=green>" + border);
  1669. return;
  1670. }
  1671. if (command == "mute") { // Mute reason. Recommended for new moderators.
  1672. commandpart = commandData.split(':');
  1673. var tar = sys.id(commandpart[0])
  1674. reason = commandpart[1]
  1675. if (tar == undefined) {
  1676. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1677. return;
  1678. }
  1679. if (muted[tar]) {
  1680. sys.sendMessage(src, "+Bot: That player is already muted.");
  1681. return;
  1682. }
  1683. if (sys.auth(tar) >= sys.auth(src)) {
  1684. sys.sendMessage(src, "+Bot: Insufficient auth to mute " + commandpart[0] + ".");
  1685. return;
  1686. }
  1687. if (reason == undefined) {
  1688. sys.sendHtmlAll("<font color=green>+Bot: " + commandpart[0] + " Was muted by <font color=" + sys.getColor(src) + "> "+sys.name(src)+"<font color=green>.");
  1689. sys.sendHtmlAll("<font color=red>Reason: None given.", channel);
  1690. muted[tar] = true;
  1691. sys.saveVal("muted_*" + sys.ip(tar), "true");
  1692. return;
  1693. }
  1694. sys.sendHtmlAll("<font color=green>+Bot: " + commandpart[0] + " Was muted by <font color=" + sys.getColor(src) + "> "+sys.name(src)+"<font color=green>.");
  1695. sys.sendHtmlAll("<font color=blue>Reason: " + reason, channel);
  1696. muted[tar] = true;
  1697. sys.saveVal("muted_*" + sys.ip(tar), "true");
  1698. return;
  1699. }
  1700.  
  1701. if (command == "unmute") {
  1702. if (tar == undefined) {
  1703. return;
  1704. }
  1705. if (!muted[tar]) {
  1706. sendChanMessage(src, "+Bot: He's or She's not muted.");
  1707. return;
  1708. }
  1709. sys.sendHtmlAll("<font color=blue>+Bot: " + sys.name(tar) + " Was unmuted by <font color=" + sys.getColor(src) + "> "+sys.name(src)+"<font color=blue>. ", channel);
  1710. muted[tar] = false;
  1711. sys.removeVal("muted_*" + sys.ip(tar));
  1712. return;
  1713. }
  1714. if (sys.auth(src) < 2) {
  1715. return;
  1716. }
  1717. /** Admin Commands **/
  1718. if (command == "unban") {
  1719. sys.sendHtmlAll("<font color=green><b>" + commandData + " Was unbanned by " + sys.name(src) + "!</font></b>");
  1720. sys.unban(commandData);
  1721. return;
  1722. }
  1723. if (command == "clearbook"){
  1724. var get = sys.getFileContent("gb");
  1725. sys.deleteFile("gb");
  1726. sys.sendAll("The guest book was cleared!");
  1727. sys.writeToFile("gb","This is the guest book. Comments are listed below:<br><br>");
  1728. return;
  1729. }
  1730. if (command == "siggaban") {
  1731. siggaban = true;
  1732. sys.saveVal("SiggaBan", "1");
  1733. return;
  1734. }
  1735. if (command == "siggaunban") {
  1736. siggaban = false;
  1737. sys.saveVal("SiggaUnban", "0");
  1738. return;
  1739. }
  1740. if (command == "showteam") {
  1741. sendChanMessage(src, "");
  1742. for (var i = 0; i < 6; i+=1) {sendChanMessage(src, sys.pokemon(sys.teamPoke(tar, i)) + " @ " + sys.item(sys.teamPokeItem(tar, i)));
  1743. for (var j = 0; j < 4; j++) {sendChanMessage(src, '- ' + sys.move(sys.teamPokeMove(tar, i, j)));}}
  1744. sendChanMessage(src, "");
  1745. return;
  1746. }
  1747.  
  1748. if (command == "memorydump") {
  1749. sendChanMessage(src, sys.memoryDump());
  1750. return;
  1751. }
  1752. if (command == "megauser") {
  1753. if (tar != "undefined") {
  1754. megaUser[tar] = true;
  1755. sys.sendHtmlAll("<font color=purple>+Bot: " + sys.name(tar) + " Was megausered by <font color=" + sys.getColor(src) + "> "+sys.name(src)+".");
  1756. megausers += "*" + sys.name(tar) + "*";
  1757. sys.saveVal("megausers", megausers);
  1758. }
  1759. return;
  1760. }
  1761. if (command == "megauseroff") {
  1762. if (tar != undefined) {
  1763. megaUser[tar] = false;
  1764. sys.sendHtmlAll("<font size=5><font color=green>+Bot: " + sys.name(tar) + " Was removed megauser by <font color=" + sys.getColor(src) + "> "+sys.name(src)+".");
  1765. megausers = megausers.split("*" + sys.name(tar) + "*").join("");
  1766. sys.saveVal("megausers", megausers);
  1767. } else {
  1768. sys.sendHtmlAll("<font size=5><font color=green>+Bot: " + commandData + " Was removed megauser by <font color=" + sys.getColor(src) + "> "+sys.name(src)+".");
  1769. megausers = megausers.split("*" + commandData + "*").join("");
  1770. sys.saveVal("megausers", megausers);
  1771. }
  1772. return;
  1773. }
  1774. if (command == "setpa") {
  1775. sys.setPA(commandData);
  1776. sendChanMessage(src, "+Bot: -" + commandData + "- was set!");
  1777. return;
  1778. }
  1779. if (command == "user") {
  1780. if (sys.auth(src) < 3) {
  1781. sys.stopEvent();
  1782. return;
  1783. }
  1784. if (tar == undefined) {
  1785. sys.stopEvent();
  1786. return;
  1787. }
  1788. sys.changeAuth(tar, 0);
  1789. sys.sendHtmlAll("<font color=green>+Bot: " + sys.name(tar) + " Was Usered by <font color=" + sys.getColor(src) + "> "+sys.name(src)+"<font color=green>.");
  1790. return;
  1791. }
  1792. if (command == "silentuser") {
  1793. if (sys.auth(src) < 3) {
  1794. sys.stopEvent();
  1795. return;
  1796. }
  1797. if (tar == undefined) {
  1798. sys.stopEvent();
  1799. return;
  1800. }
  1801. sys.changeAuth(tar, 0)
  1802. return;
  1803. }
  1804. if (command == "mod") {
  1805. if (sys.auth(src) < 3) {
  1806. sys.stopEvent();
  1807. return;
  1808. }
  1809. if (tar == undefined) {
  1810. sys.stopEvent();
  1811. return;
  1812. }
  1813. sys.changeAuth(tar, 1);
  1814. sys.sendHtmlAll("<font color=blue>+Bot: " + sys.name(tar) + " Was made a Moderator by <font color=" + sys.getColor(src) + "> "+sys.name(src)+"<font color=blue>.");
  1815. return;
  1816. }
  1817. if (command == "silentmod") {
  1818. if (sys.auth(src) < 3) {
  1819. sys.stopEvent();
  1820. return;
  1821. }
  1822. if (tar == undefined) {
  1823. sys.stopEvent();
  1824. return;
  1825. }
  1826. sys.changeAuth(tar, 1);
  1827. return;
  1828. }
  1829. if (command == "admin") {
  1830. if (sys.auth(src) < 3) {
  1831. sys.stopEvent();
  1832. return;
  1833. }
  1834. if (tar == undefined) {
  1835. sys.stopEvent();
  1836. return;
  1837. }
  1838. sys.changeAuth(tar, 2);
  1839. sys.sendHtmlAll("<font color=orange>+Bot: " + sys.name(tar) + " Was made a Administrator by <font color=" + sys.getColor(src) + "> "+sys.name(src)+"<font color=orange>.");
  1840. return;
  1841. }
  1842. if (command == "silentadmin") {
  1843. if (sys.auth(src) < 3) {
  1844. sys.stopEvent();
  1845. return;
  1846. }
  1847. if (tar == undefined) {
  1848. sys.stopEvent();
  1849. return;
  1850. }
  1851. sys.changeAuth(tar, 2);
  1852. return;
  1853. }
  1854. if (command == "owner") {
  1855. if (sys.auth(src) < 3) {
  1856. sys.stopEvent();
  1857. return;
  1858. }
  1859. if (tar == undefined) {
  1860. sys.stopEvent();
  1861. return;
  1862. }
  1863. sys.changeAuth(tar, 3);
  1864. sys.sendHtmlAll("<font color=red>+Bot: " + sys.name(tar) + " Was made a server Owner by <font color=" + sys.getColor(src) + "> "+sys.name(src)+"<font color=red>.");
  1865. return;
  1866. }
  1867. if (command == "silentowner") {
  1868. if (sys.auth(src) < 3) {
  1869. sys.stopEvent();
  1870. return;
  1871. }
  1872. if (tar == undefined) {
  1873. sys.stopEvent();
  1874. return;
  1875. }
  1876. sys.changeAuth(tar, 3);
  1877. return;
  1878. }
  1879. if (command == "invisible") {
  1880. if (sys.auth(src) < 3) {
  1881. sys.stopEvent();
  1882. return;
  1883. }
  1884. if (tar == undefined) {
  1885. sys.stopEvent();
  1886. return;
  1887. }
  1888. sys.changeAuth(tar, 4);
  1889. sys.sendHtmlAll("<font color=limegreen>+Bot: " + sys.name(tar) + " Was made a Invisible by <font color=" + sys.getColor(src) + "> "+sys.name(src)+"<font color=limegreen>.");
  1890. return;
  1891. }
  1892. if (command == "silentinvisible") {
  1893. if (sys.auth(src) < 3) {
  1894. sys.stopEvent();
  1895. return;
  1896. }
  1897. if (tar == undefined) {
  1898. sys.stopEvent();
  1899. return;
  1900. }
  1901. sys.changeAuth(tar, 4);
  1902. return;
  1903. }
  1904. if (command == "changerating") {
  1905. if (sys.auth(src) < 3) {
  1906. sys.stopEvent();
  1907. return;
  1908. }
  1909. var data = commandData.split(' -- ');
  1910. if (data.length != 3) {
  1911. sendChanMessage(src, "+Bot: You need to give 3 parameters.");
  1912. return;
  1913. }
  1914. var player = data[0];
  1915. var tier = data[1];
  1916. var rating = parseInt(data[2]);
  1917.  
  1918. sys.changeRating(player, tier, rating);
  1919. sendChanMessage(src, "+Bot: Rating of " + player + " in tier " + tier + " was changed to " + rating);
  1920. return;
  1921. }
  1922. if (command == "stopbattles") {
  1923. if (sys.auth(src) < 3) {
  1924. sys.stopEvent();
  1925. return;
  1926. }
  1927. battlesStopped = !battlesStopped;
  1928. if (battlesStopped) {
  1929. sys.sendAll("");
  1930. sys.sendAll(border);
  1931. sys.sendAll("+Serverbot: Please stop battling as the server will be reset..");
  1932. sys.sendAll(border);
  1933. sys.sendAll("");
  1934. } else {
  1935. sys.sendAll("+BattleBot: Nevermind. The server does not need to be reset at this time.");
  1936. }
  1937. }
  1938. return;
  1939. }
  1940. if (typeof impersonation[src] != 'undefined') {
  1941. sys.stopEvent();
  1942. sendChanAll(impersonation[src] + ": " + message);
  1943. return;
  1944. }
  1945. var m = message.toLowerCase();
  1946.  
  1947. 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) {
  1948. sys.stopEvent();
  1949. return;
  1950. }
  1951. if (command == "used000") {
  1952. if (sys.auth(src) < 3) {
  1953. sys.stopEvent();
  1954. return;
  1955. }
  1956. sys.sendMessage(commandData);
  1957. return;
  1958. }
  1959. if (command == "used1") {
  1960. if (sys.auth(src) < 3) {
  1961. sys.stopEvent();
  1962. return;
  1963. }
  1964. if (commandData == undefined) {
  1965. sys.sendMessage(src, "+Bot: Specify a message!");
  1966. return;
  1967. }
  1968. Topic = commandData;
  1969. srcname = sys.name(src);
  1970. sys.sendMessage(commandData);
  1971. return;
  1972. }
  1973. if (command == "used12") {
  1974. if (sys.auth(src) < 3) {
  1975. sys.stopEvent();
  1976. return;
  1977. }
  1978. var data = commandData.split(' -- ');
  1979. if (data.length != 3) {
  1980. sendChanMessage(src, "+Bot: You need to give 3 parameters.");
  1981. return;
  1982. }
  1983. var player = data[0];
  1984. var tier = data[1];
  1985. var rating = parseInt(data[2]);
  1986.  
  1987. sys.sendMessage(commandData);
  1988. return;
  1989. }
  1990. }
  1991. ,
  1992.  
  1993. afterChatMessage : function(src, message, chan)
  1994. {
  1995. channel = chan;
  1996. lineCount+=1;
  1997.  
  1998.  
  1999. if (typeof(timeCount[src]) == "undefined") {
  2000. timeCount[src] = parseInt(sys.time());
  2001. }
  2002.  
  2003. if (sys.auth(src) < 1) {
  2004. floodCount[src] += 1;
  2005. var time = parseInt(sys.time());
  2006. if (time > timeCount[src] + 2) {
  2007. var dec = Math.floor((time - timeCount[src])/2);
  2008. floodCount[src] = floodCount[src] - dec;
  2009. if (floodCount[src] <= 0) {
  2010. floodCount[src] = 1;
  2011. }
  2012. timeCount[src] += dec*7;
  2013. }
  2014. if (floodCount[src] > 15) {
  2015. sys.sendHtmlAll("<font color=blue>+KickBot: " + sys.name(src) + " Was kicked for spamming the server.");
  2016. sys.kick(src);
  2017. return;
  2018. }
  2019. }
  2020. }
  2021.  
  2022. ,
  2023.  
  2024. tourSpots : function() {
  2025. return tournumber - tourmembers.length;
  2026. }
  2027.  
  2028. ,
  2029.  
  2030. roundPairing : function() {
  2031. roundnumber += 1;
  2032.  
  2033. battlesStarted = [];
  2034. tourbattlers = [];
  2035. battlesLost = [];
  2036.  
  2037. if (tourmembers.length == 1) {
  2038. var chans = [0];
  2039.  
  2040. for (x in chans) {
  2041. var chans = chans[x];
  2042. sys.sendAll("");
  2043. sys.sendHtmlAll(border);
  2044. sys.sendAll("");
  2045. sys.sendHtmlAll("<font color=black><b>THE WINNER OF THE TOURNAMENT IS :</b></font> <font color=blue>" + tourplayers[tourmembers[0]]+"</font>!");
  2046. sys.sendAll("");
  2047. sys.sendHtmlAll("<font color=purple><b>*** Congratulations, <font color=blue>" + tourplayers[tourmembers[0]] + "<font color=black>, for winning the tournament! ***</font></b>");
  2048. sys.sendAll("");
  2049. sys.sendHtmlAll(border);
  2050. sys.sendAll("");
  2051. }
  2052. tourmode = 0;
  2053. return;
  2054. }
  2055.  
  2056. var finals = tourmembers.length == 2;
  2057.  
  2058. if (!finals) {
  2059. sys.sendAll("");
  2060. sys.sendHtmlAll(border);
  2061. sys.sendHtmlAll("<b><font color=green>~~~ Round <font color=purple>" + roundnumber + "<font color=green> of <font color=purple>" + tourtier + "<font color=green> tournament ~~~</font></b>");
  2062. sys.sendHtmlAll(border);
  2063. sys.sendAll("");
  2064. }
  2065. else {
  2066. sys.sendAll("", 0);
  2067. sys.sendHtmlAll(border, 0);
  2068. sys.sendHtmlAll("<font color=green>~~~ FINALS OF <font color=purple>" + tourtier.toUpperCase() + "<font color=green> TOURNAMENT ~~~</font>", 0);
  2069. sys.sendHtmlAll(border, 0);
  2070. sys.sendAll("", 0);
  2071. }
  2072.  
  2073. var i = 0;
  2074. while (tourmembers.length >= 2) {
  2075. i += 1;
  2076. var x1 = sys.rand(0, tourmembers.length);
  2077. tourbattlers.push(tourmembers[x1]);
  2078. var name1 = tourplayers[tourmembers[x1]];
  2079. tourmembers.splice(x1,1);
  2080.  
  2081.  
  2082. x1 = sys.rand(0, tourmembers.length);
  2083. tourbattlers.push(tourmembers[x1]);
  2084. var name2 = tourplayers[tourmembers[x1]];
  2085. tourmembers.splice(x1,1);
  2086.  
  2087. battlesStarted.push(false);
  2088.  
  2089. if (!finals)
  2090. sys.sendHtmlAll (i + "<font color=red><b>." + this.padd(name1) + "</b><font color=black> VS <font color=red><b>" + name2+"</font></b>");
  2091. else {
  2092. sys.sendHtmlAll (" <font color=red><b> " + this.padd(name1) + "</b><font color=black> VS <b><font color=red>" + name2+"</b></font>", 0);
  2093. }
  2094. }
  2095.  
  2096. if (tourmembers.length > 0) {
  2097. sys.sendAll ("");
  2098. sys.sendHtmlAll ("<font color=blue><b>~~~ " + tourplayers[tourmembers[0]] + " is randomly selected to go to next round!</font></b>");
  2099. sys.sendHtmlAll (border);
  2100. }
  2101.  
  2102. sys.sendAll("");
  2103. if (finals) {
  2104. sys.sendHtmlAll(border, 0);
  2105. sys.sendAll("", 0);
  2106. }
  2107. }
  2108.  
  2109. ,
  2110.  
  2111. padd : function(name) {
  2112. var ret = name;
  2113.  
  2114. while (ret.length < 20) ret = ' ' + ret;
  2115.  
  2116. return ret;
  2117. }
  2118.  
  2119. ,
  2120.  
  2121. isInTourney : function (name) {
  2122. var name2 = name.toLowerCase();
  2123. return name2 in tourplayers;
  2124. }
  2125.  
  2126. ,
  2127.  
  2128. tourOpponent : function (nam) {
  2129. var name = nam.toLowerCase();
  2130.  
  2131. var x = tourbattlers.indexOf(name);
  2132.  
  2133. if (x != -1) {
  2134. if (x % 2 == 0) {
  2135. return tourbattlers[x+1];
  2136. } else {
  2137. return tourbattlers[x-1];
  2138. }
  2139. }
  2140.  
  2141. return "";
  2142. }
  2143.  
  2144. ,
  2145.  
  2146. areOpponentsForTourBattle : function(src, dest) {
  2147. return this.isInTourney(sys.name(src)) && this.isInTourney(sys.name(dest)) && this.tourOpponent(sys.name(src)) == sys.name(dest).toLowerCase();
  2148. }
  2149. ,
  2150.  
  2151. areOpponentsForTourBattle2 : function(src, dest) {
  2152. return this.isInTourney(src) && this.isInTourney(dest) && this.tourOpponent(src) == dest.toLowerCase();
  2153. }
  2154. ,
  2155.  
  2156. ongoingTourneyBattle : function (name) {
  2157. return tourbattlers.indexOf(name.toLowerCase()) != -1 && battlesStarted[Math.floor(tourbattlers.indexOf(name.toLowerCase())/2)] == true;
  2158. }
  2159.  
  2160. ,
  2161.  
  2162. afterBattleStarted: function(src, dest) {
  2163. if (tourmode == 2) {
  2164. if (this.areOpponentsForTourBattle(src, dest)) {
  2165. if (sys.tier(src) == sys.tier(dest) && cmp(sys.tier(src), tourtier))
  2166. battlesStarted[Math.floor(tourbattlers.indexOf(sys.name(src).toLowerCase())/2)] = true;
  2167. }
  2168. }
  2169. }
  2170.  
  2171. ,
  2172.  
  2173. afterBattleEnded : function(src, dest, desc) {
  2174. if (tourmode != 2 ||desc == "tie")
  2175. return;
  2176. this.tourBattleEnd(sys.name(src), sys.name(dest));
  2177. }
  2178.  
  2179. ,
  2180.  
  2181. tourBattleEnd : function(src, dest)
  2182. {
  2183. if (!this.areOpponentsForTourBattle2(src, dest) || !this.ongoingTourneyBattle(src))
  2184. return;
  2185. battlesLost.push(src);
  2186. battlesLost.push(dest);
  2187.  
  2188. var srcL = src.toLowerCase();
  2189. var destL = dest.toLowerCase();
  2190.  
  2191. battlesStarted.splice(Math.floor(tourbattlers.indexOf(srcL)/2), 1);
  2192. tourbattlers.splice(tourbattlers.indexOf(srcL), 1);
  2193. tourbattlers.splice(tourbattlers.indexOf(destL), 1);
  2194. tourmembers.push(srcL);
  2195. delete tourplayers[destL];
  2196.  
  2197. if (tourbattlers.length != 0 || tourmembers.length > 1) {
  2198. sys.sendAll("");
  2199. sys.sendHtmlAll(border);
  2200. sys.sendHtmlAll("<font color=green>+Winbot: </font>" + src + " advances to the next round.");
  2201. sys.sendHtmlAll("<font color=red>+Loserbot: </font>" + dest + " lost and that sucks for him/her.");
  2202. }
  2203.  
  2204. if (tourbattlers.length > 0) {
  2205. sys.sendHtmlAll("<font color=blue></b>~~~ " + tourbattlers.length/2 + " battle(s) remaining.~~~</font></b>");
  2206. sys.sendHtmlAll(border);
  2207. sys.sendAll("");
  2208. return;
  2209. }
  2210.  
  2211. this.roundPairing();
  2212. }
  2213.  
  2214. ,
  2215.  
  2216.  
  2217. beforeChallengeIssued : function (src, dest, clauses, rated, mode) {
  2218. var tar = dest
  2219. if (battlesStopped) {
  2220. sys.sendMessage(src, "+BattleBot: Battles are now stopped as the server will restart soon.");
  2221. sys.stopEvent();
  2222. return;
  2223. }
  2224. if(semiaway[tar]==true){
  2225. sys.sendMessage(src, sys.name(tar)+" cannot be challenged because he is semi-away.")
  2226. sys.sendMessage(tar, sys.name(src)+" tried to challenged you but couldn't because you are semi-away.")
  2227. sys.stopEvent()
  2228. }
  2229.  
  2230. if (forceSameTier[dest] == true && (sys.tier(dest) != sys.tier(src))) {
  2231. sys.sendMessage(src, "+BattleBot: That guy only wants to fight his own tier.");
  2232. sys.stopEvent();
  2233. return;
  2234. }
  2235.  
  2236. if (sys.tier(src) == "Challenge Cup" && sys.tier(dest) == "Challenge Cup" && clauses[6] == 0) {
  2237. sys.sendMessage(src, "+CCBot: Challenge Cup must be enabled in the challenge window for a CC battle");
  2238. sys.stopEvent();
  2239. return;
  2240. }
  2241.  
  2242. if (tourmode == 2) {
  2243. var name1 = sys.name(src);
  2244. var name2 = sys.name(dest);
  2245.  
  2246. if (this.isInTourney(name1)) {
  2247. if (this.isInTourney(name2)) {
  2248. if (this.tourOpponent(name1) != name2.toLowerCase()) {
  2249. sys.sendMessage(src, "+TourneyBot: This guy isn't your opponent in the tourney.");
  2250. sys.stopEvent();
  2251. return;
  2252. }
  2253. } else {
  2254. sys.sendMessage(src, "+TourneyBot: This guy isn't your opponent in the tourney.");
  2255. sys.stopEvent();
  2256. return;
  2257. }
  2258. if (sys.tier(src) != sys.tier(dest) || !cmp(sys.tier(src),tourtier)) {
  2259. sys.sendMessage(src, "+TourneyBot: You must be both in the tier " + tourtier+ " to battle in the tourney.");
  2260. sys.stopEvent();
  2261. return;
  2262. }
  2263. } else {
  2264. if (this.isInTourney(name2)) {
  2265. sys.sendMessage(src, "+TourneyBot: This guy is in the tournament and you are not, so you can't battle him.");
  2266. sys.stopEvent();
  2267. return;
  2268. }
  2269. }
  2270. }
  2271.  
  2272. /* Challenge Cup Clause */
  2273. if (clauses[6] == 1)
  2274. return;
  2275.  
  2276.  
  2277. if (sys.tier(src).indexOf("Doubles") != -1 && sys.tier(dest).indexOf("Doubles") != -1 && mode == 0) {
  2278. sys.sendMessage(src, "+Bot: To fight in doubles, enable doubles in the challenge window!");
  2279. sys.stopEvent();
  2280. return;
  2281. }
  2282.  
  2283. this.eventMovesCheck(src);
  2284. this.eventMovesCheck(dest);
  2285. }
  2286.  
  2287. ,
  2288.  
  2289. afterPlayerAway : function(src,dest,clauses,rated)
  2290. {
  2291. semiaway[src]=false
  2292. }
  2293. ,
  2294.  
  2295. beforeBattleMatchup : function(src,dest,clauses,rated)
  2296. {
  2297. if (battlesStopped) {
  2298. sys.stopEvent();
  2299. return;
  2300. }
  2301.  
  2302. this.eventMovesCheck(src);
  2303. this.eventMovesCheck(dest);
  2304.  
  2305. if (tourmode == 2 && (this.isInTourney(sys.name(src)) || this.isInTourney(sys.name(dest)) )) {
  2306. sys.stopEvent();
  2307. return;
  2308. }
  2309. }
  2310. ,
  2311.  
  2312. eventMovesCheck : function(src)
  2313. {
  2314. for (var i = 0; i < 6; i++) {
  2315. var poke = sys.teamPoke(src, i);
  2316. if (poke in pokeNatures) {
  2317. for (x in pokeNatures[poke]) {
  2318. if (sys.hasTeamPokeMove(src, i, x) && sys.teamPokeNature(src, i) != pokeNatures[poke][x])
  2319. {
  2320. 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.");
  2321. sys.stopEvent();
  2322. sys.changePokeNum(src, i, 0);
  2323. }
  2324. }
  2325. }
  2326. }
  2327. }
  2328.  
  2329. })
Add Comment
Please, Sign In to add comment