Sign in to follow this  
Followers 0
Noob

Can more than one AdlibEnable() in one function?

6 posts in this topic

If possible, I'd like two AdlibEnable() inside one function.

AdlibEnable("first", 60000)

AdlibEnable("second", 500)

The first would serve me as a 1 minute timeout for my BlockInput() function - in case my function gets stuck.

And the second would check for something else every 500 milliseconds.

But I don't think I can use 2 AdlibEnable() in one function, can I? If yes, would one AdlibDisable() disable both of them?

(Sorry if this is a really silly noob question.)

Share this post


Link to post
Share on other sites



No, you can't have two Adlib's. The first Adlib here, to check for crash, is used for a proper reason. The other one, that is checking for something, should be in the main loop of your program..

Share this post


Link to post
Share on other sites

Thanks much. This ends my several day long wondering about this :whistle:

Share this post


Link to post
Share on other sites

Thanks much. This ends my several day long wondering about this :whistle:

Yeah, that can be one of the most terrible things about programming!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I want to have several adlib functions included in my bot. so far I have one that checks health lvl at intervals of 2500 miliseconds but I want to add another one that checks x and y coords but much later. I have a short solution where my adlib function could contain a counter so that when 10,000 miliseconds is reached it excutes the check and resets the counter variable however is it possible to have two?

No, you can't have two Adlib's. The first Adlib here, to check for crash, is used for a proper reason. The other one, that is checking for something, should be in the main loop of your program..

From what I read above, you said include the second one in the main loop and to me that doesn't make sense because that means it is run continously. everytime the loop is repeated it will set the adlib function, an adlibenable() should only be used once per function, shouldn't need to be used twice - let alone to be included in the loop. Do you mean to include a call function in the loop? that would make more sense but it still isn't equivalant to an adlibenable(). Therefore I don't understand your reply. Could you or someone else confirm or elaborate on this please. Edited by crislivinitup

Share this post


Link to post
Share on other sites

Just as Manadar said, you cannot have two adlib functions. A series of checks can be performed with If.. Then statements and the proper action can be taken there. Of course you could also just have two scripts and have one call the other one so you only have to start one.

Hope this helps somewhat.

Screamz


Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house.

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