Thread Tools Display Modes
07/28/14, 05:11 PM   #1
NickK
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 10
Pulling the trials timer value(s)

Is there any way i can get the value(s) of the timer that starts as soon as you enter a trial? I searched in functions in the API but didn't find anything relevant, is there something that i might be missing?

I found a workaround to do what i wanna do, but if i could pull the values straight from the server/client it would be much better.

Thanks in advance.
  Reply With Quote
07/28/14, 06:18 PM   #2
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Lua Code:
  1. -- found this, not sure it's what you want
  2. local raidDuration, penaltyTime = GetCurrentRaidTime()
  Reply With Quote
07/28/14, 06:27 PM   #3
Randactyl
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 251
What's your workaround?

Looking through zgoo, I see the following trials related items:
Code:
    ["EVENT_RAID_LEADERBOARD_DATA_CHANGED"] = 131143
    ["EVENT_RAID_LEADERBOARD_PLAYER_DATA_CHANGED"] = 131144
    ["EVENT_RAID_PARTICIPATION_UPDATE"] = 131141
    ["EVENT_RAID_REVIVE_COUNTER_UPDATE"] = 131140
    ["EVENT_RAID_SCORE_NOTIFICATION_ADDED"] = 131145
    ["EVENT_RAID_SCORE_NOTIFICATION_REMOVED"] = 131146
    ["EVENT_RAID_TIMER_STATE_UPDATE"] = 131142
    ["EVENT_RAID_TRIAL_COMPLETE"] = 131137
    ["EVENT_RAID_TRIAL_FAILED"] = 131138
    ["EVENT_RAID_TRIAL_NEW_BEST_TIME"] = 131139
    ["EVENT_RAID_TRIAL_STARTED"] = 131136

    ZO_Announce_GetCurrentRaidTrialTimeString()
So you could start your own timer on EVENT_RAID_TRIAL_STARTED, add appropriate time on EVENT_RAID_REVIVE_COUNTER_UPDATE, and stop your timer on either EVENT_RAID_TRIAL_COMPLETE or EVENT_RAID_TRIAL_FAILED. Or maybe pull it out of ZO_Announce_GetCurrentRaidTrialTimeString() at set intervals

edit: disregard me, I missed GetCurrentRaidTime() [duh]

Last edited by Randactyl : 07/28/14 at 06:29 PM.
  Reply With Quote
07/31/14, 03:33 PM   #4
NickK
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 10
Originally Posted by Randactyl View Post
What's your workaround?

Looking through zgoo, I see the following trials related items:
Code:
    ["EVENT_RAID_LEADERBOARD_DATA_CHANGED"] = 131143
    ["EVENT_RAID_LEADERBOARD_PLAYER_DATA_CHANGED"] = 131144
    ["EVENT_RAID_PARTICIPATION_UPDATE"] = 131141
    ["EVENT_RAID_REVIVE_COUNTER_UPDATE"] = 131140
    ["EVENT_RAID_SCORE_NOTIFICATION_ADDED"] = 131145
    ["EVENT_RAID_SCORE_NOTIFICATION_REMOVED"] = 131146
    ["EVENT_RAID_TIMER_STATE_UPDATE"] = 131142
    ["EVENT_RAID_TRIAL_COMPLETE"] = 131137
    ["EVENT_RAID_TRIAL_FAILED"] = 131138
    ["EVENT_RAID_TRIAL_NEW_BEST_TIME"] = 131139
    ["EVENT_RAID_TRIAL_STARTED"] = 131136

    ZO_Announce_GetCurrentRaidTrialTimeString()
So you could start your own timer on EVENT_RAID_TRIAL_STARTED, add appropriate time on EVENT_RAID_REVIVE_COUNTER_UPDATE, and stop your timer on either EVENT_RAID_TRIAL_COMPLETE or EVENT_RAID_TRIAL_FAILED. Or maybe pull it out of ZO_Announce_GetCurrentRaidTrialTimeString() at set intervals

edit: disregard me, I missed GetCurrentRaidTime() [duh]
I've been doing that with the EVENT_RAID_TRIAL_STARTED, as for the the REVIVE_COUNTER_UPDATE and the 2 completion events, they don't work, i don't know if they used to work, but they don't anymore, the event doesn't fire off at all. I will try the ZO_Announce_GetCurrentRaidTrialTimeString() and see how it works out.

Also i'll try what merilight said and report back for future reference.

Thanks both for your info.
  Reply With Quote
07/31/14, 06:36 PM   #5
NickK
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 10
What merilight wrote works, but i have hard time converting their ms into seconds, i can convert it into minutes by dividing the number by 60000 but it's impossible to get the correct amount of seconds, i divide the number by 1000 but the counter keeps going up after 60sec and i can not find a way to make it reset and start counting again.
  Reply With Quote
07/31/14, 08:58 PM   #6
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Lua Code:
  1. -- milliseconds to whole minutes elapsed
  2. local mins = math.floor(ms / 60000)
  3. -- and seconds modulo 60
  4. local secs = math.floor(ms / 1000) % 60
  5. -- print e.g. 13:07
  6. d(("time %d:%02u"):format(mins, secs))
  Reply With Quote
07/31/14, 09:44 PM   #7
NickK
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 10
Thanks again merlight but i just found the answer 5 mins ago It works like a charm now.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Pulling the trials timer value(s)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off