ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Tip - Found an asychronous timer function. (https://www.esoui.com/forums/showthread.php?t=476)

Dio 04/01/14 09:31 PM

Tip - Found an asychronous timer function.
 
zo_callLater takes two arguments, in order: function, and delay in milliseconds. (LIke setTimeout in JavaScript)

Example:

Code:

/script zo_callLater(function() d("5 seconds have past!") end, 5000)
Stumbled upon this using /zgoo in the zo_Helper area.

DewiMorgan 04/02/14 11:39 AM

Is there a list of such functions on the wiki somewhere?

ins 04/03/14 12:59 PM

Great find :)

Ouijan 04/12/14 10:03 AM

Cheers Dude thats handy! :)

ckaotik 04/14/14 07:13 AM

Quote:

Originally Posted by DewiMorgan (Post 2362)
Is there a list of such functions on the wiki somewhere?

I don't think there is a dedicated list for these (yet) but they can all be found in the global table

Dio 04/14/14 11:46 AM

If you're an addon developer, get zgoo. It's essential. Helper functions are under "zo_Helper" when you run /zgoo

Additionally, that globals wiki page is good. I cross-reference between the two constantly when developing.

Edit - while on the topic, what would be really useful is a wiki page of a globals dump that goes down 2 or 3 levels. e.g. If there is a table, expand the table down 2 or 3 levels.

I've tried to obtain this information recursively using "for x, y in pairs(_G)" but the "private function" errors are blocking.

Errc 04/14/14 12:03 PM

Quote:

Originally Posted by Dio (Post 4263)
If you're an addon developer, get zgoo. It's essential. Helper functions are under "zo_Helper" when you run /zgoo

Additionally, that globals wiki page is good. I cross-reference between the two constantly when developing.

Edit - while on the topic, what would be really useful is a wiki page of a globals dump that goes down 2 or 3 levels. e.g. If there is a table, expand the table down 2 or 3 levels.

I've tried to obtain this information recursively using "for x, y in pairs(_G)" but the "private function" errors are blocking.

Look in Zgoo. There is a function in there that will allow you to iterate _G safely. I think it is safepairs and that is how we iterate it. Uses some trickery with pcalls and parsing the error messages to avoid the private/protected functions without error.

Dio 04/14/14 12:07 PM

Quote:

Originally Posted by Errc (Post 4270)
Look in Zgoo. There is a function in there that will allow you to iterate _G safely. I think it is safepairs and that is how we iterate it. Uses some trickery with pcalls and parsing the error messages to avoid the private/protected functions without error.

Thanks, I'll try this when I get home. If I can extract all the information I may create a new Wiki page that has 2-3 levels deep of globals. I don't want to amend the current one because it is already really slow to load.

Swizzy 05/12/14 03:58 AM

** Ignore me **

Harven 05/12/14 04:12 AM

** ok, ignoring ;) **


All times are GMT -6. The time now is 07:41 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI