belyankin12
А если в этом же скрипте я хочу так же сделать второй хоткей и вторую кнопку то мне нужно снова писать это:
global ini := "IniFile.ini"
ifExist, %ini%
goto true
else
goto false
false:
IniWrite, Key, %ini%, Hotkeys, Key1
goto true
true:
IniRead, Dm, %ini%, Hotkeys, Key1
?
Например так:
global ini := "IniFile.ini"
ifExist, %ini%
goto true
else
goto false
false:
IniWrite, Key, %ini%, Hotkeys, Key1
goto true
true:
IniRead, Dm, %ini%, Hotkeys, Key1
global ini := "IniFile2.ini"
ifExist, %ini%
goto true
else
goto false
false:
IniWrite, Key, %ini%, Hotkeys, Key2
goto true
true:
IniRead, Dm2, %ini%, Hotkeys, Key2
Gui, Font, S16 CGray, Verdana
FileInstall, C:\Users\User\Desktop\1470403006_geroi.png, %A_temp%\1470403006_geroi.png
Gui, Add, Picture, x-38 y-10 w520 h560 , %A_temp%\1470403006_geroi.png
Gui, Add, Text, x22 y10 w210 h30 BackgroundTrans, Введите клавишу.
Gui, Add, Text, x22 y60 w100 h30 BackgroundTrans, Броня
Gui, Add, Text, x282 y60 w100 h30 BackgroundTrans, Баты
Gui, Add, Hotkey, x52 y110 w100 h30 vKey1, %Dm%
Gui, Add, Hotkey, x312 y110 w100 h30 ,
Gui, Add, Text, x2 y110 w30 h30 BackgroundTrans, 1.
Gui, Add, Text, x2 y160 w30 h30 BackgroundTrans, 2
Gui, Add, Hotkey, x52 y160 w100 h30 vKey2, %Dm2%
Gui, Add, Hotkey, x312 y160 w100 h30 ,
Gui, Add, Text, x2 y210 w30 h30 BackgroundTrans, 3.
Gui, Add, Text, x2 y260 w30 h30 BackgroundTrans, 4.
Gui, Add, Hotkey, x312 y210 w100 h30 ,
Gui, Add, Hotkey, x312 y260 w100 h30 ,
Gui, Add, Button, x422 y110 w40 h30 , Ок
Gui, Add, Button, x422 y160 w40 h30 , Ок
Gui, Add, Button, x422 y210 w40 h30 , Ок
Gui, Add, Button, x422 y260 w40 h30 , Ок
Gui, Add, Button, x162 y110 w40 h30 gSave, Ок
Gui, Add, Button, x162 y160 w40 h30 gSave2, Ок
Gui, Show, w478 h438, Броня и баты
Gui, Submit, NoHide
Hotkey, %Key1%, MyKey1, On, UseErrorLevel
return
MyKey1:
{
Send, {sc12}
MouseMove, 418, 510
Send, {Lbutton}
MouseMove, 497, 312
Send, {Lbutton}
MouseMove, 418, 510
Send, {Lbutton}
MouseMove, 418, 535
Send, {Lbutton}
MouseMove, 497, 347
Send, {Lbutton}
MouseMove, 418, 535
Send, {Lbutton}
MouseMove, 418, 570
Send, {Lbutton}
MouseMove, 497, 382
Send, {Lbutton}
MouseMove, 418, 570
Send, {Lbutton}
MouseMove, 418, 600
Send, {Lbutton}
MouseMove, 497, 420
Send, {Lbutton}
MouseMove, 418, 600
Send, {Lbutton}
Send, {sc12}
}
return
Save:
Gui, submit, NoHide
IniWrite, %Key1%, %ini%, Hotkeys, Key1
Reload
return
Gui, Submit, NoHide
Hotkey, %Key2%, MyKey2, On, UseErrorLevel
return
MyKey2:
{
Send, {sc12}
MouseMove, 468, 510
Send, {Lbutton}
MouseMove, 497, 312
Send, {Lbutton}
MouseMove, 468, 510
Send, {Lbutton}
MouseMove, 468, 535
Send, {Lbutton}
MouseMove, 497, 347
Send, {Lbutton}
MouseMove, 468, 535
Send, {Lbutton}
MouseMove, 468, 570
Send, {Lbutton}
MouseMove, 497, 382
Send, {Lbutton}
MouseMove, 468, 570
Send, {Lbutton}
MouseMove, 468, 600
Send, {Lbutton}
MouseMove, 497, 420
Send, {Lbutton}
MouseMove, 468, 600
Send, {Lbutton}
Send, {sc12}
}
return
Save2:
Gui, submit, NoHide
IniWrite, %Key2%, %ini%, Hotkeys, Key2
Reload
return
У меня получилось вот таким вот способом, вроде все работает:
global ini := "IniFile.ini"
ifExist, %ini%
goto true
else
goto false
false:
IniWrite, Key, %ini%, Hotkeys, Key1
IniWrite, Key, %ini%, Hotkeys, Key2
goto true
true:
IniRead, Dm, %ini%, Hotkeys, Key1
IniRead, Dm2, %ini%, Hotkeys, Key2
Gui, Font, S16 CGray, Verdana
FileInstall, C:\Users\User\Desktop\1470403006_geroi.png, %A_temp%\1470403006_geroi.png
Gui, Add, Picture, x-38 y-10 w520 h560 , %A_temp%\1470403006_geroi.png
Gui, Add, Text, x22 y10 w210 h30 BackgroundTrans, Введите клавишу.
Gui, Add, Text, x22 y60 w100 h30 BackgroundTrans, Броня
Gui, Add, Text, x282 y60 w100 h30 BackgroundTrans, Баты
Gui, Add, Hotkey, x52 y110 w100 h30 vKey1, %Dm%
Gui, Add, Hotkey, x312 y110 w100 h30 ,
Gui, Add, Text, x2 y110 w30 h30 BackgroundTrans, 1.
Gui, Add, Text, x2 y160 w30 h30 BackgroundTrans, 2
Gui, Add, Hotkey, x52 y160 w100 h30 vKey2, %Dm2%
Gui, Add, Hotkey, x312 y160 w100 h30 ,
Gui, Add, Text, x2 y210 w30 h30 BackgroundTrans, 3.
Gui, Add, Text, x2 y260 w30 h30 BackgroundTrans, 4.
Gui, Add, Hotkey, x312 y210 w100 h30 ,
Gui, Add, Hotkey, x312 y260 w100 h30 ,
Gui, Add, Button, x422 y110 w40 h30 , Ок
Gui, Add, Button, x422 y160 w40 h30 , Ок
Gui, Add, Button, x422 y210 w40 h30 , Ок
Gui, Add, Button, x422 y260 w40 h30 , Ок
Gui, Add, Button, x162 y110 w40 h30 gSave, Ок
Gui, Add, Button, x162 y160 w40 h30 gSave2, Ок
Gui, Show, w478 h438, Броня и баты
Gui, Submit, NoHide
Hotkey, %Key1%, MyKey1, On, UseErrorLevel
Hotkey, %Key2%, MyKey2, On, UseErrorLevel
return
MyKey1:
{
Send, {sc12}
MouseMove, 418, 510
Send, {Lbutton}
MouseMove, 497, 312
Send, {Lbutton}
MouseMove, 418, 510
Send, {Lbutton}
MouseMove, 418, 535
Send, {Lbutton}
MouseMove, 497, 347
Send, {Lbutton}
MouseMove, 418, 535
Send, {Lbutton}
MouseMove, 418, 570
Send, {Lbutton}
MouseMove, 497, 382
Send, {Lbutton}
MouseMove, 418, 570
Send, {Lbutton}
MouseMove, 418, 600
Send, {Lbutton}
MouseMove, 497, 420
Send, {Lbutton}
MouseMove, 418, 600
Send, {Lbutton}
Send, {sc12}
}
return
Save:
Gui, submit, NoHide
IniWrite, %Key1%, %ini%, Hotkeys, Key1
Reload
return
MyKey2:
{
Send, {sc12}
MouseMove, 468, 510
Send, {Lbutton}
MouseMove, 497, 312
Send, {Lbutton}
MouseMove, 468, 510
Send, {Lbutton}
MouseMove, 468, 535
Send, {Lbutton}
MouseMove, 497, 347
Send, {Lbutton}
MouseMove, 468, 535
Send, {Lbutton}
MouseMove, 468, 570
Send, {Lbutton}
MouseMove, 497, 382
Send, {Lbutton}
MouseMove, 468, 570
Send, {Lbutton}
MouseMove, 468, 600
Send, {Lbutton}
MouseMove, 497, 420
Send, {Lbutton}
MouseMove, 468, 600
Send, {Lbutton}
Send, {sc12}
}
return
Save2:
Gui, submit, NoHide
IniWrite, %Key2%, %ini%, Hotkeys, Key2
Reload
return