SHARE
TWEET

Untitled

a guest Aug 12th, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ({
  2. serverStartUp : function() {
  3. this.init();
  4. }
  5. ,
  6. init : function() {
  7. key = function(a,b) {
  8. return a + "*" + sys.name(b);
  9. }
  10. hasBan = function(id, poke) {
  11. return clauses[id].indexOf("*" + poke + "*") != -1;
  12. }
  13. if (typeof (clauses) == "undefined") {
  14. clauses = [];
  15. }
  16. if (typeof (clauseOn) == "undefined") {
  17. clauseOn = [];
  18. }
  19. if (typeof(impersonation) == "undefined") {
  20. sys.setPA ("impersonation");
  21. }
  22. if (typeof(muted) == "undefined") {
  23. sys.setPA ("muted");
  24. }
  25. if (typeof(maxPlayersOnline) == "undefined") {
  26. maxPlayersOnline = 0;
  27. }
  28. /* For little cup */
  29. if (typeof(lilCupLevels) == "undefined")
  30. lilCupLevels = [];
  31. }
  32. ,
  33. afterNewMessage : function (message) {
  34. if (message == "Script Check: OK") {
  35. sys.sendHtmlAll("<b><i><font color=Blue><font size=4>+ScriptBot:<b><font color=Black><font size=4> Server Owner Blade has updated the scripts!");
  36. this.init();
  37. }
  38. }
  39.  
  40. ,
  41. afterLogIn : function(src) {
  42. sys.sendHtmlMessage(src, "<b><font color=Red><font size=4>+Viper: Hello. Welcome to the Viper's Pit");
  43. sys.sendHtmlMessage(src, "<b><font color=Blue><font size=4>+CommonSense: Type /rules to see the rules you MUST follow to stay alive here");
  44. sys.sendHtmlMessage(src, "<b><font color=Black><font size=4>+CommandBot: Type /commands to see what you can do here");
  45. sys.sendHtmlMessage(src, "<b><font color=Green><font size=4>+Blade: I am the server's host, Blade, as you can see unless you are dumb or blind. Try to have fun here. ");
  46. sys.sendHtmlMessage(src, "<font color=Red><font size=5>Question of the Day: <b><font color=Black><font size=7>What is your favorite Pokemon?");
  47. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>+<font color=red>W<font color=blue>e<font color=red>l<font color=black>c<font color=green>o<font color=orange>m<font color=purple>e<font color=black><font color=red>B<font color=blue>o<font color=green>t<font color=orange>: </b><font color=black>Welcome to Viper's Pit, " + sys.name(src) + "!");
  48. if (sys.getVal("muted*" + sys.ip(src)) == "true")
  49. muted[src] = true;
  50. this.afterChangeTeam(src);
  51. }
  52. ,
  53. afterChangeTeam : function(src)
  54. {
  55. clauseOn[src] = sys.getVal("clauseOn*" + sys.name(src)) == "true";
  56. clauses[src] = sys.getVal("clauses*" + sys.name(src));
  57. }
  58. ,
  59. beforeChatMessage: function(src, message) {
  60. if (sys.auth(src) < 2 && muted[src] == true) {
  61. sys.stopEvent();
  62. sys.sendMessage(src, "Shut up! You are muted!");
  63. return;
  64. }
  65. if ((message[0] == '/' || message[0] == '!') && message.length > 1) {
  66. print("Command -- " + sys.name(src) + ": " + message);
  67. sys.stopEvent();
  68. var command;
  69. var commandData;
  70. var pos = message.indexOf(' ');
  71. if (pos != -1) {
  72. command = message.substring(1, pos).toLowerCase();
  73. commandData = message.substr(pos+1);
  74. } else {
  75. command = message.substr(1).toLowerCase();
  76. }
  77. var tar = sys.id(commandData);
  78. if (command == "commands") {
  79. sys.sendHtmlMessage(src, "<b><font color=red><font size=6>=========================");
  80. sys.sendHtmlMessage(src, "<b><font color=blue><font size=3>/usercommands - user commands");
  81. sys.sendHtmlMessage(src, "<b><font color=blue><font size=3>/modcommands - mod commands");
  82. sys.sendHtmlMessage(src, "<b><font color=blue><font size=3>/admincommands - admin commands");
  83. sys.sendHtmlMessage(src, "<b><font color=blue><font size=3>/ownercommands - owner commands");
  84. sys.sendHtmlMessage(src, "<b><font color=red><font size=6>=========================");
  85. return;
  86. }
  87. if (command == "usercommands") {
  88. sys.sendHtmlMessage(src, "<b><font color=green><font size=4>USER COMMANDS");
  89. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/burn [player] - to burn someone :P");
  90. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/freeze [player] - to freeze someone :P");
  91. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/paralyze [player] - to paralyze someone :P");
  92. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/poison [player] - to poison someone :P");
  93. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/cure [player] - to cure someone from a status problem");
  94. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/me - to talk with *** around your message");
  95. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/rules - to view the rules...duh!");
  96. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/sendHtmlAll - to send an HTML message to everyone");
  97. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/sendAll - to send a message to everyone")
  98. ;sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/auth - to view the authlist");
  99. sys.sendHtmlMessage(src, "<b><font color=green><font size=4>That's all for the user commands right now!");
  100. return;
  101. }
  102. if (command == "modcommands") {
  103. if (sys.auth(src) < 1) {
  104. sys.sendMessage(src, "You need to be a moderator to view these!");
  105. return;
  106. }
  107. sys.sendHtmlMessage(src, "<b><font color=green><font size=4>MODERATOR COMMANDS");
  108. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/kick - to kick somebody");
  109. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/[s]mute - to mute somebody. put [s] in front of mute to mute someone quietly.");
  110. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/unmute - to unmute a muted person");
  111. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/imp - to impersonate somebody");
  112. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/unimp - to stop imping");
  113. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/kill - to send a funny message saying you killed someone!");
  114. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/trivia - to ask a trivia question");
  115. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/ - ");
  116. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/ - ");
  117. sys.sendHtmlMessage(src, "<b><font color=green><font size=4>That's all for the moderator commands right now!");
  118. return;
  119. }
  120. if (command == "admincommands") {
  121. if (sys.auth(src) < 2) {
  122. sys.sendMessage(src, "You need to be an admin to view these!");
  123. return;
  124. }
  125. sys.sendHtmlMessage(src, "<b><font color=green><font size=4>ADMIN COMMANDS");
  126. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/ban - to ban somebody");
  127. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/unban - to unban somebody who is banned");
  128. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/skick - to silent kick someone ");
  129. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/clearchat - to clear the chat!");
  130. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/silence [number of minutes] - to mute all users for a selected time");
  131. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/unsilence - to cancel the silence");
  132. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/showteam [player] - to view a player's team if they need help");
  133. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/ - ");
  134. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/ - ");
  135. sys.sendHtmlMessage(src, "<b><font color=green><font size=4>That's all for the admin commands right now!");
  136. return;
  137. }
  138. if (command == "ownercommands") {
  139. if (sys.auth(src) < 3) {
  140. sys.sendMessage(src, "You need to be an owner to view these!");
  141. return;
  142. }
  143. sys.sendHtmlMessage(src, "<b><font color=green><font size=4>OWNER COMMANDS");
  144. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/user [player] - makes the person a user ");
  145. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/mod [player] - makes the person a mod ");
  146. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/admin [player] - makes the person an admin ");
  147. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/owner [player] - makes the person an owner ");
  148. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/invisible [player] - makes the person an invisible owner ");
  149. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/clearpass - to clear somebody's password");
  150. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/resetannouncement - to reset the announcement");
  151. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/defaultannouncement - to change the announcement back to the default");
  152. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/changeannouncement [new announcement] - changes the announcement ");
  153. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/spam - to spam the chat");
  154. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/ - ");
  155. sys.sendHtmlMessage(src, "<b><font color=purple><font size=3>/ - ");
  156. sys.sendHtmlMessage(src, "<b><font color=green><font size=4>That's all for the owner commands right now!");
  157. return;
  158. // USER COMMANDS
  159. }
  160. if (command == "burn") {
  161. if (tar == undefined) {
  162. sys.sendMessage(src, "You fail. This person doesn't exist");
  163. return;
  164. }
  165. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status4.png><b><font color=red><font size=3>" + commandData + " was burned by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status4.png>");
  166. return;
  167. }
  168. if (command == "freeze") {
  169. if (tar == undefined) {
  170. sys.sendMessage(src, "You fail. This person doesn't exist");
  171. return;
  172. }
  173. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status3.png><b><font color=blue><font size=3> " + commandData + " was frozen by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status3.png>");
  174. return;
  175. }
  176. if (command == "paralyze") {
  177. if (tar == undefined) {
  178. sys.sendMessage(src, "You fail. This person doesn't exist");
  179. return;
  180. }
  181. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status1.png><b><font color=yellow><font size=3> " + commandData + " was paralyzed by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status1.png>");
  182. return;
  183. }
  184. if (command == "poison") {
  185. if (tar == undefined) {
  186. sys.sendMessage(src, "You fail. This person doesn't exist");
  187. return;
  188. }
  189. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status5.png><b><font color=Purple><font size=3> " + commandData + " was poisoned by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status5.png>");
  190. return;
  191. }
  192. if (command == "cure") {
  193. if (tar == undefined) {
  194. sys.sendMessage(src, "You fail. This person doesn't exist");
  195. return;
  196. }
  197. sys.sendHtmlAll("<img src=Themes/Classic/status/battle_status2.png><b><font color=Black><font size=3> " + commandData + " was put to sleep and cured of all status problems by " + sys.name(src) + " <img src=Themes/Classic/status/battle_status2.png>");
  198. return;
  199. }
  200. if (command == "me") {
  201. sys.sendAll("*** " + sys.name(src) + " " + commandData + "***");
  202. return;
  203. }
  204. if (command == "rules") {
  205. sys.sendHtmlMessage(src, "<b><font color=blue><font size=4>RULES");
  206. sys.sendHtmlMessage(src, "<b><font color=black><font size=3>Rule 1: No trolling. If you troll... you will get banned.");
  207. sys.sendHtmlMessage(src, "<b><font color=black><font size=3>Rule 2: Don't insult auth. If you insult auth, your fate is in their hands.");
  208. sys.sendHtmlMessage(src, "<b><font color=black><font size=3>Rule 3: Do not using excessive caps. Occasional caps is fine but if you use it too much... it's a mute.");
  209. sys.sendHtmlMessage(src, "<b><font color=black><font size=3>Rule 4: No advertising other servers. No telling people to go to your server here. It is an instant kick if you do.");
  210. sys.sendHtmlMessage(src, "<b><font color=black><font size=3>Rule 5: Respect others. Do not flame anybody for some random reason. If you're having problems, talk to Auth and they will handle it.");
  211. sys.sendHtmlMessage(src, "<b><font color=black><font size=3>Rule 6: Have fun!");
  212. return;
  213. }
  214. if (command == "sendhtmlall") {
  215. sys.sendHtmlAll (commandData);
  216. return;
  217. }
  218. if (command == "sendall") {
  219. sys.sendAll (commandData);
  220. return;
  221. }
  222. if (command == "auth") {
  223. var authlist = sys.dbAuths().sort()
  224. sys.sendMessage(src, "");
  225. if(commandData == "owners") {
  226. sys.sendMessage(src, "*** Owners ***")
  227. for(x in authlist) {
  228. if(sys.dbAuth(authlist[x]) == 3) {
  229. if(sys.id(authlist[x]) == undefined) {
  230. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/oAway.png/> " + authlist[x] + " (Offline)")
  231. }
  232. if(sys.id(authlist[x]) != undefined) {
  233. sys.sendHtmlMessage(src, "<font color =green><timestamp/><img src=themes/classic/client/oAvailable.png/> " + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  234. }
  235. }
  236. }
  237. sys.sendMessage(src, "");
  238. }
  239. if(commandData == "admins" || commandData == "administrators") {
  240. sys.sendMessage(src, "*** Administrators ***")
  241. for(x in authlist) {
  242. if(sys.dbAuth(authlist[x]) == 2) {
  243. if(sys.id(authlist[x]) == undefined) {
  244. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/aAway.png/> " + authlist[x] + " (Offline)")
  245. }
  246. if(sys.id(authlist[x]) != undefined) {
  247. sys.sendHtmlMessage(src, "<font color =green><timestamp/><img src=themes/classic/client/aAvailable.png/> " + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  248. }
  249. }
  250. }
  251. sys.sendMessage(src, "");
  252. }
  253. if(commandData == "mods" || commandData == "moderators") {
  254. sys.sendMessage(src, "*** Moderators ***")
  255. for(x in authlist) {
  256. if(sys.dbAuth(authlist[x]) == 1) {
  257. if(sys.id(authlist[x]) == undefined) {
  258. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/mAway.png/> " + authlist[x] + " (Offline)")
  259. }
  260. if(sys.id(authlist[x]) != undefined) {
  261. sys.sendHtmlMessage(src, "<font color =green><timestamp/><img src=themes/classic/client/mAvailable.png/> " + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  262. }
  263. }
  264. }
  265. sys.sendMessage(src, "");
  266. }
  267. if(commandData != "moderators" && commandData != "mods" && commandData != "administrators" && commandData != "admins" && commandData != "owners") {
  268. sys.sendMessage(src, "*** Owners ***")
  269. for(x in authlist) {
  270. if(sys.dbAuth(authlist[x]) == 3) {
  271. if(sys.id(authlist[x]) == undefined) {
  272. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/oAway.png/> " + authlist[x] + " (Offline)")
  273. }
  274. if(sys.id(authlist[x]) != undefined) {
  275. sys.sendHtmlMessage(src, "<font color =green><timestamp/><img src=themes/classic/client/oAvailable.png/> " + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  276. }
  277. }
  278. }
  279. sys.sendMessage(src, "");
  280. sys.sendMessage(src, "*** Administrators ***")
  281. for(x in authlist) {
  282. if(sys.dbAuth(authlist[x]) == 2) {
  283. if(sys.id(authlist[x]) == undefined) {
  284. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/aAway.png/> " + authlist[x] + " (Offline)")
  285. }
  286. if(sys.id(authlist[x]) != undefined) {
  287. sys.sendHtmlMessage(src, "<font color =green><timestamp/><img src=themes/classic/client/aAvailable.png/> " + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  288. }
  289. }
  290. }
  291. sys.sendMessage(src, "");
  292. sys.sendMessage(src, "*** Moderators ***")
  293. for(x in authlist) {
  294. if(sys.dbAuth(authlist[x]) == 1) {
  295. if(sys.id(authlist[x]) == undefined) {
  296. sys.sendHtmlMessage(src, "<timestamp/><img src=themes/classic/client/mAway.png/> " + authlist[x] + " (Offline)")
  297. }
  298. if(sys.id(authlist[x]) != undefined) {
  299. sys.sendHtmlMessage(src, "<font color =green><timestamp/><img src=themes/classic/client/mAvailable.png/> " + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  300. }
  301. }
  302. }
  303. }
  304. return;
  305.  
  306. // Mod Commands
  307. }
  308. if (command == "kick") {
  309. if (sys.auth(src) < 1) {
  310. sys.sendMessage(src, "You cannot use this command!");
  311. return;
  312. }
  313. if (tar == undefined) {
  314. sys.sendMessage(src, "You fail. This person doesn't exist");
  315. return;
  316. }
  317. sys.kick(tar)
  318. sys.sendHtmlAll("<b><font color=red><font size=3>" + commandData + " was kicked by " + sys.name(src) + "!");
  319. return;
  320. }
  321. if (command == "mute") {
  322. if (tar == undefined) {
  323. sys.sendMessage(src, "You fail. This person does not exist.");
  324. return;
  325. }
  326. if (sys.auth(tar) >= sys.auth(src)) {
  327. sys.sendMessage("You dont have sufficient auth to mute " + commandData + ".");
  328. return;
  329. }
  330. sys.sendHtmlAll("<b><font color=blue><font size=3> " + commandData + " has been forced to shut up by " + sys.name(src) + "!");
  331. muted[tar] = true;
  332. return;
  333. }
  334. if (command == "smute") {
  335. if (tar == undefined) {
  336. sys.sendMessage(src, "You fail. This person does not exist.");
  337. return;
  338. }
  339. if (sys.auth(tar) >= sys.auth(src)) {
  340. sys.sendMessage("You dont have sufficient auth to mute " + commandData + ".");
  341. return;
  342. }
  343. sys.sendHtmlMessage("<b><font color=blue><font size=3>You forced " + commandData + " to shut up silently!");
  344. muted[tar] = true;
  345. return;
  346.  
  347. }
  348. if (command == "unmute") {
  349. if (tar == undefined) {
  350. sys.sendMessage(src, "You fail. This person does not exist.");
  351. return;
  352. }
  353. sys.sendHtmlAll("<b><font color=green><font size=3>" + commandData + " was allowed to talk again thanks to " + sys.name(src) + "!");
  354. muted[tar] = false;
  355. return;
  356. }
  357. if (command == "imp") {
  358. impersonation[src] = commandData;
  359. sys.sendMessage(src, "+Bot: Now you are " + impersonation[src] + "!");
  360. return;
  361. }
  362. if (command == "impoff") {
  363. if (sys.auth(src) < 1) {
  364. sys.sendMessage(src, "You cannot use this command!");
  365. return;
  366. }
  367. delete impersonation[src];
  368. sys.sendMessage(src, "+Bot: You are done imping! You are yourself again!");
  369. return;
  370.  
  371. }
  372. if (command == "kill") {
  373. if (sys.auth(src) < 1) {
  374. sys.sendMessage(src, "You cannot use this command!");
  375. return;
  376. }
  377. if (tar == undefined) {
  378. sys.sendMessage(src, "You fail. This person does not exist.");
  379. return;
  380. }
  381. var Links=new Array();
  382.                 Links[1]="KillBot: " + commandData + " looked at " + sys.name(src) + "'s face and died of laughter!";
  383.                 Links[2]="KillBot: " + commandData + " has been picked up by a giant ape and eaten!";
  384.                 Links[3]="KillBot: " + commandData + " was jumped by a gang of hoods but whooped their asses! Nevermind, he got murdered!";
  385.                 Links[4]="KillBot: " + commandData + " looked in the mirror...nuff said";
  386.                 Links[5]="KillBot: " + commandData + " got in a fight with a toddler and failed!";
  387.                     var i = Math.floor(6*Math.random())
  388.             sys.sendAll(Links[i]);
  389.                              return; }
  390.  
  391. //Admin Commands
  392. }
  393. if (command == "skick") {
  394. if (sys.auth(src) < 2) {
  395. sys.sendMessage(src, "You cannot use this command!");
  396. return;
  397. }
  398. if (tar == undefined) {
  399. sys.sendMessage(src, "You fail. This person doesn't exist");
  400. return;
  401. }
  402. sys.kick(tar)
  403. sys.sendHtmlMessage(src, "<b><font color=red><font size=3>" + commandData + " was silent kicked by you!");
  404. return;
  405. }
  406. if (command == "clearchat") {
  407. if (sys.auth(src) < 2) {
  408. sys.sendMessage(src, "You cannot use this command!");
  409. return;
  410. }
  411. sys.sendHtmlAll("<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>" + sys.name(src) + " cleared the chat!");
  412. return;
  413. }
  414. if (command == "silence") {
  415.  sys.sendHtmlAll("<b><font color=Green><font size=3> " + sys.name(src) + " told everyone to shut up!");
  416.  muteall = true;
  417.  return;
  418. }
  419. if (command == "unsilence") {
  420. sys.sendHtmlAll("<b><font color=Black><font size=3> " + sys.name(src) + " told everyone to talk again!");
  421.  muteall = false;
  422.  return;
  423. }
  424. if (command == "showteam") {
  425. if (sys.auth(src) < 2) {
  426. sys.sendMessage(src, "You cannot use this command!");
  427. return;
  428. }
  429. sys.sendMessage(src, "");
  430. for (var i = 0; i < 6; i+=1) {sys.sendMessage(src, sys.pokemon(sys.teamPoke(tar, i)) + " @ " + sys.item(sys.teamPokeItem(tar, i)));
  431. for (var j = 0; j < 4; j++) {sys.sendMessage(src, '- ' + sys.move(sys.teamPokeMove(tar, i, j)));}}
  432. sys.sendMessage(src, "");
  433. return;
  434. }
  435. if (command == "ban") {
  436. if(sys.dbIp(commandData) == undefined) {
  437. sendChanMessage(src, "+Bot: No player exists by this name!");
  438. return;
  439. }
  440. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  441. sendChanMessage(src, "+Bot: You can't ban this person. What are you thinking!");
  442. return;
  443. }
  444. ip = sys.dbIp(commandData)
  445. alias=sys.aliases(ip)
  446. y=0
  447. for(var x in alias) {
  448. z = sys.dbAuth(alias[x])
  449. if (z > y) {
  450. y=z
  451. }
  452. }
  453. if(y>=sys.auth(src)) {
  454. sendChanMessage(src, "+Bot: You can't ban this person. What are you thinking!");
  455. return;
  456. }
  457. banlist=sys.banList()
  458. for(a in banlist) {
  459. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  460. sendChanMessage(src, "+Bot: He/she's already banned!");
  461. return;
  462. }
  463. }
  464. sys.sendHtmlAll('<b><font color=blue>' + commandData + ' was banned by ' + sys.name(src) + '!</font></b>');
  465. if(tar != undefined) {
  466. sys.kick(tar)
  467. }
  468. sys.ban(commandData)
  469. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' + commandData + "\n")
  470. return;
  471. }
  472. if (command == "unban") {
  473. if(sys.dbIp(commandData) == undefined) {
  474. sendChanMessage(src, "+Bot: No player exists by this name!");
  475. return;
  476. }
  477. banlist=sys.banList()
  478. for(a in banlist) {
  479. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  480. sys.unban(commandData)
  481. sendChanMessage(src, "+Bot: You unbanned " + commandData + "!");
  482. sys.appendToFile('bans.txt', sys.name(src) + ' unbanned ' + commandData + "\n")
  483. return;
  484. }
  485. }
  486. sendChanMessage(src, "+Bot: He/she's not banned!");
  487. return;
  488.  
  489. //Owner Commands
  490. }
  491. if (command == "changeannouncement") {
  492. if (sys.auth(src) < 3) {
  493. sys.sendMessage(src, "You cannot use this command!");
  494. return;
  495. }
  496. sys.setAnnouncement(commandData)
  497. return;
  498. }
  499. if (command == "defaultannouncement") {
  500. if (sys.auth(src) < 3) {
  501. sys.sendMessage(src, "You cannot use this command!");
  502. return;
  503. }
  504. sys.setAnnouncement("<b><font size=9><font color=Black>Viper's<b><font size=9><font color=Red> Pit<br><b><font size=4><font color=Black>Please make sure to follow the rules and your server host is Blade!<br><font size=3><font color=Red>Join the Viper's Pit clan! Put [VP] before your name to join!");
  505. return;
  506. }
  507. if (command == "resetannouncement") {
  508. var color = sys.getColor(src)
  509. var name = sys.name(src)
  510. if (sys.auth(src) < 3) {
  511. sys.sendMessage(src, "You cannot use this command!");
  512. return;
  513. }
  514. sys.setAnnouncement("The announcement has been reset by <b><font color="+ color + ">" + name + "!");
  515. return;
  516. }
  517. if (command == "clearpass") {
  518. if (sys.auth(src) < 3) {
  519. sys.sendMessage(src, "You cannot use this command!");
  520. return;
  521. }
  522. if (tar == undefined) {
  523. sys.sendMessage(src, "You fail. This person doesn't exist");
  524. return;
  525. }
  526. sys.clearPass(commandData)
  527. sys.sendMessage(src, "The password has been cleared!");
  528. return;
  529. }
  530. if (command == "user") {
  531. if (sys.auth(src) < 3) {
  532. sys.sendMessage(src, "You cannot use this command!");
  533. return;
  534. }
  535. sys.sendHtmlAll("<b><font color=blue><font size=3>" + commandData + " was usered.");
  536. sys.changeAuth(tar, 0)
  537. return;
  538. }
  539. if (command == "mod") {
  540. if (sys.auth(src) < 3) {
  541. sys.sendMessage(src, "You cannot use this command!");
  542. return;
  543. }
  544. sys.sendHtmlAll("<b><font color=blue><font size=3>" + commandData + " now has mod powers!");
  545. sys.changeAuth(tar, 1)
  546. return;
  547. }
  548. if (command == "admin") {
  549. if (sys.auth(src) < 3) {
  550. sys.sendMessage(src, "You cannot use this command!");
  551. return;
  552. }
  553. sys.sendHtmlAll("<b><font color=blue><font size=3>" + commandData + " is an admin now!");
  554. sys.changeAuth(tar, 2)
  555. return;
  556. }
  557. if (command == "owner") {
  558. if (sys.auth(src) < 3) {
  559. sys.sendMessage(src, "You cannot use this command!");
  560. return;
  561. }
  562. sys.sendHtmlAll("<b><font color=blue><font size=3>" + commandData + " was given owner auth!");
  563. sys.changeAuth(tar, 3)
  564. return;
  565. }
  566. if (command == "invisible") {
  567. if (sys.auth(src) < 3) {
  568. sys.sendMessage(src, "You cannot use this command!");
  569. return;
  570. }
  571. var name = sys.name(src)
  572. sys.sendHtmlMessage(tar, "<b><font color=blue><font size=3>You have been given invisible owner by " + name + ". Shhh, don't tell anyone!");
  573. sys.changeAuth(src, 4)
  574. return;
  575. }
  576. if (command == "spam") {
  577. var name = sys.name(src)
  578. var color = sys.getColor(src)
  579. if (sys.auth(src) < 3) {
  580. sys.sendMessage(src, "You cannot use this command!");
  581. return;
  582. }
  583. sys.sendHtmlAll("<b><font color=" + color +">" + name + "</b><font color=black> has activated the Spam Bot!");
  584. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  585. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  586. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  587. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  588. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  589. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  590. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  591. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  592. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  593. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  594. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  595. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  596. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  597. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  598. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  599. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  600. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  601. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  602. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  603. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  604. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  605. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  606. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  607. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  608. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  609. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  610. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");    
  611. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  612. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  613. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  614. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  615. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  616. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  617. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");  
  618. sys.sendHtmlAll("<font color=red><timestamp/><font size=3>+<b><i>SpamBot: </b></i><font color=black>Spam");
  619. sys.sendHtmlAll("The Spam Bot has been de-activated!");
  620. return;
  621. }
  622. if (command == "changerating") {
  623. var data = commandData.split(', ');
  624. if (data.length != 3) {
  625. sys.sendMessage(src, "+Bot: You need to give 3 parameters.");
  626. return;
  627. }
  628. var player = data[0];
  629. var tier = data[1];
  630. var rating = parseInt(data[2]);
  631. sys.changeRating(player, tier, rating);
  632. sys.sendHtmlMessage(src, "<b><font color=green>+RatingBot: <b><font color=blue>Rating of " + player + " in tier " + tier + " was changed to " + rating);
  633. return;
  634.  
  635.  
  636.  
  637.  
  638.  
  639. // Hidden Commands
  640. }
  641. if (command == "shutdown") {
  642. if (sys.auth(src) < 3) {
  643. sys.sendMessage(src, "What kind of idiot are you? Trying to shut down this awesome server. You should be ashamed!");
  644. return;
  645. }
  646. sys.sendHtmlAll("<b><font color=red><font size=3>The server will shut down in 3...2...1...Goodbye!");
  647. sys.shutDown();
  648. return;
  649.  
  650.  
  651.  
  652.  
  653. return;
  654. }
  655. if (typeof impersonation[src] != 'undefined') {
  656. sys.stopEvent();
  657. sys.sendAll(impersonation[src] + ": " + message);
  658. return;
  659. }
  660. }
  661.  
  662.  
  663. ,
  664.  
  665. beforeChallengeIssued : function (src, dest, clauses) {
  666. /* Challenge Cup Clause */
  667. if (clauses[7] == 1)
  668. return;
  669. if (clauseOn[dest] == true) {
  670. for (var i = 0; i < 6; i++) {
  671. if (hasBan(dest, sys.teamPoke(src,i))) {
  672. sys.sendMessage(src, "ClauseBot: Your opponent is afraid of " + sys.pokemon(sys.teamPoke(src,i)));
  673. sys.stopEvent();
  674. return;
  675. }
  676. }
  677. }
  678. if (clauseOn[src] == true) {
  679. for (var i = 0; i < 6; i++) {
  680. if (hasBan(src, sys.teamPoke(dest,i))) {
  681. sys.sendMessage(src, "ClauseBot: You are afraid of some pokemon of the opponent, so I won't let you challenge them.");
  682. sys.stopEvent();
  683. return;
  684. }
  685. }
  686. }
  687. /* Regular tier checks that can't be made using the built-in server tier system */
  688. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  689. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) || sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  690. sys.sendMessage(src, "+Bot: SonicBoom and Dragon Rage are banned in Little Cup!");
  691. sys.stopEvent();
  692. }
  693. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) || sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  694. sys.sendMessage(src, "+Bot: Your opponent has banned moves SonicBoom or Dragon Rage in Little Cup tier!");
  695. sys.stopEvent();
  696. }
  697. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  698. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup!");
  699. sys.stopEvent();
  700. }
  701. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  702. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup and your opponent has it!");
  703. sys.stopEvent();
  704. }
  705. }
  706. }
  707. ,
  708. beforeBattleMatchup : function(src,dest,clauses)
  709. {
  710. if (clauseOn[dest] == true) {
  711. for (var i = 0; i < 6; i++) {
  712. if (hasBan(dest, sys.teamPoke(src,i))) {
  713. sys.stopEvent();
  714. return;
  715. }
  716. }
  717. }
  718. if (clauseOn[src] == true) {
  719. for (var i = 0; i < 6; i++) {
  720. if (hasBan(src, sys.teamPoke(dest,i))) {
  721. sys.stopEvent();
  722. return;
  723. }
  724. }
  725. }
  726. /* Regular tier checks that can't be made using the built-in server tier system */
  727. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  728. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) || sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  729. sys.stopEvent();
  730. }
  731. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) || sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  732. sys.stopEvent();
  733. }
  734. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  735. sys.stopEvent();
  736. }
  737. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  738. sys.stopEvent();
  739. }
  740. }
  741. }
  742. ,
  743. beforeBattleStarted : function(src, dest) {
  744. /* If this is little cup, the levels are changed to be level 5 */
  745. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  746. 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)];
  747. 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)];
  748. for (var i = 0; i < 6; i+=1) {
  749. if (sys.teamPokeLevel(src, i) > 5)
  750. sys.changePokeLevel(src, i, 5);
  751. if (sys.teamPokeLevel(dest, i) > 5)
  752. sys.changePokeLevel(dest, i, 5);
  753. }
  754. }
  755. }
  756. ,
  757. afterBattleEnded: function(src, dest) {
  758. /* If this is little cup, the levels are to be changed back! */
  759. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup" && lilCupLevels[src] != undefined && lilCupLevels[dest] != undefined) {
  760. for (var i = 0; i < 6; i+=1) {
  761. if (sys.teamPokeLevel(src, i) != lilCupLevels[src][i])
  762. sys.changePokeLevel(src, i, lilCupLevels[src][i]);
  763. if (sys.teamPokeLevel(dest, i) != lilCupLevels[dest][i])
  764. sys.changePokeLevel(dest, i, lilCupLevels[dest][i]);
  765. }
  766. }
  767. }
  768. ,
  769. beforeLogOut : function (src) {
  770. if (muted[src] == true) {
  771. sys.saveVal("muted*" + sys.ip(src), "true");
  772. } else {
  773. sys.removeVal("muted*" + sys.ip(src));
  774. }
  775. }
  776. })
RAW Paste Data
Top