脚本打开 在关闭 就报错。 这里的打开关闭是指 (打开脚本即可关闭) 可以运行就是 一直提示错误。在编译器里面按F5 没错误。 有知道吗请教下,#RequireAdmin
#include <IE.au3>
#include <File.au3>
Dim $oIE = _IECreate("http://www.unclenoway.com/", 0, 1, 1, 0)
Sleep(1000)
$Ele = _IEGetObjById($oIE, "gender-f")
_IEAction($Ele, "click")
$Ele = _IEGetObjById($oIE, "chatbutton")
_IEAction($Ele, "click")
AdlibRegister("_check", 1000)
Func _check()
If WinExists("叔叔不约 - 匿名聊天网 - 在线随机、匿名聊天平台 - ") = 0 Then Exit
Local $ame = ProcessGetStats()
If IsArray($ame) Then
ProcessClose($ame)
EndIf
EndFunc ;==>_check
While 1
Sleep(100)
_Send()
WEnd
Func _Send()
Local $tag = 0
_Click()
Sleep(4000)
Local $COUNT = _FileCountLines(@ScriptDir & "\say.txt")
Local $TEXT
For $I = 1 To $COUNT
$TEXT = FileReadLine(@ScriptDir & "\say.txt", $I)
WinWaitActive("叔叔不约 - 匿名聊天网 - 在线随机、匿名聊天平台 - ")
Sleep(2000)
$Txt = _IEGetObjById($oIE, "connectBtn")
If $Txt.innertext = "重新开始" Then
$tag = 1
ExitLoop
EndIf
$oIEo = _IEAttach("http://www.unclenoway.com/", "url")
$Ele = _IETagNameGetCollection($oIE, "p", 15)
If $Ele <> 0 Then
If StringInStr($Ele.outerhtml, "正在努力为你匹配...") <> 0 Then
ExitLoop
EndIf
EndIf
$Ele = _IEGetObjById($oIE, "msgBox")
_IEFormElementSetValue($Ele, $TEXT)
$SEND = _IEGetObjById($oIE, "msgSend")
_IEAction($SEND, "click")
Sleep(5000)
Next
If $tag = 0 Then
$Ele = _IEGetObjById($oIE, "connectBtn")
_IEAction($Ele, "click")
Sleep(100)
$Ele = _IEGetObjById($oIE, "connectBtn")
_IEAction($Ele, "click")
EndIf
Sleep(2000)
EndFunc ;==>_Send
Func _Click()
WinActivate("叔叔不约 - 匿名聊天网 - 在线随机、匿名聊天平台 - ")
WinWaitActive("叔叔不约 - 匿名聊天网 - 在线随机、匿名聊天平台 - ")
$Ele = _IEGetObjById($oIE, "connectBtn")
Switch $Ele.innertext
Case "离开"
Return 0
Case "重新开始"
_IEAction($Ele, "click")
EndSwitch
Return 1
EndFunc ;==>_Click
|