Advertisement
DevTricks

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

Nov 13th, 2022 (edited)
1,678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IfNotExist, %A_ScriptDir%\ConfigKEY.ini
  2.   {
  3.     IniWrite, Numpad5, %A_ScriptDir%\ConfigKEY.ini, KeyBind, Press
  4.     IniWrite, 0, %A_ScriptDir%\ConfigKEY.ini, KeyBind, Duel
  5.     IniWrite, 0, %A_ScriptDir%\ConfigKEY.ini, KeyBind, Dagger
  6.     IniWrite, 0, %A_ScriptDir%\ConfigKEY.ini, KeyBind, Bloodthorn
  7.     IniWrite, 0, %A_ScriptDir%\ConfigKEY.ini, KeyBind, Blademail
  8.     IniWrite, 0, %A_ScriptDir%\ConfigKEY.ini, KeyBind, Black
  9.     IniWrite, 0, %A_ScriptDir%\ConfigKEY.ini, KeyBind, COMBO
  10.     Press=Numpad5
  11.     Duel=WheelDown
  12.     Dagger=1
  13.     Bloodthorn=2
  14.     Blademail=5
  15.     Black=4
  16.     COMBO=Numpad0
  17.   }
  18.   Else
  19.   {
  20.     IniRead, Press,      %A_ScriptDir%\ConfigKEY.ini, KeyBind, Press
  21.     IniRead, Duel,       %A_ScriptDir%\ConfigKEY.ini, KeyBind, Duel
  22.     IniRead, Dagger,     %A_ScriptDir%\ConfigKEY.ini, KeyBind, Dagger
  23.     IniRead, Bloodthorn, %A_ScriptDir%\ConfigKEY.ini, KeyBind, Bloodthorn
  24.     IniRead, Blademail,  %A_ScriptDir%\ConfigKEY.ini, KeyBind, Blademail
  25.     IniRead, Black,      %A_ScriptDir%\ConfigKEY.ini, KeyBind, Black
  26.     IniRead, COMBO,      %A_ScriptDir%\ConfigKEY.ini, KeyBind, COMBO
  27.   }
  28.  
  29. Gui, +ToolWindow
  30. Gui, Add, Text, x12 y9 w80 h20 , Press
  31. Gui, Add, Edit, x92 y9 w100 h20 vPress, %Press%
  32.  
  33. Gui, Add, Text, x12 y39 w80 h20 , Duel
  34. Gui, Add, Edit, x92 y39 w100 h20 vDuel, %Duel%
  35.  
  36. Gui, Add, Text, x12 y69 w80 h20 , Dagger
  37. Gui, Add, Edit, x92 y69 w100 h20 vDagger, %Dagger%
  38.  
  39. Gui, Add, Text, x12 y99 w80 h20 , Bloodthorn
  40. Gui, Add, Edit, x92 y99 w100 h20 vBloodthorn, %Bloodthorn%
  41.  
  42. Gui, Add, Text, x12 y129 w80 h20 , Blademail
  43. Gui, Add, Edit, x92 y129 w100 h20 vBlademail, %Blademail%
  44.  
  45. Gui, Add, Text, x12 y159 w80 h20 , Black
  46. Gui, Add, Edit, x92 y159 w100 h20 vBlack, %Black%
  47.  
  48. Gui, Add, Text, x12 y189 w80 h20 , COMBO
  49. Gui, Add, Edit, x92 y189 w100 h20 vCOMBO, %COMBO%
  50.  
  51. Gui, Add, Button, x12 y219 w180 h40 , APPLY
  52. Gui, Show, xCenter yCenter h273 w208, KeyBind
  53.  
  54. Hotkey, %COMBO%, MyCombo
  55. return
  56.  
  57. MyCombo:
  58. send !{%Press%}
  59. sleep 252
  60. send {%Black%}
  61. sleep 60
  62. send {%Blademail%}
  63. sleep 60
  64. send {%Dagger%}
  65. sleep 100
  66. send {%Bloodthorn%}
  67. sleep 60
  68. send {%Duel%}
  69. Return
  70.  
  71. ButtonAPPLY:
  72. Hotkey, %COMBO%, Off
  73. Gui, submit, NoHide
  74. IniWrite, %Press%,      %A_ScriptDir%\ConfigKEY.ini, KeyBind, Press
  75. IniWrite, %Duel%,       %A_ScriptDir%\ConfigKEY.ini, KeyBind, Duel
  76. IniWrite, %Dagger%,     %A_ScriptDir%\ConfigKEY.ini, KeyBind, Dagger
  77. IniWrite, %Bloodthorn%, %A_ScriptDir%\ConfigKEY.ini, KeyBind, Bloodthorn
  78. IniWrite, %Blademail%,  %A_ScriptDir%\ConfigKEY.ini, KeyBind, Blademail
  79. IniWrite, %Black%,      %A_ScriptDir%\ConfigKEY.ini, KeyBind, Black
  80. IniWrite, %COMBO%,      %A_ScriptDir%\ConfigKEY.ini, KeyBind, COMBO
  81. Hotkey, %COMBO%, MyCombo
  82. MsgBox,0, Success , Your settings have been successfully applied, 1
  83. Reload
  84. Return
  85.  
  86. GuiClose:
  87.     ExitApp
  88.  
  89. GuiEscape:
  90.     ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement