Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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, C:\Users\%A_USERNAME%\Desktop\AHKTEST ; Ensures a consistent starting directory.
- Macro_1:="^1"
- Hotkey, %Macro_1%, HandsDown
- f1::
- IfNotExist C:\Users\%A_USERNAME%\Desktop\AHKTEST\initest.ini
- {
- FileAppend, [Hotkeys]`nhk1=`nhk2=`nhk3=`nhk4=`nhk5=`nhk6=`nhk7=`nhk8=`nhk9=`nhk10`nhk11=`nhk12=`nhk13=`nhk14=`nhk15=`n, C:\Users\%A_USERNAME%\Desktop\AHKTEST\initest.ini
- }
- Loop, Read, C:\Users\%A_USERNAME%\Desktop\AHKTEST\initest.ini
- {
- If A_loopreadline contains hk15=
- {
- WordFound = 1
- msgbox, Contains hk15
- break
- }
- }
- If (WordFound != "1")
- Gui,1:+AlwaysOnTop
- Gui,1:Color,Gray
- Gui,1:Font,Black
- Gui,1:Add,Hotkey,x10 y10 vMacro_1,%Macro_1%
- Gui,1:Add,Button,x+10 w100 h20 gUpdate_Macro_1,Update
- Gui,1:Add,Button,x10 y170 w100 h20 gStart,Start
- Gui,1:Show,w400 h200
- Update_Macro_1:
- GuiControlGet,New_Key,1:,Macro_1
- if(New_Key!=Macro_1)
- {
- Hotkey, %Macro_1%, HandsDown , Start,off
- Macro_1:=New_Key
- Hotkey, %Macro_1%, HandsDown , Start,on
- IniWrite, %Macro_1%, C:\Users\%A_USERNAME%\Desktop\AHKTEST\initest.ini, Hotkeys, hk1
- }
- Return
- Start:
- Tooltip,here
- return
- HandssDown:
- handsdownmacrohere
- Return
Advertisement
Add Comment
Please, Sign In to add comment