-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterraria-notes-guitar.ahk
74 lines (58 loc) · 1.13 KB
/
terraria-notes-guitar.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
69
70
71
72
73
74
#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.
MoveToNote(ByRef button)
{
direction := -1 ; 1, -1
four_blocks_pixels := 64
two_blocks_pixels := 32
invert := "NO" ; YES, NO
WinGetPos, myWinX, myWinY, myWinSizeX, myWinSizeY, A
if(invert == "NO")
MouseMove, (myWinSizeX/2 + (direction) * (four_blocks_pixels * button) + (direction) * two_blocks_pixels ), (myWinSizeY/2)
if(invert == "YES")
MouseMove, (myWinSizeX/2 + (direction) * (four_blocks_pixels * (12 - button)) + (direction) * two_blocks_pixels ), (myWinSizeY/2)
}
PlayNote()
{
send, {LButton down}
sleep, 100
send, {LButton up}
}
1::
{
MoveToNote(0)
PlayNote()
return
}
2::
{
MoveToNote(1)
PlayNote()
return
}
3::
{
MoveToNote(2)
PlayNote()
return
}
4::
{
MoveToNote(3)
PlayNote()
return
}
5::
{
MoveToNote(4)
PlayNote()
return
}
6::
{
MoveToNote(5)
PlayNote()
return
}