-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsourcecode
More file actions
64 lines (51 loc) · 1.89 KB
/
sourcecode
File metadata and controls
64 lines (51 loc) · 1.89 KB
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
Source Code, its not perfect everything doesnt work but the macro works just fine. I only made this for my self and i havent done anything before.
#Persistent
#NoEnv
Gui, Color, Black
Gui, Font, cRed
; Create GUI for FastBoard Macro Tool
Gui, Add, Text, x20 y20 w300 h20, Select Key(s) to Bind Macro (e.g., a,b,c):
Gui, Add, Edit, x20 y40 w300 h20 vSelectedKeys BackgroundBlack cRed Border
Gui, Add, Text, x20 y70 w300 h20, Enter Delay in ms (default 1ms):
Gui, Add, Edit, x20 y90 w100 h20 vDelay BackgroundBlack cRed Border, 1
Gui, Add, Text, x20 y120 w300 h20, Select Macro Action:
Gui, Add, DropDownList, x20 y140 w300 vMacroActionList BackgroundBlack cRed Border, |Play N Times
Gui, Add, Text, x20 y170 w300 h20, Enter Number of Repeats (if applicable):
Gui, Add, Edit, x20 y190 w100 h20 vRepeatCount BackgroundBlack cRed Border, 1
Gui, Add, Button, x130 y230 w100 h30 gSaveMacro, Enable Macro
Gui, Add, Button, x130 y270 w100 h30 gStopMacro, Stop Macro
; Instructions
Gui, Add, Text, x20 y310 w300 h60, Instructions: Enter keys separated by commas. Select action and delay.
Gui, Show, w360 h400, FastBoard Macro Tool
Return
SaveMacro:
Gui, Submit, NoHide
; Make sure keys are entered
if (SelectedKeys = "") {
MsgBox, Please enter at least one key.
return
}
Loop, Parse, SelectedKeys, `,
{
; Add "~" to let the key still work normally
Hotkey, ~%A_LoopField%, ExecuteMacro, On
}
MsgBox, Macro enabled for keys: %SelectedKeys% with action: %MacroActionList% and delay: %Delay% ms.
Return
StopMacro:
Loop, Parse, SelectedKeys, `,
{
Hotkey, ~%A_LoopField%, Off
}
MsgBox, Macro stopped for keys: %SelectedKeys%
Return
ExecuteMacro:
key := StrReplace(A_ThisHotkey, "~") ; Remove the "~" from key name
Loop, %RepeatCount%
{
SendInput, {%key%}
Sleep, %Delay%
}
Return
GuiClose:
ExitApp