#Custom trinket cooldown missing desaturation and swipe.

20 messages · Page 1 of 1 (latest)

atomic wing
#

I'm trying to make a formatted trinket cooldown I have it showing the correct time as of now using the following in the custom text, with some additional checks in the trigger section

function() local start, duration = GetInventoryItemCooldown("player", 13); local end_time = start + duration; local remaining = end_time - GetTime(); if remaining < 0 then return "" else local hours = floor(remaining / 3600); local minutes = floor((remaining % 3600) / 60); local seconds = floor(remaining % 60); if hours > 0 then return hours.."h "; elseif minutes > 0 then return minutes.."m "; else return seconds.."s"; end end end

I can't seem to find a way to make it desaturate while on cooldown and be saturated off cooldown, as well as the cooldown swipe to show.
I am be no means very well versed in Lua, but things like self:SetDesaturated(true) etc. doesn't seem to want to work.

dense flare
#

Why are you doing any of it in code?

atomic wing
#

It all started with ruby whelp shell showing an excessively long cooldown, so I started poking around for fun with ChatGPT, since I couldn't seem to find a solution online, but it managed to help me solve the duration being displayed as some negative 6 digit integer. So now I wanted to try and make it dynamic using any trinket in the trinket slot.

burnt prawn
#

That's not an answer to asakawa's question

atomic wing
#

Doing it the regular way with just selecting the item as a trigger cooldown etc. will show some weird number, so I thought I could fix it using code

burnt prawn
#

I think I know what you mean, it shows that weird number when the cooldown is ready, but that can just be solved by hiding the text with a condition

atomic wing
#

It only shows the number when it's on cooldown, it could just be hidden, but I thought it was more interesting to fix what could seem to be a bug and maybe understand why it's showing this long cooldown when it's obviously incorrect

dense flare
#

Use a simple Item Cooldown trigger.
If you really don't like the timer format options available then use a custom text, that's fine as you like, but use the Trigger and use the Conditions provided.

atomic wing
#

If I do that, then this is what I see:

#

Or is the issue stemming from something else?

dense flare
#

I don't know any reason for the CD being that long.

spiral fable
#

Computer uptime and long cooldowns

#

If the bug appeared again make a ticket

#

There was a workaround because of classic

atomic wing
#

Yea it only happens with very long cooldowns, 2-5 minute trinkets etc. has no issue at all, I did read something with computer uptime, but it's only been around 3 hours since I turned my pc on.

I'll make a ticket

spiral fable
#

Mention classic and profession cooldowns

#

Windows and training the pc off, doesn't mean turning the pc off off

atomic wing
#

Will do