Jump to content

Adlib issues


Recommended Posts

Hi Guys,

I think I am missing something here.

Adlibenable ("x",5000)
For $i=1 to 1000
    ToolTip($i, 0, 0)
    sleep (200)
Next
Adlibdisable ()

Func x ()
Sleep (10000)
EndFunc
If I understand right, the x function will be executed every 5 secs, and in the mean while the main script paused.

So why when the 10 seconds (in the x func) are over the tooltip doesn't continue? :ph34r:

10x in advance, guys...

Edited by BlueScreen
Link to comment
Share on other sites

Remarks

Every 250 ms (or time ms) the specified "function" is called--typically to check for unforeseen errors. For example, you could use adlib in a script which causes an error window to pop up unpredictably.

The adlib function should be kept simple as it is executed often and during this time the main script is paused. Also, the time parameter should be used carefully to avoid CPU load.

Link to comment
Share on other sites

OK. my mistake. :ph34r:

But if I fix it and do this:

Adlibenable ("x",15000)
For $i=1 to 1000
    ToolTip($i, 0, 0)
    sleep (200)
Next

Adlibdisable ()

func x ()
Sleep (5000)
EndFunc

The script starts and tooltip start counting. after 15 secs, there is a sleep of 5 secs. Once this sleep is over, I expected that the tooltip will count for another 15 seconds, but it counts only ~10 secs. Why? Is it because once the function is started 'Adlib' timer starts also?

Edited by BlueScreen
Link to comment
Share on other sites

Yea, basically. Every 15 seconds the adlib is processed, and causes it to pause for 5. That eats away into 5 seconds of the 15 until the next 5 second pause, so you only have 10 seconds left for the rest of the script before the adlib is executed agian.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

I agree, the behaviour is weird, BlueScreen :ph34r:

I modified your scriptlet slightly, which reveals interesting results:

Adlibenable ("x",5000)
    For $i=1 to 1000
    ToolTip("Loop:" & $i, 400, 300)
    sleep (200)
    Next
    Adlibdisable ()

Func x ()
    ToolTip("AdlibStart", 400, 300)
    Sleep (10000) ;change this value for interesting results
    ToolTip("AdlibEnd", 400, 300)
    Sleep(1000);this shows that the func is looping
EndFunc

.. See what they have to say on the Bug Reports forum .. ?

Edit: ... Since the helpfile does say that the rest of the script pauses. Which leads me to expect the timer to continue only after the adlib function terminates. But then, perhaps it's just a matter of interpretation of what actually pauses, and if this includes the timer or not? My head hurts - where's that weekend :(

Edited by trids
Link to comment
Share on other sites

  • Administrators

The script "pauses" in the sense that lines from the main script are not executed while lines from the adlib section are. The timers always update because...you can't stop time :ph34r: (The TimerInit() function simply returns the current PC time and TimerDiff works out the difference, pausing the script doesn't affect the PC time IYSWIM)

Edited by Jon
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...