Вот скрипт с сохранение профилей, писал для себя .
#SingleInstance force
#Persistent
#NoEnv
SendMode Input
SetBatchLines, -1
#MaxHotkeysPerInterval
#HotkeyInterval, -1
DllCall("LoadKeyboardLayout", "Str", "00000409", "Int", 1)
Gui, Color, 9CEE90
Gui, Font, s11 Bold, Cambria
Gui, Add, Text, x82 y10 w40 h20 cBlue, Y pos
Gui, Add, Edit, x92 y40 w40 h20 cRed vDllCall3
Gui, Add, Text, x12 y10 w40 h20 cBlue, X pos
Gui, Add, Edit, x22 y40 w40 h20 cRed vDllCall1
Gui, Add, Text, x162 y10 w40 h20 cBlue, Delay
Gui, Add, Edit, x162 y40 w40 h20 cRed vDllCall2, 20
Gui, Add, Edit, x95 y125 w40 h20 cRed vDllCall4, 2
Gui, Add, Button, x192 y90 w42 h20 gSave, Save
Gui, Add, Button, x20 y90 w42 h20 gOpen, Open
Gui, Add, Button, x108 y90 w42 h20 gOK, OK
Gui, Show, x557 y130 h171 w255, LightGreen = {:-)
return
*~vk7A:: ; свернуть - для точной настройки макроса
Suspend, On
return
~vk79:: ; f10 выход
Suspend, Off
ExitApp
return
~vk78::
Suspend, toggle
return
*~WheelUp:: ; колесо вверх активация макроса
Suspend, Off
MoveOFF := 1
MoveON := 0
stop := 0
Return
*~vk47:: ; G - бросок гранаты
KeyWait, LButton
Suspend, On
KeyWait, LButton, D
Suspend, Off
return
*~WheelDown::
Suspend, On
MoveOFF := 0
MoveON := 0
stop := 0
return
*~vk51:: ; Q - переключение на пистолет
MoveOFF := 0
MoveON := 1
stop := 1
return
*~vk76:: ; F7
Gui Submit, NoHide
Suspend, Off
If keystroke = 1
{
keystroke =
np := 0
op := 0
SoundBeep, 1000
}
Else if keystroke =
{
keystroke = 1
np := 0x08
op := 0x010
SoundBeep, 1000
}
return
return
$vk75:: ; F6
Gui Submit, NoHide
Suspend, Off
If keystroke = 1
{
keystroke =
n := 0
o := 0
SoundBeep, 1000
}
Else if keystroke =
{
keystroke = 1
n := 0x02
o := 0x04
SoundBeep, 1000
}
return
; 0x02 нажать лкм
; 0x04 отпустить лкм
;0x08 нажать пкм
;0x010 отпустить пкм
*~$LButton::
DllCall("mouse_event", UInt, np, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать правую кнопку мыши
DllCall("Sleep", UInt, 40)
DllCall("mouse_event", UInt, op, Int, 0, Int, 0, UInt, 0, Int, 0) ; отпустить правую кнопку мыши
while GetKeyState("LButton","P")
{
if MoveOFF
DllCall("mouse_event", uint, 1, int, x, int, y, uint, 0, int, 0) ; для основного оружия движение мыши
DllCall("mouse_event", UInt, n, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать левую кнопку мыши
; Sleep, Time ; первая задержка
DllCall("Sleep", UInt, Time)
DllCall("mouse_event", UInt, o, Int, 0, Int, 0, UInt, 0, Int, 0) ; отпустить левую кнопку мыши
; Sleep, Timee ; первая задержка
DllCall("Sleep", UInt, Timee)
if MoveON
DllCall("mouse_event", uint, 1, int, 0, int, z, uint, 0, int, 0) ; для второстипенного оружия
If stop
DllCall("Sleep", UInt, 40)
}
DllCall("mouse_event", UInt, np, Int, 0, Int, 0, UInt, 0, Int, 0) ; нажать правую кнопку мыши
DllCall("Sleep", UInt, 40)
DllCall("mouse_event", UInt, op, Int, 0, Int, 0, UInt, 0, Int, 0) ; отпустить правую кнопку мыши
return
Save: ; сохранение
Gui Submit, NoHide
FileSelectFile, SelectedFile, S24, , Сохранить макрос, *.ini
IniWrite, %DllCall3%, %SelectedFile%.ini, xdirectory, dir3
IniWrite, %DllCall1%, %SelectedFile%.ini, ydirectory, dir1
IniWrite, %DllCall2%, %SelectedFile%.ini, sldirectory, dir2
FileDelete, .ini
Return
Open: ; загрузить ранее сохранённый макрос
Gui Submit, NoHide
FileSelectFile, SelectedFile, 24, , Загрузить макрос, *.ini
IniRead, OutputVar3, %SelectedFile%, xdirectory, dir3, %A_Space%
IniRead, OutputVar1, %SelectedFile%, ydirectory, dir1, %A_Space%
IniRead, OutputVar2, %SelectedFile%, sldirectory, dir2, %A_Space%
GuiControl,, DllCall3, % OutputVar3
GuiControl,, DllCall1, % OutputVar1
GuiControl,, DllCall2, % OutputVar2
Return
OK:
Gui Submit, NoHide
np := 0
op := 0
n := 0
o := 0
Time := DllCall2
Timee := DllCall2
y := DllCall3
x := DllCall1
z := DllCall4
Suspend, Off
Return
GuiClose:
ExitApp