刚抽空给你做个。 没优化, 不检测怪物死亡没有,你自己加检测代码。 用我发的后台找色的库文件。
不算是后台。 IE类的操作我不熟悉,不会让IE自动点击。 最小化按钮将程序移动到桌面右上角,只露出来一点。相当于后台了
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <WINAPI.AU3>
Opt("GUIOnEventMode",1)
Global $Url = "http://www.game2.cn/?view=play&g=xianyu3",$StartFlg=0
_IEErrorHandlerRegister ()
$Form=GUICreate("", 1024, 650, 200, 100, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, -2, -2, 1024, 620)
$Minimize = GUICtrlCreateButton("最小化", 0, 620, 80, 30)
GUICtrlSetOnEvent($Minimize, "Mini")
$StartBt = GUICtrlCreateButton("启动", 200, 620, 80, 30)
GUICtrlSetOnEvent($StartBt, "Start")
$Close = GUICtrlCreateButton("退 出", 944, 620, 80, 30)
GUICtrlSetOnEvent($Close, "Quit")
$oIE.navigate($Url)
$oIE.refresh
GUISetState(@SW_SHOW)
While 1
If $StartFlg=1 Then
Hit()
Else
Sleep(100)
EndIf
WEnd
Func Quit()
Exit
EndFunc
Func Mini()
If GUICtrlRead($Minimize)="最小化" Then
WinMove($Form,"",@DesktopWidth-80,-620,Default,Default,1)
GUICtrlSetData($Minimize,"还原")
Else
WinMove($Form,"",50,50,Default,Default,1)
GUICtrlSetData($Minimize,"最小化")
EndIf
EndFunc
Func Start()
If GUICtrlRead($StartBt )="启动" Then
$StartFlg=1
GUICtrlSetData($StartBt ,"停止")
Else
$StartFlg=0
GUICtrlSetData($StartBt ,"启动")
EndIf
EndFunc
Func Hit()
Local $FormPos=WinGetPos($Form)
Local $MousePos=MouseGetPos()
MouseClick("left",$FormPos[0]+410,$FormPos[1]+290,1,1)
MouseMove($MousePos[0],$MousePos[1],1)
Sleep(500)
ControlSend($Form,"","[CLASS:Internet Explorer_Server; INSTANCE:1]","{Space}")
Sleep(500)
ControlSend($Form,"","[CLASS:Internet Explorer_Server; INSTANCE:1]","{Space}")
Sleep(500)
ControlSend($Form,"","[CLASS:Internet Explorer_Server; INSTANCE:1]","{TAB}")
Sleep(500)
EndFunc
|