Hello everyone,
Im quite new to AutoItscript. I followed a tutorial on how to make an autotyper script and was already able to add enter to it, I would now like the option of having hotkeys too? Any idea how I start on this? This is my code:
Dim $timer, $run = False, $label[2]=['Start','Stop']
$gui = GUICreate("Artego's AutoTyper", 335, 100)
GUISetState()
GUICtrlCreateLabel("Text", 8, 10)
$key1 = GUICtrlCreateInput("", 35, 8, 120)
GUICtrlCreateLabel("Time", 8, 44)
$time1 = GUICtrlCreateInput("(in miliseconds)", 35, 40, 120)
$button = GUICtrlCreateButton($label[$run], 190, 8, 60)
HotKeySet("{F7}", "Start")
HotKeySet("{F8}", "Stop")
While 1
Switch GUIGetMsg()
Case -3
ExitLoop
Case $button
$run = Not $run
GUICtrlSetData($button, $label[$run])
$timer = 0
Case Else
If $run Then
If TimerDiff($timer) > GUICtrlRead($time1) And Not WinActive($gui) Then
Send(GUICtrlRead($key1))
Send ("{ENTER}")
$timer = TimerInit()
EndIf
EndIf
EndSwitch
WEnd
I already thried the HotKeySet, but I think it works in a different way. Thanks if you help me, it's really appreciated