Jump to content

notice changes


Recommended Posts

a wannt to do script which will open defined site.

and it will be refresh site until script will "notice" that something was changed on this site. and then it will say time of that change.

hope i wrote it clear.

no need ready code just post me a few clues.

Link to comment
Share on other sites

$link = InputBox("link", "insert session link", "www", "", -1, -1, 0, 0)


#include <IE.au3>
            Do
$oIE = _IECreate($link, 1)


            
;clock
            AdlibEnable("UpdateClock", 1000)
            While WinExists(_IEPropertyGet($oIE, "hwnd"))
            Sleep(10000)
            WEnd
            Exit
            Func UpdateClock()
            Local $curTime = "<b>Current Time is: </b>" & @HOUR & ":" & @MIN & ":" & @SEC
            _IEErrorNotify(False)
            Local $oAutoItClock = _IEGetObjByName($oIE, "AutoItClock")
            If Not IsObj($oAutoItClock) Then
            $oBody = _IETagNameGetCollection($oIE, "body", 0)
            _IEDocInsertHTML($oBody, "<div id='AutoItClock'></div>", "afterbegin")
            $oAutoItClock = _IEGetObjByName($oIE, "AutoItClock")
            _IEPropertySet($oAutoItClock, "innerhtml", $curTime)
            _IELoadWait($oIE)
            $sReferrer = _IEPropertyGet($oIE, "referrer")
            If $sReferrer Then _IEDocInsertText($oAutoItClock, _
            "  Referred by: " & $sReferrer, "afterend")
            Else
            _IEPropertySet($oAutoItClock, "innerhtml", $curTime)
            EndIf
            _IEErrorNotify(True)
;end clock

;load
_IELoadWait ($oIE)
;end load

;count links
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")
send({ENTER})
For
Next
;end counting

            Until $iNumLinks = 1
EndFunc

ok so i made this.

do AutoIt can log $iNumLinks value into some txt file addind a date and time?

and what is wrong with this loop? [do -> until]

thanks in advance

Edited by Wratislavian
Link to comment
Share on other sites

$link = InputBox("link", "insert session link", "www", "", -1, -1, 0, 0)
#include <IE.au3>
            Do
 
            Func UpdateClock()

            Until $iNumLinks = 1

EndFunc

ok so i made this.

do AutoIt can log $iNumLinks value into some txt file addind a date and time?

and what is wrong with this loop? [do -> until]

You can't declare a function inside a loop, and you overlapped the EndFunc with Until, which is also wrong. By convention functions are declared at the bottom of a script and called up in the body.

I prefer the _FileWriteLog() function because it time-tags entries automatically.

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

#include <File.au3>
#include <IE.au3>


MsgBox(4096, "jak zdobyc link do sesji?", "mozilla -> galaktyka -> ustawiasz uklad -> prawy: -> pokaz info o stronie -> zakladka odnosniki -> szukasz <<pokaz>> -> prawy na to i kopiuj = mamy link do sesji")
$link = InputBox("made by Wrati", "wklep link do sesji, nacisnij ok i w ciagu 15 sekund podaj koordy ciekawego ukladu skrypt ruszy automatycznie ", "bedni to noob :)", "", -1, -1, 500, 500)
MsgBox(4096, "info", "od tego czasu nie klikaj nic, chyba ze krzyzyk zeby zamknac skrypt")

$oIE = _IECreate($link, 1)

;load
_IELoadWait ($oIE)
;end load

sleep(15000)

;count links
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
_FileWriteLog(@ScriptDir & '\Event.txt', $iNumLinks)


;end count


;____________________________


Do
send("{TAB 3}")
send("{ENTER 2}")
_IELoadWait ($oIE)
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
_FileWriteLog(@ScriptDir & '\Event.txt', $iNumLinks)
Until $iNumLinks = 1000

ok its almost done.

and i want to loop interupt in every 30 minutes and do the screenshot and after that go back to loop.

with screenshots i can handle but with pausing loop no.

Link to comment
Share on other sites

30 min. timer in that Do loop? Something like this maybe...

$last = TimerInit()
Do
send("{TAB 3}")
send("{ENTER 2}")
_IELoadWait ($oIE)
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
_FileWriteLog(@ScriptDir & '\Event.txt', $iNumLinks)
    If TimerDiff($last) > 1800000 Then
        ;insert some code to do screenshot here
        $last = TimerInit()
    EndIf
Until $iNumLinks = 1000
Edited by Siao

"be smart, drink your wine"

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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