|
|
Gearswap Support Thread
By DaneBlood 2026-03-15 23:29:05
im trying to fix my fastcast for WHM since it drops to much HP for me
sets.fastcast={
main={ name="Grioavolr", augments={'"Fast Cast"+7',}},
sub="Clerisy Strap",
ammo="Impatiens",
head="Ebers Cap +3",
body={ name="Inyanga Jubbah +2", priority=0},
hands={ name="Fanatic Gloves", augments={'MP+50','Healing magic skill +10','"Conserve MP"+7','"Fast Cast"+7',}},
legs="Pinga Pants",
feet={ name="Telchine Pigaches", augments={'"Fast Cast"+5','HP+50',}},
neck={ name="Clr. Torque +2", augments={'Path: A',}},
waist="Witful Belt",
left_ear={ name="Etiolation Earring", priority=50},
right_ear="Malignance Earring",
left_ring={ name="Gelatinous Ring +1", priority=150},
right_ring="Lebeche Ring",
back="Perimede Cape",
THe above set puts me at 2318
but i always seme to drop to 2191 as i cast a spell
my cure sets has 2315 HP in it
and my idle set gas 2353
but adding in the priories for gelantinues ring did notthing in diffrence HP wise
then i added priorty on ear slots with 50hp and that did no change either.
am i doing the priorities wrong and is there a way to set the order its getting equiped with gearswpa ?
-- edit --
oopsie it looks like the drop comes when im switching into the idle set.
I just disabled the fast cast and tried to look for timmings and it looks to be my idle set i need to fix
-- edit 2 --
Yup re-enabled my fastcast set and disabled my idle set and it did not drop that low
oh well
By Dodik 2026-03-16 10:51:32
It's transitions that drop HP, not sets themselves.
Idle -> precast -> midcast -> idle.
One or more of those transitions drop HP from one set to the other. If you have HP+% items anywhere, those should be swapped first (high priority number). Then any static HP+ items.
Necro Bump Detected!
[69 days between previous and next post]
By LightningHelix 2026-05-24 17:30:56
I am using mote's libs and trying to make an aftercast set for Boost to put Ask Sash in the waist slot immediately. The motivation here is that it goes to my idle set, which does not have Ask Sash in it, very briefly before it checks job_buff_change(buff, gain), and I'm losing a tick of Regain. (This has been a known issue people posted about, I'm an idiot, etc.) I'm failing miserably.
I tried to overkill it with multiple DISTINCT things I thought might work: Code sets.buff.Boost = {waist="Ask Sash"}
sets.midcast['Boost'] = sets.buff.Boost --this works fine
sets.aftercast['Boost'] = sets.buff.Boost --this does not, see below
sets.aftercast.JA.Boost = sets.buff.Boost --this does not, see below
function job_aftercast(spell, action, spellMap, eventArgs)
windower.add_to_chat(216, 'inside aftercast')
if spell.english == "Boost" then
windower.add_to_chat(216, 'boost set?')
equip(sets.buff.Boost)
return true
else
--otherwise, do nothing
end
end
The "return true" in job_aftercast is because, per the comments in mote's gearswaps files, "Return true if we handled the aftercast work. Otherwise it will fall back to the general aftercast() code in Mote-Include." and I do NOT want to equip generic sets.idle! That function looks to call handle_actions(spell, 'aftercast')... which then messes around in the _G namespace and I'm too stupid to figure it out from there.
The two aftercast sets prevent the file from even loading because it complains about the general existence of sets.aftercast - this is not surprising to me because I've never used one in my life before!
Quote: GearSwap has detected an error in the user function get_sets:
...Windower/addons/gearswap/data/Joespreadsheet/MNK.lua:264: attempt to index field 'aftercast' (a nil value) I'm certainly not going to create a blank aftercast set if I can avoid it, because that seems like it could break something else.
The job_aftercast is correctly being called enough to write my add-to-chat debug statements, but debug mode shows that it's not actually equipping the set that I expect even for a moment, nor bypassing the regular idle set:

(ignore the bits about not having the Gloves, they're on Coelestrox today)
It is neither
-trying to equip sets.buff.Boost
- not trying to equip the default sets.idle
so I assume I've done something horribly wrong. Any help would be much appreciated, I assume this is a one-liner but I cannot figure out the one line!
Bismarck.Radec
Server: Bismarck
Game: FFXI
Posts: 202
By Bismarck.Radec 2026-05-24 18:02:25
Rather than actually returning true, try setting 'eventArgs.handled' to true before you return, like so:
Code function job_aftercast(spell, action, spellMap, eventArgs)
windower.add_to_chat(216, 'inside aftercast')
if spell.english == "Boost" then
windower.add_to_chat(216, 'boost set?')
equip(sets.buff.Boost)
eventArgs.handled = true
else
--otherwise, do nothing
end
end
As for why this should work, here's a snip of mote-include with the _G[ .. stuff changed to the specific function during aftercast. Hopefully it makes more sense
Code
**This starts around line 257, depending on your mote-include version**
-- Job-specific handling of this action
if not eventArgs.cancel and not eventArgs.handled and job_aftercast then
job_aftercast(spell, action, spellMap, eventArgs) **** Your function is here
if eventArgs.cancel then
cancel_spell()
end
end
-- Default handling of this action
if not eventArgs.cancel and not eventArgs.handled and default_aftercast then **** Because we set eventArgs.handled to true, this bit will be skipped. Right now, this is what gives you sets.idle as the post-boost set.
default_aftercast(spell, spellMap)
display_breadcrumbs(spell, spellMap, action)
end
-- Global post-handling of this action
if not eventArgs.cancel and user_post_aftercast then
user_post_aftercast(spell, action, spellMap, eventArgs)
end
[+]
By darkwaffle 2026-05-24 18:33:58
sets.aftercast is just causing errors because sets.aftercast doesn't exist when you're trying to put things into it, you can declare it with
but I don't think you need to do that for anything either.
I think by 'return true' it's referring to the eventArgs rather than a literal return. handle_actions appears to just check eventArgs.cancel and eventArgs.handled to determine if it should proceed with calling other functions, I don't think it's expecting any value to be returned from your job_aftercast. Otherwise I think you're on the right track, I'd try removing 'return true' and replacing it with
and see if that works. I think what you have written is valid, it's just still proceeding into default_aftercast afterwards and equipping, presumably, your normal idle set instead. Alternatively if you still run into problems I think you can do the exact same thing in job_post_aftercast instead - it's basically the same process and function except it's the last thing that handle_action calls so anything you choose to equip will overwrite the default set instead of vice versa.
[+]
By LightningHelix 2026-05-24 18:39:52

...Well gosh dang, that's exactly what I wanted, yes!
Thank you so much! Worked like a charm and now my Ask Sash isn't vanishing for exactly long enough to lose that first Regain tick.
Bahamut.Khelek
Server: Bahamut
Game: FFXI
Posts: 12
By Bahamut.Khelek 2026-05-31 08:52:39
I want to cancel actions in pretarget if I'm midaction, and I've tried this before. But I remember midaction used to get stuck for a really long time when I was manawalling, so I gave up on it. I believe it was mainly if I interacted with a chest?
the code I used was:
Code function pretarget()
if midaction() then
cancel_spell()
return
end
end
I was wondering if anyone knows if midaction still locks up for really long periods, and/or if there's a fix if that's the case.
By darkwaffle 2026-05-31 11:25:46
I wrangled with that myself a few months ago and I don't remember my exact findings but I think the gist of it was this.
Midaction can get stuck but gearswap will resolve it itself if it is left idle for a few seconds (2-3) / you wait a few seconds before doing something to 'wake' Gearswap. However if you are button mashing then I think you can enter a state where each press will cause Gearswap to check midaction, find that not enough time has passed, it will update some sort of midaction timestamp and then the process repeats leaving you stuck indefinitely while you are rapidly pressing buttons.
I found the cause of this that I could recreate (I assume it could also occur due to dropped packets never telling you that you completed an action or something like that) was generally casting spell X, letting it complete and then trying to start casting spell Y before the 'global cooldown' had passed and then continuing to quickly press the spell Y button. X completes, Y starts (or rather Gearswap thinks Y starts), Gearswap sets midaction = true, server says you can't do it yet and I don't think Gearswap handles that information to unset midaction.
The workaround I put in place for this was to setup an incoming chunk listener for for 'Unable to cast/use' messages. When I receive one I record the time and then during precast handling before I check midaction I first check this timestamp. Anytime I've received an 'unable to do thing' message within the last two seconds I manually set midaction to false before proceeding with everything else.
As far as I know it's been working well although even prior to putting this in place I never really had a problem with it, my friend is using my library though and can't not button mash which is what uncovered this particular scenario at least lol.
Precast logic Code -- The client has received an 'unable to cast/use' message. This can sometimes lead to invalid midaction() responses.
-- If the message we received within the last two seconds then set midaction = false.
-- This is a 'failsafe' to try to prevent users getting 'stuck' behind midaction termination.
if STATE_UNABLE_TO_CAST_TIMESTAMP and os.clock() - STATE_UNABLE_TO_CAST_TIMESTAMP <= 2 then
midaction(false)
end
Listener setup Code
function RegisterOnChunk()
LIBRARY_PACKETS = require "packets"
RegisterWindowerEvent("incoming chunk", OnChunk)
end
function OnChunk(id, original, modified, injected, blocked)
if id == 0x029 then
local MessagePacket = LIBRARY_PACKETS.parse('incoming', original)
local Message = MessagePacket["Message"]
-- Collection of messages that indicate the character attempted to perform an action but was unable due to the 'global cooldown'
local UnableToActionMessages =
{
[17] = true, -- Spell
[18] = true, -- Spell
[55] = true, -- Item
[56] = true, -- Item
[87] = true, -- JA
[88] = true, -- JA
[89] = true, -- WS
[90] = true -- WS
}
if UnableToActionMessages[Message] then
STATE_UNABLE_TO_CAST_TIMESTAMP = os.clock()
end
end
end
By Ceowolf 2026-06-07 10:07:59
I recently created new lua's and have been getting the following error in game: Lua runtime error: gearswap/equip_processing.lua:62:attempt to index field '?' (a nil value).
The error occurs sporadically and I can't figure out why. All gear appears to swap when it is supposed to and debug mode does not point to anything. I used Co-pilot to write the lua and it has been unsuccessful in fixing this issue. I have 4 other job files that are similar and also experience the error.
I have been experiencing a lot of game crashes that may or may not be related to this error so any help would be greatly appreciated.
First post and sorry for length or formatting.
Runfencer Lua
-----------------------------------------
-- RUN.lua
-- Modernized for Mote-Include + Global-Include + TH support
-----------------------------------------
if player.main_job ~= 'RUN' then
return
end
-----------------------------------------
-- GET SETS
-----------------------------------------
function get_sets()
include('Global-Include.lua')
mote_include_version = 2
include('Mote-Include.lua')
end
-----------------------------------------
-- JOB SETUP
-----------------------------------------
function job_setup()
include('Mote-TreasureHunter')
init_global()
-- Rune cycling
state.RuneIndex = M{
['description']='Rune',
'Ignis','Gelus','Flabra','Tellus','Sulpor','Unda','Lux','Tenebrae'
}
end
function user_setup()
state.OffenseMode:options('DD','Tank','HybridTank','MaxHasteTP')
set_macro_page(6, 33)
send_command('bind ^insert gs c rune_forward')
send_command('bind ^delete gs c rune_backward')
send_command('bind ^` gs c cast_rune')
end
function user_unload()
send_command('unbind ^insert')
send_command('unbind ^delete')
send_command('unbind ^`')
clear_global_keybinds()
end
-----------------------------------------
-- GEAR SETS
-----------------------------------------
function init_gear_sets()
---------------------------------------------------------
-- TREASURE HUNTER
---------------------------------------------------------
sets.TreasureHunter = {
head="White Rarab Cap +1",
ammo="Per. Lucky Egg",
legs={name="Herculean Trousers", augments={'Pet: "Mag.Atk.Bns."+30','Enmity-6','"Treasure Hunter"+2',}},
}
---------------------------------------------------------
-- PRECAST
---------------------------------------------------------
sets.precast = {}
sets.precast.JA = {}
sets.Enmity = {
ammo="Seeth. Bomblet +1",
head="Halitus Helm",
body="Ayanmo Corazza +2",
hands="Futhark Mitons",
legs="Zoar Subligar",
feet="CSM Boots +1",
neck="Unmoving Collar +1",
waist="Sailfi Belt +1",
left_ear="Crep. Earring",
right_ear="Cessance Earring",
left_ring="Murky Ring",
right_ring="Defending Ring",
back={ name="Ogma's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10','Damage taken-5%'}},
}
sets.precast.JA['Vallation'] = set_combine(sets.Enmity, {body="Runeist Coat +2"})
sets.precast.JA['Valiance'] = sets.precast.JA['Vallation']
sets.precast.JA['Pflug'] = set_combine(sets.Enmity, {feet="Runeist Bottes"})
sets.precast.JA['Battuta'] = sets.Enmity
sets.precast.JA['Liement'] = set_combine(sets.Enmity, {body="Futhark Coat" })
sets.precast.JA['Gambit'] = set_combine(sets.Enmity, {hands="Runeist Mitons +1" })
sets.precast.JA['Rayke'] = set_combine(sets.Enmity, {feet="Futhark Boots" })
sets.precast.JA['Swordplay'] = set_combine(sets.Enmity, {hands="Futhark Mitons" })
sets.precast.JA['One For All'] = sets.Enmity
sets.precast.JA['Elemental Sforzo'] = set_combine(sets.Enmity, {body="Futhark Coat" })
sets.precast.JA['Vivacious Pulse'] = sets.Enmity
sets.precast.JA['Lunge'] = sets.Enmity
sets.precast.JA['Swipe'] = sets.precast.JA['Lunge']
sets.precast.FC = {
ammo="Seeth. Bomblet +1",
head="Rune. Bandeau +2",
body={name="Adhemar Jacket +1", augments={'STR+12','DEX+12','Attack+20',}},
hands="CSM Gloves +1",
legs="Aya. Cosciales +2",
feet="CSM Boots +1",
neck="Melic Torque",
waist="Sailfi Belt +1",
left_ear="Loquac. Earring",
right_ear="Enchntr. Earring +1",
left_ring="Murky Ring",
right_ring="Ayanmo Ring",
back={ name="Ogma's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10','Damage taken-5%'}},
}
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {
head="Rune. Bandeau +2",
legs="Futhark Trousers",
})
---------------------------------------------------------
-- WEAPONSKILL
---------------------------------------------------------
sets.precast.WS = {
ammo="Seeth. Bomblet +1",
head="Halitus Helm",
body={name="Adhemar Jacket +1", augments={'STR+12','DEX+12','Attack+20',}},
hands="CSM Gloves +1",
legs="Aya. Cosciales +2",
feet="CSM Boots +1",
neck="Rep. Plat. Medal",
waist="Sailfi Belt +1",
left_ear="Crep. Earring",
right_ear="Cessance Earring",
left_ring="Rufescent Ring",
right_ring="Sroda Ring",
back={name="Ogma's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10','Damage taken-5%'}},
}
---------------------------------------------------------
-- ENGAGED SETS
---------------------------------------------------------
sets.engaged = {}
sets.engaged.DD = {
ammo="Seeth. Bomblet +1",
head="Rune. Bandeau +2",
body={name="Adhemar Jacket +1", augments={'STR+12','DEX+12','Attack+20',}},
hands={name="Herculean Gloves", augments={'Accuracy+15','"Conserve MP"+3','Accuracy+13 Attack+13','Mag. Acc.+16 "Mag.Atk.Bns."+16',}},
legs="Aya. Cosciales +2",
feet="CSM Boots +1",
neck="Lissome Necklace",
waist="Sailfi Belt +1",
left_ear="Crep. Earring",
right_ear="Cessance Earring",
left_ring="Chirich Ring",
right_ring="Moonbeam Ring",
back={name="Ogma's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10','Damage taken-5%'}},
}
sets.engaged.Tank = set_combine(sets.engaged.DD, {
left_ring="Murky Ring",
right_ring="Defending Ring",
})
sets.engaged.HybridTank = set_combine(sets.engaged.Tank, {})
sets.engaged.MaxHasteTP = set_combine(sets.engaged.DD, {})
---------------------------------------------------------
-- MIDCAST
---------------------------------------------------------
sets.midcast = {}
sets.midcast['Enhancing Magic'] = {
ammo="Seeth. Bomblet +1",
head="Rune. Bandeau +2",
body={name="Adhemar Jacket +1", augments={'STR+12','DEX+12','Attack+20',}},
hands="CSM Gloves +1",
legs="Aya. Cosciales +2",
feet="CSM Boots +1",
neck="Melic Torque",
waist="Sailfi Belt +1",
left_ear="Loquac. Earring",
right_ear="Enchntr. Earring +1",
left_ring="Murky Ring",
right_ring="Ayanmo Ring",
back={ name="Ogma's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10','Damage taken-5%'}},
}
sets.midcast.Phalanx = sets.midcast['Enhancing Magic']
sets.midcast['Divine Magic'] = sets.Enmity
sets.midcast.Flash = sets.Enmity
sets.midcast.Foil = sets.Enmity
sets.midcast.Crusade = sets.Enmity
sets.midcast.Embolden = {}
---------------------------------------------------------
-- IDLE
---------------------------------------------------------
sets.idle = {
ammo="Homiliary",
head="Rune. Bandeau +2",
body="Runeist Coat +2",
hands="CSM Gloves +1",
legs="Aya. Cosciales +2",
feet="CSM Boots +1",
neck="Elite Royal Collar",
waist="Sailfi Belt +1",
left_ear="Crep. Earring",
right_ear="Cessance Earring",
left_ring="Murky Ring",
right_ring="Shneddick Ring",
back={name="Ogma's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10','Damage taken-5%'}},
}
sets.idle.Town = set_combine(sets.idle, {})
sets.idle.LatentRefresh = {}
---------------------------------------------------------
-- DEFENSE (F10/F11)
---------------------------------------------------------
sets.defense = {}
sets.defense.PDT = {
ammo="Crepuscular Pebble",
head="Rune. Bandeau +2",
body="Ayanmo Corazza +2",
hands="CSM Gloves +1",
legs="Aya. Cosciales +2",
feet="CSM Boots +1",
neck="Elite Royal Collar",
waist="Sailfi Belt +1",
left_ear="Crep. Earring",
right_ear="Cessance Earring",
left_ring="Murky Ring",
right_ring="Defending Ring",
back={name="Ogma's Cape", augments={'DEX+20','Accuracy+20 Attack+20','DEX+10','"Dbl.Atk."+10','Damage taken-5%'}},
}
sets.defense.MDT = set_combine(sets.defense.PDT, {
})
---------------------------------------------------------
-- OTHER
---------------------------------------------------------
sets.Kiting = {right_ring="Shneddick Ring" }
info.tagged_mobs = T{}
end
-----------------------------------------
-- JOB LOGIC (Mote-native)
-----------------------------------------
function job_aftercast(spell, action, spellMap, eventArgs)
if player and player.status and player.status ~= '' then
handle_equipping_gear(player.status)
end
end
function job_buff_change(buff, gain)
if type(global_buff_change) == 'function' then
global_buff_change(buff, gain)
end
end
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enhancing Magic' and buffactive['Embolden'] and sets.midcast.Embolden then
equip(sets.midcast.Embolden)
end
end
-----------------------------------------
-- RUNE CYCLING
-----------------------------------------
function job_self_command(cmdParams, eventArgs)
local cmd = cmdParams[1]
if cmd == 'rune_forward' then
state.RuneIndex:cycle()
add_to_chat(122, 'Rune: '..state.RuneIndex.value)
return
end
if cmd == 'rune_backward' then
state.RuneIndex:cycleback()
add_to_chat(122, 'Rune: '..state.RuneIndex.value)
return
end
if cmd == 'cast_rune' then
send_command('input /ja "'..state.RuneIndex.value..'" <me>')
return
end
if type(global_self_command) == 'function' then
global_self_command(cmd, cmdParams)
end
end
-----------------------------------------
-- CUSTOMIZATION
-----------------------------------------
function customize_idle_set(idleSet)
idleSet = customize_global_idle_set(idleSet)
return idleSet
end
function customize_melee_set(meleeSet)
return meleeSet
end
Global-Include.lua
-----------------------------------------
-- Global-Include.lua
-- Shared logic for all jobs
-----------------------------------------
-- Job Keybind Action
-- ALL JOBS F9 Cycle Offense Mode
-- ALL JOBS F10 Emergency PDT
-- F11 Emergency MDT
-- Ctrl + F12 Cancel Emergency PDT/MDT
-- Ctrl + t Treasure Mode cycle
-- Ctrl + W Warp Ring
-- F12 Update gear
-- RUN Ctrl + Inser Cycle runes Forward
-- RUN Ctrl + Delete Cycle Runes Backward
-- RUN Ctrl + ` Cast Rune
-- BLU Ctrl + L Toggle Learning Mode
-- BLU ` Casts Sudden Lunge
-- BLM Ctrl + M Toggle Magic Burst
-- BLM WIN + W Toggle Weapon Lock
-- DRK — No job‑specific binds
-- PUP WIN + P Cycle Pet Mode
-----------------------------------------
-- Global-Include.lua
-- Shared logic for all jobs (Mote-compatible)
-----------------------------------------
-----------------------------------------
-- GLOBAL STATE SETUP
-----------------------------------------
function init_global_states()
-- Only custom toggles (Mote owns Offense/Defense/Idle/Treasure)
state.Kiting = M(false, 'Kiting')
end
-----------------------------------------
-- GLOBAL KEYBINDS
-----------------------------------------
function init_global_keybinds()
-- Warp Ring
send_command('bind ^w gs c warp')
-- Kiting toggle
send_command('bind ^k gs c kiting')
send_command('bind ^t gs c cycle TreasureMode')
end
function clear_global_keybinds()
send_command('unbind ^w')
send_command('unbind ^k')
send_command('unbind ^t')
end
-----------------------------------------
-- GLOBAL SELF COMMANDS
-----------------------------------------
function global_self_command(cmd, cmdParams)
local command = cmd
-----------------------------------------------------
-- Warp Ring
-----------------------------------------------------
if command == 'warp' then
add_to_chat(122, 'Warp Ring activated.')
send_command('input /equip ring2 "Warp Ring"; wait 11; input /item "Warp Ring" <me>')
return
end
-----------------------------------------------------
-- Kiting toggle
-----------------------------------------------------
if command == 'kiting' then
state.Kiting:toggle()
add_to_chat(122, 'Kiting: '..tostring(state.Kiting.value))
return
end
end
-----------------------------------------
-- GLOBAL BUFF HANDLING
-----------------------------------------
function global_buff_change(buff, gain)
if type(buff) ~= 'string' then
return
end
if buff == 'Silence' and gain then
local has_echo =
(player and player.inventory and player.inventory['Echo Drops']) or
(player and player.wardrobe and player.wardrobe['Echo Drops'])
if has_echo then
send_command('input /item "Echo Drops" <me>')
end
end
end
-----------------------------------------
-- GLOBAL IDLE LOGIC
-----------------------------------------
function customize_global_idle_set(idleSet)
if player and player.mpp and player.mpp < 51 and sets and sets.idle and sets.idle.LatentRefresh then
idleSet = set_combine(idleSet, sets.idle.LatentRefresh)
end
if state and state.Kiting and state.Kiting.value and sets and sets.Kiting then
idleSet = set_combine(idleSet, sets.Kiting)
end
return idleSet
end
-----------------------------------------
-- GLOBAL INITIALIZATION
-----------------------------------------
function init_global()
init_global_states()
init_global_keybinds()
end
-----------------------------------------
-- OPTIONAL MODE CHANGE NOTIFICATIONS
-----------------------------------------
function notify_mode_change(modeName, modeState)
add_to_chat(122, modeName..": "..modeState.value)
end
By darkwaffle 2026-06-08 21:58:07
Line 62 of equip_processing is
Code
return (res.items[item_id][language..'_log']:lower() == name:lower() or res.items[item_id][language]:lower() == name:lower())
Gearswap checks for the existence of res.items[item_id] in the line before this so it sounds like the lookup of the item name using the language.._log or language key is returning nil and then trying to call lower() from nil is causing the error. Have you done anything that would change the value of the 'language' variable in Gearswap or made any alterations to the resource files? Namely items.lua or the resources.lua library. It might be worth including a chat message somewhere to check the value of language if you're not sure, as far as I know only 'english' and 'japanese' are valid.
Code
windower.add_to_chat(1,"LANGUAGE= " .. language)
Server: Kujata
Game: FFXI
Posts: 45
By Kujata.Tetsuiga 2026-06-18 08:41:05
Greetings all, having a slight issue with my sch gearswap, it's a very lightly modfied Mirdain's. If im on the Unlocked weapon preset, it tries to use my fast cast set as a precast for weapon skills, thus switching staves, and killing my TP. I can't seem to figure out why or how to stop it.
--Yavanna
-- Load and initialize the include file.
include('Mirdain-Include')
--Set to ingame lockstyle and Macro Book/Set
LockStylePallet = "13"
MacroBook = "19"
MacroSet = "1"
--Uses Items Automatically
AutoItem = false
--Upon Job change will use a random lockstyleset
Random_Lockstyle = false
--Lockstyle sets to randomly equip
Lockstyle_List = {1,2,6,12}
-- Use "gs c food" to use the specified food item
Food = "Tropical Crepe"
--Set default mode (TP,ACC,DT)
state.OffenseMode:options('TP','ACC','DT','PDT','MEVA')
state.OffenseMode:set('DT')
--Command to Lock Style and Set the correct macros
jobsetup (LockStylePallet,MacroBook,MacroSet)
--Weapon Modes
state.WeaponMode:options('Musa','Mpaca','Unlocked','Locked','Shield','Khat')
state.WeaponMode:set('Unlocked')
function get_sets()
--Set the weapon options. This is set below in job customization section
sets.Weapons = {}
sets.Weapons['Musa'] ={
main={ name="Musa", augments={'Path: C',}},
sub="Enki Strap",
}
sets.Weapons['Mpaca'] ={
main={ name="Mpaca's Staff", augments={'Path: A',}},
sub="Enki Strap",
}
sets.Weapons['Locked'] ={}
sets.Weapons['Unlocked'] ={}
sets.Weapons.Shield ={
main="Daybreak",
sub="Genmei Shield",
}
sets.Weapons.Khat ={
main="Opashoro",
sub="Alber Strap",
}
sets.Weapons.Sleep ={
}
-- Standard idle set
sets.Idle = {
main="Mpaca's Staff",
sub="Khonsu",
ammo="Homiliary",
head="Befouled Crown",
body="Arbatel Gown +3",
hands="Arbatel Bracers +3",
legs="Assid. Pants +1",
feet={ name="Chironic Slippers", augments={'"Fast Cast"+2','CHR+1','"Refresh"+1',}},
neck="Sibyl Scarf",
waist="Null Belt",
left_ear="Etiolation Earring",
right_ear={ name="Moonshade Earring", augments={'MP+25','Latent effect: "Refresh"+1',}},
left_ring="Gurebu's Ring",
right_ring="Stikini Ring +1",
back={ name="Lugh's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','MND+10','Enmity-10','Damage taken-5%',}},
}
-- 'TP','PDL','ACC','DT','PDT','MEVA'
sets.Idle.TP = set_combine(sets.Idle, {})
sets.Idle.ACC = set_combine(sets.Idle, {})
sets.Idle.DT = set_combine(sets.Idle, {})
sets.Idle.PDT = set_combine(sets.Idle, {})
sets.Idle.Resting = set_combine(sets.Idle, {})
sets.Idle.MEVA = set_combine(sets.Idle, {
neck="Warder's Charm +1",
waist="Carrier's Sash",
})
-- Set is only applied when sublimation is charging
sets.Idle.Sublimation = set_combine(sets.Idle, {
head="Acad. Mortar. +3", -- +4 Submlimation when active
waist="Embla Sash", -- +3 Submlimation when active
})
-- Set to swap into when player is moving
sets.Movement = {
feet="Herald's Gaiters"
}
-- Set to be used if you get
sets.Cursna_Received = {
neck="Nicander's Necklace",
left_ring={ name="Eshmun's Ring", bag="wardrobe1", priority=2},
right_ring={ name="Eshmun's Ring", bag="wardrobe2", priority=1},
waist="Gishdubar Sash",
}
-- Sets are used for when player is engaged
sets.OffenseMode = {
main="Opashoro",
sub="Alber Strap",
ammo="Staunch Tathlum +1",
head="Nyame Helm",
body="Nyame Mail",
hands="Nyame Gauntlets",
legs="Nyame Flanchard",
feet="Nyame Sollerets",
neck="Null Loop",
waist="Null Belt",
left_ear="Digni. Earring",
right_ear="Telos Earring",
left_ring="Chirich Ring +1",
right_ring="Chirich Ring +1",
back="Null Shawl",
}
sets.OffenseMode.TP = set_combine(sets.OffenseMode, { })
sets.OffenseMode.DT = set_combine(sets.OffenseMode, { })
sets.OffenseMode.ACC = set_combine(sets.OffenseMode, { })
sets.OffenseMode.PDT = set_combine(sets.OffenseMode, { })
sets.OffenseMode.MEVA = set_combine(sets.OffenseMode, { })
-- Set to use when Dual Wielding
sets.DualWield = {}
-- Set to use when casting spells (sent with Mid-Cast packet - only concern is HP/MP and Fastcast)
sets.Precast = {}
sets.Precast.FastCast = {
main={ name="Musa", augments={'Path: C',}},
sub="Khonsu",
ammo="Sapience Orb",
head={ name="Peda. M.Board +3", augments={'Enh. "Altruism" and "Focalization"',}},
body="Zendik Robe",
hands="Acad. Bracers +3",
legs="Pinga Pants",
feet={ name="Peda. Loafers +3", augments={'Enhances "Stormsurge" effect',}},
neck="Voltsurge Torque",
waist={ name="Shinjutsu-no-Obi +1", augments={'Path: A',}},
left_ear="Malignance Earring",
right_ear="Enchntr. Earring +1",
left_ring="Kishar Ring",
right_ring="Prolix Ring",
back={ name="Fi Follet Cape +1", augments={'Path: A',}},
}
sets.Precast.Enhancing = set_combine(sets.Precast.FastCast, {})
sets.Precast.Cure = set_combine(sets.Precast.FastCast, {})
-- Swaps for Grimoire Fast Cast (Should be over 80% FC)
sets.Precast.Grimoire = {}
-- Job Abilities
sets.JA = {}
sets.JA["Light Arts"] = {}
sets.JA["Penury"] = {}
sets.JA["Celerity"] = {}
sets.JA["Rapture"] = {}
sets.JA["Accession"] = {}
sets.JA["Perpetuance"] = {}
sets.JA["Addendum: White"] = {}
sets.JA["Dark Arts"] = {}
sets.JA["Parsimony"] = {}
sets.JA["Alacrity"] = {}
sets.JA["Ebullience"] = {}
sets.JA["Manifestation"] = {}
sets.JA["Focalization"] = {}
sets.JA["Immanence"] = {}
sets.JA["Addendum: White"] = {}
sets.JA["Sublimation"] = {}
sets.JA["Tabula Rasa"] = {legs={ name="Peda. Pants +3", augments={'Enhances "Tabula Rasa" effect',}}}
sets.JA["Modus Veritas"] = {}
sets.JA["Libra"] = {}
sets.JA["Caper Emissarius"] = {}
sets.JA["Convert"] = {}
-- ===================================================================================================================
-- sets.midcast
-- ===================================================================================================================
--Base set for midcast - if not defined will notify and use your idle set for surviability
sets.Midcast = set_combine(sets.Idle, {})
-- Cure Set
sets.Midcast.Cure = {
main="Chatoyant Staff",
sub="Khonsu",
ammo="Ombre Tathlum +1",
head={ name="Vanya Hood", augments={'MP+50','"Fast Cast"+10','Haste+2%',}},
body={ name="Kaykaus Bliaut +1", augments={'MP+80','"Cure" potency +6%','"Conserve MP"+7',}},
hands={ name="Kaykaus Cuffs +1", augments={'MP+80','"Conserve MP"+7','"Fast Cast"+4',}},
legs={ name="Kaykaus Tights +1", augments={'MP+80','"Cure" spellcasting time -7%','Enmity-6',}},
feet={ name="Kaykaus Boots +1", augments={'MP+80','"Cure" spellcasting time -7%','Enmity-6',}},
neck="Incanter's Torque",
waist={ name="Shinjutsu-no-Obi +1", augments={'Path: A',}},
left_ear="Mendi. Earring",
right_ear="Meili Earring",
left_ring={ name="Mephitas's Ring +1", augments={'Path: A',}},
right_ring="Janniston Ring",
back={ name="Fi Follet Cape +1", augments={'Path: A',}},
}
-- Cursna Gear
sets.Midcast.Cursna = set_combine(sets.Midcast.Cure, {
body={ name="Peda. Gown +3", augments={'Enhances "Enlightenment" effect',}},
legs="Acad. Pants +3",
feet="Gende. Galosh. +1",
neck="Debilis Medallion",
left_ring="Menelaus's Ring",
right_ring="Haoma's Ring",
})
-- Enhancing Skill
sets.Midcast.Enhancing = {
main={ name="Musa", augments={'Path: C',}},
sub="Khonsu",
ammo="Ombre Tathlum +1",
head={ name="Telchine Cap", augments={'Enh. Mag. eff. dur. +10',}},
body={ name="Peda. Gown +3", augments={'Enhances "Enlightenment" effect',}},
hands={ name="Telchine Gloves", augments={'Enh. Mag. eff. dur. +10',}},
legs={ name="Telchine Braconi", augments={'Enh. Mag. eff. dur. +10',}},
feet={ name="Telchine Pigaches", augments={'"Regen" potency+3',}},
neck="Incanter's Torque",
waist="Embla Sash",
left_ear="Mimir Earring",
right_ear="Mendi. Earring",
left_ring="Stikini Ring +1",
right_ring={ name="Mephitas's Ring +1", augments={'Path: A',}},
back={ name="Fi Follet Cape +1", augments={'Path: A',}},
}
-- Spells that require SKILL
sets.Midcast.Enhancing.Skill = set_combine(sets.Midcast.Enhancing, {})
sets.Midcast.Enhancing.Others = set_combine(sets.Midcast.Enhancing, {})
--Used for elemental Bar Magic Spells
sets.Midcast.Enhancing.Elemental = set_combine(sets.Midcast.Enhancing, {})
sets.Midcast.Regen = set_combine(sets.Midcast.Enhancing, {
main={ name="Musa", augments={'Path: C',}},
sub="Khonsu",
head="Arbatel Bonnet +3",
back={ name="Lugh's Cape", augments={'MND+20','Mag. Acc+20 /Mag. Dmg.+20','MND+10','Enmity-10','Damage taken-5%',}},
})
sets.Midcast.Refresh = set_combine(sets.Midcast.Enhancing, { })
-- High MACC for landing spells
sets.Midcast.Enfeebling = {
ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
head="Acad. Mortar. +3",
body="Acad. Gown +3",
hands="Acad. Bracers +3",
legs="Arbatel Pants +3",
feet="Acad. Loafers +3",
neck={ name="Argute Stole +2", augments={'Path: A',}},
waist={ name="Obstin. Sash", augments={'Path: A',}},
left_ear="Regal Earring",
right_ear="Crep. Earring",
left_ring="Stikini Ring +1",
right_ring="Stikini Ring +1",
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Damage taken-5%',}},
}
sets.Midcast.Enfeebling.MACC = set_combine(sets.Midcast.Enfeebling, {})
sets.Midcast.Enfeebling.Potency = set_combine(sets.Midcast.Enfeebling, {})
sets.Midcast.Dark = set_combine(sets.Midcast.Enfeebling, {})
sets.Midcast.Dark.MACC = set_combine(sets.Midcast.Enfeebling.MACC, {})
sets.Midcast.Dark.Absorb = set_combine(sets.Midcast.Enfeebling, {})
-- Used for Vagary (6k+ nuke no kill)
sets.Midcast.Vagary = {
main="Chatoyant Staff",
ammo="Hasty Pinion +1",
head={ name="Vanya Hood", augments={'MP+50','"Fast Cast"+10','Haste+2%',}},
body="Zendik Robe",
hands="Gende. Gages +1",
legs="Pinga Pants +1",
feet={ name="Merlinic Crackows", augments={'"Mag.Atk.Bns."+29','"Fast Cast"+6','DEX+7','Mag. Acc.+14',}},
neck={ name="Unmoving Collar +1", augments={'Path: A',}},
waist="Embla Sash",
left_ear={ name="Odnowa Earring +1", augments={'Path: A',}},
right_ear="Etiolation Earring",
left_ring="Weather. Ring",
right_ring="Kishar Ring",
back={ name="Lugh's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','"Fast Cast"+10','Damage taken-5%',}},
}
sets.Midcast.Nuke = {
main={ name="Bunzi's Rod", augments={'Path: A',}},
sub="Ammurapi Shield",
ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
head="Agwu's Cap",
body="Arbatel Gown +3",
hands={ name="Agwu's Gages", augments={'Path: A',}},
legs={ name="Agwu's Slops", augments={'Path: A',}},
feet="Arbatel Loafers +3",
neck={ name="Argute Stole +2", augments={'Path: A',}},
waist="Hachirin-no-Obi",
left_ear="Malignance Earring",
right_ear="Regal Earring",
left_ring="Shiva Ring +1",
right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Damage taken-5%',}},
}
sets.Midcast.Nuke.Earth = set_combine(sets.Midcast.Nuke, { neck="Quanpur Necklace", })
sets.Midcast.Burst = set_combine(sets.Midcast.Nuke, {
main={ name="Bunzi's Rod", augments={'Path: A',}},
sub="Ammurapi Shield",
ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
head={ name="Peda. M.Board +3", augments={'Enh. "Altruism" and "Focalization"',}},
body={ name="Agwu's Robe", augments={'Path: A',}},
hands={ name="Agwu's Gages", augments={'Path: A',}},
legs={ name="Agwu's Slops", augments={'Path: A',}},
feet="Arbatel Loafers +3",
neck={ name="Argute Stole +2", augments={'Path: A',}},
waist="Hachirin-no-Obi",
left_ear="Malignance Earring",
right_ear="Regal Earring",
left_ring="Mujin Band",
right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Damage taken-5%',}},
})
sets.Helix = set_combine(sets.Midcast.Nuke, {
main={ name="Bunzi's Rod", augments={'Path: A',}},
sub="Ammurapi Shield",
ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
head="Arbatel Bonnet +3",
body="Arbatel Gown +3",
hands="Arbatel Bracers +3",
legs="Arbatel Pants +3",
feet="Arbatel Loafers +3",
neck={ name="Argute Stole +2", augments={'Path: A',}},
waist={ name="Acuity Belt +1", augments={'Path: A',}},
left_ear="Regal Earring",
right_ear={ name="Arbatel Earring", augments={'System: 1 ID: 1676 Val: 0','Mag. Acc.+9',}},
left_ring="Mallquis Ring",
right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Damage taken-5%',}},
})
sets.Helix.Burst = set_combine(sets.Midcast.Nuke, {
main={ name="Bunzi's Rod", augments={'Path: A',}},
sub="Culminus",
ammo={ name="Ghastly Tathlum +1", augments={'Path: A',}},
head={ name="Peda. M.Board +3", augments={'Enh. "Altruism" and "Focalization"',}},
body={ name="Agwu's Robe", augments={'Path: A',}},
hands={ name="Agwu's Gages", augments={'Path: A',}},
legs={ name="Agwu's Slops", augments={'Path: A',}},
feet="Arbatel Loafers +3",
neck={ name="Argute Stole +2", augments={'Path: A',}},
waist={ name="Acuity Belt +1", augments={'Path: A',}},
left_ear="Malignance Earring",
right_ear={ name="Arbatel Earring", augments={'System: 1 ID: 1676 Val: 0','Mag. Acc.+9',}},
left_ring="Mujin Band",
right_ring="Mallquis Ring",
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10','Damage taken-5%',}},
})
sets.Helix.Dark = set_combine(sets.Helix, {
head="Pixie Hairpin +1",
left_ring="Archon Ring",
})
sets.Helix.Light = set_combine(sets.Helix, {
main="Daybreak",
left_ring="Weather. Ring"
})
-- Specific gear for spells
sets.Midcast["Stoneskin"] = set_combine(sets.Midcast.Enhancing, {
ammo="Hasty Pinion +1",
head="Arbatel Bonnet +3",
body="Arbatel Gown +3",
hands={ name="Nyame Gauntlets", augments={'Path: B',}},
legs="Arbatel Pants +3",
feet={ name="Nyame Sollerets", augments={'Path: B',}},
waist="Siegel Sash",
left_ring="Defending Ring",
right_ring={ name="Gelatinous Ring +1", augments={'Path: A',}},
neck="Nodens Gorget",
left_ear="Earthcry Earring",
})
sets.Midcast["Aquaveil"] = set_combine(sets.Midcast.Enhancing, {
head="Amalric Coif +1"
})
sets.Midcast["Klimaform"] = set_combine(sets.Midcast.Enhancing, {})
sets.Midcast["Impact"] = set_combine(sets.Midcast.Enfeebling, {
body="Crepuscular Cloak",
})
sets.Midcast["Embrava"] = set_combine(sets.Midcast.Enhancing, {})
sets.Midcast["Stun"] = set_combine(sets.Midcast.Enfeebling.MACC, {})
sets.Perpetuance = { hands="Arbatel Bracers +3", }
sets.Immanence = { hands="Arbatel Bracers +3", }
sets.Ebullience = { head="Arbatel Bonnet +3", }
sets.Rapture = { head="Arbatel Bonnet +3", }
sets.Penury = { legs="Arbatel Pants +3", } -- not swapped due to duration
sets.Parsimony = { legs="Arbatel Pants +3", }
sets.Klimaform = { feet="Arbatel Loafers +3", }
sets.Storms = { feet="Pedagogy Loafers +3", }
sets.WS = {
sub="Enki Strap",
ammo="Oshasha's Treatise",
head={ name="Nyame Helm", augments={'Path: B',}},
body={ name="Nyame Mail", augments={'Path: B',}},
hands={ name="Nyame Gauntlets", augments={'Path: B',}},
legs={ name="Nyame Flanchard", augments={'Path: B',}},
feet={ name="Nyame Sollerets", augments={'Path: B',}},
neck="Sanctity Necklace",
waist="Eschan Stone",
left_ear="Crep. Earring",
right_ear="Telos Earring",
left_ring="Cornelia's Ring",
right_ring="Epaminondas's Ring",
back={ name="Lugh's Cape", augments={'HP+60','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','"Fast Cast"+10','Damage taken-5%',}},
}
sets.WS["Cataclysm"] = {
sub="Enki Strap",
ammo="Sroda Tathlum",
head="Pixie Hairpin +1",
body="Arbatel Gown +3",
hands="Jhakri Cuffs +2",
legs="Arbatel Pants +3",
feet="Arbatel Loafers +3",
neck="Sibyl Scarf",
waist="Hachirin-no-Obi",
left_ear="Malignance Earring",
right_ear="Regal Earring",
left_ring="Archon Ring",
right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','Weapon skill damage +10%','Damage taken-5%',}},
}
sets.WS["Oshala"] = {
main="Opashoro",
sub="Enki Strap",
ammo="Sroda Tathlum",
head="Pixie Hairpin +1",
body="Arbatel Gown +3",
hands="Jhakri Cuffs +2",
legs="Arbatel Pants +3",
feet="Arbatel Loafers +3",
neck="Sibyl Scarf",
waist="Hachirin-no-Obi",
left_ear="Malignance Earring",
right_ear="Regal Earring",
left_ring="Archon Ring",
right_ring={ name="Metamor. Ring +1", augments={'Path: A',}},
back={ name="Lugh's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','Weapon skill damage +10%','Damage taken-5%',}},
}
-- Set used to tag treasure hunger
sets.TreasureHunter = {
ammo="Per. Lucky Egg",
head="Volte Cap",
legs="Volte Hose",
waist="Chaac Belt",
}
end
-------------------------------------------------------------------------------------------------------------------
-- DO NOT EDIT BELOW THIS LINE UNLESS YOU NEED TO MAKE JOB SPECIFIC RULES
-------------------------------------------------------------------------------------------------------------------
-- Called when the player's subjob changes.
function sub_job_change_custom(new, old)
-- Typically used for Macro pallet changing
end
--Adjust custom precast actions
function pretarget_custom(spell,action)
end
-- Augment basic equipment sets
function precast_custom(spell)
local equipSet = {}
if spell.type == "WhiteMagic" and (buffactive["Light Arts"] or buffactive["Addendum: White"]) then
log("Grimoire Set (White)")
equipSet = set_combine(equipSet, sets.Precast.Grimoire)
elseif spell.type == "BlackMagic" and (buffactive["Dark Arts"] or buffactive["Addendum: Black"]) then
log("Grimoire Set (Dark)")
equipSet = set_combine(equipSet, sets.Precast.Grimoire)
end
return equipSet
end
-- Augment basic equipment sets
function midcast_custom(spell)
local equipSet = {}
if buffactive["Immanence"] then
log("Immanence Set")
equipSet = set_combine(equipSet, sets.Immanence)
end
if buffactive["Ebullience"] then
log("Ebullience Set")
equipSet = set_combine(equipSet, sets.Ebullience)
end
if buffactive["Rapture"] then
log("Rapture Set")
equipSet = set_combine(equipSet, sets.Rapture)
end
-- Skipping Penury due to lack of duration gear (Embrava)
--[[
if buffactive["Penury"] then
log("Penury Set")
equipSet = sets.Penury
end
]]--
if buffactive["Parsimony"] then
log("Parsimony Set")
equipSet = set_combine(equipSet, sets.Parsimony)
end
if buffactive["Perpetuance"] then
log("Perpetuance Set")
equipSet = set_combine(equipSet, sets.Perpetuance)
end
return equipSet
end
-- Augment basic equipment sets
function aftercast_custom(spell)
local equipSet = {}
return equipSet
end
--Function is called when the player gains or loses a buff
function buff_change_custom(name,gain)
local equipSet = {}
return equipSet
end
--This function is called when a update request the correct equipment set
function choose_set_custom()
local equipSet = {}
return equipSet
end
--Function is called when the player changes states
function status_change_custom(new,old)
local equipSet = {}
return equipSet
end
--Function is called when a self command is issued
function self_command_custom(command)
end
-- This function is called when the job file is unloaded
function user_file_unload()
end
--Function used to automate Job Ability use - Checked first
function check_buff_JA()
local buff = 'None'
return buff
end
--Function used to automate Spell use
function check_buff_SP()
local buff = 'None'
return buff
end
function pet_change_custom(pet,gain)
local equipSet = {}
return equipSet
end
function pet_aftercast_custom(spell)
local equipSet = {}
return equipSet
end
function pet_midcast_custom(spell)
local equipSet = {}
return equipSet
end
By Thaylia 2026-06-18 10:51:46
I think your Idle weapon leaks into your sets.WS when calling "built_set".
An easy fix would be to add this: Code
-- Augment basic equipment sets
function precast_custom(spell)
local equipSet = {}
if spell.type == "WeaponSkill" and state.WeaponMode.value == "Unlocked" then
equipSet = set_combine(equipSet, { main = player.equipment.main, sub = player.equipment.sub })
end
It makes sure to keep your current main weapon equipped when you WS.
[+]
Server: Kujata
Game: FFXI
Posts: 45
By Kujata.Tetsuiga 2026-06-18 12:58:51
Thank you so very much !!! It was driving me insane trying to figure it out lol.
Bahamut.Xismal
Server: Bahamut
Game: FFXI
Posts: 1
By Bahamut.Xismal 2026-06-19 04:50:17
Would appreciate some help/guidance diagnosing my gearswap issue please. Note: I am using Mirdain's lua and modified the equipment sets based on the gear I have. I am not very good at the codes.
Issue:
The weapons I defined in precast and midcast are not being swapped in; instead what I have selected as weaponmode is "locked in" when I am casting a spell. I don't want to use "Unlocked" mode as I want to specify which weaponset to use as aftercast idle and this can change depending on the situation.
Want to achieve:
Idleset (weaponset selected here) > Precast (swap in defined weapons) > Midcast (swap in defined weapons) > Aftercast (swap back to idleset with the weaponset defined at start)
My lua codes (truncated codes that are not relevant):
Start/Idle/Weaponset Code --Set default mode (IdleTown,RefreshDT)
state.OffenseMode:options('IdleTown', 'RefreshDT')
state.OffenseMode:set('IdleTown')
--Weapon Modes
state.WeaponMode:options('DaybreakArchduke','MalignanceDT','Unlocked')
state.WeaponMode:set('DaybreakArchduke')
function get_sets()
-- Weapon setup
sets.Weapons = {}
sets.Weapons['DaybreakArchduke'] = {
main="Daybreak",
sub="Archduke's Shield",
}
sets.Weapons['MalignanceDT'] = {
main="Malignance Pole",
sub="Oneiros Grip",
}
sets.Weapons['Unlocked'] = {}
-- Standard Idle set with -DT,Refresh,Regen and movement gear
sets.Idle = {}
sets.Idle.IdleTown = set_combine(sets.Idle, {
ammo="Staunch Tathlum +1",
head="Null Masque",
body="Theo. Bliaut +4",
hands="Nyame Gauntlets",
legs="Nyame Flanchard",
feet="Nyame Sollerets",
neck={ name="Clr. Torque +2", augments={'Path: A',}},
waist="Carrier's Sash",
left_ear="Alabaster Earring",
right_ear="Arete del Luna +1",
left_ring="Warp Ring",
right_ring="Shneddick Ring +1",
back={ name="Alaunus's Cape", augments={'MND+20','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','"Fast Cast"+10','Damage taken-5%',}},
})
sets.Idle.RefreshDT = set_combine(sets.Idle, {
ammo="Homiliary",
head="Null Masque",
body="Theo. Bliaut +4",
hands="Nyame Gauntlets",
legs="Nyame Flanchard",
feet="Nyame Sollerets",
neck={ name="Clr. Torque +2", augments={'Path: A',}},
waist="Null Belt",
left_ear="Alabaster Earring",
right_ear="Odnowa Earring +1",
left_ring="Murky Ring",
right_ring="Shneddick Ring +1",
back="Null Shawl",
})
Precast Code -- ===================================================================================================================
-- sets.Precast
-- ===================================================================================================================
sets.Precast = {}
-- Used for Magic Spells (Cap 80%)
sets.Precast.FastCast = {
main="C. Palug Hammer",
sub="Chanter's Shield",
ammo="Impatiens",
head={ name="Vanya Hood", augments={'MP+50','"Fast Cast"+10','Haste+2%',}},
body="Inyanga Jubbah +2",
hands={ name="Gende. Gages +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','"Cure" spellcasting time -5%',}},
legs="Aya. Cosciales +2",
feet="Regal Pumps +1",
neck={ name="Clr. Torque +2", augments={'Path: A',}},
waist="Witful Belt",
left_ear="Malignance Earring",
right_ear="Loquac. Earring",
left_ring="Lebeche Ring",
right_ring="Kishar Ring",
back="Perimede Cape",
}
-- Used for Cure cast
-- 3k HP, 80% Cast Speed, 25% gear haste
sets.Precast.Cure = set_combine(sets.Precast.FastCast, {
main={ name="Queller Rod", augments={'Healing magic skill +15','"Cure" potency +10%','"Cure" spellcasting time -7%',}},
sub="Sors Shield",
ammo="Impatiens",
head={ name="Vanya Hood", augments={'MP+50','"Fast Cast"+10','Haste+2%',}},
body="Inyanga Jubbah +2",
hands={ name="Gende. Gages +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -2%','"Cure" spellcasting time -5%',}},
legs="Ebers Pant. +1",
feet={ name="Vanya Clogs", augments={'"Cure" potency +5%','"Cure" spellcasting time -15%','"Conserve MP"+6',}},
neck={ name="Clr. Torque +2", augments={'Path: A',}},
waist="Witful Belt",
left_ear="Malignance Earring",
right_ear="Mendi. Earring",
left_ring="Lebeche Ring",
right_ring="Kishar Ring",
back="Perimede Cape",
})
Midcast Code -- ===================================================================================================================
-- sets.Midcast
-- ===================================================================================================================
--Base set for midcast - if not defined will notify and use your idle set for surviability
sets.Midcast = set_combine(sets.Idle, sets.Idle.RefreshDT, { })
--This set is used as base as is overwrote by specific gear changes (Spell Interruption Rate Down)
sets.Midcast.SIRD = {}
-- Cure Set
sets.Midcast.Cure = {
main="Chatoyant Staff",
sub="Achaq Grip",
ammo="Pemphredo Tathlum",
head={ name="Kaykaus Mitra +1", augments={'MP+80','MND+12','Mag. Acc.+20',}},
body="Ebers Bliaut +1",
hands="Theo. Mitts +4",
legs="Ebers Pant. +1",
feet={ name="Kaykaus Boots +1", augments={'Mag. Acc.+20','"Cure" potency +6%','"Fast Cast"+4',}},
neck={ name="Clr. Torque +2", augments={'Path: A',}},
waist="Gishdubar Sash",
left_ear="Glorious Earring",
right_ear="Mendi. Earring",
left_ring="Murky Ring",
right_ring="Mephitas's Ring +1",
back={ name="Alaunus's Cape", augments={'MND+20','Eva.+20 /Mag. Eva.+20','Mag. Evasion+10','"Fast Cast"+10','Damage taken-5%',}},
}
Aftercast (I only saw one defined for WS which I didnt modify yet) Code -- ===================================================================================================================
-- sets.aftercast
-- ===================================================================================================================
sets.WS = {
ammo="Oshasha's Treatise",
head={ name="Nyame Helm", augments={'Path: B',}},
body={ name="Nyame Mail", augments={'Path: B',}},
hands={ name="Nyame Gauntlets", augments={'Path: B',}},
legs={ name="Nyame Flanchard", augments={'Path: B',}},
feet={ name="Nyame Sollerets", augments={'Path: B',}},
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear={ name="Moonshade Earring", augments={'Accuracy+4','TP Bonus +250',}},
right_ear="Ishvara Earring",
left_ring="Ilabrat Ring",
right_ring="Epaminondas's Ring",
back={ name="Alaunus's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10','Damage taken-5%',}},
}
DO NOT EDIT at the end of the lua Code -------------------------------------------------------------------------------------------------------------------
-- DO NOT EDIT BELOW THIS LINE UNLESS YOU NEED TO MAKE JOB SPECIFIC RULES
-------------------------------------------------------------------------------------------------------------------
-- Called when the player's subjob changes.
function sub_job_change_custom(new, old)
-- Typically used for Macro pallet changing
end
--Adjust custom precast actions
function pretarget_custom(spell,action)
end
-- Augment basic equipment sets
function precast_custom(spell)
local equipSet = {}
return equipSet
end
-- Augment basic equipment sets
function midcast_custom(spell)
local equipSet = {}
return equipSet
end
-- Augment basic equipment sets
function aftercast_custom(spell)
local equipSet = {}
if not buffactive['Afflatus Solace'] and not buffactive['Afflatus Misery'] then
add_to_chat(8,'You are not in a stance')
end
return equipSet
end
--Function is called when the player gains or loses a buff
function buff_change_custom(name,gain)
local equipSet = {}
return equipSet
end
--This function is called when a update request the correct equipment set
function choose_set_custom()
local equipSet = {}
return equipSet
end
--Function is called when the player changes states
function status_change_custom(new,old)
local equipSet = {}
return equipSet
end
--Function is called when a self command is issued
function self_command_custom(command)
end
-- Function is called when the job lua is unloaded
function user_file_unload()
end
--Function used to automate Job Ability use - Checked first
function check_buff_JA()
local buff = 'None'
return buff
end
--Function used to automate Spell use
function check_buff_SP()
local buff = 'None'
return buff
end
function pet_change_custom(pet,gain)
local equipSet = {}
return equipSet
end
function pet_aftercast_custom(spell)
local equipSet = {}
return equipSet
end
function pet_midcast_custom(spell)
local equipSet = {}
return equipSet
end
Scenario example 1:
I selected "DaybreakArchduke" weaponset (for refresh+idle).
When I cast a spell say "Cure" for example,
a. Precast- I am expecting it to swap to Queller Rod but it is locked in Daybreak+Archduke (granted this is instantaneous and I might not see it). -FAIL
b. Midcast- I am expecting it to swap to Chatoyant Staff just as the spell lands but it is locked in Daybreak+Archduke. -FAIL
c. Aftercast- I am expecting it to swap to Daybreak+Archduke but since the above is locked all the while, I cannot discern. -CANT TELL
Scenario example 2:
I selected "Unlocked" weaponset (but equipped Daybreak+Archduke for refresh+idle).
When I cast a spell say "Cure" for example,
a. Precast- I am expecting it to swaps to Queller Rod and it swaps to Queller Rod (granted this is instantaneous and I might not see it). -SUCCESS
b. Midcast- I am expecting it to swap to Chatoyant Staff just as the spell lands and it swaps Chatoyant Staff. -SUCCESS
c. Aftercast- I am expecting it to swap to Daybreak+Archduke but it stays as Chatoyang Staff. -FAIL
What should I change or add to achieve what I am seeking?
Quote: Want to achieve:
Idleset (weaponset selected here) > Precast (swap in defined weapons) > Midcast (swap in defined weapons) > Aftercast (swap back to idleset with the weaponset defined at start)
Just looking for someone to explain this addon a bit for me. It looks like it is an alternative to Spellcast.
Is it going to be replacing Spellcast? In which ways is it better or worse. I don't know any programming but I've slowly learned more and more about spellcast and the 'language' used in gearswap is confusing to me.
It says it uses packets so it potentially could be more detectable? but does that also eliminate any lag that spellcast may encounter?
I plan on redoing my PUP xml to include pet casting sets thanks to the new addon petschool. I'm just not sure if it's worth it to just wait until gearswap gets more popular or to go ahead and do it in spellcast.
If anyone could give me more info I'd greatly appreciate it.
|
|