Advertisement
Guest User

Untitled

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