Sign in to follow this  
Followers 0
dbeck157

Cycling "Screensaver"

2 posts in this topic

#1 ·  Posted

Hello! I am currently working on a program that detects idle time and then starts to navigate to other live webpages pages every N seconds. Basically, after N seconds of idle time, it will navigate to a new page. My issue is that I am mixing in love webpages and local html files and it isn't moving on from the local files.

The program works when switching to live pages and back, but after it switches to a local html location, it will not switch to anything else. It IS in fact switching the case statement (I tested it by having the case send a number key and I can see the number come through if I leave my cursor on a text field), but the actual page does not navigate.

Any ideas?

#include <Timers.au3>
#include <IE.au3>

$oIE = _IECreate("http://www.google.com/")
$InactivityTrigger = 5*1000
$PID = 0

Sleep(3*1000)
Send("{F11}")

While True
   $InactiveFor = _Timer_GetIdleTime()

  If $InactiveFor >= $InactivityTrigger And Not $PID Then
  Switch Random(0, 5, 1)
     Case 0
        $PID = _IENavigate($oIE, "https://www.google.com")
        Send("{0}")
     Case 1
        $PID = _IENavigate($oIE, "https://www.yahoo.com")
        Send("{2}")
     Case 2
        $PID = _IENavigate($oIE, "https://www.bing.com")
        Send("{3}")
     Case 3
        $PID = _IENavigate($oIE, "C:\Users\mypc\test00.html")
        Send("{4}")
     Case 4
        $PID = _IENavigate($oIE, "C:\Users\mypc\test01.html")
        Send("{5}")
     Case 5
        $PID = _IENavigate($oIE, "C:\Users\mypc\test02.html")
        Send("{6}")
  EndSwitch

  ConsoleWrite("started" & @CRLF)

  ElseIf $InactiveFor < $InactivityTrigger And $PID Then
  ProcessClose($PID)
  $PID = 0
  ConsoleWrite("stopped" & @CRLF)

EndIf

Wend

 

Share this post


Link to post
Share on other sites



#2 ·  Posted

On My PC your script working!

maybe try replace: C:\Users\mypc\test00.html >>to>> file:///C:/Users/mypc/test00.html


Regards,
 

Share this post


Link to post
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
Sign in to follow this  
Followers 0