でキーストロークをシミュレートしようとしていControlSend()
ます。何らかの理由で動作しません。
While 1
ControlSend("PokeMMO", "", "", "{DOWN}")
Sleep(900)
ControlSend("PokeMMO", "", "", "{DOWN}")
Sleep(900)
ControlSend("PokeMMO", "", "", "{DOWN}")
Sleep(900)
ControlSend("PokeMMO", "", "", "a")
Sleep(Random(750, 2000, 1))
ControlSend("PokeMMO", "", "", "a")
Sleep(Random(750, 2000, 1))
ControlSend("PokeMMO", "", "", "a")
Sleep(Random(750, 2000, 1))
ControlSend("PokeMMO", "", "", "a")
Sleep(3000)
WEnd
タイトル:РokеММO、
クラス:LWJGL
Global $sProcess = "javaw.exe" ;PokeMMO Process
ControlSend(_Process2Win($sProcess), "", "", "{DOWN}")
Func _Process2Win($pid)
If IsString($pid) Then $pid = ProcessExists($pid)
If $pid = 0 Then Return -1
$list = WinList()
For $i = 1 To $list[0][0]
If $list[$i][0] <> "" And BitAND(WinGetState($list[$i][1]), 2) Then
$wpid = WinGetProcess($list[$i][0])
If $wpid = $pid Then Return $list[$i][0]
EndIf
Next
Return -1
EndFunc ;==>_Process2Win