Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 102.36 KB | None | 0 0
  1. ({
  2. serverStartUp : function() {
  3. this.init();
  4. }
  5. ,
  6. init : function() {
  7. lastMemUpdate = 0;
  8.  
  9. key = function(a,b) {
  10. return a + "*" + sys.name(b);
  11. }
  12.  
  13. semiUbers = [];
  14.  
  15. var tempU = new Array(150,249,250,382,383,384,483,484,487,505);
  16. for (x in tempU) {
  17. semiUbers[tempU[x]] = true;
  18. }
  19.  
  20. saveKey = function(thing, id, val) {
  21. sys.saveVal(key(thing,id), val);
  22. }
  23.  
  24. getKey = function(thing, id) {
  25. return sys.getVal(key(thing,id));
  26. }
  27.  
  28. hasBan = function(id, poke) {
  29. return clauses[id].indexOf("*" + poke + "*") != -1;
  30. }
  31.  
  32. cmp = function(a, b) {
  33. return a.toLowerCase() == b.toLowerCase();
  34. }
  35.  
  36. if (typeof(varsCreated) != 'undefined')
  37. return;
  38.  
  39. battlesStopped = false;
  40. channelUsers = [];
  41. channelTopics = [];
  42.  
  43. sys.setPA("forceSameTier");
  44. sys.setPA("touruser");
  45. sys.setPA("rangebans");
  46. sys.setPA("tourmod");
  47. sys.setPA("tourowner");
  48. sys.setPA("megaUser");
  49. megausers = sys.getVal("megausers");
  50.  
  51. siggamute = (sys.getVal("SiggaMute") == "1");
  52. siggaban = (sys.getVal("SiggaBan") == "1");
  53.  
  54.  
  55. muteall = false;
  56.  
  57. sys.setPA ("impersonation");
  58. sys.setPA ("muted");
  59. sys.setPA("caps");
  60. sys.setPA("timeCount");
  61. sys.setPA("floodCount");
  62. sys.setPA("joinoff");
  63. maxPlayersOnline = 0;
  64.  
  65. if (sys.existChannel("RP Channel")) {
  66. rpchannel = sys.channelId("RP Channel");
  67. } else {
  68. rpchannel = sys.createChannel("RP Channel");
  69. }
  70. if (sys.existChannel("RP Channel")== false) {
  71. sys.createChannel("RP Channel");
  72. }
  73. if (sys.existChannel("League")) {
  74. leaguechannel = sys.channelId("League");
  75. } else {
  76. leaguechannel = sys.createChannel("League");
  77. }
  78. if (sys.existChannel("League")== false) {
  79. sys.createChannel("League");
  80. }
  81. if (sys.existChannel("Staff Channel")) {
  82. staffchannel = sys.channelId("Staff Channel");
  83. } else {
  84. staffchannel = sys.createChannel("Staff Channel");
  85. }
  86. if (sys.existChannel("Staff Channel")== false) {
  87. sys.createChannel("Staff Channel");
  88. }
  89. if (sys.existChannel("Scripting School")) {
  90. sschannel = sys.channelId("Scripting School");
  91. } else {
  92. sschannel = sys.createChannel("Scripting School");
  93. }
  94. if (sys.existChannel("Scripting School")== false) {
  95. sys.createChannel("Scripting School");
  96. }
  97. if (sys.existChannel("Scripting Room")) {
  98. srchannel = sys.channelId("Scripting Room");
  99. } else {
  100. srchannel = sys.createChannel("Scripting Room");
  101. }
  102. if (sys.existChannel("Scripting Room")== false) {
  103. sys.createChannel("Scripting Room");
  104. }
  105.  
  106. }
  107.  
  108. ,
  109.  
  110.  
  111. afterNewMessage : function (message) {
  112. if (message == "Script Check: OK") {
  113. sys.sendHtmlAll("<timestamp/><font color=orange><b>~~Server~~</f></b>:<font color=black> Script Check: <font color=black>Scripts were updated by the server!</f>");
  114. this.init();
  115. }
  116. }
  117.  
  118. ,
  119.  
  120. afterLogIn : function(src) {
  121. /* Welcome TUO*/
  122. if (sys.name(src) == "TheUnknownOne") {
  123. sys.sendHtmlAll("<font color=red><b>~~Server~~</b>: <font color=black>Please welcome the server co-owner <b>" + sys.name(src) + "</b>!");
  124. sys.changeAuth(src, 3);
  125. return;
  126. }
  127. /* Welcome Darkness*/
  128. if (sys.name(src) == "Darkness") {
  129. sys.sendHtmlAll("<font color=black><b>~~Server~~</b>: <font color=black>Please welcome one of the site owners <b>Darkness</b>!");
  130. return;
  131. }
  132. /* Welcome Coyotte508*/
  133. if (sys.name(src) == "coyotte508") {
  134. sys.sendHtmlAll("<font color=green><b>~~Server~~</b>: <font color=black>Please welcome the head programmer of PO <b>coyotte508</b>!");
  135. return;
  136. }
  137. /* Welcome Crystal Moogle*/
  138. if (sys.name(src) == "Crystal Moogle") {
  139. sys.sendHtmlAll("<font color=pink><b>~~Server~~</b>: <font color=black>Please welcome one of the site owners <b>Crystal Moogle</b>!");
  140. return;
  141. }
  142. sys.sendHtmlMessage(src, "<font color=green><b>+CommandBot</b>:</f> <font color=black>Use /commands or !commands to see the commands!");
  143.  
  144. if (sys.auth(src) == 0) {
  145. sys.sendHtmlAll("<font color=green><timestamp/><b>~~Server~~:</font></b> Please welcome <b>" + sys.name(src) + "</font></b>!");
  146. }
  147. if (sys.auth(src) == 1) {
  148. sys.sendHtmlAll("<font color=blue><timestamp/>~~Server~~:</font><b> Please welcome moderator <b>" + sys.name(src) + "</font></b>!");
  149. }
  150. if (sys.auth(src) == 2) {
  151. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Server~~:</font><b> Please welcome administrator <b>" + sys.name(src) + "</font></b>!");
  152. }
  153. if (sys.auth(src) == 3) {
  154. sys.sendHtmlAll("<font color=red><timestamp/><b>~~Server~~:</font><b> Please welcome owner <b>" + sys.name(src) + "</font></b>!");
  155. }
  156. if (sys.auth(src) == 4) {
  157. sys.sendHtmlAll("<font color=LimeGreen><timestamp/><b>~~Server~~:</font><b> Please welcome Hidden Auth <b>" + sys.name(src) + "</font></b>!");
  158. }
  159.  
  160. if (sys.getVal("muted*" + sys.ip(src)) == "true")
  161. muted[src] = true;
  162.  
  163. if (sys.numPlayers() > maxPlayersOnline) {
  164. maxPlayersOnline = sys.numPlayers();
  165. }
  166.  
  167. if (maxPlayersOnline > sys.getVal("MaxPlayersOnline")) {
  168. sys.saveVal("MaxPlayersOnline", maxPlayersOnline);
  169. }
  170.  
  171. if (!Topic) {Topic = sys.getFileContent("topic.txt");}
  172. sys.sendHtmlMessage(src,'<b><font color=limegreen>±Motd:<font color=black> </b>' + Topic);
  173. sys.sendMessage(src,"");
  174.  
  175. sys.sendMessage(src, "");
  176.  
  177. this.afterChangeTeam(src);
  178. }
  179.  
  180. ,
  181.  
  182. beforeChatMessage: function(src, message) {
  183. if (sys.auth(src) < 3 && muted[src] == true) {
  184. sys.stopEvent();
  185. sys.sendMessage(src, "~~Server~~: Sorry you have been muted for breaking the rules!");
  186. return;
  187. }
  188.  
  189. if ((message[0] == '/' || message[0] == '!') && message.length > 1) {
  190. if (parseInt(sys.time()) - lastMemUpdate > 500) {
  191. sys.clearChat();
  192. lastMemUpdate = parseInt(sys.time());
  193. }
  194. print("Command -- " + sys.name(src) + ": " + message);
  195. sys.stopEvent();
  196. var command;
  197. var commandData;
  198. var pos = message.indexOf(' ');
  199. var mcmd = [];
  200.  
  201. if (pos != -1) {
  202. command = message.substring(1, pos).toLowerCase();
  203. commandData = message.substr(pos+1);
  204. mcmd = commandData.split(':');
  205. } else {
  206. command = message.substr(1).toLowerCase();
  207. }
  208. var tar = sys.id(commandData);
  209.  
  210. function sendChanMessage(src, msg) {
  211. sys.sendMessage(src, msg, chan); }
  212.  
  213. var userCommands = ({
  214. "usercommands" : function () {
  215. sys.sendHtmlMessage(src, "<hr>");
  216. sys.sendHtmlMessage(src, "<font color=cornflowerblue><timestamp/><b>*** <font color=black>User Commands <font color=cornflowerblue>***</f>");
  217. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/catch</b></f>: <font color=black>to catch a pokemon. Theres a small chance you get a <font color=gold><b>Shiny</b><font color=black>, if you do be sure to put it in the journal!</f>");
  218. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/auth <font color=red>Name</b></f>: <font color=black>to show the server authlist</f>");
  219. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Name<font color=black> is either Mods, Admins or Owners, if you leave the <font color=green>Auth<font color=black> blank it shows all server auth.</f>");
  220. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/rules</b></f>: <font color=black>to show the server rules</f>");
  221. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/players</f></b>: <font color=black>to get the number of players online");
  222. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/torture <font color=red>Person</b></f> : <font color=black>to torture someone, its fun too! It gets a random result é.é");
  223. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Person<font color=black> is any online person on the server.</f>");
  224. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/credits</b></f>: <font color=black>to view the credits and how to get these scripts.");
  225. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/viewjournal</b></f>: <font color=black>to view the book of wonderful comments");
  226. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=black> IF you see a trolled guest book please report this to the server Admins/Owners.");
  227. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/signjournal <font color=red> Quote/Message</b></f>: <font color=black>be apart of the wonderful journal!");
  228. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Quote/Message</f><font color=black> is any quote or message you would like to share.");
  229. sys.sendHtmlMessage(src, "<hr>");
  230. return;
  231. }
  232. ,
  233. burn : function () {
  234. if (tar == undefined) {
  235. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b></font> Well you fail, either you didnt type the persons name right or that person isnt on");
  236. return;
  237. }
  238. sys.sendHtmlAll("<timestamp/><img src='themes/classic/status/battle_status4.png'><b> " + sys.name(tar) + " has been burned in <font color=red>hot lava</u></font> by " + sys.name(src) + " <img src='themes/classic/status/battle_status4.png'></b>");
  239. return;
  240. }
  241. ,
  242. poison : function () {
  243. if (tar == undefined) {
  244. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b></font> Well you fail, either you didnt type the persons name right or that person isnt on");
  245. return;
  246. }
  247. sys.sendHtmlAll("<timestamp/><img src='themes/classic/status/battle_status5.png'><b> " + sys.name(tar) + " has been poisoned after <font color=purple>drinking a poisoned drink</u></font> by " + sys.name(src) + " <img src='themes/classic/status/battle_status5.png'></b>");
  248. return;
  249. }
  250. thunder : function () {
  251. if (tar == undefined) {
  252. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b></font> Well you fail, either you didnt type the persons name right or that person isnt on");
  253. return;
  254. }
  255. sys.sendHtmlAll("<timestamp/><img src='themes/classic/status/battle_status1.png'><b> " + sys.name(tar) + " has been <font color=gold>hitted by thunder</u></font> by " + sys.name(src) + " <img src='themes/classic/status/battle_status1.png'></b>");
  256. return;
  257. }
  258. ,
  259. sleep : function () {
  260. if (tar == undefined) {
  261. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b></font> Well you fail, either you didnt type the persons name right or that person isnt on");
  262. return;
  263. }
  264. sys.sendHtmlAll("<timestamp/><img src='themes/classic/status/battle_status2.png'><b> " + sys.name(tar) + " has been <font color=gray> put to sleep</u></font> by " + sys.name(src) + " <img src='themes/classic/status/battle_status2.png'></b>");
  265. return;
  266. }
  267. ,
  268. commands: function () {
  269. sys.sendHtmlMessage(src, "<hr>");
  270. sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>*** Commands ***");
  271. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/UserCommands</f></b>: <font color=green>For Users");
  272. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/HtmlCommands</f></b>: <font color=purple>For HTML Commands");
  273. sys.sendHtmlMessage(src, "<font color=gold><timestamp/><b>/TourCommands</f></b>: <font color=gold>For Tour Commands");
  274. if (sys.auth(src) < 1) {
  275. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~</f></b>: <font color=black>Sorry but you need auth if you want to see the other commands.");
  276. sys.sendHtmlMessage(src, "<hr>");
  277. return;
  278. }
  279. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/ModCommands</f></b>: <font color=blue>For Moderators");
  280. if (sys.auth(src) < 2) {
  281. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~</f></b>: <font color=black>Sorry but you need higher auth if you want to see the other commands.");
  282. sys.sendHtmlMessage(src, "<hr>");
  283. return;
  284. }
  285. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/AdminCommands</f></b>: <font color=orange>For Administrators");
  286. if (sys.auth(src) < 3) {
  287. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~</f></b>: <font color=black>Sorry but you need higher auth if you want to see the other commands.");
  288. sys.sendHtmlMessage(src, "<hr>");
  289. return;
  290. }
  291. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/OwnerCommands</f></b>: <font color=red>For Owners");
  292. sys.sendHtmlMessage(src, "<hr>");
  293. return; }
  294. ,
  295. me:function () {
  296. sys.sendAll("*** " + sys.name(src) + " " + commandData); }
  297. ,
  298. htmlme:function () {
  299. sys.sendHtmlAll("<font color=fuchsia><timestamp/>*** </font> <b>" + sys.name(src) + "</b> " + commandData); }
  300. ,
  301. htmlcommands: function () {
  302. sys.sendHtmlMessage(src, "<hr>");
  303. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>*** <font color=black>Html Commands <font color=red>***</f>");
  304. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendAll <font color=red>Message<font color=black></b> : <font color=black>to send a message to everyone</f>.");
  305. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message.</f>");
  306. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendmessage <font color=red>Message<font color=black></b> : <font color=black>to send a message to yourself.");
  307. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message.</f>");
  308. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendHtmlAll <font color=red>Message<font color=black></b> : <font color=black>to send a message to everyone using HTML.");
  309. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message, HTML Allowed</f>");
  310. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendHtmlMessage <font color=red>Message<font color=black></b> : <font color=black>to send a message to yourself using HTML.");
  311. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message, HTML Allowed</f>");
  312. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/me <font color=red>Message</b><font color=black>: to send a message to everyone with *** before your name</f>");
  313. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message.</f>");
  314. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/htmlme <font color=red>Message</b><font color=black>: to send a message to everyone with *** before your name</f>");
  315. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message, HTML Allowed</f>");
  316. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/imgoptions <font color=black>: to see all options with img, mostly fun based</f>");
  317. sys.sendHtmlMessage(src, "<hr>");
  318. return; }
  319. ,
  320. tourcommands: function () {
  321. sys.sendHtmlMessage(src, "<hr>");
  322. sys.sendHtmlMessage(src, "<font color=gold><timestamp/><b>*** <font color=black>Tour Commands <font color=gold>***</f>");
  323. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/join <font color=black></b> : <font color=black>to join the tour</f>.");
  324. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/leave <font color=black></b> : <font color=black>to leave the tour</f>.");
  325. if (sys.auth(src) < 1) {
  326. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to the see other commands you need auth.</f>.");
  327. sys.sendHtmlMessage(src, "<hr>");
  328. return;
  329. }
  330. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/settier <font color=red>Tier<font color=black></b> : <font color=black>to send a the message what the tier is</f>.");
  331. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Tier<font color=black> is any message, if you want a falid tour put a tier that exists.</f>");
  332. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/setpeople <font color=red>People<font color=black></b> : <font color=black>to send the message that shows how many people may join the tour.");
  333. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> People<font color=black> is any number of people, for a falid tour put numbers.</f>");
  334. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/tour <font color=black></b> : <font color=black>to show that a tour is about to start.");
  335. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/round <font color=red>Number<font color=black></b> : <font color=black>to show the current round.");
  336. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Number<font color=black> is any number</f>");
  337. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/round<font color=red>1/2/3/4/5</b><font color=black>: to show the current round</f>");
  338. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> 1/2/3/4/5<font color=black> is the current round, must be placed like /round1 to work and this only works for numbers 1 to 5.</f>");
  339. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/joinon <font color=black></b> : <font color=black>to start the signups</f>.");
  340. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/joinoff <font color=black></b> : <font color=black>to end the signups</f>.");
  341. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/massdq <font color=black></b> : <font color=black>to DQ all people in the tour.");
  342. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/endtour <font color=black></b> : <font color=black>to end the current tour.");
  343. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/push <font color=red>Person<font color=black></b> : <font color=black>to put someone in the tour.");
  344. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Person<font color=black> is any online player.</f>");
  345. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/dq <font color=red>Person<font color=black></b> : <font color=black>to DQ someone from the tour.");
  346. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Person<font color=black> is any online player.</f>");
  347. if (sys.auth(src) < 3) {
  348. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to the see other commands you need higher auth.</f>.");
  349. sys.sendHtmlMessage(src, "<hr>");
  350. return;
  351. }
  352. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>AuthName<font color=red> Person</f></b>: <font color=black>give someone tour auth.");
  353. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=blue> TourAuthName</f><font color=black> is any tourauthname, <font color=red>Person<font color=black> is any online player.");
  354. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/tourauthnames</f></b>: <font color=black>view authnames for the /TourAuthName.");
  355. sys.sendHtmlMessage(src, "<hr>");
  356. return; }
  357. ,
  358. join : function () {
  359. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>" + sys.name(src) + "</b> has joined the tour</font></b>!");
  360. return; }
  361. ,
  362. leave : function () {
  363. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>" + sys.name(src) + "</b> has left the tour</font></b>!");
  364. return; }
  365. ,
  366. dq : function () {
  367. if (sys.auth(src) < 1) {
  368. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to use this command you need auth.</f>.");
  369. return;
  370. }
  371. if (tar == undefined) {
  372. return;
  373. }
  374. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>" + commandData + "</b> has been DQed by " + sys.name(src) + "</font></b>!");
  375. sys.sendHtmlMessage(tar, "<font color=orange><timestamp/><b>~~Bot~~:</font></b> You have been DQed from the tour by " + sys.name(src) + "</font></b>!");
  376. return; }
  377. ,
  378. push : function () {
  379. if (sys.auth(src) < 1) {
  380. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to use the command you need auth.</f>.");
  381. return;
  382. }
  383. if (tar == undefined) {
  384. return;
  385. }
  386. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>" + commandData + "</b> has been pushed in the tour by " + sys.name(src) + "</font></b>!");
  387. sys.sendHtmlMessage(tar, "<font color=orange><timestamp/><b>~~Bot~~:</font></b> You have been pushed in the tour by " + sys.name(src) + "</font></b>!");
  388. return; }
  389. ,
  390. massdq : function () {
  391. if (sys.auth(src) < 1) {
  392. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to use this command you need auth.</f>.");
  393. return;
  394. }
  395. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>All people who joined have been DQed by" + sys.name(src) + "</font></b>!");
  396. return; }
  397. ,
  398. sendmessage : function () {
  399. sys.sendMessage(src, commandData); }
  400. ,
  401. sendhtmlmessage : function () {
  402. sys.sendHtmlMessage(src, commandData); }
  403. ,
  404. sendall : function () {
  405. sys.sendAll(commandData); }
  406. ,
  407. sendhtmlall : function () {
  408. sys.sendHtmlAll(commandData); }
  409. ,
  410. credits:function () {
  411. sys.sendHtmlMessage(src, "<hr>");
  412. sys.sendHtmlMessage(src, "<timestamp/><b><font color=skyblue><font size=3>Max for making the basic of these scripts!");
  413. sys.sendHtmlMessage(src, "<timestamp/><b><font color=red><font size=3>TheUnknownOne for adding commands and the tour script also for the editing!");
  414. sys.sendHtmlMessage(src, "<timestamp/><b><font color=darkblue><font size=3>Arceus for the catch command!");
  415. sys.sendHtmlMessage(src, "<timestamp/><b><font color=green><font size=3>Intel_iX for the editing and speeding the scripts up!");
  416. sys.sendHtmlMessage(src, "<timestamp/><b><font color=blue><font size=3>Ian for the clearchat command and the MOTD!");
  417. sys.sendHtmlMessage(src, "<timestamp/><b><font color=black><font size=3>If you want these scripts ask TheUnknownOne or Email <TheUnknownOne25@gmail.com>");
  418. sys.sendHtmlMessage(src, "<hr>");
  419. return; }
  420. ,
  421. torture : function () {
  422. if (tar == undefined) {
  423. sys.sendMessage(src, "~~Bot~~: You fail. That person is either not on or does not exist");
  424. return;
  425. }
  426.  
  427. var Links=new Array();
  428. Links[1]="~~Bot~~: " + commandData + " has died from a falling meteorite by " + sys.name(src) + "!";
  429. Links[2]="~~Bot~~: " + commandData + " has been picked up and chucked down a hole by " + sys.name(src) + ".";
  430. Links[3]="~~Bot~~: " + commandData + " has been told to go to his room and die of bordum by " + sys.name(src) + ".";
  431. Links[4]="~~Bot~~: " + commandData + " had a heart attack and fell of the Grand Canyon by " + sys.name(src) + ".";
  432. Links[5]="~~Bot~~: " + commandData + " got hit by a car and died in the hospital by " + sys.name(src) + ".";
  433. Links[6]="~~Bot~~: " + commandData + " was made to smell spygirl's underwhere by " + sys.name(src) + ".";
  434. var i = Math.floor(6*Math.random())
  435. sys.sendAll(Links[i]);
  436. return; }
  437. ,
  438. 'catch' : function () {
  439. var num=Math.floor(650*Math.random());
  440. var pokemon=sys.pokemon(num);
  441. var nature=Math.floor(25*Math.random());
  442. var nature=sys.nature(nature);
  443. var shiny=Math.floor(8192*Math.random());
  444. var hpiv=Math.floor(32*Math.random());
  445. var spaiv=Math.floor(32*Math.random());
  446. var atkiv=Math.floor(32*Math.random());
  447. var defiv=Math.floor(32*Math.random());
  448. var spdiv=Math.floor(32*Math.random());
  449. var speiv=Math.floor(32*Math.random());
  450. if (shiny!=8191)
  451. {
  452. sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a " +pokemon + " with a " + nature + " nature!");
  453. sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
  454. sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
  455. }
  456. if (shiny==8191)
  457. {
  458. sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a shiny " + pokemon + " with a " + nature + " nature!");
  459. sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
  460. sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
  461. sys.sendAll("~~CaptureBot~~: This is a rare event");
  462. }
  463. }
  464. ,
  465. rules : function () {
  466. sys.sendHtmlMessage(src, "<br>");
  467. sys.sendHtmlMessage(src, "<font color=red>*** <font color=black><b>Server Rules</b> <font color=black>***</f></b>");
  468. sys.sendHtmlMessage(src, "<b><font color=red>Rule #1<font color=black> - Do Not Abuse CAPS:</f></b>");
  469. sys.sendHtmlMessage(src, "- <b>The occasional word in CAPS is acceptable, however repeated use is not.</b>");
  470. sys.sendHtmlMessage(src, "<b><font color=red>Rule #2 - No Flooding the Chat:</f></b>");
  471. sys.sendHtmlMessage(src, "- <b>Please do not post a large amount of short messages when you can easily post one or two long messages.</f></b>");
  472. sys.sendHtmlMessage(src, "<b><font color=red>Rule #3 - Do not Challenge Spam:</f></b>");
  473. sys.sendHtmlMessage(src, "- <b>If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.</f></b>");
  474. sys.sendHtmlMessage(src, "<b><font color=red>Rule #4 - Don't ask for battles in the main chat:</f></b>");
  475. sys.sendHtmlMessage(src, "- <b>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.</f></b>");
  476. sys.sendHtmlMessage(src, "<b><font color=red>Rule #5 - No Trolling/Flaming/Insulting of Any kind:</f></b>");
  477. sys.sendHtmlMessage(src, "- <b>Behaving stupidly and excessive vulgarity will not be tolerated</f></b>.");
  478. sys.sendHtmlMessage(src, "<b><font color=red>Rule #6 - Please only speak English:</f></b>");
  479. sys.sendHtmlMessage(src, "- <b>Most people speak a different language, which is ok. But please speak english</f></b>.");
  480. sys.sendHtmlMessage(src, "<b><font color=red>Rule #7 - No Advertising:");
  481. sys.sendHtmlMessage(src, "- <b>There will be absolutely no advertising on the server</f></b>.");
  482. sys.sendHtmlMessage(src, "<b><font color=red>Rule #8 - No Obscene or Pornographic Content Allowed:</f></b>");
  483. sys.sendHtmlMessage(src, "- <b>This includes links, texts, images, and any other kind of media. This will result in a instant ban.</f></b>");
  484. sys.sendHtmlMessage(src, "<b><font color=red>Rule #9 - Do not ask for Auth:</f></b>");
  485. sys.sendHtmlMessage(src," - <b>Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.</f></b>");
  486. sys.sendHtmlMessage(src,"<b><font color=red>Rule #10 - Do not Insult Auth:</f></b>");
  487. sys.sendHtmlMessage(src, "- <b>Insulting Auth will result in immediate punishment.</f></b>");
  488. sys.sendHtmlMessage(src, "<br>");
  489. if (sys.auth(src) < 1) {
  490. return;
  491. }
  492. sys.sendHtmlMessage(src, "<br>");
  493. sys.sendHtmlMessage(src, "<font color=black>*** <font color=blue><b>Auth Rules</b> <font color=black>***</f></b>");
  494. sys.sendHtmlMessage(src, "<b><font color=red>Rule #1 - Behave yourself, act appropriately:");
  495. sys.sendHtmlMessage(src, "- <b>This is includes flaming, insulting, trolling of ANY KIND");
  496. sys.sendHtmlMessage(src,"<b><font color=red>Rule # 2 - Do not advertize:</f></b>");
  497. sys.sendHtmlMessage(src,"- <b>Do not advertize any other server or pages. Youtube or game, music pages are okay, but an excesive advertizing of them, could cause problems.</f></b>");
  498. sys.sendHtmlMessage(src,"<b><font color=red>Rule #3 - No Obscene or Pornographic Content Allowed:");
  499. sys.sendHtmlMessage(src,"- <b>This includes links, texts, images, and any other kind of obscene media. This will result in a instant ban.</f></b>");
  500. sys.sendHtmlMessage(src,"<b><font color=red>Rule #4 - Do not ask for Auth:</f></b>");
  501. sys.sendHtmlMessage(src,"- <b>Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.</f></b>");
  502. sys.sendHtmlMessage(src, "<b><font color=red>Rule #5 - Do not Challenge Spam:</f></b>");
  503. sys.sendHtmlMessage(src, "- <b>If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.</f></b>");
  504. sys.sendHtmlMessage(src, "<br>");
  505. }
  506. ,
  507. auth : function () {
  508. var authlist = sys.dbAuths().sort()
  509. sys.sendMessage(src, "");
  510. if(commandData == "owners") {
  511. sys.sendMessage(src, "*** Owners ***")
  512. for(var x in authlist) {
  513. if(sys.dbAuth(authlist[x]) == 3) {
  514. if(sys.id(authlist[x]) == undefined) {
  515. sys.sendMessage(src, authlist[x] + " (Offline)")
  516. }
  517. if(sys.id(authlist[x]) !=undefined) {
  518. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  519. }
  520. }
  521. }
  522. sys.sendMessage(src, "");
  523. }
  524. if(commandData == "admins" || commandData == "Administrators") {
  525. sys.sendMessage(src, "*** Administrators ***")
  526. for(var x in authlist) {
  527. if(sys.dbAuth(authlist[x]) == 2) {
  528. if(sys.id(authlist[x]) == undefined) {
  529. sys.sendMessage(src, authlist[x] + " (Offline)")
  530. }
  531. if(sys.id(authlist[x]) !=undefined) {
  532. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  533. }
  534. }
  535. }
  536. sys.sendMessage(src, "");
  537. }
  538. if(commandData == "mods" || commandData == "Moderators") {
  539. sys.sendMessage(src, "*** Moderators ***")
  540. for(var x in authlist) {
  541. if(sys.dbAuth(authlist[x]) == 1) {
  542. if(sys.id(authlist[x]) == undefined) {
  543. sys.sendMessage(src, authlist[x] + " (Offline)")
  544. }
  545. if(sys.id(authlist[x]) !=undefined) {
  546. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  547. }
  548. }
  549. }
  550. sys.sendMessage(src, "");
  551. }
  552.  
  553. if(commandData != "moderators" && commandData != "mods" &&commandData != "administrators" && commandData != "admins" && commandData != "owners") {
  554.  
  555. sys.sendMessage(src, "*** Owners ***")
  556. for (var x in authlist) {
  557. if (sys.dbAuth(authlist[x]) == 3) {
  558. if (sys.id(authlist[x]) == undefined) {
  559. sys.sendMessage(src, authlist[x]+ " (Offline)")
  560. }
  561. if (sys.id(authlist[x]) != undefined) {
  562. sys.sendHtmlMessage(src,'<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  563. }
  564. }
  565. }
  566. sys.sendMessage(src, "");
  567. sys.sendMessage(src, "*** Administrators ***")
  568. for( var x in authlist) {
  569. if (sys.dbAuth(authlist[x]) == 2) {
  570. if (sys.id(authlist[x]) == undefined) {
  571. sys.sendMessage(src, authlist[x] + " (Offline)")
  572. }
  573. if (sys.id(authlist[x]) != undefined) {
  574. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  575. }
  576. }
  577. }
  578. sys.sendMessage(src, "");
  579. sys.sendMessage(src, "*** Moderators ***")
  580. for(x in authlist) {
  581. if(sys.dbAuth(authlist[x]) == 1) {
  582. if(sys.id(authlist[x]) == undefined) {
  583. sys.sendMessage(src, authlist[x]+ " (Offline)")
  584. }
  585. if(sys.id(authlist[x]) != undefined) {
  586. sys.sendHtmlMessage(src,'<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  587. }
  588. }
  589. }
  590. }
  591. return;
  592. }
  593. ,
  594. players: function () {
  595. sys.sendMessage(src, "+CountBot: There are " + sys.numPlayers() +" players online.");
  596. return;
  597. }
  598.  
  599. ,
  600. viewjournal : function (){
  601. sys.sendHtmlMessage(src, "");
  602. sys.sendHtmlMessage(src, '<timestamp/> <font color="red">*** The Guest Book ***</font>');
  603. sys.sendHtmlMessage(src, "");
  604. var get = sys.getFileContent("gb").split("*");
  605. for(x in get){
  606. sys.sendHtmlMessage(src,get[x]);
  607. }
  608. return; }
  609. ,
  610. signjournal : function () {
  611. if (commandData == undefined) {
  612. var get = sys.getFileContent("gb");
  613. sys.writeToFile("gb",get + sys.name(src) + "*");
  614. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  615. return;
  616. }
  617. var qu = commandData.match(/<(\w+)[^>]*>/g);
  618. if (qu) {
  619. for (var x in qu) {
  620. commandData+= qu[x].replace(/<(\w+)[^>]*>/g,'</$1>'); }
  621. }
  622. if (message.search(/[\u202E\u202D]/) != -1) {
  623. return; }
  624. var get = sys.getFileContent("gb");
  625. sys.writeToFile("gb",get + sys.name(src) + " - " + commandData +"*");
  626. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  627. return; }
  628. });
  629.  
  630. var modCommands = ({
  631. modcommands: function () {
  632. sys.sendHtmlMessage(src, "<hr>");
  633. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>*** <font color=black>Mod Commands <font color=orange>***");
  634. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/imp <font color=red>Person</f></b> : <font color=black>to impersonate someone");
  635. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is either an online player or any name.");
  636. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/impOff</f></b> : <font color=black>to stop impersonating.");
  637. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/kick <font color=red>Person</f></b> :<font color=black> to kick someone");
  638. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is any online player.");
  639. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>Mute/Unmute <font color=red>Person</f></b> : <font color=black>to Mute/Unmute someone.");
  640. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=blue>Mute/Unmute</f><font color=black> is to Mute(shut someone up) or Unmute(to allow that person to talk again),<font color=red> Person<font color=black> is any online player.");
  641. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changemotd <font color=red>Message</f></b> : <font color=black>to change MOTD.");
  642. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Message</f><font color=black> is any message for people to see if they log on, HTML Allowed.");
  643. sys.sendHtmlMessage(src, "<hr>");
  644. return; }
  645. ,
  646. imp: function () {
  647. impersonation[src] = commandData;
  648. sys.sendMessage(src, "+Bot: Now you are " + impersonation[src] +"!");
  649. return;
  650. }
  651. ,
  652. changemotd: function () {
  653. Topic = commandData;
  654. sys.sendHtmlAll("<font color=red>+Bot: The MOTD has been changed.");
  655. }
  656.  
  657. ,
  658. joinon: function () {
  659. joinoff[src]=false
  660. sys.sendHtmlAll("<font color=orange><b><font size=3>~~Bot~~:</b></font> The signups have been started by " + sys.name(src) + ", type <b>/join</b> to join the tour!</f>");
  661. return;
  662. }
  663. ,
  664. joinoff: function () {
  665. joinoff[src]=true
  666. sys.sendHtmlAll("<font color=orange><b><font size=3>~~Bot~~:</b></font> The signups have been ended by " + sys.name(src) + ".</f>");
  667. return;
  668. }
  669. ,
  670. endtour: function () {
  671. sys.sendHtmlAll("<font color=orange><b><font size=3>~~Bot~~:</b></font> The Tour has been ended by " + sys.name(src) + ".</f>");
  672. return;
  673. }
  674. ,
  675. tour: function () {
  676. sys.sendHtmlAll("<hr>");
  677. sys.sendHtmlAll("<timestamp/><font color=red><b>*** TOURNAMENT ***</f></b></font>");
  678. sys.sendHtmlAll("<timestamp/><font color=blue><b>*** The tier will be decided when you see the message</f></b></font>");
  679. sys.sendHtmlMessage(src,"<timestamp/><font color=orange><b>~~Bot~~:</f></b><font color=black> Type /settier to set the tier</f>");
  680. sys.sendHtmlAll("<timestamp/><font color=blue><b>*** The amount of people will be decided when you see the message</f></b></font>");
  681. sys.sendHtmlMessage(src, "<timestamp/><font color=orange><b>~~Bot~~:</f></b><font color=black> Type /setpeople to set the amount of players");
  682. sys.sendHtmlAll("<timestamp/><font color=orange><b>~~Bot~~:</f></b><font color=black> Type /join to join the tour!");
  683. sys.sendHtmlAll("<timestamp/><font color=orange><b>~~Bot~~:</f></b><font color=black> Type /leave to leave the tour!");
  684. sys.sendHtmlAll("<hr>");
  685. return;
  686. }
  687. ,
  688. settier : function () {
  689. sys.sendHtmlAll("<b><font size=5><font color=red>A(n) " + commandData + " Tour has been started by " + sys.name(src) + "!</font></b></f>");
  690. return;
  691. }
  692. ,
  693. setpeople : function () {
  694. sys.sendHtmlAll("<b><font size=5><font color=red>The Number of players allowed for the tour are: " + commandData + "!</font></f></b>");
  695. return;
  696. }
  697. ,
  698. round1 : function () {
  699. sys.sendHtmlAll("<b><font size=5><font color=red>Round 1 has been started by " + sys.name(src) + " !</font></f></b>");
  700. return;
  701. }
  702. ,
  703. round2 : function () {
  704. sys.sendHtmlAll("<b><font size=5><font color=red>Round 2 has been started by " + sys.name(src) + " !</font></f></b>");
  705. return;
  706. }
  707.  
  708. ,
  709. round3: function () {
  710. sys.sendHtmlAll("<b><font size=5><font color=red>Round 3 has been started by " + sys.name(src) + " !</font></f></b>");
  711. return;
  712. }
  713. ,
  714. round4: function () {
  715. sys.sendHtmlAll("<b><font size=5><font color=red>Round 4 has been started by " + sys.name(src) + " !</font></f></b>");
  716. return;
  717. }
  718. ,
  719. round5: function () {
  720. sys.sendHtmlAll("<b><font size=5><font color=red>Round 5 has been started by " + sys.name(src) + " !</font></f></b>");
  721. return;
  722. }
  723. ,
  724. round: function () {
  725. sys.sendHtmlAll("<b><font size=5><font color=red>Round " + commandData + " has been started by " + sys.name(src) + " !</font></f></b>");
  726. return;
  727. }
  728. ,
  729. impoff : function () {
  730. delete impersonation[src];
  731. sys.sendMessage(src, "+Bot: Now you are yourself!");
  732. return;
  733. }
  734. ,
  735. kick : function () {
  736. if (tar == undefined) {
  737. return;
  738. }
  739. sys.sendHtmlAll("<font color=red><b>+KickBot:</b> " + commandData + " Was kicked for something by " +sys.name(src) + "!");
  740. sys.kick(tar);
  741. return;
  742. }
  743. ,
  744. mute: function () {
  745. if (tar == undefined) {
  746. return;
  747. }
  748. if (sys.auth(tar) >= sys.auth(src)) {
  749. sys.sendMessage("+Bot: you dont have sufficient auth to mute " + commandData + ".");
  750. return;
  751. }
  752. sys.sendHtmlAll("<font color=blue><b>+MuteBot:</b> " + commandData + " Was muted by " +sys.name(src) + "!");
  753. muted[tar] = true;
  754. return
  755. }
  756. ,
  757. unmute:function () {
  758. if (tar == undefined) {
  759. return;
  760. }
  761. sys.sendHtmlAll("<font color=green><b>+MuteBot:</b> " + commandData + " Was unmuted by " +sys.name(src) + "!");
  762. muted[tar] = false;
  763. return;
  764. }
  765. })
  766. var adminCommands = ({
  767. admincommands : function () {
  768. if (sys.auth(src) < 2) {
  769. sys.sendMessage(src, "+CommandBot: Your are not of the right authority to view these commands.");
  770. return;
  771. }
  772.  
  773. sys.sendHtmlMessage(src, "<hr>");
  774. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>*** <font color=black>Admin Commands <font color=red>***</b></f>");
  775. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/reset</f></b>: <font color=black>to reset the server variables");
  776. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/masskick</f></b>: <font color=black>to clean up the server");
  777. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/setPA <font color=red>Paname</f></b>: <font color=black>to add a new pa");
  778. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Paname</f><font color=black> is a PA to put in the scripts, be carefull as this can make an error.");
  779. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearjournal</f></b>: <font color=black>to clear the journal");
  780. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>Ban/Unban</f><font color=red> Person</b>: <font color=black>to ban/unban someone");
  781. sys.sendHtmlMessage(src, "<font color=blue>°<b>Note: <font color=black>To <font color=blue>Ban<font color=black>(keep there IP from entering the server) and <font color=blue>Unban<font color=black>(let a banned person get in the server again),<font color=red> Person</f><font color=black> is any online or offline player in the members database.");
  782. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearchat</f></b>: <font color=black>to clear the chat");
  783. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>forcerule</f><font color=red> Rule</b>: <font color=black>to show a rule to everyone");
  784. sys.sendHtmlMessage(src, "<font color=blue>°<b>Note: <Font color=red>Rule<font color=black> is rule 1-10.");
  785. sys.sendHtmlMessage(src, "<hr>");
  786. return;
  787. }
  788. ,
  789. forcerule: function () {
  790. if (commandData == undefined) {
  791. sys.sendMessage(src, "~~Bot~~:Not a valid rule");
  792. return;
  793. }
  794. if (commandData == 1) {
  795. sys.sendAll("Rule #1 - Do Not Abuse CAPS:");
  796. sys.sendAll("- The occasional word in CAPS is acceptable, however repeated use is not.");
  797. return;
  798. }
  799. if (commandData == 2) {
  800. sys.sendAll("Rule #2 - No Flooding the Chat:");
  801. sys.sendAll("- Please do not post a large amount of short messages when you can easily post one or two long messages.");
  802. return;
  803. }
  804. if (commandData == 3) {
  805. sys.sendAll("Rule #3 - Do not Challenge Spam:");
  806. sys.sendAll("- If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.");
  807. return;
  808. }
  809. if (commandData == 4) {
  810. sys.sendAll("Rule #4 - Don't ask for battles in the main chat:");
  811. sys.sendAll("- 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.");
  812. return;
  813. }
  814. if (commandData == 5) {
  815. sys.sendAll("Rule #5 - No Trolling/Flaming/Insulting of Any kind:");
  816. sys.sendAll("- Behaving stupidly and excessive vulgarity will not be tolerated.");
  817. return;
  818. }
  819. if (commandData == 6) {
  820. sys.sendAll("Rule #6 - Please only speak English:");
  821. sys.sendAll("- Most people speak a different language, which is ok. But please speak english.");
  822. return;
  823. }
  824. if (commandData == 7) {
  825. sys.sendAll("Rule #7 - No Advertising:");
  826. sys.sendAll("- There will be absolutely no advertising on the server.");
  827. return;
  828. }
  829. if (commandData == 8) {
  830. sys.sendAll("Rule #8 - No Obscene or Pornographic Content Allowed:");
  831. sys.sendAll("- This includes links, texts, images, and any other kind of media. This will result in a instant ban.");
  832. return;
  833. }
  834. if (commandData == 9) {
  835. sys.sendAll("Rule #9 - Do not ask for Auth:");
  836. sys.sendAll(" - Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.");
  837. return;
  838. }
  839. if (commandData == 10) {
  840. sys.sendAll("Rule #10 - Do not Insult Auth:");
  841. sys.sendAll("- Insulting Auth will result in immediate punishment.");}
  842. return;
  843. }
  844. ,
  845. reset : function () {
  846. this.serverStartUp();
  847. sys.sendAll("~~Server~~: The server script variables were reset.");
  848. return;
  849. }
  850. ,
  851. changeannouncement: function () {
  852. if (sys.auth(src) < 3) {
  853. return;
  854. }
  855. sys.setAnnouncement(commandData);}
  856. ,
  857. resetannouncement: function () {
  858. if (sys.auth(src) < 3) {
  859. return;
  860. }
  861. sys.setAnnouncement("Announcement reset by<font color=fuchsia> " + sys.name(src));}
  862. ,
  863. changemotd:function () {
  864. Topic = commandData;
  865. sys.sendAll("The MOTD has been changed.");}
  866. ,
  867. ban:function () {
  868. if(sys.dbIp(commandData) == undefined) {
  869. sendChanMessage(src, "+Bot: No player exists by this name!");
  870. return;
  871. }
  872.  
  873. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  874. sendChanMessage(src, "+Bot: Can't do that to higher auth!");
  875. return;
  876. }
  877. var ip = sys.dbIp(commandData);
  878. var alias=sys.aliases(ip)
  879. var y=0;
  880. var z;
  881. for(var x in alias) {
  882. z = sys.dbAuth(alias[x])
  883. if (z > y) {
  884. y=z
  885. }
  886. }
  887. if(y>=sys.auth(src)) {
  888. sendChanMessage(src, "+Bot: Can't do that to higher auth!");
  889. return;
  890. }
  891. var banlist=sys.banList()
  892. for(a in banlist) {
  893. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  894. sendChanMessage(src, "+Bot: He/she's already banned!");
  895. return;
  896. }
  897. }
  898.  
  899. sys.sendHtmlAll('<b><font color=red>' + commandData + ' was banned by ' + sys.name(src) + '!</font></b>');
  900. if(tar != undefined) {
  901. sys.kick(tar)
  902. }
  903. sys.ban(commandData)
  904. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
  905. return;
  906. }
  907. ,
  908. unban: function () {
  909. if(sys.dbIp(commandData) == undefined) {
  910. sendChanMessage(src, "+Bot: No player exists by this name!");
  911. return;
  912. }
  913. var banlist=sys.banList()
  914. for(a in banlist) {
  915. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  916. sys.unban(commandData)
  917. sys.sendHtmlAll('<b><font color=red>' + commandData + ' was unbanned by ' + sys.name(src) + '!</font></b>');
  918. sys.appendToFile('bans.txt', sys.name(src) + ' unbanned ' +commandData + "n")
  919. return;
  920. }
  921. }
  922. sendChanMessage(src, "+Bot: He/she's not banned!");
  923. return;
  924.  
  925. }
  926. ,
  927.  
  928. silentkick : function () {
  929. if (sys.auth(src) < 3) {
  930. return;
  931. }
  932. if (tar == undefined) {
  933. return;
  934. }
  935. sys.kick(tar);
  936. return;
  937. }
  938. ,
  939. clearchat:function () {
  940. var c;
  941. for (c=0;c<2999;c++) {
  942. sys.sendAll("");
  943. }
  944. sys.clearChat();
  945. sys.sendAll(sys.name(src) + " Has Cleared the chat!");
  946. return;
  947. }
  948. ,
  949. setpa:function () {
  950. sys.setPA(commandData);
  951. sys.sendMessage(src, "Bot: -" + commandData + "- was set!");
  952. return;
  953. }
  954. ,
  955. clearjournal:function () {
  956. var get = sys.getFileContent("gb");
  957. sys.deleteFile("gb");
  958. sys.sendAll("The guest book was cleared!");
  959. sys.writeToFile("gb","This is the guest book. Comments are listed below:<br><br>");
  960. return;
  961. }
  962. ,
  963. masskick:function () {
  964. for (var i = 1; i < 200 && sys.numPlayers() > 0; i++) {
  965. if (sys.loggedIn(i)) {
  966. sys.kick(i);
  967. }
  968. }
  969. return;
  970. }
  971. });
  972. var ownerCommands = ({
  973.  
  974. ownercommands : function () {
  975. sys.sendHtmlMessage(src, "<hr>");
  976. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** <font color=black>Owner Commands <font color=blue>***</b></f>");
  977. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/resetannouncement</f></b>: <font color=black>to reset the announcement(clear it)");
  978. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changeannouncement <font color=red>Message</f></b>: <font color=black>change announcement");
  979. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Message</f><font color=black> is any message for people to see if they log on , HTML Allowed.");
  980. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/silentkick</f><font color=red> Person</b></f>: <font color=black>to silently kick someone");
  981. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is any online player.");
  982. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>SilentMute/SilentUnmute <font color=red>Person</f></b> : <font color=black>to silenly Mute/Unmute someone.");
  983. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=blue>SilentMute</f><font color=black> is to Silently(do it without people seeing it)Mute(shut someone up)or Unmute(to allow that person to talk again),<font color=red> Person<font color=black> is any online player.");
  984. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=green>SilentBan/SilentUnban</f></b>: <font color=black>to silently ban someone");
  985. sys.sendHtmlMessage(src, "<font color=blue>°<b>Note: <font color=black>To <font color=blue>SilentBan<font color=black>(do it without people seeing it)(keep there IP from entering the server) and <font color=blue>SilentUnban<font color=black>(do it without people seeing it)(let a banned person get in the server again),<font color=red> Person</f><font color=black> is any online or offline player in the members database.");
  986. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=indigo>S<font color=blue>AuthName<font color=red> Person</f></b>: <font color=black>give someone auth."); // you use the 's' if you want to do it SILENTLY //
  987. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=indigo>S<font color=black> is optional, it can be used to silently give auth ,<font color=blue> AuthName</f><font color=black> is any authname, <font color=red>Person<font color=black> is any online player.");
  988. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/authnames</f></b>: <font color=black>view authnames for the /AuthName.");
  989. sys.sendHtmlMessage(src, "<hr>");
  990. return;
  991. }
  992. ,
  993. clearpass: function () {
  994. sys.clearPass(commandData);
  995. sys.sendHtmlMessage(src, "<timestamp/><font color=orange><b>~~Bot~~:</b></font> You cleared " + commandData + "'s password.<f>");
  996. sys.sendHtmlMessage(tar, "<timestamp/><font color=orange><b>~~Bot~~:</b></font> Your Password has been cleared by " + sys.name(src) + ".<f>");
  997. return;
  998. }
  999. ,
  1000. alias: function () {
  1001. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</font></b> The aliases for the IP " + commandData + " are: " + sys.aliases(commandData) + ".");
  1002. return;
  1003. }
  1004. ,
  1005. authnames: function () {
  1006. sys.sendHtmlMessage(src, "<hr>");
  1007. sys.sendHtmlMessage(src, "<font color=purple><timestamp/> *** Auth Names ***</f>");
  1008. sys.sendHtmlMessage(src, "<font color=green><timestamp/> 0 Auth = <b> User</f>"); // */user* //
  1009. sys.sendHtmlMessage(src, "<font color=blue><timestamp/> 1 Auth = <b> Mod</f>"); // */mod* //
  1010. sys.sendHtmlMessage(src, "<font color=orange><timestamp/> 2 Auth = <b> Admin</f>"); // */admin*//
  1011. sys.sendHtmlMessage(src, "<font color=red><timestamp/> 3 Auth = <b> Owner</f>"); // */owner* //
  1012. sys.sendHtmlMessage(src, "<font color=cornflowerblue><timestamp/> 4 Auth = <b> Invisible</f>"); // */invisible* //
  1013. sys.sendHtmlMessage(src, "<hr>");
  1014. }
  1015. ,
  1016. tourauthnames: function () {
  1017. sys.sendHtmlMessage(src, "<hr>");
  1018. sys.sendHtmlMessage(src, "<font color=purple><timestamp/> *** Auth Names ***</f>");
  1019. sys.sendHtmlMessage(src, "<font color=green><timestamp/> 0 TourAuth = <b> TourUser</f>"); // */touruser* //
  1020. sys.sendHtmlMessage(src, "<font color=blue><timestamp/> 1 TourAuth = <b> TourMod</f>"); // */tourmod* //
  1021. sys.sendHtmlMessage(src, "<font color=orange><timestamp/> 2 TourAuth = <b> TourAdmin</f>"); // */touradmin*//
  1022. sys.sendHtmlMessage(src, "<font color=red><timestamp/> 3 TourAuth = <b> TourOwner</f>"); // */tourowner* //
  1023. sys.sendHtmlMessage(src, "<hr>");
  1024. }
  1025. ,
  1026. secretcommands : function () {
  1027. sys.sendHtmlMessage(src, "<hr>");
  1028. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>*** <font color=black>Secret Commands <font color=black>***</b></f>");
  1029. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/eval <font color=skyblue>String</f></b>: <font color=black>to use any js string");
  1030. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=skyblue>String</f><font color=black> is any valid javascript string, doesnt save in the script, use this only if you know how to script.");
  1031. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearpass</f><font color=red> Person</b></f>: <font color=black>to clear someones password");
  1032. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is any player that has a pass and is in the members database.");
  1033. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/showteam</f><font color=red> Person</b></f>: <font color=black>to show someones team");
  1034. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is any online player.");
  1035. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/alias</f><font color=orange> IP</b></f>: <font color=black>to show someones alieses on there IP");
  1036. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>IP</f><font color=black> is any registerd IP in the database.");
  1037. sys.sendHtmlMessage(src, "<hr>");
  1038. return;
  1039. }
  1040. ,
  1041. silentmute: function () {
  1042. if (tar == undefined) {
  1043. return;
  1044. }
  1045. muted[tar] = true;
  1046. return
  1047. }
  1048. ,
  1049. touruser: function () {
  1050. if (tar == undefined) {
  1051. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1052. return;
  1053. }
  1054. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been given Tour-User by " + sys.name(src) + ".");
  1055. return;
  1056. }
  1057. ,
  1058. tourmod: function () {
  1059. if (tar == undefined) {
  1060. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1061. return;
  1062. }
  1063. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been given Tour-Mod by " + sys.name(src) + ".");
  1064. return;
  1065. }
  1066. ,
  1067. touradmin: function () {
  1068. if (tar == undefined) {
  1069. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1070. return;
  1071. }
  1072. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been given Tour-Admin by " + sys.name(src) + ".");
  1073. return;
  1074. }
  1075. ,
  1076. tourowner: function () {
  1077. if (tar == undefined) {
  1078. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1079. return;
  1080. }
  1081. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been given Tour-Owner by " + sys.name(src) + ".");
  1082. return;
  1083. }
  1084. ,
  1085. silentunmute: function () {
  1086. if (tar == undefined) {
  1087. return;
  1088. }
  1089. muted[tar] = false;
  1090. return
  1091. }
  1092. ,
  1093. showteam: function () {
  1094. if (tar == undefined) {
  1095. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1096. return;
  1097. }
  1098. sys.sendMessage(src, "");
  1099. for (var i = 0; i < 6; i+=1) {sys.sendMessage(src, sys.pokemon(sys.teamPoke(tar, i)) + " @ " + sys.item(sys.teamPokeItem(tar, i)));
  1100. for (var j = 0; j < 4; j++) {sys.sendMessage(src, '- ' + sys.move(sys.teamPokeMove(tar, i, j)));}}
  1101. sys.sendMessage(src, "");
  1102. return;
  1103. }
  1104. ,
  1105. user: function () {
  1106. if (tar == undefined) {
  1107. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1108. return;
  1109. }
  1110. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been usered by " + sys.name(src) + ".");
  1111. sys.changeAuth(tar, 0);
  1112. return;
  1113. }
  1114. ,
  1115. mod: function () {
  1116. if (tar == undefined) {
  1117. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1118. return;
  1119. }
  1120. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " was been made a mod by " + sys.name(src) + ".");
  1121. sys.changeAuth(tar, 1);
  1122. return;
  1123. }
  1124. ,
  1125. admin: 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.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " was been made an admin by " + sys.name(src) + ".");
  1131. sys.changeAuth(tar, 2);
  1132. }
  1133. ,
  1134. owner: 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.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " was made an owner by " + sys.name(src) + ".");
  1140. sys.changeAuth(tar, 3);
  1141. }
  1142. ,
  1143. invisible: 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.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " was made an invisible auth by " + sys.name(src) + ".");
  1149. sys.changeAuth(tar, 4);
  1150. return;
  1151. }
  1152. ,
  1153. suser: function () {
  1154. if (tar == undefined) {
  1155. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1156. return;
  1157. }
  1158. sys.changeAuth(tar, 0);
  1159. }
  1160. ,
  1161. smod: function () {
  1162. if (tar == undefined) {
  1163. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1164. return;
  1165. }
  1166. sys.changeAuth(tar, 1);
  1167. }
  1168. ,
  1169. sadmin: function () {
  1170. if (tar == undefined) {
  1171. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1172. return;
  1173. }
  1174. sys.changeAuth(tar, 2);
  1175. }
  1176. ,
  1177. sowner: function () {
  1178. if (tar == undefined) {
  1179. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1180. return;
  1181. }
  1182. sys.changeAuth(tar, 3);
  1183. return;
  1184. }
  1185. ,
  1186. sinvisible: function () {
  1187. if (tar == undefined) {
  1188. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1189. return;
  1190. }
  1191. sys.changeAuth(tar, 4);
  1192. return;
  1193. }
  1194. ,
  1195. eval: function () {
  1196. sys.eval(commandData);
  1197. return;
  1198. }
  1199. ,
  1200. silentban:function () {
  1201. if(sys.dbIp(commandData) == undefined) {
  1202. sys.sendMessage(src, "+Bot: No player exists by this name!");
  1203. return;
  1204. }
  1205. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  1206. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  1207. return;
  1208. }
  1209. var ip = sys.dbIp(commandData);
  1210. var alias=sys.aliases(ip)
  1211. var y=0;
  1212. var z;
  1213. for(var x in alias) {
  1214. z = sys.dbAuth(alias[x])
  1215. if (z > y) {
  1216. y=z
  1217. }
  1218. }
  1219. if(y>=sys.auth(src)) {
  1220. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  1221. return;
  1222. }
  1223. var banlist=sys.banList()
  1224. for(a in banlist) {
  1225. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  1226. sys.sendMessage(src, "+Bot: He/she's already banned!");
  1227. return;
  1228. }
  1229. }
  1230.  
  1231. if(tar != undefined) {
  1232. sys.kick(tar)
  1233. }
  1234. sys.ban(commandData)
  1235. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
  1236. return;
  1237. }
  1238. ,
  1239. silentunban: function () {
  1240. if(sys.dbIp(commandData) == undefined) {
  1241. sendChanMessage(src, "+Bot: No player exists by this name!");
  1242. return;
  1243. }
  1244. var banlist=sys.banList()
  1245. for(a in banlist) {
  1246. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  1247. sys.unban(commandData)
  1248. sys.appendToFile('bans.txt', sys.name(src) + ' unbanned ' +commandData + "n")
  1249. return;
  1250. }
  1251. }
  1252. sendChanMessage(src, "+Bot: He/she's not banned!");
  1253. return;
  1254.  
  1255. }
  1256. ,
  1257. });
  1258. var getCommand = ({
  1259. '0': function (name) {
  1260. if (name in userCommands) {
  1261. return userCommands[name]; }
  1262. }
  1263. ,
  1264. '1': function (name) {
  1265. if (name in modCommands) {
  1266. return modCommands[name]; }
  1267. else if (name in userCommands) {
  1268. return userCommands[name]; }
  1269. }
  1270. ,
  1271. '2' : function (name) {
  1272. if (name in adminCommands) {
  1273. return adminCommands[name]; }
  1274. else if (name in modCommands) {
  1275. return modCommands[name]; }
  1276. else if (name in userCommands) {
  1277. return userCommands[name]; }
  1278. }
  1279. ,
  1280. '3' : function (name) {
  1281. if (name in ownerCommands) {
  1282. return ownerCommands[name]; }
  1283. else if (name in adminCommands) {
  1284. return adminCommands[name]; }
  1285. else if (name in modCommands) {
  1286. return modCommands[name]; }
  1287. else if (name in userCommands) {
  1288. return userCommands[name]; }
  1289. }
  1290. ,
  1291. '4' : function (name) {
  1292. if (name in ownerCommands) {
  1293. return ownerCommands[name]; }
  1294. else if (name in adminCommands) {
  1295. return adminCommands[name]; }
  1296. else if (name in modCommands) {
  1297. return modCommands[name]; }
  1298. else if (name in userCommands) {
  1299. return userCommands[name]; }
  1300. }
  1301. });
  1302. var cmd = getCommand[sys.auth(src)](command);
  1303. if (!cmd) {
  1304. sys.sendMessage(src, getCommand[3](command) ? "+Bot: You aren't allowed to use that command." : "+Bot: That command doesn't exist." );
  1305. return; }
  1306. cmd();
  1307. return;
  1308.  
  1309. }
  1310. if (typeof impersonation[src] != 'undefined') {
  1311. sys.stopEvent();
  1312. sys.sendAll(impersonation[src] + ": " + message);
  1313. return;
  1314. }
  1315. }
  1316.  
  1317. ,
  1318.  
  1319. beforeChallengeIssued : function (src, dest, clauses) {
  1320. /* Challenge Cup Clause */
  1321. if (clauses[7] == 1)
  1322. return;
  1323.  
  1324. if (clauseOn[dest] == true) {
  1325. for (var i = 0; i < 6; i++) {
  1326. if (hasBan(dest, sys.teamPoke(src,i))) {
  1327. sys.sendMessage(src, "ClauseBot: Your opponent is afraid of " + sys.pokemon(sys.teamPoke(src,i)));
  1328. sys.stopEvent();
  1329. return;
  1330. }
  1331. }
  1332. }
  1333. if (clauseOn[src] == true) {
  1334. for (var i = 0; i < 6; i++) {
  1335. if (hasBan(src, sys.teamPoke(dest,i))) {
  1336. sys.sendMessage(src, "ClauseBot: You are afraid of some pokemon of the opponent, so I won't let you challenge them.");
  1337. sys.stopEvent();
  1338. return;
  1339. }
  1340. }
  1341. }
  1342.  
  1343. /* Regular tier checks that can't be made using the built-in server tier system */
  1344. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1345. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  1346. sys.sendMessage(src, "+Bot: SonicBoom and Dragon Rage are banned in Little Cup!");
  1347. sys.stopEvent();
  1348. }
  1349. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  1350. sys.sendMessage(src, "+Bot: Your opponent has banned moves SonicBoom or Dragon Rage in Little Cup tier!");
  1351. sys.stopEvent();
  1352. }
  1353. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  1354. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup!");
  1355. sys.stopEvent();
  1356. }
  1357. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  1358. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup and your opponent has it!");
  1359. sys.stopEvent();
  1360. }
  1361. }
  1362. }
  1363.  
  1364. ,
  1365.  
  1366. beforeBattleMatchup : function(src,dest,clauses)
  1367. {
  1368. if (clauseOn[dest] == true) {
  1369. for (var i = 0; i < 6; i++) {
  1370. if (hasBan(dest, sys.teamPoke(src,i))) {
  1371. sys.stopEvent();
  1372. return;
  1373. }
  1374. }
  1375. }
  1376. if (clauseOn[src] == true) {
  1377. for (var i = 0; i < 6; i++) {
  1378. if (hasBan(src, sys.teamPoke(dest,i))) {
  1379. sys.stopEvent();
  1380. return;
  1381. }
  1382. }
  1383. }
  1384.  
  1385. /* Regular tier checks that can't be made using the built-in server tier system */
  1386. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1387. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  1388. sys.stopEvent();
  1389. }
  1390. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  1391. sys.stopEvent();
  1392. }
  1393. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  1394. sys.stopEvent();
  1395. }
  1396. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  1397. sys.stopEvent();
  1398. }
  1399. }
  1400. }
  1401.  
  1402. ,
  1403.  
  1404. beforeBattleStarted : function(src, dest) {
  1405. /* If this is little cup, the levels are changed to be level 5 */
  1406. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1407. 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)];
  1408. 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)];
  1409. for (var i = 0; i < 6; i+=1) {
  1410. if (sys.teamPokeLevel(src, i) > 5)
  1411. sys.changePokeLevel(src, i, 5);
  1412. if (sys.teamPokeLevel(dest, i) > 5)
  1413. sys.changePokeLevel(dest, i, 5);
  1414. }
  1415. }
  1416. }
  1417.  
  1418. ,
  1419.  
  1420. afterBattleEnded: function(src, dest) {
  1421. /* If this is little cup, the levels are to be changed back! */
  1422. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup" && lilCupLevels[src]!= undefined && lilCupLevels[dest] != undefined) {
  1423. for (var i = 0; i < 6; i+=1) {
  1424. if (sys.teamPokeLevel(src, i) != lilCupLevels[src][i])
  1425. sys.changePokeLevel(src, i,lilCupLevels[src][i]);
  1426. if (sys.teamPokeLevel(dest, i) != lilCupLevels[dest][i])
  1427. sys.changePokeLevel(dest, i,lilCupLevels[dest][i]);
  1428. }
  1429. }
  1430. }
  1431.  
  1432. ,
  1433.  
  1434. beforeLogOut : function (src) {
  1435. if (muted[src] == true) {
  1436. sys.saveVal("muted*" + sys.ip(src), "true");
  1437. } else {
  1438. sys.removeVal("muted*" + sys.ip(src));
  1439. }
  1440. }
  1441.  
  1442. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement