Advertisement
DevTricks

GUI с динамическим изменением HOTKEY 2

Nov 15th, 2022 (edited)
1,286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IfNotExist, %A_ScriptDir%\ConfigKey2.ini
  2. {
  3. IniWrite, 3,        %A_ScriptDir%\ConfigKey2.ini, KeyBind, soul ;IniWrite, Value, Filename, Section, Key
  4. IniWrite, 6,        %A_ScriptDir%\ConfigKey2.ini, KeyBind, botle
  5. IniWrite, numpad3,  %A_ScriptDir%\ConfigKey2.ini, KeyBind, rearm
  6. IniWrite, $numpad3, %A_ScriptDir%\ConfigKey2.ini, KeyBind, COMBO
  7. soul=3
  8. botle=6
  9. rearm=numpad3
  10. COMBO=$numpad3
  11. }
  12. Else
  13. {
  14. IniRead, soul,  %A_ScriptDir%\ConfigKey2.ini, KeyBind, soul ;IniRead, OutputVar, Filename, Section, Key [, Default]
  15. IniRead, botle, %A_ScriptDir%\ConfigKey2.ini, KeyBind, botle
  16. IniRead, rearm, %A_ScriptDir%\ConfigKey2.ini, KeyBind, rearm
  17. IniRead, COMBO, %A_ScriptDir%\ConfigKey2.ini, KeyBind, COMBO
  18. }
  19.  
  20. Gui, Add, Text, x12 y9 w120 h20 , Rearm
  21. Gui, Add, Edit, x132 y9 w120 h20 vrearm, %rearm%
  22.  
  23. Gui, Add, Text, x12 y39 w120 h20 , Soul ring
  24. Gui, Add, Edit, x132 y39 w120 h20 vsoul, %soul%
  25.  
  26. Gui, Add, Text, x12 y69 w120 h20 , Botle
  27. Gui, Add, Edit, x132 y69 w120 h20 vbotle, %botle%
  28.  
  29. Gui, Add, Text, x12 y99 w120 h20 , COMBO5
  30. Gui, Add, Edit, x132 y99 w120 h20 vCOMBO, %COMBO%
  31.  
  32. Gui, Add, Button, x12 y139 w236 h50 , APPLY
  33. Gui, Show, xCenter yCenter h212 w268, Soul+Botle+Rearm
  34.  
  35. Hotkey, %COMBO%, MyCombo ;Hotkey, KeyName [, Label, Options]
  36. Return
  37.  
  38. MyCombo:
  39. send {%soul%}
  40. sleep 60
  41. send {%botle%}
  42. sleep 60
  43. send {%rearm%}
  44. Return
  45.  
  46. ButtonAPPLY:
  47. Gui, submit, NoHide
  48. IniWrite, %rearm%, %A_ScriptDir%\ConfigKey2.ini, KeyBind, rearm
  49. IniWrite, %soul%, %A_ScriptDir%\ConfigKey2.ini, KeyBind, soul
  50. IniWrite, %botle%, %A_ScriptDir%\ConfigKey2.ini, KeyBind, botle
  51. IniWrite, %COMBO%, %A_ScriptDir%\ConfigKey2.ini, KeyBind, COMBO
  52.  
  53.  
  54. Hotkey, %COMBO%, MyCombo
  55. MsgBox,0, Success , Your settings have been successfully applied, 3
  56. Reload
  57. Return
  58.  
  59. GuiClose:
  60. ExitApp
  61. GuiEscape:
  62. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement