Change
"if petisvalid == 'TRUE' then"
to
"if pet.isvalid then"
and see if that works.
Change
"if petisvalid == 'TRUE' then"
to
"if pet.isvalid then"
and see if that works.
the reason pet.isvalid == 'TRUE' does not work is because its not a String its a Boolean so it would be pet.isvalid == true but sence booleans only have 2 ways thay can be all you need is pet.isvalid
i.e.
if pet.isvalid == 'TRUE' then --will not work for boolean
if pet.isvalid then --is used when the vareable is true
if not pet.isvalid then --is used when the variable is false
here is your sc code rebuilt in to gs
it checks to see if you have a pet and if you can cast fightCode:if new == 'Engaged' then equip(sets.engaged.tp) if not pet.isvalid then add_to_chat(158,'Pet Not Available') end if pet.isvalid and (windower.ffxi.get_ability_recasts()[100] == 0) then send_command('wait 2 3;input /pet "Fight" <t>') else send_command('wait 5 6;input /ja "Box Step" <t>') end
if you do not have a pet it will send a message to chat then cast box step
else it will checket to see if the recast of fight is 0 and if it is will cast fight if not it will cast boxestep
So this: (windower.ffxi.get_ability_recasts()[100] == 0) is a universal recast check in GearSwap? That's pretty cool!
That's good to know and still pretty cool. Much cleaner than Spellcast!
New question though: Can I get GearSwap to detect whether or not my pet is resting like:
pet.status == 'Resting'
pet.status == 'Idle'
pet.status == 'Engaged'
Because I don't want to use Fight unless the pet is idle.
I've tried this both just pet.status and pet.status == 'Idle' and then made the pet "Stay" but it still uses Fight when I engage a target:
It's possible the pet never actually counts as resting, even though it recovers HP when you use the Stay command. If so I'll just use a toggled variable that switches on when I use Stay and off when I use Heel like before.Code:function status_change(new,old) if new == 'Engaged' then equip(sets.engaged.tp) if not pet.isvalid then add_to_chat(158,'Pet Not Available') end if pet.isvalid and pet.status == 'Idle' and (windower.ffxi.get_ability_recasts()[100] == 0) then send_command('wait 2 4;input /pet "Fight" <t>') else send_command('wait 5 6;input /ja "Box Step" <t>') end else equip(sets.idle.pettank) end end
Ohhh okay that makes sense then. Thank you for your help. ^_^
windower.ffxi.get_ability_recasts()
Returns a table containing the current ability recast times. See below for spell recast times.
--contains only about 250 values depending on what abilitys have the same timer but only thoes that your current job setup has access to
windower.ffxi.get_spell_recasts()
Returns a table containing the current spell recast times. See above for ability recast times.
--contains over 900 values one for each spell
http://dev.windower.net/doku.php?id=...ons:ffxi:start
I meant using recast_id works for both. You don't have to use spell.recast_id for one and spell.id for the other.
i was not sure if thay made that fix yet
I tried to copy my macro book code from my DRG lua to my BLU lua but got an error.
My DRG lua has at the top:
My BLU Lua has:Code:function get_sets() AccIndex = 1 AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. -- AttIndex = 1 AttArray = {"LowATT","HighATT","LowContent"} -- LowATT Is The Same As LowACC Set. MidACC & HighACC Take Priority Over These 2 Sets(HighATT & LowContent). -- select_default_macro_book(1) -- Change Default Macro Book At The End -
Code:function get_sets() send_command('bind f9 gs c toggle TP set') send_command('bind f10 gs c toggle Idle set') send_command('bind f11 gs c toggle CDC set') send_command('bind f12 gs c toggle Req set') send_command('bind !f12 gs c toggle Rea set') select_default_macro_book(1) -- Change Default Macro Book At The End --
But for some reason when I load my BLU lua, it says error with the line associated with the select_default_macro_book. The error says: attempt to call global 'select_default_macro_book....then the rest is cut off in the console ><
It's literally copy and pasted into the same 'get_sets' section so not sure why it's not working. I even copyed the same bottom section where I define which subs correspond to which macro books...
I am currently using Mote's WHM GS lua, I have a question regarding separating the sets for Cure I-IV and Cure V-VI.
The reason being, I want to use a set of 50% cure potency, 500 healing magic skill, and -50 enmity for Cure I-IV and a set where I simply try to maximize Power for Cure V-VI.
I realize that your Cure logic is further broken down to Cure and CureSolace, which I also utilize. I can see it being quite simple if I change the library mapping of Cures (change V-VI to CureHigh or something, then add additional logic to get_spell_map function), but is there a way to do it easily without touching the library?
Thanks in advance.
Correction: Cure I-IV should be 50 potency and -50 enmity, healing magic will be automatically 500+ since I will be trying to maximize power with those 2 conditions.
Figured it out thanks!
When using gearswap is there a way that when nitro is active to put on my song set and lock it? No need for precast etc cause its instant cast, and tired of disabling my gs and remaking macros over and over. Thanks!
When using gearswap is there a way that when nitro is active to put on my song set and lock it? No need for precast etc cause its instant cast, and tired of disabling my gs and remaking macros over and over. Thanks!