Sign in to follow this  
Followers 0
c4mpi

why does this code fail?

5 posts in this topic

#1 ·  Posted (edited)

#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



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

Put both tests in the first loop?

ty:)

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