Jump to content

Recommended Posts

Posted

I've never really used any of the IE stuff in autoit because I use google chrome, but is there a way to get data from a countdown timer on a website?

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Posted

You should be able to read the value of that page element, yes. Do you have a website that you could share that you want to do this on?

Posted

This was kinda tricky because they use javascript to do the countdown, and based on what time it's supposed to display it shows a different image...

But this seems to work. >_<

#include <IE.au3>
#include <Array.au3>

Global $aTime[10]
Global $varLastTime

$oIE = _IECreate ("http://countdown.onlineclock.net/")

While 1
    $varCount = 0
    $oImgs = _IEImgGetCollection ($oIE)
    $iNumImg = @extended
    For $oImg In $oImgs
        If $oImg.nameProp = "clear.gif" Then ContinueLoop
        $var = StringReplace ($oImg.nameProp, ".gif", "")
        $var = StringReplace ($var, "colon", ":")
        
        If StringLeft($var, 1) = "c" Then $var = StringTrimLeft ($var, 1)
        
        $aTime[$varCount] = $var
        $varCount += 1
    Next

    $string = ""
    For $x = 0 to 9
        $string &= $aTime[$x]
    Next
    
    If $string <> $varLastTime Then
        ToolTip ($string, 0, 0)
        $varLastTime = $string
    EndIf
    Sleep (100)
WEnd

Btw, holla from up the road in Waukee.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...