View Single Post
06/25/18, 05:10 AM   #8
Necrotic
Join Date: Jun 2018
Posts: 5
Originally Posted by votan View Post
And this one: GetCollectibleCooldownAndDuration(collectibleId) ?
Thanks. I'll test it out. I wonder if it goes in to cool down when you enter combat with some skills.


Originally Posted by Dolgubon View Post
As far as queueing up goes, the base game API doesn't do it very much. You'd need to register an event with the EVENT_MANAGER, probably something like EVENT_COMBAT_STATE_CHANGED. You might need to do a few other stuff like check the mounted state of the character
Combat state changed is what i'm using to add or remove the helm lol. But if you use some skills.. like shield charge.. to initiate combat, it's as though the collectible had been used and is on cool down and get the warning "That collectible is not ready"


Originally Posted by ArtOfShred View Post
You could just do:

Code:
function RetryFunction()
if not IsCollectibleActive(#) then
     UseCollectible(#)
else
     EVENT_MANAGER:UnregisterForUpdate("Refire")
end

function DoThat****MyDude()
     UseCollectible(#)
     EVENT_MANAGER:RegisterForUpdate("Refire", RetryFunction, 100)
end
Function will just keep trying every 100 ms until it gets used. Might want to put a counter variable on it too so it times out after a few seconds if not.
Awesome! That is exactly what I'm looking for! Thank you so much!
  Reply With Quote