Jump to content

adlibregister issue


Queener
 Share

Go to solution Solved by SmOke_N,

Recommended Posts

  • Moderators

Okay I'll look into it shortly (today), after I run a few tests of my own.

 

Should be all the test you need here:

Global $giAdlibMills = 3000
Global $giTestAdlibCount = 0

AdlibRegister("Adlib", $giAdlibMills)

While 1
    Sleep(0xFEFEFE)
WEnd

Func Adlib()
    AdlibUnRegister("Adlib")
    $giTestAdlibCount += 1
    MsgBox(0, $giTestAdlibCount, "Message shows, leaves in 3 secs, immediatly pops backup!", 3)
    AdlibRegister("Adlib", $giAdlibMills)
EndFunc

.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Sorry, I didn't notice the test you wrote above. I tried registering a second function and then the first again, swapping back and forth between the two. The timer issue seemed to fix itself when I did that.

Edit : DOH, my second test was at fault. I'm glad I didn't post it. :whistle:

Edited by czardas
Link to comment
Share on other sites

SmOkeN, czardas,

Is this not the expected behaviour for an adlib.  If I schedule an adlib to be run every 1 second but spend 2 seconds in each instance I expect them to start to queue...or am I misunderstanding the issue here?

kylomas

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

  • Moderators

You're misunderstanding.

I too would expect them to queue, if I didn't disable it first! lol

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I take my "Duh!" back.  Is this not a timing issue?  Try running this...

Global $giAdlibMills = 5000
Global $giTestAdlibCount = 0

AdlibRegister("Adlib", $giAdlibMills)

While 1
    Sleep(0xFEFEFE)
WEnd

Func Adlib()
    ConsoleWrite(@sec & @CRLF)
    AdlibUnRegister("Adlib")
    $giTestAdlibCount += 1
    MsgBox(0, $giTestAdlibCount, "Message shows, leaves in 3 secs, immediatly pops backup!", 2)
    AdlibRegister("Adlib", $giAdlibMills)
EndFunc

If not, please explain in monosyllabic terms.

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

  • Moderators

I don't know what you're asking me.

When you register something, it starts over.  At least that's what it should do.

That shows that it does not in fact start over, that it (the timer) is still being generated from the first time it was ran even though it was unregistered (which should kill the timer as well).

Edit:

My reference to the issue is Adlib* functions.  Remember, the set time is 5 seconds before it should re-enter that function since it was disabled before the msgbox.  Not 1 or 2.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

That shows that it does not in fact start over, that it (the timer) is still being generated from the first time it was ran even though it was unregistered (which should kill the timer as well).

 

This shows that the timer is being reset...

Global $giAdlibMills = 5000
Global $giTestAdlibCount = 0

AdlibRegister("Adlib", $giAdlibMills)

While 1
    Sleep(0xFEFEFE)
WEnd

Func Adlib()
    ConsoleWrite(@sec & @CRLF)
    AdlibUnRegister("Adlib")
    $giAdlibMills += 5000
    $giTestAdlibCount += 1
    MsgBox(0, $giTestAdlibCount, "Message shows, leaves in 3 secs, immediatly pops backup!", 2)
    AdlibRegister("Adlib", $giAdlibMills)
EndFunc

Not sure what is happening to the formatting....

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

  • Moderators

You have me confused on what you're trying to prove :( .

Global $giAdlibMills = 5000
Global $giTestAdlibCount = 0

AdlibRegister("Adlib", $giAdlibMills)

While 1
    Sleep(0xFEFEFE)
WEnd

Func Adlib()
    ConsoleWrite(@sec)
    AdlibUnRegister("Adlib")
    $giTestAdlibCount += 1
    MsgBox(0, $giTestAdlibCount, "Message shows, leaves in 3 secs, immediatly pops backup!", 2)
    ConsoleWrite(":" & @SEC & @CRLF)
    ; should not come back to this function for 5 seconds from second @sec
    ; subtract the 2 seconds from the MsgBox, and you'll see it doesn't happen this way
    AdlibRegister("Adlib", $giAdlibMills) 
EndFunc

That shows what I'm saying.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

The repro I posted in the ticket shows a ten second delay triggering five seconds after having been registered. I think perhaps this might just require a tweak to AdlibRegister, but I'm only guessing.

The statement I made earlier (in #23) about registering a second function was incorrect. I managed to mislead myself: trying to be too clever too early in the morning.

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