SingleInstance force DIR A_Desktop Ahk FileCreateDir DIR DIRSET A_Desk

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
#SingleInstance, force
DIR = %A_Desktop%\Ahk
FileCreateDir, %DIR%
DIRSET = %A_Desktop%\Ahk\options.ini
IfNotExist,%DIR%\*.ini
{
SplashTextOn, , 60,AHK,Наберитесь терпения`nидёт установка нужных файлов...
UrlDownloadToFile, https://www.dropbox.com/s/urpzy5kypr3jucv/options.ini?dl=1, %DIR%\options.ini
SplashTextoff
}
gosub, ReadSettings
Gui, MainMenu:Add, Hotkey, x10 y10 w100 h20 vhot1, %hot1% ; Бинди на нумпады
Gui, MainMenu:Add, Hotkey, x10 y50 w100 h20 vhot2, %hot2% ; Бинди на нумпады
Gui, MainMenu:Add, Hotkey, x10 y90 w100 h20 vhot3, %hot3% ; И ещё допустим 5 хоткеев | Бинди на нумпады
Gui, MainMenu:Add, Hotkey, x120 y30 w100 h20 vbaction, %baction% ; Активация скрипта
Gui, MainMenu:Add, Button, x100 y130 w170 h20 gSaveButton, СОХРАНИТЬ
Gui, MainMenu:Add, Button, x100 y170 w170 h20 gCfgGen, СОЗДАТЬ КОНФИГ
Gui, MainMenu:Show, w400 h220, gui
ReadSettings:
{
IniRead, hot1, %DIRSET%, Options, hot1
IniRead, hot2, %DIRSET%, Options, hot2
IniRead, hot3, %DIRSET%, Options, hot3
IniRead, baction, %DIRSET%, Options, baction
{
if baction=ERROR
{
baction=
}
if baction !=
{
Hotkey, ~%baction%, Action
}
}
return
}
SaveButton:
{
Gui, MainMenu:Submit, NoHide
IniWrite, %hot1%, %DIRSET%, Options, hot1
IniWrite, %hot2%, %DIRSET%, Options, hot2
IniWrite, %hot3%, %DIRSET%, Options, hot3
IniWrite, %baction%, %DIRSET%, Options, baction
Gosub, ReadSettings
MsgBox, 64, AHK, Сохранено!
return
}
CfgGen:
Gui, MainMenu:Submit, NoHide
for k, v in {"Numpad0": "kp_ins", "Numpad1": "kp_end", "Numpad2": "kp_downarrow", "Numpad3": "kp_pgdn", "Numpad4": "kp_leftarrow", "Numpad5": "kp_5","Numpad6": "kp_rightarrow","Numpad7": "kp_home","Numpad8": "kp_uparrow","Numpad9": "kp_pgup","NumpadDiv": "kp_slash","NumpadMult": "kp_multiply","NumpadSub": "kp_minus","NumpadAdd": "kp_plus","NumpadDot": "kp_del"} ; Здесь что-то не так
var1 = bind "%hot1%" "say: GLHF" `; bind "%hot2%" "say: DDos chat" `; bind "%hot3%" "say_team: ya na chitah"
var2 := RegExReplace(var1, k, v) ; Или здесь
FileDelete, %A_Desktop%\Ahk\autoexec.cfg
FileAppend, %var2%, %A_Desktop%\Ahk\autoexec.cfg
return
Action:
Gui, MainMenu:Submit, NoHide
time1 := 5000
time2 := 10000
Loop
{
SendInput, {%hot1%}
sleep 300
if (GetKeyState("B", "P"))
{
sleep %time1%
break
}
if (GetKeyState("Y", "P")) || if (GetKeyState("U", "P"))
{
sleep %time2%
break
}
SendInput, {%hot2%}
sleep 300
if (GetKeyState("B", "P"))
{
sleep %time1%
break
}
if (GetKeyState("Y", "P")) || if (GetKeyState("U", "P"))
{
sleep %time2%
break
}
SendInput, {%hot3%}
if (GetKeyState("B", "P"))
{
sleep %time1%
break
}
if (GetKeyState("Y", "P")) || if (GetKeyState("U", "P"))
{
sleep %time2%
break
}
}
goto, Action
return
Esc::
MainMenuGuiClose:
ExitApp