Advertisement
Guest User

Untitled

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