Advertisement
Guest User

Untitled

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