Jump to content

Recommended Posts

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


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")
     Case 1
        $PID = _IENavigate($oIE, "https://www.yahoo.com")
     Case 2
        $PID = _IENavigate($oIE, "https://www.bing.com")
     Case 3
        $PID = _IENavigate($oIE, "C:\Users\mypc\test00.html")
     Case 4
        $PID = _IENavigate($oIE, "C:\Users\mypc\test01.html")
     Case 5
        $PID = _IENavigate($oIE, "C:\Users\mypc\test02.html")

  ConsoleWrite("started" & @CRLF)

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




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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...