找回密码
 加入
搜索
查看: 1939|回复: 2

[IE类操作] [已解决]请问为什么WI7系统一直无法运行脚本。

[复制链接]
what6621 该用户已被删除
发表于 2016-3-22 13:40:37 | 显示全部楼层 |阅读模式
本帖最后由 what6621 于 2016-3-24 13:53 编辑
#RequireAdmin
#NoTrayIcon
#include <IE.au3>
#include <File.au3>

Dim $oIE = _IECreate("https://www.liveany.com/", 0, 1, 1, 0)
Sleep(1000)
$Ele = _IEGetObjById($oIE, "startBtn")
_IEAction($Ele, "click")

Dim $handle = WinGetHandle("Liveany 陌生隨機聊天 - Internet Explorer") 

AdlibRegister("_Exit") 
While 1
        Sleep(100)
        _Send()
WEnd
Func _Send()
        Sleep(4000)
        Local $COUNT = _FileCountLines(@ScriptDir & "\say.txt")
        Local $TEXT
        WinActivate($handle)
        WinWaitActive($handle)
        Local $COUNT = _FileCountLines(@ScriptDir & "\say.txt")
        Local $TEXT
        For $I = 1 To $COUNT
                Sleep(1000)
                $TEXT = FileReadLine(@ScriptDir & "\say.txt", $I)
                $Ele = _IEGetObjById($oIE, "inputText")
                _IEFormElementSetValue($Ele, $TEXT)
                $SEND = _IEGetObjById($oIE, "sendMessageButton")
                _IEAction($SEND, "click")
                
                $oIE = _IEAttach("http://www.liveany.com/web.html", "url")
                $Ele = _IETagNameGetCollection($oIE, "H4", 3)
                If $Ele <> 0 Then
                        If StringInStr($Ele.outerhtml, "您已经离线了") <> 0 Then
                                ExitLoop
                        EndIf
                        
                EndIf
                Sleep(5000)
        Next
        Sleep(2000)
        $SEND = _IEGetObjById($oIE, "reConnectButton")
        _IEAction($SEND, "click")

        Sleep(1000)
        If WinExists("Windows Internet Explorer", "") = 1 Then 
                WinActivate("Windows Internet Explorer", "")
                ControlClick("Windows Internet Explorer", "离开此页(&L)", "[CLASS:Button; INSTANCE:1]")
                
        EndIf
EndFunc   ;==>_Send

Func _Exit()
        If WinExists($handle) = 0 Then Exit
EndFunc   ;==>_Exit
是这样的。在WI7系统32. 64 多无法正常运行系统。在WI8 就可以运行。系统换好几个依旧如此。好矛盾,版本是最新版。 附源码谁帮我瞧瞧。 文本一直发送不出去。http://sc1.111ttt.com/2015/1/09/11/102112205092.mp3
发表于 2016-3-23 10:57:19 | 显示全部楼层
看不懂楼主的代码,留言mark一下
发表于 2016-3-23 11:23:16 | 显示全部楼层
对IE操作不是很懂~支持一下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-28 16:58 , Processed in 0.074378 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表