#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=C:\WINDOWS\system32\SHELL32.dll|-19
#AutoIt3Wrapper_outfile=..\程序\rift报警\监控RIFT.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
;~ by yeqing880
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;Opt('MustDeclareVars', 1)
TCPStartUp()
;AdlibRegister ("Mem",3000)
Global $Socket
conn()
While 1
$sRecv=TCPRecv($Socket,7788,1)
If @error Then
AdlibUnRegister ("sendx")
AdlibUnRegister ("GMCALL")
conn()
EndIf
WEnd
;While 1
;Sleep(1000)
;WEnd
Func Sendx() ;报告服务器在线
$ssend=TCPSend ($Socket,StringToBinary("online",4))
EndFunc
Func conn() ;开始连接
Do
Sleep (1000)
$Socket = TCPConnect(FileRead("\\192.168.0.88\wanghongbo\报警IP.txt"),7788)
Until $Socket <> -1
AdlibRegister ("GMCALL",6000)
AdlibRegister ("sendx",5000)
EndFunc
Func Mem();释放内存
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, _
'int', False, 'int', @AutoItPID)
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall("kernel32.dll" , 'int', 'CloseHandle', 'int', $ai_Handle[0])
EndFunc
Func GMCALL() ;GM报警
;MsgBox(0,"","time",1)
If look() Then
;$szData ="GMcall....."
;If @error Or $szData = "" Then ExitLoop
TCPSend ($Socket,StringToBinary("GMcall",4))
GUICreate("报警",@DesktopWidth,@DesktopHeight,0,0,-1)
GUICtrlCreateLabel("GM报警", -1, -1, @DesktopWidth, @DesktopHeight)
GUICtrlSetFont(-1, 300, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
While 1
WinSetOnTop("报警","",1)
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then
AdlibUnRegister ("sendx")
AdlibUnRegister ("GMCALL")
TCPShutdown()
Exit
EndIf
WEnd
EndIf
EndFunc
Func look() ;查找像素
AutoItSetOption ("WinTitleMatchMode",2)
If ProcessExists("RIFT.exe")<>0 Then
$array=WinList("RIFT","")
;MsgBox(0,"",$array[0][0])
;While IsArray($array)
; Sleep(5000)
For $i=1 To $array[0][0]
$pos= WinGetPos($array[$i][1])
PixelSearch ($pos[0]+10,$pos[3]+$pos[1]-40,$pos[3]+$pos[1]-160,$pos[0]+100,0xF059A3,3,2,$array[$i][1])
If Not @error Then
PixelSearch ($pos[0]+10,$pos[3]+$pos[1]-40,$pos[3]+$pos[1]-160,$pos[0]+100,0xB7477D,3,2,$array[$i][1])
If Not @error Then
;MsgBox(0,"","find")
Return 1
EndIf
Else
;MsgBox(0,"","no")
Return 0
EndIf
Next
; WEnd
Else
Return 0
EndIf
EndFunc