Hello!
Is there a way on Gearswap to cancel the swaps if the spell or the ability is in recast? It keeps swapping to my precast sets if I hit the macro and recast in not up.
thank you for the help!
Posted 19 May 2014 - 06:01 PM
Hello!
Is there a way on Gearswap to cancel the swaps if the spell or the ability is in recast? It keeps swapping to my precast sets if I hit the macro and recast in not up.
thank you for the help!
Posted 19 May 2014 - 08:09 PM
if windower.ffxi.get_ability_recasts()[60] > 0 then cancel_spell() end
The 60 in this case is from Windower/res/job_abilities.lua (or just abilities.lua, if you aren't on dev). In this case 60 refers to Steal.
Posted 19 May 2014 - 09:49 PM
Thank you! I will try it
Posted 19 May 2014 - 10:46 PM
I had to add a return after cancel_spell() or it will swap me to precast set, but it worked pefectly, thx.
btw is there a way to add multiple abilities in one rule or for spells like Elemental magic? or I have to do rule for every spell?
Posted 20 May 2014 - 12:22 AM
after further testing it is preventing to other abilities and even magic to fire until the recast on the ability in the code gets to 0.
Posted 20 May 2014 - 12:00 PM
Try this for a more general case:
if spell.type == 'JobAbility' and windower.ffxi.get_ability_recasts()[spell.recast_id] > 0 then cancel_spell() end
Specifically for Steal:
if spell.english == 'Steal' and windower.ffxi.get_ability_recasts()[60] > 0 then cancel_spell() end
Posted 20 May 2014 - 02:02 PM
ok got the abilities working, now Im trying to do it with spells but not working this is the code Im using
if spell.type == 'BlackMagic' and windower.ffxi.get_spell_recasts()[spell.recast_id] > 0 then cancel_spell() end
but it still swaps me, whats goin wrong? thank you!
Posted 20 May 2014 - 10:35 PM
Ah, you need to put "return" after cancel_spell() for all above examples.
Posted 20 May 2014 - 11:28 PM
even with return its still not working, its swaps me to precast >midcast>aftercast sets, no idea why cause the abilities one is working perfectly. this is the full code
function pretarget(spell) if spell.type == 'BlackMagic' and windower.ffxi.get_spell_recasts()[spell.recast_id] > 0 then send_command('@input /echo '..spell.english..' not rdy!') cancel_spell() return elseif spell.type == 'JobAbility' and windower.ffxi.get_ability_recasts()[spell.recast_id] > 0 then send_command('@input /echo '..spell.english..' not rdy!') cancel_spell() return end end
I have tried the code in precast function but still not working,
Posted 21 May 2014 - 03:25 PM
Just noticed that for spells you need to use [spell.id] instead of [spell.recast_id]
Working now!! thx Arcon and Byrth!
Posted 21 May 2014 - 03:48 PM
It should definitely be "recast_id", if it isn't, it's a bug and we need to fix it.
Posted 21 May 2014 - 04:09 PM
the spell_recast.lua doesn't have a recast_id thats why it wasn't working
Posted 21 May 2014 - 04:40 PM
The id in there is the recast_id, that's the point of it. It should still work.
Posted 21 May 2014 - 06:35 PM
If I use [spell.recast_id] I get the error "attempt to compare number with nil", if I use [spell.id] it works.
thats with spells, for abilities it works ok with [spell.recast_id]
Posted 30 May 2014 - 12:32 AM
If I use [spell.recast_id] I get the error "attempt to compare number with nil", if I use [spell.id] it works.
thats with spells, for abilities it works ok with [spell.recast_id]
the reason your getting this is because weapon-skills and ranged do not have recast ids
this is what i use
function pretarget(spell) if spell.name ~= 'Ranged' and spell.type ~= 'WeaponSkill' then if spell.action_type == 'Ability' then if spell and (windower.ffxi.get_ability_recasts()[spell.recast_id] >= 1) then cancel_spell() return end elseif spell.action_type == 'Magic' then if spell and (windower.ffxi.get_spell_recasts()[spell.recast_id] >= 1) then cancel_spell() return end end end end function precast(spell) if spell.name ~= 'Ranged' and spell.type ~= 'WeaponSkill' then if spell.action_type == 'Ability' then if spell and (windower.ffxi.get_ability_recasts()[spell.recast_id] >= 1) then cancel_spell() return end elseif spell.action_type == 'Magic' then if spell and (windower.ffxi.get_spell_recasts()[spell.recast_id] >= 1) then cancel_spell() return end end end end
Posted 16 June 2014 - 05:09 PM
You probably don't define the update_pet_mode function.
Posted 16 June 2014 - 05:16 PM
so would i remove it entirely and just use the
Posted 16 June 2014 - 06:14 PM
Where did you get the file from? Your question cannot be answered as is, because we have no idea what you want. The function definition is corrupt. It looks like a copy/paste mistake.
Posted 16 June 2014 - 06:22 PM
it was a pup.lua that i moded into a bst but i'm fairly new to writing this type of files,
https://github.com/K.../master/PUP.lua
0 members, 1 guests, 0 anonymous users