-
Notifications
You must be signed in to change notification settings - Fork 0
/
hogwarts-legacy-fast-mounts.ahk
68 lines (59 loc) · 1.68 KB
/
hogwarts-legacy-fast-mounts.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#NoEnv
#SingleInstance Force
SetWorkingDir %A_ScriptDir%
SendMode Input
SetKeyDelay, 100
#IFWinActive, ahk_exe HogwartsLegacy.exe
LoadSettings(_SourcePath = "settings.ini", _ValueDelim = "=", _VarPrefixDelim = "_")
{
Global
if !FileExist(_SourcePath){
MsgBox, 16, % "Error", % "The file " . _SourcePath . " does not esxist"
} else {
Local FileContent, CurrentPrefix, CurrentVarName, CurrentVarContent, DelimPos
FileRead, FileContent, %_SourcePath%
If ErrorLevel = 0
{
Loop, Parse, FileContent, `n, `r%A_Tab%%A_Space%
{
If A_LoopField Is Not Space
{
If (SubStr(A_LoopField, 1, 1) = "[")
{
RegExMatch(A_LoopField, "\[(.*)\]", ini_Section)
CurrentPrefix := ini_Section1
}
Else
{
DelimPos := InStr(A_LoopField, _ValueDelim)
CurrentVarName := SubStr(A_LoopField, 1, DelimPos - 1)
CurrentVarContent := SubStr(A_LoopField, DelimPos + 1)
%CurrentPrefix%%_VarPrefixDelim%%CurrentVarName% = %CurrentVarContent%
}
}
}
}
}
}
LoadSettings()
HotKey, %TransportVehicles_MagicStick%, MagicStickHandler
HotKey, %TransportVehicles_Hippogriff%, HippogriffHandler
HotKey, %TransportVehicles_Graphorns%, GraphornsHandler
MagicStickHandler:
{
Send "{Tab Down}{3 up}" ;hold a
Sleep 300 ;10 seconds
Send "{3 down}{Tab up}"
}
HippogriffHandler:
{
Send "{Tab Down}{2 up}" ;hold a
Sleep 300 ;10 seconds
Send "{2 down}{Tab up}"
}
GraphornsHandler:
{
Send "{Tab Down}{1 up}" ;hold a
Sleep 300 ;10 seconds
Send "{1 down}{Tab up}"
}