garbaniann

Untitled

Jun 2nd, 2022
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn ; Enable warnings to assist with detecting common errors.
  3. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir, C:\Users\%A_USERNAME%\Desktop\AHKTEST ; Ensures a consistent starting directory.
  5.  
  6. Macro_1:="^1"
  7.  
  8. Hotkey, %Macro_1%, HandsDown
  9.  
  10. f1::
  11. IfNotExist C:\Users\%A_USERNAME%\Desktop\AHKTEST\initest.ini
  12. {
  13. 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
  14. }
  15.  
  16. Loop, Read, C:\Users\%A_USERNAME%\Desktop\AHKTEST\initest.ini
  17. {
  18. If A_loopreadline contains hk15=
  19. {
  20. WordFound = 1
  21. msgbox, Contains hk15
  22. break
  23. }
  24. }
  25. If (WordFound != "1")
  26.  
  27. Gui,1:+AlwaysOnTop
  28. Gui,1:Color,Gray
  29. Gui,1:Font,Black
  30.  
  31. Gui,1:Add,Hotkey,x10 y10 vMacro_1,%Macro_1%
  32. Gui,1:Add,Button,x+10 w100 h20 gUpdate_Macro_1,Update
  33.  
  34. Gui,1:Add,Button,x10 y170 w100 h20 gStart,Start
  35.  
  36.  
  37. Gui,1:Show,w400 h200
  38.  
  39.  
  40. Update_Macro_1:
  41. GuiControlGet,New_Key,1:,Macro_1
  42. if(New_Key!=Macro_1)
  43. {
  44. Hotkey, %Macro_1%, HandsDown , Start,off
  45. Macro_1:=New_Key
  46. Hotkey, %Macro_1%, HandsDown , Start,on
  47. IniWrite, %Macro_1%, C:\Users\%A_USERNAME%\Desktop\AHKTEST\initest.ini, Hotkeys, hk1
  48. }
  49. Return
  50.  
  51. Start:
  52. Tooltip,here
  53. return
  54.  
  55. HandssDown:
  56. handsdownmacrohere
  57. Return
Advertisement
Add Comment
Please, Sign In to add comment