1. #1

    Some sort of wait() or pause() function?

    I need a function to pause my addon for about a second without locking up the game for the duration, this is one thing I've found that does it, but it locks up the game for the duration of the time it waits, ultimately it isn't good. Is there a better way of doing it?
    Code:
    local function wait(seconds)
    	local _start = time()
    	local _end = _start+seconds
    	while (_end ~= time()) do
    	end
    end
    Thanks!
    Last edited by Obsession; 2012-09-11 at 03:21 AM.

  2. #2
    No way in game, and from my understanding no longer any way to do it with addons either.

  3. #3
    With whatever you're trying to achieve, you can do the time check within the onupdate event, then after a second do what you want.
    Moo.

  4. #4
    Hmm, in hindsight I should have done that, I decided to just use AceTimer :s. Thanks though!

  5. #5
    Deleted
    For reference, the WoW Lua engine is single-threaded. If you pause the engine (infinite/long loops) the game itself also hangs for the duration.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •