View Single Post
02-17-24, 09:40 AM   #18
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,910
The time between the events is 90 minutes for the login test but once you've started the clock it's then reduced by 15 minutes (the time the event takes) which I didn't account for.

The ticker code would be:
Lua Code:
  1. local ticker = C_Timer.NewTicker(1, function()
  2.     if timeToRun > 0 then
  3.         timeToRun = timeToRun - 1
  4.         printTime(timeToRun, inEvent)
  5.         return
  6.     end
  7.     if inEvent then -- The event just finished
  8.         inEvent = false
  9.         timeToRun = waitTime - eventTime -- Reset ticker timer to 90 minutes wait time minus 15 mins event time
  10.     else  -- Waiting for the next event just expired
  11.         inEvent = true
  12.         timeToRun = eventTime -- And the event is running
  13.     end
  14.     printTime(timeToRun, inEvent)
  15. end)
  16. printTime(timeToRun, inEvent)

Also fixed in my previous post.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-17-24 at 09:49 AM.
  Reply With Quote