Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.90 KB | None | 0 0
  1. var myDate = new Date();
  2. var TLoop = true;
  3. var time = MyTime();
  4. var Winner;
  5. var Loser;
  6. var CurDiff = (me.diff == 1) ? "Nightmare" : (me.diff == 2) ? "Hell" : "Normal";
  7. function NTMain()
  8. {
  9. Delay(1000);
  10.  
  11. Include("libs/common/NTCommon.ntl");
  12.  
  13. RegisterEvent(EVENT_GAMEMSG, PvPCatch);
  14. RegisterEvent(EVENT_KEYDOWN, Keyz);
  15.  
  16. SetStatusText("PvP Tourny Logging Is On!");
  17.  
  18. Print("ÿc2PvP Tracking by MoD-Tru");
  19. Delay(Random(500,800));
  20. Print("ÿc5Press 5 (NumPad) for help!");
  21.  
  22. var tournyLog = FileOpen("PvP Tracking/Logs/tournyLog.txt", 2);
  23. if(!tournyLog)
  24. tournyLog = FileOpen("PvP Tracking/Logs/tournyLog.txt", 2);
  25. tournyLog.WriteLine("---------" + me.gamename + "---------");
  26. tournyLog.WriteLine("Date: " + myDate.toDateString());
  27. tournyLog.WriteLine("Start Time: " + time);
  28. tournyLog.WriteLine("Difficulty: " + CurDiff);
  29. tournyLog.WriteLine(" ");
  30. tournyLog.Close();
  31. Delay(Random(200,400));
  32.  
  33. while(TLoop)
  34. Delay(Random(250,500));
  35. }
  36.  
  37. function PvPCatch(msg, type)
  38. {
  39. if(type == 4 && msg.indexOf(" was slain by ") != -1)
  40. {
  41. Print("ÿc3Logging Duel!");
  42. Winner = msg.split(" was slain by ")[1];
  43. Loser = msg.split(" was slain by ")[0];
  44. Delay(Random(400,800));
  45. tournyLog = FileOpen("PvP Tracking/Logs/tournyLog.txt", 2);
  46. if(!tournyLog)
  47. tournyLog = FileOpen("PvP Tracking/Logs/tournyLog.txt", 2);
  48. tournyLog.WriteLine(Winner + " VS " + Loser + ". Winner: " + Winner);
  49. tournyLog.WriteLine(" ");
  50. tournyLog.Close();
  51. Delay(Random(200,400));
  52. }
  53. return;
  54. }
  55.  
  56. function MyTime()
  57. {
  58. var now = new Date();
  59. var HR = now.getHours();
  60. var MM = now.getMinutes();
  61. var SS = now.getSeconds();
  62. var DT = "AM";
  63. var Civ = true;
  64.  
  65. if(Civ)
  66. {
  67. if (HR > 11) { DT = "PM"; }
  68. if (HR > 12) { HR = HR - 12 }
  69. if (HR == 0) { HR = 12}
  70. }
  71. if (HR < 10) { HR = "0" + HR }
  72. if (MM < 10) { MM = "0" + MM }
  73. if (SS < 10) { SS = "0" + SS }
  74.  
  75. var time = HR + ":" + MM + ":" + SS + " " + DT;
  76. return time;
  77. }
  78.  
  79. function Keyz(keycode)
  80. {
  81. switch(keycode)
  82. {
  83. case 96: // '0' (NumPad)
  84. UnregisterEvent(EVENT_GAMEMSG, (PvPCatch, OppInfo, MyInfo));
  85. Print("ÿc2PvP Logging has been turned off!");
  86. SetStatusText("PvP Logging Is OFF!");
  87. break;
  88. case 97: // '1' (NumPad)
  89. RegisterEvent(EVENT_GAMEMSG, (PvPCatch, OppInfo, MyInfo));
  90. Print("ÿc2PvP Logging has been turned back on!");
  91. SetStatusText("PvP Logging Is On!");
  92. break;
  93. case 99: // '3' (NumPad)
  94. tournyLog = FileOpen("PvP Tracking/Logs/tournyLog.txt", 1);
  95. tournyLog.Close();
  96. Print("ÿc2tournyLog.txt erased!");
  97. break;
  98. case 101: // '5' (NumPad)
  99. HelpButton()
  100. break;
  101. }
  102. }
  103.  
  104. function HelpButton()
  105. {
  106. Print("ÿc2Press '0' (NumPad) to turn off Logging");
  107. Print("ÿc2Press '1' (NumPad) to turn on Logging");
  108. Print("ÿc2Press '3' (NumPad) to clear your tournyLog.txt");
  109. Print("ÿc2Press '5' (NumPad) to see this help");
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement