Advertisement
Guest User

Untitled

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