Advertisement
theMizzler

Reverse JungleTimer

May 31st, 2012
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;LEAGUE OF LEGENDS CREEP TIMERS - REVERSE VERSION
  2. ;VERSION 2.3
  3. ;Created by unknown, modded by theMizzler
  4. ;Minimal version created by pacov
  5. ;Last update - 5/31/2012
  6.  
  7. ;DESCRIPTION
  8. ;The purpose of this AutoHotKey script is to enable League of Legends players to quickly track when critical creeps are spawned.  
  9. ;The script handles baron, dragon, red, and blue buffs.  In short, the user with this script installed presses a hotkey (detailed
  10. ;below) to track when a specific creep has died.  When the user presses the hotkey, a timer is kept of that objective. When the corresponding chat key is pressed, the time until that objective is chatted.
  11. ;The bottom line is that this script makes it simple for everyone on the team to know when creeps
  12. ;respawn just by having 1 person paying enough attention to press a hot key when a particular creep dies.  
  13.  
  14. ;HOW TO INSTALL
  15. ;Step 1 - Download and install AutoHotkey at http://www.autohotkey.com/download/
  16. ;Step 2 - If you received this code via pastebin, open notepad, copy and paste the info, and save the file as whatever you want.
  17. ;be sure to save the file with the extension .ahk (ex lol.ahk).  If you received this file as a .ahk file, move to step 3.
  18.  
  19. ;HOW TO RUN
  20. ;Right click on the .ahk file and click run.  If you compiled the script, simply click on the compiled file and it will execute.  
  21.  
  22. ;HOW TO USE IN GAME
  23. ;The following step is CRITICAL.  At 90 seconds into the game, you mustpress F9.  This sets the internal counter within the
  24. ;script so that the script believes your game time is currently at 90 seconds (Minions have spawned).  You have to do this at the start of every game
  25. ;and it is not possible to automate it further.  The thing to understand here is that the script has NO idea of when your game
  26. ;has started unless you tell it (by pressing f9 at 15 seconds).
  27.  
  28. ;This variable determines when in game to press the F9 key to synchronize the time of the script and the game, in seconds.
  29. clockSynchroniseTime = 90
  30.  
  31. ;These variables determine what to call the objectives in chat
  32. oBName      = oB
  33. oRName      = oR
  34. tBName      = tB
  35. tRName      = tR
  36. dName       = D
  37. bName       = B
  38.  
  39. ;Reverse timers
  40. oBTimer     := 0
  41. oRTimer     := 0
  42. tBTimer     := 0
  43. tRTimer     := 0
  44. dTimer      := 0
  45. bTimer      := 0
  46.  
  47. ;These values determine whether reminders be shown.
  48. ;-1: this reminder is not shown
  49. ;0: it is announced when this objective spawns
  50. ;any value over 0: this many seconds before the objective spawns, a reminder is shown
  51.  
  52. ;HOTKEYS
  53. ;F9 = Reset game timer to 90 seconds (Use this after 90 seconds ingame. Synchonize time is adjustable.)
  54.  
  55. ;Shift+F1 = time OUR BLUE
  56. ;Shift+F2 = time OUR RED
  57. ;Shift+F3 = time THEIR BLUE
  58. ;Shift+F4 = time THEIR RED
  59. ;Shift+F5 = time DRAGON
  60. ;Shift+F6 = time BARON NASH
  61.  
  62. ;F1 = report OUR BLUE
  63. ;F2 = report OUR RED
  64. ;F3 = report THEIR BLUE
  65. ;F4 = report THEIR RED
  66. ;F5 = report DRAGON
  67. ;F6 = report BARON
  68.  
  69. ;Everything below this line is the script for the game.  Good luck and have fun!
  70.  
  71. #Persistent
  72.  
  73. GameStartTime := -1
  74.  
  75. GetGameSeconds() {
  76.     global GameStartTime
  77.     return (A_TickCount - GameStartTime)//1000
  78. }
  79.  
  80. MakeTime(totalSeconds) {
  81.     S := mod(totalSeconds, 60)
  82.     M := mod((totalSeconds // 60), 60)
  83.     H := mod((totalSeconds // 3600), 3600)
  84.    
  85.     zM := ""
  86.     zS := ""
  87.     zH := ""
  88.    
  89.     if M < 10
  90.         zM := "0"
  91.     if S < 10
  92.         zS := "0"
  93.     if H > 0
  94.         zH := H . ":"
  95.    
  96.     return (zH . zM . M . ":" . zS . S)
  97. }
  98.  
  99. TimeStamp(name, delay) {
  100.     delaySeconds := GetGameSeconds() + delay
  101.    
  102.     Chat(MakeTime(delaySeconds) . " " . name)
  103. }
  104.  
  105. Handle(name, timer) {
  106.     timeDiff := timer - GetGameSeconds()
  107.     if timeDiff > 0
  108.     {
  109.         Chat(name . " up in " . MakeTime(timeDiff))
  110.     }
  111.     else
  112.     {
  113.         Chat(name . " is up")
  114.     }
  115. }
  116.  
  117. ~+F1::
  118.     oBTimer := GetGameSeconds() + 300
  119. return
  120.  
  121. ~+F2::
  122.     oRTimer := GetGameSeconds() + 300
  123. return
  124.  
  125. ~+F3::
  126.     tBTimer := GetGameSeconds() + 300
  127. return
  128.  
  129. ~+F4::
  130.     tRTimer := GetGameSeconds() + 300
  131. return
  132.  
  133. ~+F5::
  134.     dTimer := GetGameSeconds() + 360
  135. return
  136.  
  137. ~+F6::
  138.     bTimer := GetGameSeconds() + 420
  139. return
  140.  
  141. ~F1::
  142.     Handle(oBName, oBTimer)
  143. return
  144.  
  145. ~F2::
  146.     Handle(oRName, oRTimer)
  147. return
  148.  
  149. ~F3::
  150.     Handle(tBName, tBTimer)
  151. return
  152.  
  153. ~F4::
  154.     Handle(tRName, tRTimer)
  155. return
  156.  
  157. ~F5::
  158.     Handle(dName, dTimer)
  159. return
  160.  
  161. ~F6::
  162.     Handle(bName, bTimer)
  163. return
  164.  
  165. ~F9::
  166.     GameStartTime := A_TickCount - (clockSynchroniseTime * 1000)
  167. return
  168.  
  169. Chat(msg) {
  170.     Send {Enter}
  171.     sleep 50
  172.     Send %msg%
  173.     sleep 50
  174.     Send {Enter}
  175. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement