Hotkey Update - Run Loop

Post your working scripts, libraries and tools for AHK v1.1 and older
_G8_
Posts: 3
Joined: 12 Feb 2019, 13:29

Hotkey Update - Run Loop

14 Feb 2019, 16:41

I've been looking at tutorials and I think I have a working script for a hotkey updater. However, I'm having a few problems. I want to have a hotkey that is the default when you run the script and when you press the hotkey it activates the loop. When you use the hotkey updater, I want that new hotkey that the person chose to now run the loop instead of the default one. Can anybody help me attach both the loop and the hotkey code?

Code: Select all

#SingleInstance Force

Start_Hotkey:="numpad1"

Hotkey, %Start_Hotkey% , Start

Gui, 1:+AlwaysOnTop
Gui, 1:Color, Black
Gui, 1:Font, cBlack s12

Gui, 1:Add, Hotkey, x10 y10 vStart_Hotkey, %Start_Hotkey%
Gui, 1:Add, Button, gUpdate_StartKey, Update
Gui, 1:Add, Button, gStart, Start
Gui, 1:Show, w500 h200

return

GuiClose:
Escape::ExitApp

Update_StartKey:
GuiControlGet,New_Key,1:,Start_Hotkey
if(New_Key!=Start_Hotkey)
{
Hotkey, %Start_Hotkey% , Start,off
Start_Hotkey:=New_Key
Hotkey, %Start_Hotkey% , Start,on
}
return

Start:
2::
loop, 2
{
Send {Space down}
Sleep 50
Send {Space up}
Sleep 10
}
return

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Google [Bot] and 139 guests