AutoIT3薅喜来登酒店公共网络羊毛

    解决喜来登酒店无线网络(Sheraton_PUBLIC)每3/小时链接一次问题

    #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)&' 冲浪愉快^_^'
    EndIf

    MsgBox(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)
    EndIf

    Sleep(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'
    EndIf

    Sleep(2000)

    EndIf
    Sleep(60000)
    WEnd

    转载请注明:RAIN MAN » AutoIT3薅喜来登酒店公共网络羊毛

    喜欢 3

还没有人抢沙发呢~