Jump to content
Sign in to follow this  
c4mpi

why does this code fail?

Recommended Posts

c4mpi

#include <IE.au3>

$timer = TimerInit()


While 1
    Sleep(Random(1000,7000))
    $timed = TimerDiff($timer)
    If $timed > 3000 Then
        _IECreate("www.google.com")
        $timer = TimerInit()
    EndIf
WEnd

$timer2 = TimerInit()


While 2
    Sleep(Random(1000,2000))
    $timed2 = TimerDiff($timer2)
    If $timed2 > 5000 Then
        _IECreate("www.youtube.com.com")
        $timer2 = TimerInit()
    EndIf
WEnd

Why does this code fail? It doesnt open youtube.com every 5000 ms

thanks for answers

Edited by c4mpi

Share this post


Link to post
Share on other sites
Jos

Why would it? It never leaves the first While-Wend loop.

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
c4mpi

Why would it? It never leaves the first While-Wend loop.

hehe, this is ofcourse a dumb question...

how can I make it?

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.