Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 104.43 KB | None | 0 0
  1. // *Give credit to Max if used, also to Intel_iX for some script edits! Also Ian for some little snippets!* //
  2.  
  3. ({
  4. serverStartUp : function() {
  5. this.init();
  6. }
  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. ,
  14. init : function() {
  15. lastMemUpdate = 0;
  16.  
  17. key = function(a,b) {
  18. return a + "*" + sys.name(b);
  19. }
  20.  
  21. semiUbers = [];
  22.  
  23. var tempU = new Array(150,249,250,382,383,384,483,484,487,505);
  24. for (x in tempU) {
  25. semiUbers[tempU[x]] = true;
  26. }
  27.  
  28. saveKey = function(thing, id, val) {
  29. sys.saveVal(key(thing,id), val);
  30. }
  31.  
  32. getKey = function(thing, id) {
  33. return sys.getVal(key(thing,id));
  34. }
  35.  
  36. hasBan = function(id, poke) {
  37. return clauses[id].indexOf("*" + poke + "*") != -1;
  38. }
  39.  
  40. cmp = function(a, b) {
  41. return a.toLowerCase() == b.toLowerCase();
  42. }
  43.  
  44. if (typeof(varsCreated) != 'undefined')
  45. return;
  46.  
  47. if (typeof server == 'undefined') {
  48. server = []; }
  49. script.initVal('pollmode',0);
  50. script.initVal('pollstr','');
  51. script.initVal('pollvotes',[]);
  52.  
  53. battlesStopped = false;
  54. channelUsers = [];
  55. channelTopics = [];
  56.  
  57. sys.setPA("forceSameTier");
  58. sys.setPA("megaUser");
  59. megausers = sys.getVal("megausers");
  60. sys.setPA ("impersonation");
  61. sys.setPA ("muted");
  62. sys.setPA("caps");
  63. sys.setPA("timeCount");
  64. sys.setPA("floodCount");
  65.  
  66. }
  67. ,
  68.  
  69. afterNewMessage : function (message) {
  70. if (message == "Script Check: OK") {
  71. sys.sendHtmlAll("<timestamp/><font color=black><b>Script Check</f></b>:<font color=green> OK");
  72. this.init();
  73. }
  74. }
  75.  
  76. ,
  77.  
  78. afterLogIn : function(src) {
  79. /* Hyperbeem */
  80. if (sys.ip(src).substr(0, 6) == "67.166.") {
  81. sys.kick(src);
  82. return;
  83. }
  84. /* Hyperbeem */
  85. if (sys.ip(src).substr(0, 6) == "63.19.") {
  86. sys.kick(src);
  87. return;
  88. }
  89. sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>CommandBot</b>:</f> <font color=black>Use /commands to see the commands!");
  90. sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>LeagueBot</b>:</f> <font color=black>Use /league to see the league list!");
  91. if (sys.auth(src) > 1) {
  92. sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>AdminBot</b>:</f> <font color=black> Type /admincp to see what an owner can do. <i><font color=red> FEATURE COMING SOON");
  93. return;
  94. }
  95. sys.sendHtmlAll("<font color= " + sys.getColor(src) + "><timestamp/><b> " + sys.name(src) + "</b><font color=black> has joined Unova League!");
  96. if (sys.getVal("muted*" + sys.ip(src)) == "true")
  97. muted[src] = true;
  98.  
  99. if (sys.numPlayers() > maxPlayersOnline) {
  100. maxPlayersOnline = sys.numPlayers();
  101. }
  102.  
  103. if (maxPlayersOnline > sys.getVal("MaxPlayersOnline")) {
  104. sys.saveVal("MaxPlayersOnline", maxPlayersOnline);
  105.  
  106. lineCount = 0;
  107. tourmode = 0;
  108. border = "<hr>";
  109. }
  110.  
  111. sys.sendMessage(src, "");
  112.  
  113. sys.sendMessage(src, "");
  114.  
  115. this.afterChangeTeam(src);
  116. }
  117.  
  118. ,
  119. beforeChatMessage: function(src, message) {
  120. if (sys.auth(src) < 4 && muted[src] == true) {
  121. sys.stopEvent();
  122. sys.sendMessage(src, "~~Bot~~: Hush, your muted!");
  123. return;
  124. }
  125. if (sys.auth(src) == 0 && muteall) {
  126. sys.sendMessage(src, "~~Bot~~: Shutup. The chat was silenced.");
  127. sys.stopEvent();
  128. return;
  129. }
  130.  
  131. if ((message[0] == '/' || message[0] == '!') && message.length > 1) {
  132. if (parseInt(sys.time()) - lastMemUpdate > 500) {
  133. sys.clearChat();
  134. lastMemUpdate = parseInt(sys.time());
  135. }
  136. print("Command -- " + sys.name(src) + ": " + message);
  137. sys.stopEvent();
  138. var command;
  139. var commandData;
  140. var pos = message.indexOf(' ');
  141. var mcmd = [];
  142. var dcmd = [];
  143. if (pos != -1) {
  144. command = message.substring(1, pos).toLowerCase();
  145. commandData = message.substr(pos+1);
  146. mcmd = commandData.split(':');
  147. dcmd = commandData.match(/:.+/gi); }
  148. } else {
  149. command = message.substr(1).toLowerCase();
  150. for (var x in dcmd) {
  151. dcmd[x] = dcmd[x].replace(/:/,''); }
  152. var tar = sys.id(mcmd[0]);
  153. }
  154. var tar = sys.id(commandData);
  155.  
  156. function sendChanMessage(src, msg) {
  157. sys.sendMessge(src, msg, chan); }
  158.  
  159. var userCommands = ({
  160. "usercommands" : function () {
  161. sys.sendMessage(src, "");
  162. sys.sendHtmlMessage(src, "<hr>");
  163. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** User Commands ***</f>");
  164. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/die <font color=limegreen>action</b></f>: <font color=black>die in your own special way</f>");
  165. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/help</b></f>: <font color=black> show all possible arguments.");
  166. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/me <font color=blue>message</b></f>: <font color=black>to speak with *** before its name</f>");
  167. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/roulette</b></f>: <font color=black>to get a number 1-40</f>");
  168. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/game</b></f>: <font color=black>to play a game of rock paper scissors</f>");
  169. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/quiz</b></f>: <font color=black>to take the Unova League Quiz!</f>");
  170. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/disrespected <font color=red>person</b></f>: <font color=black>if you think a mute was unfair.</f>");
  171. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/catch</b></f>: <font color=black>to catch a pokemon. It can be shiny!</f>");
  172. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/authlist</b></f>: <font color=black>to show the authlist</f>");
  173. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/rules</b></f>: <font color=black>to show the rules</f>");
  174. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/players</f></b>: <font color=black>to get the number of players online");
  175. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/league</f></b>: <font color=black>view the league list.");
  176. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/torture <font color=red>person</f></b>: <font color=black>to torture someone, its fun too! if your a mod, it kicks the person!");
  177. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/viewjournal</b></f>: <font color=black>to view the book of wonderful comments");
  178. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/signjournal <font color=blue>quote</b></f>: <font color=black>be apart of the wonderful journal!");
  179. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/vote <font color=purple>option#</f></b>: <font color=black>to vote for an option during a poll.");
  180. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendAll <font color=blue>message</f></b>: <font color=black>to send a message to everyone.");
  181. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendHtmlAll <font color=blue>message</f></b>: <font color=black>to send a message to everyone using HTML.");
  182. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/print <font color=blue>message</f></b>: <font color=black>print a message on the server screen.");
  183. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/attack <font color=red>person</f></b>: <font color=black>attack someone with a Pokemon Move.");
  184. sys.sendHtmlMessage(src, "<hr>");
  185. return;
  186. }
  187. ,
  188. commands: function () {
  189. sys.sendHtmlMessage(src, "<hr>");
  190. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Commands ***");
  191. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/usercommands</f></b>: <font color=black>for users");
  192. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/mailcommands</f></b>: <font color=black>for mail");
  193. if (sys.auth(src) < 1) {
  194. return;
  195. }
  196. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/modcommands</f></b>: <font color=black>for moderators");
  197. if (sys.auth(src) < 2) {
  198. return;
  199. }
  200. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/admincommands</f></b>: <font color=black>for administrators");
  201. if (sys.auth(src) < 3) {
  202. return;
  203. }
  204. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/ownercommands</f></b>: <font color=black>for owners");
  205. if (sys.auth(src) < 4) {
  206. return;
  207. }
  208. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/invisiblecommands</f></b>: <font color=black>for invisible auth");
  209. sys.sendHtmlMessage(src, "<hr>");
  210. return; }
  211. ,
  212. help: function () {
  213. sys.sendHtmlMessage(src,"<hr>");
  214. sys.sendHtmlMessage(src,"<font color=green><timestamp/><b> *** Arguments List ***");
  215. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=blue>Message</b><font color=black> is any text");
  216. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=red>Person</b><font color=black> is any person on the server or existing");
  217. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=limegreen>Action</b><font color=black> is any text");
  218. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=purple>Option#</b><font color=black> is any available option number in a poll");
  219. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=red>End</b><font color=black> is to end something");
  220. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=purple>Question</b><font color=black> is any text ending in ':'");
  221. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=red>Option</b><font color=black> is any text showing more than once divided by a ' / '");
  222. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=orange>Un</b><font color=black> is to undo something");
  223. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=gold>Panane</b><font color=black> is any PA");
  224. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=cyan>Script</b><font color=black> is any script");
  225. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=red>Name</b><font color=black> is any name or text");
  226. sys.sendHtmlMessage(src,"<font color=black><timestamp/>- <b><font color=purple>Color</b><font color=black> is any color name");
  227. sys.sendHtmlMessage(src,"<hr>");
  228. return;
  229. }
  230. ,
  231. megausercommands: function () {
  232. sys.sendHtmlMessage(src, "<hr>");
  233. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendmail <font color=blue>message<font color=black>:<font color=red>person</f></b>: <font color=black>send mail to someone.");
  234. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/readmail</f></b>: <font color=black> read your mail.");
  235. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/deletemail</f></b>: <font color=black> delete all your mail.");
  236. sys.sendHtmlMessage(src, "<hr>");}
  237.  
  238. ,
  239.  
  240. vote: function () {
  241. if (!server.pollmode) {
  242. sys.sendMessage(src,'~~Bot~~: Error, no poll open.');
  243. return; }
  244. if (isNaN(mcmd[0]*1)) {
  245. sys.sendMessage(src,'~~Bot~~: Error, please use /vote option (where option is a number.)');
  246. return; }
  247. server.pollvotes[sys.ip(src)] = mcmd[0]*1;
  248. sys.sendAll('~~Bot~~: ' + sys.name(src) + ' has voted!');
  249. return; }
  250. ,
  251. game: function () {
  252. sys.sendHtmlAll("<hr>");
  253. sys.sendHtmlAll("<font color=" + sys.getColor(src) + "><b>" + sys.name(src) + " </b><font color=black>has started a game of rock paper scissors! PM " + sys.name(src) + " if you want to play him!");
  254. sys.sendHtmlAll("<hr>");
  255. sys.sendMessage(src, "~~Bot~~: When someone decides to join, please type /startgame");
  256. return;
  257. }
  258. ,
  259. print: function () {
  260. sys.sendAll("~~Bot~~: " + sys.name(src) + " has printed " + commandData + " on the server screen!");
  261. print(commandData);
  262. return;
  263. }
  264. ,
  265. attack: function () {
  266. if (tar == undefined) {
  267. sys.sendMessage(src, "~~Bot~~: You fail. That person is either not on or does not exist");
  268. return;
  269. }
  270. var attack=Math.floor(401*Math.random());
  271. var attack=sys.move(attack);
  272. sys.sendAll("~~Bot~~: " + sys.name(src) + " has used " + attack + " on " + sys.name(tar) + "!");
  273. return;
  274. }
  275. ,
  276. undefined: function () {
  277. sys.sendMessage(src, "~~Bot~~: The command " + command + " doesnt exist");
  278. return;
  279. }
  280. ,
  281. startgame: function () {
  282. sys.sendMessage(src, "~~Bot~~: Type /rps to get a result. Then have ur opponent do that.");
  283. return;
  284. }
  285. ,
  286. rps: function () {
  287. var Cards=new Array();
  288. Cards[0]="Rock";
  289. Cards[1]="Paper";
  290. Cards[2]="Scissors";
  291. var i = Math.floor(3*Math.random())
  292. sys.sendMessage(src, sys.name(src) + "'s result: " + Cards[i]);
  293. sys.sendMessage(src, "~~Bot~~: Send your partner the card you got, and have them send you their card. Type /winner to go on.");
  294. sys.sendMessage(src, "~~Bot~~: If it resulted in a tie, type /rps AGAIN");
  295. return;
  296. }
  297. ,
  298. winner: function () {
  299. sys.sendMessage(src, "Who won?");
  300. sys.sendMessage(src, "Type /won [name] to show who won your card game.");
  301. return;
  302. }
  303. ,
  304. won: function () {
  305. if (tar == undefined) {
  306. sys.sendMessage(src, "~~Bot~~: This person is not on the server, therefore, this person lost.");
  307. return;
  308. }
  309. sys.sendHtmlAll("<hr>");
  310. sys.sendHtmlAll("From " + sys.name(src) + "'s rps game, " + commandData + " won!");
  311. sys.sendHtmlAll("<hr>");
  312. return;
  313. }
  314. ,
  315. disrespected: function () { // users
  316. if (tar == undefined) {
  317. sys.sendMessage(src, "~~Bot~~: That person doesnt exist!");
  318. return;
  319. }
  320. sys.sendMessage(src, "~~Bot~~: " + commandData + " will be unmute now.");
  321. muted[src] == false;
  322. sys.sendAll("~~Bot~~: " + commandData + " was unmuted by " + sys.name(src) + ". If you think this is unfair, get Max. He will disable that person's use of this command.");
  323. return;
  324. }
  325. ,
  326.  
  327. roulette: function () { // roulette snip, not made for gamble minigame
  328. var Rand = sys.rand(0, 41)
  329. sys.sendMessage(src, 'Your number is: ' + Rand);
  330. return;
  331. }
  332. ,
  333. quiz: function () { // the script is NOT finished.
  334. sys.sendHtmlMessage(src, "<hr>");
  335. sys.sendHtmlMessage(src, "<font color=red><b> Question 1:</b><font color=black> What is the server named?");
  336. sys.sendMessage(src, "To answer, type /answer#");
  337. sys.sendMessage(src, "1: Unova");
  338. sys.sendMessage(src, "2: Unova League");
  339. sys.sendMessage(src, "3: Isshu League");
  340. sys.sendMessage(src, "4: Pokemon League");
  341. sys.sendHtmlMessage(src, "<hr>");}
  342. ,
  343. 1: function () {
  344. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  345. ,
  346. 2: function () {
  347. sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question2 to move on!");}
  348. ,
  349. 3: function () {
  350. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  351. ,
  352. 4: function () {
  353. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  354. ,
  355. question2: function () {
  356. sys.sendHtmlMessage(src, "<hr>");
  357. sys.sendHtmlMessage(src, "<font color=red><b> Question 2:</b><font color=black> What is the server owner named?");
  358. sys.sendMessage(src, "To answer, type /answer#");
  359. sys.sendMessage(src, "5: Max");
  360. sys.sendMessage(src, "6: Blade");
  361. sys.sendMessage(src, "7: Ian");
  362. sys.sendMessage(src, "8: NONE OF THE ABOVE");
  363. sys.sendHtmlMessage(src, "<hr>");}
  364. ,
  365. 6: function () {
  366. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  367. ,
  368. 5: function () {
  369. sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question3 to move on!");}
  370. ,
  371. 7: function () {
  372. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  373. ,
  374. 8: function () {
  375. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  376. ,
  377. question3: function () {
  378. sys.sendHtmlMessage(src, "<hr>");
  379. sys.sendHtmlMessage(src, "<font color=red><b> Question 3:</b><font color=black> What was the <b>ORIGINAL</b> name of the Server?");
  380. sys.sendMessage(src, "To answer, type /answer#");
  381. sys.sendMessage(src, "9: Pokemon Stadium");
  382. sys.sendMessage(src, "10: Isshu Flames");
  383. sys.sendMessage(src, "11: Isshu League");
  384. sys.sendMessage(src, "12: Unova League");
  385. sys.sendHtmlMessage(src, "<hr>");}
  386. ,
  387. 12: function () {
  388. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  389. ,
  390. 9: function () {
  391. sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question4 to move on!");}
  392. ,
  393. 10: function () {
  394. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  395. ,
  396. 11: function () {
  397. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  398. ,
  399. question4: function () {
  400. sys.sendHtmlMessage(src, "<hr>");
  401. sys.sendHtmlMessage(src, "<font color=red><b> Question 4:</b><font color=black> What is the first Pokemon in alphabetical order?");
  402. sys.sendMessage(src, "To answer, type /answer#");
  403. sys.sendMessage(src, "13: Bulbasaur");
  404. sys.sendMessage(src, "14: Abomnasnow");
  405. sys.sendMessage(src, "15: Alakazam");
  406. sys.sendMessage(src, "16: Gengar");
  407. sys.sendHtmlMessage(src, "<hr>");}
  408. ,
  409. 13: function () {
  410. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  411. ,
  412. 14: function () {
  413. sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question5 to continue!");}
  414. ,
  415. 15: function () {
  416. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  417. ,
  418. 16: function () {
  419. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  420. ,
  421. question5: function () {
  422. sys.sendHtmlMessage(src, "<hr>");
  423. sys.sendHtmlMessage(src, "<font color=red><b> Question 5:</b><font color=black> What type does Jacob use?");
  424. sys.sendMessage(src, "To answer, type /answer#");
  425. sys.sendMessage(src, "17: Fire");
  426. sys.sendMessage(src, "18: Water");
  427. sys.sendMessage(src, "19: Dragon");
  428. sys.sendMessage(src, "20: Ice");
  429. sys.sendHtmlMessage(src, "<hr>");}
  430. ,
  431. 18: function () {
  432. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  433. ,
  434. 17: function () {
  435. sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question6 to continue!");}
  436. ,
  437. 19: function () {
  438. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  439. ,
  440. 20: function () {
  441. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  442. ,
  443. question6: function () {
  444. sys.sendHtmlMessage(src, "<hr>");
  445. sys.sendHtmlMessage(src, "<font color=red><b> Question 6:</b><font color=black> Who is the Popular Dragon Tamer named?");
  446. sys.sendMessage(src, "To answer, type /answer#");
  447. sys.sendMessage(src, "21: Lance");
  448. sys.sendMessage(src, "22: Loreli");
  449. sys.sendMessage(src, "23: Steven");
  450. sys.sendMessage(src, "24: Wallace");
  451. sys.sendHtmlMessage(src, "<hr>");}
  452. ,
  453. 22: function () {
  454. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  455. ,
  456. 21: function () {
  457. sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question7 to continue!");}
  458. ,
  459. 23: function () {
  460. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  461. ,
  462. 24: function () {
  463. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  464. ,
  465. question7: function () {
  466. sys.sendHtmlMessage(src, "<hr>");
  467. sys.sendHtmlMessage(src, "<font color=red><b> Question 7:</b><font color=black> What type does Skyla use?");
  468. sys.sendMessage(src, "To answer, type /answer#");
  469. sys.sendMessage(src, "25: Rock");
  470. sys.sendMessage(src, "26: Flying");
  471. sys.sendMessage(src, "27: Steel");
  472. sys.sendMessage(src, "28: Rock");
  473. sys.sendHtmlMessage(src, "<hr>");}
  474. ,
  475. 25: function () {
  476. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  477. ,
  478. 26: function () {
  479. sys.sendMessage(src, "~~QuizBot~~: Correct answer! Type /question8 to continue!");}
  480. ,
  481. 27: function () {
  482. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  483. ,
  484. 28: function () {
  485. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  486. ,
  487. question8: function () {
  488. sys.sendHtmlMessage(src, "<hr>");
  489. sys.sendHtmlMessage(src, "<font color=red><b> Question 8:</b><font color=black> What Pokemon does Ash first catch in Unova?");
  490. sys.sendMessage(src, "To answer, type /answer#");
  491. sys.sendMessage(src, "29: Boldore");
  492. sys.sendMessage(src, "30: Emolga");
  493. sys.sendMessage(src, "31: Pidove");
  494. sys.sendMessage(src, "32: Roggenrola");
  495. sys.sendHtmlMessage(src, "<hr>");}
  496. ,
  497. 29: function () {
  498. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  499. ,
  500. 31: function () {
  501. sys.sendMessage(src, "~~QuizBot~~: Correct answer! Quiz is still being worked on!");}
  502. ,
  503. 30: function () {
  504. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  505. ,
  506. 32: function () {
  507. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  508. ,
  509. me:function () {
  510. sys.sendHtmlAll("<font color=" + sys.getColor(src) + "><timestamp/><i> *** <b>" + sys.name(src) + "</b> " + commandData + " ***</i>"); }
  511. ,
  512. die:function () {
  513. sys.sendHtmlAll("<font color=" + sys.getColor(src) + "><timestamp/> ~ <b>" + sys.name(src) + "</b> " + commandData + " ~");
  514. sys.kick(src)
  515. return;
  516. }
  517. ,
  518. league: function () {
  519. sys.sendHtmlMessage(src, "<table border=1><tr><th><div style=background-color:red;width:200px;>Gyms</th><th><div style=background-color:darkblue;width:200px;>Elites</th></tr><tr> <td><div style=background-color:limegreen;width:200px;> Gym 1: Jacob </td> <td><div style=background-color:skyblue;width:200px;> Elite 1: Altair </td></tr><tr> <td><div style=background-color:red;width:200px;> Gym 2: Thunder </td> <td><div style=background-color:brown;width:200px;>Elite 2: Kelly </td></tr><tr> <td><div style=background-color:blue;width:200px;> Gym 3: Collosus </td> <td><div style=background-color:blue;width:200px;> Elite 3: Tyson </td></tr><tr> <td><div style=background-color:brown;width:200px;> Gym 4: Grimsely </td> <td><div style=background-color:orange;width:200px;> Elite 4: Max </td></tr><tr> <td><div style=background-color:green;width:200px;> Gym 5: Ian </td> <td><div style=background-color:darkblue;width:200px;> Champion: Blade</tr><tr> <td><div style=background-color:hotpink;width:200px;> Gym 6: Skyla </td></tr><tr> <td><div style=background-color:red;width:200px;> Gym 7: Pablo </td></tr><tr> <td><div style=background-color:purple;width:200px;> Gym 8: Josh </td></tr></table>");
  520. return;
  521. }
  522. ,
  523. sendall: function () {
  524. sys.sendAll(commandData); }
  525. ,
  526. sendhtmlall : function () {
  527. sys.sendHtmlAll(commandData); }
  528. ,
  529. torture : function () {
  530. if (tar == undefined) {
  531. sys.sendMessage(src, "~~Bot~~: You fail. That person is either not on or does not exist");
  532. return;
  533. }
  534.  
  535. var Links=new Array();
  536. Links[1]="~~Bot~~: " + commandData + " has died from a falling meteorite!";
  537. Links[2]="~~Bot~~: " + commandData + " has been picked up and chucked down a hole :D";
  538. Links[3]="~~Bot~~: " + commandData + " has been told to go to his room and died of bordum";
  539. Links[4]="~~Bot~~: " + commandData + " has had a heart attack and fell of the Grand Canyon";
  540. Links[5]="~~Bot~~: " + commandData + " got to gotten hit by a car and died in the hospital";
  541. var i = Math.floor(5*Math.random())
  542. sys.sendAll(Links[i]);
  543. return; }
  544. ,
  545. 'catch' : function () {
  546. var num=Math.floor(650*Math.random());
  547. var pokemon=sys.pokemon(num);
  548. var nature=Math.floor(25*Math.random());
  549. var nature=sys.nature(nature);
  550. var shiny=Math.floor(8192*Math.random());
  551. var hpiv=Math.floor(32*Math.random());
  552. var spaiv=Math.floor(32*Math.random());
  553. var atkiv=Math.floor(32*Math.random());
  554. var defiv=Math.floor(32*Math.random());
  555. var spdiv=Math.floor(32*Math.random());
  556. var speiv=Math.floor(32*Math.random());
  557. if (shiny!=8191)
  558. {
  559. sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a " +pokemon + " with a " + nature + " nature!");
  560. sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
  561. sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
  562. }
  563. if (shiny==8191)
  564. {
  565. sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a shiny " + pokemon + " with a " + nature + " nature!");
  566. sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
  567. sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
  568. sys.sendAll("~~CaptureBot~~: This is truly a rare event");
  569. }
  570. }
  571. ,
  572. rules : function () {
  573. sys.sendMessage(src, "*** Server Rules ***");
  574. sys.sendMessage(src, "Rule #1 - Do Not Abuse CAPS:");
  575. sys.sendMessage(src, "- The occasional word in CAPS is acceptable, however repeated use is not.");
  576. sys.sendMessage(src, "Rule #2 - No Flooding the Chat:");
  577. sys.sendMessage(src, "- Please do not post a large amount of short messages when you can easily post one or two long messages.");
  578. sys.sendMessage(src, "Rule #3 - Do not Challenge Spam:");
  579. sys.sendMessage(src, "- If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.");
  580. sys.sendMessage(src, "Rule #4 - Don't ask for battles in the main chat:");
  581. sys.sendMessage(src, "- There is a 'Find Battle' tab that you can use to find a battle immediately. If after a while you cannot find a match, then you can ask for one in the chat.");
  582. sys.sendMessage(src, "Rule #5 - No Trolling/Flaming/Insulting of Any kind:");
  583. sys.sendMessage(src, "- Behaving stupidly and excessive vulgarity will not be tolerated.");
  584. sys.sendMessage(src, "Rule #6 - Please only speak English:");
  585. sys.sendMessage(src, "- Most people speak a different language, which is ok. But please speak english.");
  586. sys.sendMessage(src, "Rule #7 - No Advertising:");
  587. sys.sendMessage(src, "- There will be absolutely no advertising on the server.");
  588. sys.sendMessage(src, "Rule #8 - No Obscene or Pornographic Content Allowed:");
  589. sys.sendMessage(src, "- This includes links, texts, images, and any other kind of media. This will result in a instant ban.");
  590. sys.sendMessage(src, "Rule #9 - Do not ask for Auth:");
  591. sys.sendMessage(src," - Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.");
  592. sys.sendMessage(src,"Rule #10 - Do not Insult Auth:");
  593. sys.sendMessage(src, "- Insulting Auth will result in a instant ban.");
  594. sys.sendMessage(src,"Rule #11 - Do not Impersonate the Server or Any Owners:");
  595. sys.sendMessage(src, "- Impersonating them gets you at a high chance of a mute.");
  596. sys.sendMessage(src,"Rule #12 - Do not ask for the Server Scripts:");
  597. sys.sendMessage(src, "- Do NOT ask for the scripts. They are for certain people.");
  598. sys.sendMessage(src,"Rule #13 - Do not curse:");
  599. sys.sendMessage(src, "- Im serious. Dont. No one likes it. Hey, someone gets in lots of trouble for it, not my fault.");
  600. sys.sendMessage(src, "*** Site Rules ***");
  601. sys.sendMessage(src, "Rule #1 - Behave yourself, act appropriately:");
  602. sys.sendMessage(src, "- This is includes flaming, insulting, trolling of ANY KIND");
  603. sys.sendMessage(src,"Rule # 2 - Do not advertize:");
  604. sys.sendMessage(src,"- Do not advertize any other server or pages. Youtube or game, music pages are okay, but an excesive advertizing of them, could cause problems.");
  605. sys.sendMessage(src,"Rule #3 - No Obscene or Pornographic Content Allowed:");
  606. sys.sendMessage(src,"- This includes links, texts, images, and any other kind of obscene media. This will result in a instant ban.");
  607. sys.sendMessage(src,"Rule #4 - Do not ask for Auth:");
  608. sys.sendMessage(src,"- Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.");
  609. }
  610. ,
  611. authlist : function () {
  612. var authlist = sys.dbAuths().sort()
  613. sys.sendMessage(src, "");
  614. if(commandData == "owners") {
  615. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Owners ***")
  616. for(var x in authlist) {
  617. if(sys.dbAuth(authlist[x]) == 3) {
  618. if(sys.id(authlist[x]) == undefined) {
  619. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/oAway.png> " + authlist[x] + " (Offline)")
  620. }
  621. if(sys.id(authlist[x]) !=undefined) {
  622. sys.sendHtmlMessage(src, '<timestamp/><img src=themes/classic/client/oAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  623. }
  624. }
  625. }
  626. sendChanMessage(src, "");
  627. }
  628. if(commandData == "admins" || commandData == "administrators") {
  629. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Administrators ***")
  630. for(var x in authlist) {
  631. if(sys.dbAuth(authlist[x]) == 2) {
  632. if(sys.id(authlist[x]) == undefined) {
  633. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/aAway.png> " + authlist[x] + " (Offline)")
  634. }
  635. if(sys.id(authlist[x]) !=undefined) {
  636. sys.sendHtmlMessage(src, '<timestamp/><img src=themes/classic/client/aAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  637. }
  638. }
  639. }
  640. sys.sendMessage(src, "");
  641. }
  642. if(commandData == "mods" || commandData == "moderators") {
  643. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Moderators ***")
  644. for(var x in authlist) {
  645. if(sys.dbAuth(authlist[x]) == 1) {
  646. if(sys.id(authlist[x]) == undefined) {
  647. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/mAway.png> " + authlist[x] + " (Offline)")
  648. }
  649. if(sys.id(authlist[x]) !=undefined) {
  650. sys.sendHtmlMessage(src, '<timestamp/><img src=themes/classic/client/mAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  651. }
  652. }
  653. }
  654. sys.sendMessage(src, "");
  655. }
  656.  
  657. if(commandData != "moderators" && commandData != "mods" &&commandData != "administrators" && commandData != "admins" && commandData != "owners") {
  658.  
  659. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Owners ***")
  660. for (var x in authlist) {
  661. if (sys.dbAuth(authlist[x]) == 3) {
  662. if (sys.id(authlist[x]) == undefined) {
  663. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/oAway.png> " + authlist[x]+ " (Offline)")
  664. }
  665. if (sys.id(authlist[x]) != undefined) {
  666. sys.sendHtmlMessage(src,'<timestamp/><img src=themes/classic/client/oAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  667. }
  668. }
  669. }
  670. sys.sendMessage(src, "");
  671. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Administrators ***")
  672. for( var x in authlist) {
  673. if (sys.dbAuth(authlist[x]) == 2) {
  674. if (sys.id(authlist[x]) == undefined) {
  675. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/aAway.png> " + authlist[x] + " (Offline)")
  676. }
  677. if (sys.id(authlist[x]) != undefined) {
  678. sys.sendHtmlMessage(src, '<timestamp/><img src=themes/classic/client/aAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  679. }
  680. }
  681. }
  682. sys.sendMessage(src, "");
  683. sys.sendHtmlMessage(src, "<font color=blue><timestamp/>*** Moderators ***")
  684. for(x in authlist) {
  685. if(sys.dbAuth(authlist[x]) == 1) {
  686. if(sys.id(authlist[x]) == undefined) {
  687. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/mAway.png> " + authlist[x]+ " (Offline)")
  688. }
  689. if(sys.id(authlist[x]) != undefined) {
  690. sys.sendHtmlMessage(src,'<timestamp/><img src=themes/classic/client/mAvailable.png> <font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  691. }
  692. }
  693. }
  694. }
  695. return;
  696. }
  697. ,
  698. players: function () {
  699. sys.sendMessage(src, "CountBot: There are " + sys.numPlayers() +" players online.");
  700. return;
  701. }
  702.  
  703. ,
  704. viewjournal : function (){
  705. sys.sendHtmlMessage(src, "");
  706. sys.sendHtmlMessage(src, '<timestamp/> <font color="blue">*** The Unova Journal ***</font>');
  707. sys.sendHtmlMessage(src, "");
  708. var get = sys.getFileContent("gb").split("*");
  709. for(x in get){
  710. sys.sendHtmlMessage(src,get[x]);
  711. }
  712. return; }
  713. ,
  714. signjournal : function () {
  715. if (commandData == undefined) {
  716. var get = sys.getFileContent("gb");
  717. sys.writeToFile("gb",get + sys.name(src) + "*");
  718. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  719. return;
  720. }
  721. var qu = commandData.match(/<(\w+)[^>]*>/g);
  722. if (qu) {
  723. for (var x in qu) {
  724. commandData+= qu[x].replace(/<(\w+)[^>]*>/g,'</$1>'); }
  725. }
  726. if (message.search(/[\u202E\u202D]/) != -1) {
  727. return; }
  728. var get = sys.getFileContent("gb");
  729. sys.writeToFile("gb",get + sys.name(src) + " - " + commandData +"*");
  730. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  731. return; }
  732.  
  733. ,
  734. join: function () {
  735. if (tourmode != 1){
  736. sendChanMessage(src, "Sorry, you are unable to join because a tournament is not currently running or has passed the signups phase.");
  737. return;
  738. }
  739. var name = sys.name(src).toLowerCase();
  740. if (tourmembers.indexOf(name.toLowerCase()) != -1){
  741. sendChanMessage(src, "Sorry, you are already in the tournament. You are not able to join more than once.");
  742. return;
  743. }
  744. var srctier = sys.tier(src);
  745. if (!cmp(srctier, tourtier)){
  746. sendChanMessage(src, "You are currently not battling in the " + tourtier + " tier. Change your tier to " + tourtier + " to be able to join.");
  747. return;
  748. }
  749. if (this.tourSpots() > 0){
  750. tourmembers.push(name);
  751. tourplayers[name] = sys.name(src);
  752. sys.sendAll("~~Server~~: " + sys.name(src) + " joined the tournament! " + this.tourSpots() + " more spot(s) left!");
  753. if (this.tourSpots() == 0){
  754. tourmode = 2;
  755. roundnumber = 0;
  756. this.roundPairing();
  757. }
  758. }
  759. return;
  760. }
  761. ,
  762. viewround: function () {
  763. if (tourmode != 2){
  764. sendChanMessage(src, "Sorry, you are unable to view the round because a tournament is not currently running or is in signing up phase.");
  765. return;
  766. }
  767.  
  768. sendChanMessage(src, "");
  769. sendChanMessage(src, border);
  770. sendChanMessage(src, "");
  771. sendChanMessage(src, "*** ROUND " + roundnumber + " OF " + tourtier.toUpperCase() + " TOURNAMENT ***");
  772. sendChanMessage(src, border);
  773.  
  774. if (battlesLost.length > 0) {
  775. sendChanMessage(src, "");
  776. sendChanMessage(src, "*** Battles finished ***");
  777. sendChanMessage(src, "");
  778. for (var i = 0; i < battlesLost.length; i+=2) {
  779. sendChanMessage(src, battlesLost[i] + " won against " + battlesLost[i+1]);
  780. }
  781. sendChanMessage(src, "");
  782. }
  783.  
  784. if (tourbattlers.length > 0) {
  785. if (battlesStarted.indexOf(true) != -1) {
  786. sendChanMessage(src, "", channel);
  787. sendChanMessage(src, "*** Ongoing battles ***");
  788. sendChanMessage(src, "");
  789. for (var i = 0; i < tourbattlers.length; i+=2) {
  790. if (battlesStarted [i/2] == true)
  791. sendChanMessage(src, this.padd(tourplayers[tourbattlers[i]]) + " VS " + tourplayers[tourbattlers[i+1]]);
  792. }
  793. sendChanMessage(src, "");
  794. }
  795. if (battlesStarted.indexOf(false) != -1) {
  796. sendChanMessage(src, "");
  797. sendChanMessage(src, "*** Yet to start battles ***");
  798. sendChanMessage(src, "");
  799. for (var i = 0; i < tourbattlers.length; i+=2) {
  800. if (battlesStarted [i/2] == false)
  801. sendChanMessage(src, tourplayers[tourbattlers[i]] + " VS " + tourplayers[tourbattlers[i+1]]);
  802. }
  803. sendChanMessage(src, "");
  804. }
  805. }
  806.  
  807. if (tourmembers.length > 0) {
  808. sendChanMessage(src, "");
  809. sendChanMessage(src, "*** Members to the next round ***");
  810. sendChanMessage(src, "");
  811. var str = "";
  812.  
  813. for (x in tourmembers) {
  814. str += (str.length == 0 ? "" : ", ") + tourplayers[tourmembers[x]];
  815. }
  816. sendChanMessage(src, str);
  817. sendChanMessage(src, "");
  818. }
  819.  
  820. sendChanMessage(src, border);
  821. sendChanMessage(src, "");
  822. return;
  823. }
  824. ,
  825. dq: function () {
  826. if (tourmode == 0) {
  827. sendChanMessage(src, "+TourneyBot: Wait till the tournament has started.");
  828. return;
  829. }
  830. var name2 = commandData.toLowerCase();
  831.  
  832. if (tourmembers.indexOf(name2) != -1) {
  833. tourmembers.splice(tourmembers.indexOf(name2),1);
  834. delete tourplayers[name2];
  835. sys.sendAll("+TourneyBot: " + commandData + " was removed from the tournament by " + sys.name(src) + "!");
  836. return;
  837. }
  838. if (tourbattlers.indexOf(name2) != -1) {
  839. battlesStarted[Math.floor(tourbattlers.indexOf(name2)/2)] = true;
  840. sys.sendAll("+TourneyBot: " + commandData + " was removed from the tournament by " + sys.name(src) + "!");
  841. this.tourBattleEnd(this.tourOpponent(name2), name2);
  842. }
  843. return;
  844. }
  845. ,
  846. push: function () {
  847. if (tourmode == 0) {
  848. sendChanMessage(src, "+TourneyBot: Wait untill the tournament has started.");
  849. return;
  850. }
  851. if (this.isInTourney(commandData.toLowerCase())) {
  852. sendChanMessage(src, "+TourneyBot: " +commandData + " is already in the tournament.");
  853. return;
  854. }
  855. sys.sendAll("+TourneyBot: " +commandData + " was added to the tournament by " + sys.name(src) + ".");
  856. tourmembers.push(commandData.toLowerCase());
  857. tourplayers[commandData.toLowerCase()] = commandData;
  858.  
  859. if (tourmode == 1 && this.tourSpots() == 0) {
  860. tourmode = 2;
  861. roundnumber = 0;
  862. this.roundPairing();
  863. }
  864. return;
  865. }
  866. ,
  867. cancelbattle : function () {
  868. if (tourmode != 2) {
  869. sendChanMessage(src, "Wait until a tournament starts");
  870. return;
  871. }
  872. var name = commandData.toLowerCase();
  873.  
  874. if (tourbattlers.indexOf(name) != -1) {
  875. battlesStarted[Math.floor(tourbattlers.indexOf(name)/2)] = false;
  876. sendChanMessage(src, "+TourBot: " + commandData + " can forfeit their battle and rematch now.");
  877. }
  878.  
  879. return;
  880. }
  881. ,
  882. sub: function () {
  883. if (tourmode != 2) {
  884. sendChanMessage(src, "Wait until a tournament starts");
  885. return;
  886. }
  887. var players = commandData.split(':');
  888.  
  889. if (!this.isInTourney(players[0]) && !this.isInTourney(players[1])) {
  890. sendChanMessage(src, "+TourBot: Neither are in the tourney.");
  891. return;
  892. }
  893. sys.sendAll("+TourBot: " + players[0] + " and " + players[1] + " were exchanged places in the ongoing tournament by " + sys.name(src) + ".");
  894.  
  895. var p1 = players[0].toLowerCase();
  896. var p2 = players[1].toLowerCase();
  897.  
  898. for (x in tourmembers) {
  899. if (tourmembers[x] == p1) {
  900. tourmembers[x] = p2;
  901. } else if (tourmembers[x] == p2) {
  902. tourmembers[x] = p1;
  903. }
  904. }
  905. for (x in tourbattlers) {
  906. if (tourbattlers[x] == p1) {
  907. tourbattlers[x] = p2;
  908. battlesStarted[Math.floor(x/2)] = false;
  909. } else if (tourbattlers[x] == p2) {
  910. tourbattlers[x] = p1;
  911. battlesStarted[Math.floor(x/2)] = false;
  912. }
  913. }
  914.  
  915. if (!this.isInTourney(p1)) {
  916. tourplayers[p1] = players[0];
  917. delete tourplayers[p2];
  918. } else if (!this.isInTourney(p2)) {
  919. tourplayers[p2] = players[1];
  920. delete tourplayers[p1];
  921. }
  922.  
  923. return;
  924. }
  925. ,
  926. tour: function () {
  927. if (typeof(tourmode) != "undefined" && tourmode > 0){
  928. sys.sendMessage(src, "Sorry, you are unable to start a tournament because one is still currently running.");
  929. return;
  930. }
  931.  
  932. if (commandData.indexOf(':') == -1)
  933. commandpart = commandData.split(' ');
  934. else
  935. commandpart = commandData.split(':');
  936.  
  937. tournumber = parseInt(commandpart[1]);
  938.  
  939. if (isNaN(tournumber) || tournumber <= 2){
  940. sys.sendMessage(src, "You must specify a tournament size of 3 or more.");
  941. return;
  942. }
  943.  
  944. var tier = sys.getTierList();
  945. var found = false;
  946. for (var x in tier) {
  947. if (cmp(tier[x], commandpart[0])) {
  948. tourtier = tier[x];
  949. found = true;
  950. break;
  951. }
  952. }
  953. if (!found) {
  954. sys.sendMessage(src, "Sorry, the server does not recognise the " + commandpart[0] + " tier.");
  955. return;
  956. }
  957.  
  958. tourmode = 1;
  959. tourmembers = [];
  960. tourbattlers = [];
  961. tourplayers = [];
  962. battlesStarted = [];
  963. battlesLost = [];
  964.  
  965. sys.sendAll("");
  966. sys.sendAll(border);
  967. sys.sendAll("*** A Tournament was started by " + sys.name(src) + "! ***");
  968. sys.sendAll("PLAYERS: " + tournumber);
  969. sys.sendAll("TYPE: Single Elimination");
  970. sys.sendAll("TIER: " + tourtier);
  971. sys.sendAll("");
  972. sys.sendAll("*** Go in the Tournaments channel and type /join or !join to enter the tournament! ***");
  973. sys.sendAll(border);
  974. sys.sendAll("");
  975. return;
  976. }
  977. ,
  978. changecount: function () {
  979. if (tourmode != 1) {
  980. sendChanMessage(src, "Sorry, you are unable to join because the tournament has passed the sign-up phase.");
  981. return;
  982. }
  983. var count = parseInt(commandData);
  984.  
  985. if (isNaN(count) || count < 3) {
  986. return;
  987. }
  988.  
  989. if (count < tourmembers.length) {
  990. sendChanMessage(src, "There are more than that people registered");
  991. return;
  992. }
  993.  
  994. tournumber = count;
  995.  
  996. sys.sendAll("");
  997. sys.sendAll(border);
  998. sys.sendAll("~~Server~~: " + sys.name(src) + " changed the numbers of entrants to " + count + "!");
  999. sys.sendAll("*** " + this.tourSpots() + " more spot(s) left!");
  1000. sys.sendAll(border);
  1001. sys.sendAll("");
  1002.  
  1003. if (this.tourSpots() == 0 ){
  1004. tourmode = 2;
  1005. roundnumber = 0;
  1006. this.roundPairing();
  1007. }
  1008.  
  1009. return;
  1010. }
  1011. ,
  1012. endtour: function () {
  1013. if (tourmode != 0){
  1014. tourmode = 0;
  1015. sys.sendAll("");
  1016. sys.sendAll(border);
  1017. sys.sendAll("~~Server~~: The tournament was cancelled by " + sys.name(src) + " !" );
  1018. sys.sendAll(border);
  1019. sys.sendAll("");
  1020. }else
  1021. sendChanMessage(src, "Sorry, you are unable to end a tournament because one is not currently running.");
  1022. return;
  1023. }
  1024. });
  1025.  
  1026. var modCommands = ({
  1027. modcommands: function () {
  1028. sys.sendHtmlMessage(src, "<hr>");
  1029. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Mod Commands ***");
  1030. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/imp <font color=red>thing</f></b>: <font color=black>to impersonate something");
  1031. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/impOff</f></b>: <font color=black>to stop impersonating.");
  1032. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=red>end<font color=green>silence</b>: <font color=black> Silence/Desilence the chat.");
  1033. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/newpoll <font color=purple><b>question: <font color=red>option/option/option</f></b><font color=green></b>: </b><font color=black>start a new poll.");
  1034. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/pollclose</f></b>: <font color=black>to end a poll.");
  1035. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/kick <font color=red>person</f></b>: <font color=black> to kick someone");;
  1036. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/kickmsg <font color=blue>message</f></b>: <font color=black> to change the kickmessage");
  1037. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=orange>un<font color=green>mute <font color=red>person</f></b>: <font color=black>Mute/Unmute someone.");
  1038. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=green>changename <font color=red>name</f></b>: <font color=black>Change your name, keep your auth.");
  1039. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=green>changecolor <font color=purple>color</f></b>: <font color=black>Change your name, keep your auth.");
  1040. sys.sendHtmlMessage(src, "<hr>");
  1041. return; }
  1042.  
  1043. ,
  1044. pollclose: function () {
  1045. if (server.pollmode == 0) {
  1046. sys.sendMessage(src, "~~Bot~~: Poll is already closed. ");
  1047. return;}
  1048. server.pollmode = 0;
  1049. sys.sendAll("~~Bot~~: Poll was closed by " + sys.name(src) + ".");
  1050. var nu = [];
  1051. var tally = [];
  1052. for (var z in server.pollvotes) {
  1053. if (tally[server.pollvotes[z]] == undefined) {
  1054. tally[server.pollvotes[z]] = 1; }
  1055. else {
  1056. tally[server.pollvotes[z]] += 1; }
  1057. }
  1058. for (var z in tally) {
  1059. if (server.polloptions[z - 1] != undefined) {
  1060. sys.sendAll('~~Bot~~: Votes for option #'+z+'('+ server.polloptions[z - 1] +') - ' + tally[z]); }
  1061. }
  1062. server.pollmode = 1;
  1063. return; }
  1064. ,
  1065. newpoll: function () {
  1066. if (mcmd[0] == undefined || mcmd[1] == undefined) {
  1067. sys.sendMessage(src,'~~Bot~~: You fail.');
  1068. return; }
  1069. server.pollvotes = [];
  1070. server.polloptions = mcmd[1].split('/');
  1071. if (server.polloptions.length == 1) {
  1072. sys.sendMessage(src,'~~Bot~~: Error.');
  1073. return; }
  1074. sys.sendAll('~~Bot~~: Poll; ' + mcmd[0]);
  1075. sys.sendAll('~~Bot~~: Please vote! Use /vote option');
  1076. for ( var z in server.polloptions ) {
  1077. sys.sendAll('~~Bot~~: Option #'+(z*1+1)+': '+ server.polloptions[z]); }
  1078. server.pollmode = 1;
  1079. return; }
  1080. ,
  1081. imp: function () {
  1082. impersonation[src] = commandData;
  1083. sys.sendMessage(src, "Bot: Now you are " + impersonation[src] +"!");
  1084. return;
  1085. }
  1086. ,
  1087. changename: function () {
  1088. sys.changeName(src, commandData);
  1089. sys.sendMessage(src, "~~Bot~~: You changed your name to " + commandData + "!");
  1090. return;
  1091. }
  1092.  
  1093. ,
  1094. changecolor: function (src, tar, chan, str, args, args_l) {
  1095. var c = newColor(args[0]);
  1096. if ( (c.green <= 220 && c.lightness <= 140) || src.auth > 0) {
  1097. src.color = c; }
  1098. else {
  1099. return "You are not allowed to use that color."; }
  1100. return "You changed your color to "+ c +"."; }
  1101. ,
  1102. torture : function () {
  1103. if (tar == undefined) {
  1104. sys.sendMessage(src, "~~Bot~~: You fail. That person is either not on or does not exist");
  1105. return;
  1106. }
  1107.  
  1108. var Links=new Array();
  1109. Links[1]="~~Bot~~: " + commandData + " has died from a falling meteorite!";
  1110. Links[2]="~~Bot~~: " + commandData + " has been picked up and chucked down a hole :D";
  1111. Links[3]="~~Bot~~: " + commandData + " has been told to go to his room and died of bordum";
  1112. Links[4]="~~Bot~~: " + commandData + " has had a heart attack and fell of the Grand Canyon";
  1113. Links[5]="~~Bot~~: " + commandData + " got to gotten hit by a car and died in the hospital";
  1114. var i = Math.floor(5*Math.random())
  1115. sys.sendAll(Links[i]);
  1116. sys.kick(tar)
  1117. return; }
  1118. ,
  1119. impoff : function () {
  1120. delete impersonation[src];
  1121. sys.sendMessage(src, "Bot: Now you are yourself!");
  1122. return;
  1123. }
  1124. ,
  1125. kickmsg: function () {
  1126. kickmessage = commandData;
  1127. sys.sendAll("The kick message has been changed.");
  1128. return;
  1129. }
  1130.  
  1131. ,
  1132. kick : function () {
  1133. if (tar == undefined) {
  1134. return;
  1135. }
  1136. if (!kickmessage) {kickmessage = sys.getFileContent("kickmessage.txt");}
  1137. sys.sendAll("~~Bot~~: " + sys.name(tar) + " " + kickmessage);
  1138. sys.kick(tar);
  1139. return;
  1140. }
  1141. ,
  1142. mute: function () {
  1143. if (tar == undefined) {
  1144. return;
  1145. }
  1146. sys.sendAll("Bot: " + commandData + " was muted by " +sys.name(src) + "!");
  1147. muted[tar] = true;
  1148. return
  1149. }
  1150. ,
  1151. silence: function () {
  1152. sys.sendAll("~~Bot~~: The chat has been silenced by " + sys.name(src) + ".");
  1153. muteall = true;
  1154. return;
  1155. }
  1156. ,
  1157. endsilence: function () {
  1158. sys.sendAll("~~Bot~~: The chat was de-silenced!");
  1159. muteall = false;
  1160. return;
  1161. }
  1162. ,
  1163. unmute:function () {
  1164. if (tar == undefined) {
  1165. return;
  1166. }
  1167. sys.sendAll("Bot: " + commandData + " was unmuted by " +sys.name(src) + "!");
  1168. muted[tar] = false;
  1169. return;
  1170. }
  1171. })
  1172. var adminCommands = ({
  1173. admincommands : function () {
  1174. if (sys.auth(src) < 2) {
  1175. sys.sendMessage(src, "CommandBot: Your are not of the right authority to view these comamnds.");
  1176. return;
  1177. }
  1178. sys.sendHtmlMessage(src, "<hr>");
  1179. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Admin Commands ***");
  1180. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/reset</f></b>: <font color=black>to reset the server variables");
  1181. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/masskick</f></b>: <font color=black>to clean up the server");
  1182. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changeannouncement <font color=blue>message</f></b>: <font color=black>change announcement");
  1183. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/setPA <font color=gold>paname</f></b>: <font color=black>to add a new pa");
  1184. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearjournal</f></b>: <font color=black>to clear the journal");
  1185. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=orange>un<font color=green>ban <font color=red>person</f></b>: <font color=black>to ban/unban someone");
  1186. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearchat</f></b>: <font color=black>to clear the chat");
  1187. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/resetannouncement</f></b>: <font color=black>reset announcement");
  1188. sys.sendHtmlMessage(src, "<hr>");
  1189. return;
  1190. }
  1191. ,
  1192. reset : function () {
  1193. this.serverStartUp();
  1194. sys.sendAll("+Server: The server script variables were reset.");
  1195. return;
  1196. }
  1197. ,
  1198. changeannouncement: function () {
  1199. sys.setAnnouncement(commandData);}
  1200. ,
  1201. resetannouncement: function () {
  1202. sys.setAnnouncement("Announcement reset by<font color=" + sys.getColor(src) + "><b> " + sys.name(src));}
  1203. ,
  1204. changemotd:function () {
  1205. Topic = commandData;
  1206. sys.sendAll("The MOTD has been changed.");}
  1207. ,
  1208. ban:function () {
  1209. if(sys.dbIp(commandData) == undefined) {
  1210. sys.sendMessage(src, "+Bot: No player exists by this name!");
  1211. return;
  1212. }
  1213.  
  1214. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  1215. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  1216. return;
  1217. }
  1218. var ip = sys.dbIp(commandData);
  1219. var alias=sys.aliases(ip)
  1220. var y=0;
  1221. var z;
  1222. for(var x in alias) {
  1223. z = sys.dbAuth(alias[x])
  1224. if (z > y) {
  1225. y=z
  1226. }
  1227. }
  1228. if(y>=sys.auth(src)) {
  1229. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  1230. return;
  1231. }
  1232. var banlist=sys.banList()
  1233. for(a in banlist) {
  1234. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  1235. sys.sendMessage(src, "+Bot: He/she's already banned!");
  1236. return;
  1237. }
  1238. }
  1239.  
  1240. sys.sendHtmlAll('<b><font color=red>' + commandData + ' was banned by ' + sys.name(src) + '!</font></b>');
  1241. if(tar != undefined) {
  1242. sys.kick(tar)
  1243. }
  1244. sys.ban(commandData)
  1245. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
  1246. return;
  1247. }
  1248. ,
  1249. unban: function () {
  1250. if(sys.dbIp(commandData) == undefined) {
  1251. sys.sendMessage(src, "+Bot: No player exists by this name!");
  1252. return;
  1253. }
  1254. var banlist=sys.banList()
  1255. for(a in banlist) {
  1256. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  1257. sys.unban(commandData)
  1258. sys.sendMessage(src, "+Bot: You unbanned " + commandData + "!");
  1259. sys.appendToFile('bans.txt', sys.name(src) + ' unbanned ' +commandData + "n")
  1260. return;
  1261. }
  1262. }
  1263. sys.sendMessage(src, "+Bot: He/she's not banned!");
  1264. return;
  1265.  
  1266. }
  1267. ,
  1268.  
  1269. silentkick : function () {
  1270. if (sys.auth(src) < 3) {
  1271. return;
  1272. }
  1273. if (tar == undefined) {
  1274. return;
  1275. }
  1276. sys.kick(tar);
  1277. return;
  1278. }
  1279. ,
  1280. clearchat:function () {
  1281. var c;
  1282. for (c=0;c<2999;c++) {
  1283. sys.sendAll("");
  1284. }
  1285. sys.clearChat();
  1286. sys.sendAll(sys.name(src) + " cleared the chat!");
  1287. return;
  1288. }
  1289. ,
  1290. setpa:function () {
  1291. sys.setPA(commandData);
  1292. sys.sendMessage(src, "Bot: -" + commandData + "- was set!");
  1293. return;
  1294. }
  1295. ,
  1296. clearjournal:function () {
  1297. var get = sys.getFileContent("gb");
  1298. sys.deleteFile("gb");
  1299. sys.sendAll("The guest book was cleared!");
  1300. sys.writeToFile("gb","This is the guest book. Comments are listed below:<br><br>");
  1301. return;
  1302. }
  1303. ,
  1304. masskick:function () {
  1305. for (var i = 1; i < 200 && sys.numPlayers() > 0; i++) {
  1306. if (sys.loggedIn(i)) {
  1307. sys.kick(i);
  1308. }
  1309. }
  1310. return;
  1311. }
  1312. });
  1313. var ownerCommands = ({
  1314.  
  1315. ownercommands : function () {
  1316. sys.sendHtmlMessage(src, "<hr>");
  1317. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Owner Commands ***");
  1318. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/silentkick<font color=red> person</f></b>: <font color=black>to silently kick someone");
  1319. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/silentban<font color=red> person</f></b>: <font color=black>to silently ban someone");
  1320. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/id <font color=red>person</f></b>: <font color=black>show the id of someone.");
  1321. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/authoptions</f></b>: <font color=black>see what you do to auth people.");
  1322. sys.sendHtmlMessage(src, "<hr>");
  1323. return;
  1324. }
  1325. ,
  1326. authoptions: function () {
  1327. sys.sendHtmlMessage(src, "<hr>");
  1328. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b> *** Auth Options ***</b></f>");
  1329. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>user <font color=red>person</f></b>: <font color=black> to user someone.");
  1330. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>mod <font color=red>person</f></b>: <font color=black> to mod someone.");
  1331. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>admin <font color=red>person</f></b>: </b><font color=black> to admin someone.");
  1332. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>owner <font color=red>person</f></b>:<font color=black> to owner someone.");
  1333. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b> /<font color=purple>s<font color=green>invisible <font color=red>person</f></b>:<font color=black> to invisible someone.");
  1334. sys.sendHtmlMessage(src, "<hr>");
  1335. }
  1336. ,
  1337. silentban:function () {
  1338. if(sys.dbIp(commandData) == undefined) {
  1339. sys.sendMessage(src, "+Bot: No player exists by this name!");
  1340. return;
  1341. }
  1342. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  1343. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  1344. return;
  1345. }
  1346. var ip = sys.dbIp(commandData);
  1347. var alias=sys.aliases(ip)
  1348. var y=0;
  1349. var z;
  1350. for(var x in alias) {
  1351. z = sys.dbAuth(alias[x])
  1352. if (z > y) {
  1353. y=z
  1354. }
  1355. }
  1356. if(y>=sys.auth(src)) {
  1357. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  1358. return;
  1359. }
  1360. var banlist=sys.banList()
  1361. for(a in banlist) {
  1362. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  1363. sys.sendMessage(src, "+Bot: He/she's already banned!");
  1364. return;
  1365. }
  1366. }
  1367.  
  1368. if(tar != undefined) {
  1369. sys.kick(tar)
  1370. }
  1371. sys.ban(commandData)
  1372. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
  1373. return;
  1374. }
  1375. ,
  1376. id: function () {
  1377. if (tar == undefined) {
  1378. sys.sendMessage(src, "~~Bot~~: That person doesnt exist or isnt on the Server!");
  1379. return;
  1380. }
  1381. sys.sendMessage(src, sys.name(tar) + "s ID: " + tar);
  1382. return;
  1383. }
  1384. ,
  1385. user: function () {
  1386. if (tar == undefined) {
  1387. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1388. return;
  1389. }
  1390. sys.sendAll("+Bot: " + commandData + " was usered.");
  1391. sys.changeAuth(tar, 0);
  1392. return;
  1393. }
  1394. ,
  1395. mod: function () {
  1396. if (tar == undefined) {
  1397. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1398. return;
  1399. }
  1400. sys.sendAll("+Bot: " + commandData + " was made a moderator.");
  1401. sys.changeAuth(tar, 1);
  1402. return;
  1403. }
  1404. ,
  1405. admin: function () {
  1406. if (tar == undefined) {
  1407. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1408. return;
  1409. }
  1410. sys.sendAll("+Bot: " + commandData + " is now an admin.");
  1411. sys.changeAuth(tar, 2);
  1412. }
  1413. ,
  1414. owner: function () {
  1415. if (tar == undefined) {
  1416. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1417. return;
  1418. }
  1419. sys.sendAll("+Bot: " + commandData + " is now a server owner!");
  1420. sys.changeAuth(tar, 3);
  1421. }
  1422. ,
  1423. invisible: function () {
  1424. if (tar == undefined) {
  1425. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1426. return;
  1427. }
  1428. sys.sendAll("+Bot: " + commandData + " now has invisible authority!");
  1429. sys.changeAuth(tar, 4);
  1430. return;
  1431. }
  1432. ,
  1433. suser: function () {
  1434. if (tar == undefined) {
  1435. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1436. return;
  1437. }
  1438. sys.changeAuth(tar, 0);
  1439. }
  1440. ,
  1441. smod: function () {
  1442. if (tar == undefined) {
  1443. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1444. return;
  1445. }
  1446. sys.changeAuth(tar, 1);
  1447. }
  1448. ,
  1449. sadmin: function () {
  1450. if (tar == undefined) {
  1451. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1452. return;
  1453. }
  1454. sys.changeAuth(tar, 2);
  1455. }
  1456. ,
  1457. sowner: function () {
  1458. if (tar == undefined) {
  1459. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1460. return;
  1461. }
  1462. sys.changeAuth(tar, 3);
  1463. return;
  1464. }
  1465. ,
  1466. sinvisible: function () {
  1467. if (tar == undefined) {
  1468. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1469. return;
  1470. }
  1471. sys.changeAuth(tar, 4);
  1472. return;
  1473. }
  1474. ,
  1475. clearpass: function () {
  1476. if (sys.auth < 4) {
  1477. sys.sendMessage(src, "~~Bot~~: You need to be an invisible authority to clear someones password.");
  1478. return;
  1479. }
  1480. sys.clearPass(commandData);
  1481. sys.sendAll("~~Bot~~: " + commandData + "'s password has been cleared by " + sys.name(src) + ".");
  1482. return;
  1483. }
  1484.  
  1485. ,
  1486. invisiblecommands : function () {
  1487. if (sys.auth(src) < 4) {
  1488. sys.sendMessage(src, "~~Bot~~: Sir these are NOT for you");
  1489. return;
  1490. }
  1491. sys.sendHtmlMessage(src, "<hr>");
  1492. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Invisible Commands ***");
  1493. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/eval<font color=cyan> script</f></b>: <font color=black> evaluate a script");
  1494. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearpass<font color=red> person</f></b>: <font color=black> clear a password");
  1495. sys.sendHtmlMessage(src, "<hr>");}
  1496. ,
  1497. eval: function () {
  1498. if (sys.auth < 4) {
  1499. sys.sendMessage(src, "~~Bot~~: You need to be an invisible authority to clear someones password.");
  1500. return;
  1501. }
  1502. sys.eval(commandData);}
  1503. });
  1504. var getCommand = ({
  1505. '0': function (name) {
  1506. if (name in userCommands) {
  1507. return userCommands[name]; }
  1508. }
  1509. ,
  1510. '1': function (name) {
  1511. if (name in modCommands) {
  1512. return modCommands[name]; }
  1513. else if (name in userCommands) {
  1514. return userCommands[name]; }
  1515. }
  1516. ,
  1517. '2' : function (name) {
  1518. if (name in adminCommands) {
  1519. return adminCommands[name]; }
  1520. else if (name in modCommands) {
  1521. return modCommands[name]; }
  1522. else if (name in userCommands) {
  1523. return userCommands[name]; }
  1524. }
  1525. ,
  1526. '3' : function (name) {
  1527. if (name in ownerCommands) {
  1528. return ownerCommands[name]; }
  1529. else if (name in adminCommands) {
  1530. return adminCommands[name]; }
  1531. else if (name in modCommands) {
  1532. return modCommands[name]; }
  1533. else if (name in userCommands) {
  1534. return userCommands[name]; }
  1535. }
  1536. ,
  1537. '4' : function (name) {
  1538. if (name in ownerCommands) {
  1539. return ownerCommands[name]; }
  1540. else if (name in adminCommands) {
  1541. return adminCommands[name]; }
  1542. else if (name in modCommands) {
  1543. return modCommands[name]; }
  1544. else if (name in userCommands) {
  1545. return userCommands[name]; }
  1546. }
  1547. });
  1548. var cmd = getCommand[sys.auth(src)](command);
  1549. if (!cmd) {
  1550. sys.sendMessage(src, getCommand[3](command) ? "+Bot: You aren't allowed to use that command." : "+Bot: That command doesn't exist." );
  1551. return; }
  1552. cmd();
  1553. return;
  1554.  
  1555. }
  1556. if (typeof impersonation[src] != 'undefined') {
  1557. sys.stopEvent();
  1558. sys.sendAll(impersonation[src] + ": " + message);
  1559. return;
  1560. }
  1561. }
  1562.  
  1563. ,
  1564.  
  1565. beforeChallengeIssued : function (src, dest, clauses) {
  1566. /* Challenge Cup Clause */
  1567. if (clauses[7] == 1)
  1568. return;
  1569.  
  1570. if (clauseOn[dest] == true) {
  1571. for (var i = 0; i < 6; i++) {
  1572. if (hasBan(dest, sys.teamPoke(src,i))) {
  1573. sys.sendMessage(src, "ClauseBot: Your opponent is afraid of " + sys.pokemon(sys.teamPoke(src,i)));
  1574. sys.stopEvent();
  1575. return;
  1576. }
  1577. }
  1578. }
  1579. if (clauseOn[src] == true) {
  1580. for (var i = 0; i < 6; i++) {
  1581. if (hasBan(src, sys.teamPoke(dest,i))) {
  1582. sys.sendMessage(src, "ClauseBot: You are afraid of some pokemon of the opponent, so I won't let you challenge them.");
  1583. sys.stopEvent();
  1584. return;
  1585. }
  1586. }
  1587. }
  1588.  
  1589. /* Regular tier checks that can't be made using the built-in server tier system */
  1590. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1591. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  1592. sys.sendMessage(src, "+Bot: SonicBoom and Dragon Rage are banned in Little Cup!");
  1593. sys.stopEvent();
  1594. }
  1595. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  1596. sys.sendMessage(src, "+Bot: Your opponent has banned moves SonicBoom or Dragon Rage in Little Cup tier!");
  1597. sys.stopEvent();
  1598. }
  1599. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  1600. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup!");
  1601. sys.stopEvent();
  1602. }
  1603. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  1604. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup and your opponent has it!");
  1605. sys.stopEvent();
  1606. }
  1607. }
  1608. }
  1609.  
  1610. ,
  1611.  
  1612. beforeBattleMatchup : function(src,dest,clauses)
  1613. {
  1614. if (clauseOn[dest] == true) {
  1615. for (var i = 0; i < 6; i++) {
  1616. if (hasBan(dest, sys.teamPoke(src,i))) {
  1617. sys.stopEvent();
  1618. return;
  1619. }
  1620. }
  1621. }
  1622. if (clauseOn[src] == true) {
  1623. for (var i = 0; i < 6; i++) {
  1624. if (hasBan(src, sys.teamPoke(dest,i))) {
  1625. sys.stopEvent();
  1626. return;
  1627. }
  1628. }
  1629. }
  1630.  
  1631. /* Regular tier checks that can't be made using the built-in server tier system */
  1632. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1633. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  1634. sys.stopEvent();
  1635. }
  1636. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  1637. sys.stopEvent();
  1638. }
  1639. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  1640. sys.stopEvent();
  1641. }
  1642. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  1643. sys.stopEvent();
  1644. }
  1645. }
  1646. }
  1647.  
  1648. ,
  1649.  
  1650. beforeBattleStarted : function(src, dest) {
  1651. /* If this is little cup, the levels are changed to be level 5 */
  1652. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1653. lilCupLevels[src] = [sys.teamPokeLevel(src, 0), sys.teamPokeLevel(src,1), sys.teamPokeLevel(src, 2), sys.teamPokeLevel(src, 3), sys.teamPokeLevel(src, 4),sys.teamPokeLevel(src, 5)];
  1654. lilCupLevels[dest] = [sys.teamPokeLevel(dest, 0),sys.teamPokeLevel(dest, 1), sys.teamPokeLevel(dest, 2), sys.teamPokeLevel(dest, 3),sys.teamPokeLevel(dest, 4), sys.teamPokeLevel(dest, 5)];
  1655. for (var i = 0; i < 6; i+=1) {
  1656. if (sys.teamPokeLevel(src, i) > 5)
  1657. sys.changePokeLevel(src, i, 5);
  1658. if (sys.teamPokeLevel(dest, i) > 5)
  1659. sys.changePokeLevel(dest, i, 5);
  1660. }
  1661. }
  1662. }
  1663.  
  1664. ,
  1665.  
  1666. afterBattleEnded: function(src, dest) {
  1667. /* If this is little cup, the levels are to be changed back! */
  1668. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup" && lilCupLevels[src]!= undefined && lilCupLevels[dest] != undefined) {
  1669. for (var i = 0; i < 6; i+=1) {
  1670. if (sys.teamPokeLevel(src, i) != lilCupLevels[src][i])
  1671. sys.changePokeLevel(src, i,lilCupLevels[src][i]);
  1672. if (sys.teamPokeLevel(dest, i) != lilCupLevels[dest][i])
  1673. sys.changePokeLevel(dest, i,lilCupLevels[dest][i]);
  1674. }
  1675. }
  1676. }
  1677.  
  1678. ,
  1679.  
  1680. beforeLogOut : function (src) {
  1681. sys.sendHtmlAll("<font color= " + sys.getColor(src) + "><timestamp/><b> " + sys.name(src) + "</b><font color=black> has left Unova League!");
  1682. if (muted[src] == true) {
  1683. sys.saveVal("muted*" + sys.ip(src), "true");
  1684. } else {
  1685. sys.removeVal("muted*" + sys.ip(src));
  1686. }
  1687. }
  1688.  
  1689. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement