Gearswap Support Thread

Eorzea Time
 
 
 
Language: JP EN FR DE
Ffxivpro Yellow Box
9158 users online
Forum » Windower » Support » Gearswap Support Thread
Gearswap Support Thread
First Page 2 3 ... 189 190
Offline
Posts: 1410
By DaneBlood 2026-03-15 23:29:05
Link | Quote | Reply
 
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
Offline
By Dodik 2026-03-16 10:51:32
Link | Quote | Reply
 
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.
necroskull Necro Bump Detected! [69 days between previous and next post]
Offline
By LightningHelix 2026-05-24 17:30:56
Link | Quote | Reply
 
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
Offline
Server: Bismarck
Game: FFXI
User: Radec
Posts: 202
By Bismarck.Radec 2026-05-24 18:02:25
Link | Quote | Reply
 
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
[+]
Offline
Posts: 71
By darkwaffle 2026-05-24 18:33:58
Link | Quote | Reply
 
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
Code
sets.aftercast = {}

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
Code
eventArgs.handled = true


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.
[+]
Offline
By LightningHelix 2026-05-24 18:39:52
Link | Quote | Reply
 

...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
Offline
Server: Bahamut
Game: FFXI
User: Khelek
Posts: 12
By Bahamut.Khelek 2026-05-31 08:52:39
Link | Quote | Reply
 
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.
Offline
Posts: 71
By darkwaffle 2026-05-31 11:25:46
Link | Quote | Reply
 
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
Offline
Posts: 5
By Ceowolf 2026-06-07 10:07:59
Link | Quote | Reply
 
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
Offline
Posts: 71
By darkwaffle 2026-06-08 21:58:07
Link | Quote | Reply
 
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)
 Kujata.Tetsuiga
Offline
Server: Kujata
Game: FFXI
User: Tetsuiga
Posts: 45
By Kujata.Tetsuiga 2026-06-18 08:41:05
Link | Quote | Reply
 
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.

Offline
Posts: 10
By Thaylia 2026-06-18 10:51:46
Link | Quote | Reply
 
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.
[+]
 Kujata.Tetsuiga
Offline
Server: Kujata
Game: FFXI
User: Tetsuiga
Posts: 45
By Kujata.Tetsuiga 2026-06-18 12:58:51
Link | Quote | Reply
 
Thank you so very much !!! It was driving me insane trying to figure it out lol.
 Bahamut.Xismal
Offline
Server: Bahamut
Game: FFXI
User: Xismal
Posts: 1
By Bahamut.Xismal 2026-06-19 04:50:17
Link | Quote | Reply
 
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)
First Page 2 3 ... 189 190