Тема: AHK: объединение скрипта
Помогите соединить два скрипта, где в первом значение pid находиться из второго и вводится в первый.
Первый скрипт:
#NoEnv ;
javaw_exe := "ahk_pid 23840"
F8::
Loop
{
ControlSend,, {d Down}, %javaw_exe%
Sleep, 32500
ControlSend,, {d Up}, %javaw_exe%
Sleep, 100
ControlSend,, {a Down}, %javaw_exe%
Sleep, 32500
ControlSend,, {a Up}, %javaw_exe%
Sleep, 100
ControlSend,,{Numpad8 Down}, %javaw_exe%
Sleep,100
ControlSend,,{Numpad8 Up}, %javaw_exe%
Sleep,100
ControlSend,,{Numpad9 Down}, %javaw_exe%
Sleep,100
ControlSend,,{Numpad9 Up}, %javaw_exe%
Sleep,100
}
F7::
Loop
{
ControlSend,, {k Down}, %javaw_exe%
}
return
F12:: Reload
Второй скрипт:
;
; sba
;
#NoEnv
#NoTrayIcon
#SingleInstance Ignore
SetWorkingDir, %A_ScriptDir%
SetBatchLines, -1
CoordMode, Pixel, Screen
txtNotFrozen := "(Hold Ctrl or Shift to suspend updates)"
txtFrozen := "(Updates suspended)"
Gui, New, hwndhGui AlwaysOnTop Resize MinSize
Gui, Add, Text,, pid:
Gui, Add, Text, xm r4 w200 ReadOnly -Wrap vCtrl_Title
Gui, Add, Edit, x81 y44 w63 h20 vmipid, Ваш Pid
Gui, Show, NoActivate, sba
horzMargin := temp*450//A_ScreenDPI - 1000
SetTimer, Update, 250
return
GuiSize:
Gui %hGui%:Default
if !horzMargin
return
ctrlW := A_GuiWidth - horzMargin
Loop, Parse, list, `,
GuiControl, Move, Ctrl_%A_LoopField%, w%ctrlW%
return
Update:
Gui %hGui%:Default
actWin := WinExist("A")
WinGet, t2, PID
UpdateText("Ctrl_Title", "`nahk_pid " t2)
UpdateText(ControlID, NewText)
{
static OldText := {}
global hGui
if (OldText[ControlID] != NewText)
{
GuiControl, %hGui%:, % ControlID, % NewText
OldText[ControlID] := NewText
}
}
WinToClient(hWnd, ByRef x, ByRef y)
{
VarSetCapacity(pt, 8), NumPut(y, NumPut(x, pt, "int"), "int")
if !DllCall("ScreenToClient", "ptr", hWnd, "ptr", &pt)
return false
x := NumGet(pt, 0, "int"), y := NumGet(pt, 4, "int")
return true
}
~*Ctrl::
~*Shift::
SetTimer, Update, Off
UpdateText("Ctrl_Freeze", txtFrozen)
return
~*Ctrl up::
~*Shift up::
SetTimer, Update, On
return