WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Delay function (https://www.wowinterface.com/forums/showthread.php?t=39087)

Platine 02-26-11 07:34 AM

Delay function
 
How to make a proper function of the delay?

function My_Delay(sec)
local My_currentTime=GetTime();
while ( My_currentTime+sec>GetTime() ) do
-- wait a 'sec' time
end
end

My_Delay(5) - Wow sleep on 5 sec., and are not supported any action

Xrystal 02-26-11 08:44 AM

I doubt you can tell wow to sleep for any amount of time as events are processed as they occur.

However, you can create a frame in an addon that has an onupdate routine that can trigger your options within a timer system but only your addon. It will not stop other addons from doing their stuff or wow itself.

Platine 02-26-11 01:33 PM

User-function wait
 
Yes, you're right, just call the user-function wait:

http://www.wowwiki.com/Wait

Thanks.

Xrystal 02-26-11 05:33 PM

ooh, learn something new every day :D

I'm assuming you've tried it and it works.

Seerah 02-26-11 06:09 PM

That won't make WoW "sleep", though. It sounds as if you want WoW to become unresposive. You can do this, but it would also freeze up the display of the game as well and may disconnect you. Why you would do this, I have no idea.


All times are GMT -6. The time now is 11:49 PM.

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