闲着没事写的自动重链接(公共网络每3/小时要连接一次问题)
本帖最后由 bloodfog 于 2018-6-22 16:16 编辑#include <IE.au3>
;#NoTrayIcon
#AutoIt3Wrapper_Icon=E:\AUTOIT3\CODE\OPENHTTP\ico.ico ;
#AutoIt3Wrapper_UseX64=n$url = 'https://portal.danmagi.com/magni/sheraton_club_des_pins/tiered/packages/connected?times='&@YEAR&@MON&@MDAY&@HOUR&@MIN&@SEC
$oIE = _IECreate ($url)
$sHTML = _IEDocReadHTML ($oIE)
Sleep(20000)
$file = FileOpen("Sheraton.ini", 2) ;打开并清空文本内容
; 检查打开的文件是否可为读
FileWrite('Sheraton.ini', $sHTML) ;写入数据
FileClose($file) ;关闭文本
Sleep(5000)
WinClose("Sheraton")
Sleep(2000)$filenote = FileReadLine("Sheraton.ini", 76) ;读取第76行内容$getstr = StringMid($filenote,58,17)
$getstr = StringMid($getstr,8,4)&StringMid($getstr,5,2)&StringMid($getstr,2,2)&StringMid($getstr,13,2)&StringMid($getstr,16,2)
;MsgBox(0,"返回指定字符数",$getstr);If StringLen($getstr) <> 12 Then
$getstr = '200808080808'
$notetime = '程序已启动,冲浪愉快^_^'
Else
$notetime = '网络过期时间 '&StringMid($filenote,58,17)&' 冲浪愉快^_^'
EndIfMsgBox(4096, "Copyright 2018 RainMan", $notetime, 5) ;5S后自动关闭While 1 ;每分钟执行一次
$nowdate = @YEAR&@MON&@MDAY&@HOUR&@MIN
;MsgBox(0,"检测报告",$nowdate&">"&$getstr)
If $nowdate>$getstr Then
MsgBox(4096, "Copyright 2018 RainMan", "网络已到期,5S后程序将自动重新链接网络...", 5) ;5S后自动关闭$sUrl = 'https://portal.danmagi.com/magni/sheraton_club_des_pins/tiered/free_only?times='&@YEAR&@MON&@MDAY&@HOUR&@MIN&@SEC
$oIE = _IECreate($sUrl) ;IE打开
$tHTML = _IEDocReadHTML ($oIE)
Sleep(15000)
$file = FileOpen("Connect.ini", 2) ;打开并清空文本内容
; 检查打开的文件是否可为读
FileWrite('Connect.ini', $tHTML) ;写入数据
FileClose($file) ;关闭文本
Sleep(2000)
$isTrue = FileReadLine("Connect.ini", 84)
Sleep(1000)
$oInputs = _IETagNameGetCollection ($oIE, "BUTTON")
If $isTrue = " 3 Hours / Free" Then
MsgBox(4096, "Copyright 2018 RainMan", "开工咯~准备开始自动连接网络^_^", 5)
For $oInput In $oInputs
if $oInput.value = "Connect" then
_IEAction ($oInput, "click")
EndIf
Next
Else
MsgBox(4096, "Copyright 2018 RainMan", "神游了,没找到链接按钮,那我再来一次吧^_^", 5)
EndIfSleep(10000)
WinClose("danmagi")
Sleep(2000)
WinClose("Sheraton")
Sleep(2000)
WinClose("360")
Sleep(2000)
WinClose("504")
Sleep(2000)
WinClose("Property")
Sleep(2000)
WinClose("您访问的网页")
Sleep(2000)$oIE = _IECreate ($url)
$sHTML = _IEDocReadHTML ($oIE)
Sleep(10000)
$file = FileOpen("Sheraton.ini", 2) ;打开并清空文本内容
; 检查打开的文件是否可为读
FileWrite('Sheraton.ini', $sHTML) ;写入数据
FileClose($file) ;关闭文本
Sleep(5000)
WinClose("Sheraton")
Sleep(2000)$filenote = FileReadLine("Sheraton.ini", 76) ;读取第76行内容$getstr = StringMid($filenote,58,17)
$getstr = StringMid($getstr,8,4)&StringMid($getstr,5,2)&StringMid($getstr,2,2)&StringMid($getstr,13,2)&StringMid($getstr,16,2)If StringLen($getstr) <> 12 Then
$getstr = '200808080808'
EndIfSleep(2000)EndIf
Sleep(60000)
WEnd
这是什么? 感觉像自动刷新
感觉画面还行 干嘛用的呢? 感觉是AU3写的 厉害了,研究一下
页:
[1]