Jump to content

Infinite Loop U


Recommended Posts

Ok so I'm quite a bit of a newb and I'm sure I'm going about this all wrong. But I have a computer that I used thats going to rotate pages forever... or well until I press a key or actually that doesn't even matter if I give it an option to exit as this is all this computer is going to do to a wall mounted LCD.

But I can get it to run all the way through the app once but it will never loop. I've peiced it together with a couple examples found around the forum.

Any ideas or help would be GREATLY appriciated.

Thanks!

CODE

run( "C:\Program Files\Internet Explorer\IEXPLORE.EXE -new http://www.nbc15online.com","")

Sleep("3000")

Send('{f11}')

HotKeySet("{esc}","LoopFlagToggle")

$loopflag = 0

Do

Send('http://www.nbc15online.com')

Send ("{ENTER}")

WinWait ( "Home - NBC 15 Online - Windows Internet Explorer" )

Sleep("15000")

Send('{f6}')

Send('http://www.weartv.com')

Send ("{ENTER}")

WinWait ( "WEAR ABC 3 - Windows Internet Explorer" )

Sleep("15000")

Send('{f6}')

Send('http://www.wkrg.com')

Sleep("1000")

Send ("{ENTER}")

WinWait ( "News Mobile Alabama AL News Pensacola Florida FL News - WKRG.com Mobile - Pensacola - Windows Internet Explorer" )

Sleep("15000")

Send('{f6}')

Send('http://www.myfoxgulfcoast.com')

Send ("{ENTER}")

WinWait ( "MyFox Gulf Coast | News Weather WALA FOX10tv.com - Windows Internet Explorer" )

Sleep("15000")

Until $loopflag <> 0

$loopflag = 0

While $loopflag = 0

msgbox(0,"Looping with WHILE LOOP","Looping until ESC key is pressed")

WEnd

Func LoopFlagToggle()

$loopflag = 1

EndFunc

Link to comment
Share on other sites

Was bored ;)

#include <IE.au3>
HotKeySet('{ESC}', 'LoopFlagToggle')
_IEErrorHandlerRegister()

$oIE = _IECreate(); Runs Internet Explorer.
_IEPropertySet($oIE, 'theatermode', True); Makes fullscreen.

$loopflag = 0
While 1
    If $loopflag = 0 Then 
        _IENavigate($oIE, 'http://www.nbc15online.com')
        Sleep("15000")
        _IENavigate($oIE, 'http://www.weartv.com')
        Sleep("15000")
        _IENavigate($oIE, 'http://www.wkrg.com')
        Sleep("15000")
        _IENavigate($oIE, 'http://www.myfoxgulfcoast.com')
        Sleep("15000")
    Else
        Sleep(1000)
    EndIf
WEnd

Exit

Func LoopFlagToggle()
    If $loopflag = 1 Then
        $loopflag = 0
    Else
        $loopflag = 1
    EndIf
EndFunc
Edited by LongBowNZ
Link to comment
Share on other sites

Was bored ;)

#include <IE.au3>
HotKeySet('{ESC}', 'LoopFlagToggle')
_IEErrorHandlerRegister()

$oIE = _IECreate(); Runs Internet Explorer.
_IEPropertySet($oIE, 'theatermode', True); Makes fullscreen.

$loopflag = 0
While 1
    If $loopflag = 0 Then 
        _IENavigate($oIE, 'http://www.nbc15online.com')
        Sleep("15000")
        _IENavigate($oIE, 'http://www.weartv.com')
        Sleep("15000")
        _IENavigate($oIE, 'http://www.wkrg.com')
        Sleep("15000")
        _IENavigate($oIE, 'http://www.myfoxgulfcoast.com')
        Sleep("15000")
    Else
        Sleep(1000)
    EndIf
WEnd

Exit

Func LoopFlagToggle()
    If $loopflag = 1 Then
        $loopflag = 0
    Else
        $loopflag = 1
    EndIf
EndFunc

Thank you!!!! Thanks for the putting the notes in there as well! :D

Link to comment
Share on other sites

That looked like fun, so I did one too:

#include <IE.au3>

Global $fPaused = False
Global $avURLs[4] = ['http://www.nbc15online.com', 'http://www.weartv.com', _
        'http://www.wkrg.com', 'http://www.myfoxgulfcoast.com']
Global $avIE[UBound($avURLs)]
Global $iTimer

_IEErrorHandlerRegister()

; Create a hidden browser instance for each site
For $n = 0 To UBound($avIE) - 1
    $avIE[$n] = _IECreate($avURLs[$n], 0, 0, 0, 0)
    Sleep(100)
; Theater mode idea stolen from LongBowNZ
    _IEPropertySet($avIE[$n], 'theatermode', True)
Next

HotKeySet("{PAUSE}", "_Pause")
HotKeySet("{ESC}", "_Quit")

While 1
    For $n = 0 To UBound($avIE) - 1
; Navigate the hidden browser
        _IENavigate($avIE[$n], $avURLs[$n], 0)
        $iTimer = TimerInit()
; Wait max 11sec for load complete
        While 1
            If _IELoadWait($avIE[$n], 10, 100) Then
        ; Make this browser visible
                _IEAction($avIE[$n], "visible")
        ; Hide all other browsers
                For $i = 0 To UBound($avIE) - 1
                    If $i <> $n Then _IEAction($avIE[$i], "invisible")
                Next
                Sleep(10000); Display for at least 10sec
                ExitLoop
            ElseIf TimerDiff($iTimer) > 20 * 1000 Then
                ExitLoop
            EndIf
        WEnd
    Next
WEnd

Func _Pause()
    $fPaused = Not $fPaused
    If $fPaused Then
        Do
            Sleep(20)
        Until Not $fPaused
    EndIf
EndFunc ;==>_Pause

Func _Quit()
    For $n = 0 To UBound($avIE) - 1
        _IEQuit($avIE[$n])
    Next
    Exit
EndFunc ;==>_Quit

;)

Edit: Stole theater mode idea from LongBowNZ.

Edited by PsaltyDS
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

I'd use salty's if I was you ashoover, even though I havn't tested it, it's bound to be better than mine ;)

Edit: Stole theater mode idea from LongBowNZ.

Not really my idea, saw he opened IE and pressed F11 so replicated it with probably better results (I hate Send()) :D
Link to comment
Share on other sites

That looked like fun, so I did one too:

#include <IE.au3>

Global $fPaused = False
Global $avURLs[4] = ['http://www.nbc15online.com', 'http://www.weartv.com', _
        'http://www.wkrg.com', 'http://www.myfoxgulfcoast.com']
Global $avIE[UBound($avURLs)]
Global $iTimer

_IEErrorHandlerRegister()

; Create a hidden browser instance for each site
For $n = 0 To UBound($avIE) - 1
    $avIE[$n] = _IECreate($avURLs[$n], 0, 0, 0, 0)
    Sleep(100)
; Theater mode idea stolen from LongBowNZ
    _IEPropertySet($avIE[$n], 'theatermode', True)
Next

HotKeySet("{PAUSE}", "_Pause")
HotKeySet("{ESC}", "_Quit")

While 1
    For $n = 0 To UBound($avIE) - 1
; Navigate the hidden browser
        _IENavigate($avIE[$n], $avURLs[$n], 0)
        $iTimer = TimerInit()
; Wait max 11sec for load complete
        While 1
            If _IELoadWait($avIE[$n], 10, 100) Then
    ; Make this browser visible
                _IEAction($avIE[$n], "visible")
    ; Hide all other browsers
                For $i = 0 To UBound($avIE) - 1
                    If $i <> $n Then _IEAction($avIE[$i], "invisible")
                Next
                Sleep(10000); Display for at least 10sec
                ExitLoop
            ElseIf TimerDiff($iTimer) > 20 * 1000 Then
                ExitLoop
            EndIf
        WEnd
    Next
WEnd

Func _Pause()
    $fPaused = Not $fPaused
    If $fPaused Then
        Do
            Sleep(20)
        Until Not $fPaused
    EndIf
EndFunc;==>_Pause

Func _Quit()
    For $n = 0 To UBound($avIE) - 1
        _IEQuit($avIE[$n])
    Next
    Exit
EndFunc;==>_Quit

;)

Edit: Stole theater mode idea from LongBowNZ.

Hey Salty... Quick question for ya. Any reason only the url nbc15online.com is fullscreened and the others are brought back down to normal window size?

Thanks!

Link to comment
Share on other sites

That looked like fun, so I did one too:

#include <IE.au3>

Global $fPaused = False
Global $avURLs[4] = ['http://www.nbc15online.com', 'http://www.weartv.com', _
        'http://www.wkrg.com', 'http://www.myfoxgulfcoast.com']
Global $avIE[UBound($avURLs)]
Global $iTimer

_IEErrorHandlerRegister()

; Create a hidden browser instance for each site
For $n = 0 To UBound($avIE) - 1
    $avIE[$n] = _IECreate($avURLs[$n], 0, 0, 0, 0)
    Sleep(100)
; Theater mode idea stolen from LongBowNZ
    _IEPropertySet($avIE[$n], 'theatermode', True)
Next

HotKeySet("{PAUSE}", "_Pause")
HotKeySet("{ESC}", "_Quit")

While 1
    For $n = 0 To UBound($avIE) - 1
; Navigate the hidden browser
        _IENavigate($avIE[$n], $avURLs[$n], 0)
        $iTimer = TimerInit()
; Wait max 11sec for load complete
        While 1
            If _IELoadWait($avIE[$n], 10, 100) Then
    ; Make this browser visible
                _IEAction($avIE[$n], "visible")
    ; Hide all other browsers
                For $i = 0 To UBound($avIE) - 1
                    If $i <> $n Then _IEAction($avIE[$i], "invisible")
                Next
                Sleep(10000); Display for at least 10sec
                ExitLoop
            ElseIf TimerDiff($iTimer) > 20 * 1000 Then
                ExitLoop
            EndIf
        WEnd
    Next
WEnd

Func _Pause()
    $fPaused = Not $fPaused
    If $fPaused Then
        Do
            Sleep(20)
        Until Not $fPaused
    EndIf
EndFunc;==>_Pause

Func _Quit()
    For $n = 0 To UBound($avIE) - 1
        _IEQuit($avIE[$n])
    Next
    Exit
EndFunc;==>_Quit

;)

Edit: Stole theater mode idea from LongBowNZ.

Hey Salty... Quick question for ya. Any reason only the url nbc15online.com is fullscreened and the others are brought back down to normal window size?

Thanks!

Link to comment
Share on other sites

Hey Salty... Quick question for ya. Any reason only the url nbc15online.com is fullscreened and the others are brought back down to normal window size?

Thanks!

Don't know. I don't see that problem when I run it.

;)

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

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...