Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance Force
- SetTitleMatchMode 2
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- global OffsetVar:=2 ;Controls how many minutes the time is offset
- global OffsecVar:=45 ;Controls how many seconds the time is offset
- MissionList=
- Loop, Read, C:\AHK\AW\Missions.txt ;Missions.txt contains a list of all missions seperated by newlines
- MissionList=%MissionList%%A_LoopReadLine%|
- Gui, Font, s12
- yVar:=10
- Loop 7
- {
- Gui, Add, DropDownList, vMH%A_Index% W200 X10 Y%yVar%, %MissionList%
- Gui, Add, DropDownList, vMM%A_Index% W200 X220 Y%yVar%, %MissionList%
- Gui, Add, DropDownList, vME%A_Index% W200 X430 Y%yVar%, %MissionList%
- yVar+=3
- Gui, Add, Text, vCD%A_Index% X634 Y%yVar% W200, 00:00
- yVar+=27
- FormatTime, CalcVar, 20160101070000, yyyyMMddHHmmss
- TempVar:=5 * A_Index + OffsetVar
- CalcVar+=%TempVar%, minutes
- Loop 2
- {
- TVar=
- Loop 14
- {
- CalcVar+=35, minutes
- FormatTime, SVar, %CalcVar%, hh:mm
- TVar=%TVar%%A_Space%%A_Space%%A_Space%%A_Space%%A_Space%%SVar%
- }
- Gui, Add, Text, X10 Y%yVar%, %TVar%
- yVar+=25
- }
- }
- Loop, Read, C:\AHK\AW\HL.txt
- GuiControl, ChooseString, MH%A_Index%, %A_LoopReadLine%
- Loop, Read, C:\AHK\AW\ML.txt
- GuiControl, ChooseString, MM%A_Index%, %A_LoopReadLine%
- Loop, Read, C:\AHK\AW\EL.txt
- GuiControl, ChooseString, ME%A_Index%, %A_LoopReadLine%
- Gui, Add, Button, X10 W620 H60 Y%yVar% gSaveList, Save
- Gui, Add, Button, X635 W100 H60 Y%yVar% gClearList, Clear
- Gui, Show, W840 H655 Y0
- GoSub EverySecond
- SetTimer EverySecond, 1000
- return
- GuiClose:
- ExitApp
- EverySecond:
- Loop 7
- {
- newTime := A_Hour * 3600 + A_Min * 60 + A_Sec - A_Index * 300 - OffsetVar * 60 - OffsecVar - 300
- Transform, rVar, Mod, %newTime%, 2100
- cVar:=2100-rVar
- if(cVar < 300){
- mVar:=AZ(floor(cVar/60))
- sVar:=AZ(mod(cVar,60))
- Gui, Font, cRed
- GuiControl, Text, CD%A_Index%, %mVar%:%sVar% Active
- GuiControl, Font, CD%A_Index%
- }
- else{
- cVar-=300
- mVar:=AZ(floor(cVar/60))
- sVar:=AZ(mod(cVar,60))
- Gui, Font, cBlack
- GuiControl, Text, CD%A_Index%, %mVar%:%sVar%
- GuiControl, Font, CD%A_Index%
- }
- }
- return
- AZ(x){
- return SubStr( "0" x, -1)
- }
- SaveList:
- FileDelete, C:\AHK\AW\HL.txt
- FileDelete, C:\AHK\AW\ML.txt
- FileDelete, C:\AHK\AW\EL.txt
- Loop 7
- {
- GuiControlGet TempVar,, MH%A_Index%
- FileAppend %TempVar%`n,C:\AHK\AW\HL.txt
- GuiControlGet TempVar,, MM%A_Index%
- FileAppend %TempVar%`n,C:\AHK\AW\ML.txt
- GuiControlGet TempVar,, ME%A_Index%
- FileAppend %TempVar%`n,C:\AHK\AW\EL.txt
- }
- return
- Clearlist:
- Loop 7 {
- GuiControl, Choose, MH%A_Index%, 0
- GuiControl, Choose, MM%A_Index%, 0
- GuiControl, Choose, ME%A_Index%, 0
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement