尝试使用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
答案 0 :(得分:0)
您可以先使用WinGetHandle接收Window的句柄,然后在ControlSend函数中使用此句柄,该句柄应该可以正常工作。它看起来如下:
$handle = WinGetHandle("[TITLE:PokeMMO; CLASS:LWJGL]")
ControlSend($handle, Default, $handle, "{Down}")
首先尝试显示句柄内容以确认,您正在接收工作句柄。与ConsoleWrite($handle)
或MsgBox(1, "Handle", WinGetTitle($handle))
去吧,试一试;-)
祝你好运!
答案 1 :(得分:0)
因为我看到“MMO”和“a”我可以假设你正试图将它发送到视频游戏窗口吗?
您可以做的事情很少:下载一个窗口游戏控制器,如IsBoxer,您将能够轻松地将键击快速发送到远程帐户。大多数MMO阻止.dll可以发送击键。
VLU