Advertisement
Guest User

PvE Map Rotation

a guest
Apr 20th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. #SingleInstance Force
  2. SetTitleMatchMode 2
  3. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  4. ; #Warn ; Enable warnings to assist with detecting common errors.
  5. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  6. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  7.  
  8. global OffsetVar:=2 ;Controls how many minutes the time is offset
  9. global OffsecVar:=45 ;Controls how many seconds the time is offset
  10. MissionList=
  11. Loop, Read, C:\AHK\AW\Missions.txt ;Missions.txt contains a list of all missions seperated by newlines
  12. MissionList=%MissionList%%A_LoopReadLine%|
  13. Gui, Font, s12
  14. yVar:=10
  15. Loop 7
  16. {
  17. Gui, Add, DropDownList, vMH%A_Index% W200 X10 Y%yVar%, %MissionList%
  18. Gui, Add, DropDownList, vMM%A_Index% W200 X220 Y%yVar%, %MissionList%
  19. Gui, Add, DropDownList, vME%A_Index% W200 X430 Y%yVar%, %MissionList%
  20. yVar+=3
  21. Gui, Add, Text, vCD%A_Index% X634 Y%yVar% W200, 00:00
  22. yVar+=27
  23. FormatTime, CalcVar, 20160101070000, yyyyMMddHHmmss
  24. TempVar:=5 * A_Index + OffsetVar
  25. CalcVar+=%TempVar%, minutes
  26. Loop 2
  27. {
  28. TVar=
  29. Loop 14
  30. {
  31. CalcVar+=35, minutes
  32. FormatTime, SVar, %CalcVar%, hh:mm
  33. TVar=%TVar%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%SVar%
  34. }
  35. Gui, Add, Text, X10 Y%yVar%, %TVar%
  36. yVar+=25
  37. }
  38. }
  39. Loop, Read, C:\AHK\AW\HL.txt
  40. GuiControl, ChooseString, MH%A_Index%, %A_LoopReadLine%
  41. Loop, Read, C:\AHK\AW\ML.txt
  42. GuiControl, ChooseString, MM%A_Index%, %A_LoopReadLine%
  43. Loop, Read, C:\AHK\AW\EL.txt
  44. GuiControl, ChooseString, ME%A_Index%, %A_LoopReadLine%
  45. Gui, Add, Button, X10 W620 H60 Y%yVar% gSaveList, Save
  46. Gui, Add, Button, X635 W100 H60 Y%yVar% gClearList, Clear
  47. Gui, Show, W840 H655 Y0
  48. GoSub EverySecond
  49. SetTimer EverySecond, 1000
  50. return
  51.  
  52. GuiClose:
  53. ExitApp
  54.  
  55. EverySecond:
  56. Loop 7
  57. {
  58. newTime := A_Hour * 3600 + A_Min * 60 + A_Sec - A_Index * 300 - OffsetVar * 60 - OffsecVar - 300
  59. Transform, rVar, Mod, %newTime%, 2100
  60. cVar:=2100-rVar
  61. if(cVar < 300){
  62. mVar:=AZ(floor(cVar/60))
  63. sVar:=AZ(mod(cVar,60))
  64. Gui, Font, cRed
  65. GuiControl, Text, CD%A_Index%, %mVar%:%sVar% Active
  66. GuiControl, Font, CD%A_Index%
  67. }
  68. else{
  69. cVar-=300
  70. mVar:=AZ(floor(cVar/60))
  71. sVar:=AZ(mod(cVar,60))
  72. Gui, Font, cBlack
  73. GuiControl, Text, CD%A_Index%, %mVar%:%sVar%
  74. GuiControl, Font, CD%A_Index%
  75. }
  76. }
  77. return
  78.  
  79. AZ(x){
  80. return SubStr( "0" x, -1)
  81. }
  82.  
  83. SaveList:
  84. FileDelete, C:\AHK\AW\HL.txt
  85. FileDelete, C:\AHK\AW\ML.txt
  86. FileDelete, C:\AHK\AW\EL.txt
  87. Loop 7
  88. {
  89. GuiControlGet TempVar,, MH%A_Index%
  90. FileAppend %TempVar%`n,C:\AHK\AW\HL.txt
  91. GuiControlGet TempVar,, MM%A_Index%
  92. FileAppend %TempVar%`n,C:\AHK\AW\ML.txt
  93. GuiControlGet TempVar,, ME%A_Index%
  94. FileAppend %TempVar%`n,C:\AHK\AW\EL.txt
  95. }
  96. return
  97.  
  98. Clearlist:
  99. Loop 7 {
  100. GuiControl, Choose, MH%A_Index%, 0
  101. GuiControl, Choose, MM%A_Index%, 0
  102. GuiControl, Choose, ME%A_Index%, 0
  103. }
  104. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement