Checking Recast Timer In A Gearswap Lua?

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » Windower » General » Checking recast timer in a gearswap lua?
Checking recast timer in a gearswap lua?
Offline
Posts: 40
By Kainminter 2023-01-16 18:52:39
Link | Quote | Reply
 
How do you read the recast timer of an ability or spell in gearswap?

I've been trying to write something in my summoner lua that confirms whether Blood Pact: Ward is up or not.
Offline
Posts: 1109
By DaneBlood 2023-01-16 20:40:15
Link | Quote | Reply
 
her is something i use to prevent activating gear swaps on ja/magic that is in cooldown anyway.

You can probably dissect it into what you need


local spell_recasts = windower.ffxi.get_spell_recasts()
local ja_recasts = windower.ffxi.get_ability_recasts()
if spell.action_type == 'Magic' and (spell.recast_id or spell.id) then
local spell_recasts = windower.ffxi.get_spell_recasts()
if spell_recasts[spell.recast_id or spell.id] and spell_recasts[spell.recast_id or spell.id] > 0 then
cancel_spell()
return
end
elseif spell.type == "JobAbility" and (spell.recast_id or spell.id) then
local ja_recasts = windower.ffxi.get_ability_recasts()
if ja_recasts[spell.recast_id or spell.id] and ja_recasts[spell.recast_id or spell.id] > 0 then
cancel_spell()
return
end
end
[+]
necroskull Necro Bump Detected! [91 days between previous and next post]
Offline
Posts: 709
By Tarage 2023-04-18 06:35:51
Link | Quote | Reply
 
DaneBlood said: »
her is something i use to prevent activating gear swaps on ja/magic that is in cooldown anyway.

You can probably dissect it into what you need


local spell_recasts = windower.ffxi.get_spell_recasts()
local ja_recasts = windower.ffxi.get_ability_recasts()
if spell.action_type == 'Magic' and (spell.recast_id or spell.id) then
local spell_recasts = windower.ffxi.get_spell_recasts()
if spell_recasts[spell.recast_id or spell.id] and spell_recasts[spell.recast_id or spell.id] > 0 then
cancel_spell()
return
end
elseif spell.type == "JobAbility" and (spell.recast_id or spell.id) then
local ja_recasts = windower.ffxi.get_ability_recasts()
if ja_recasts[spell.recast_id or spell.id] and ja_recasts[spell.recast_id or spell.id] > 0 then
cancel_spell()
return
end
end

FYI you are getting the recasts twice, once inside the if statements, and once at the top.
[+]
Log in to post.