|  | 
    Gearswap Support Thread
 
    
        
        
        
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 363 
                
			
			By Asura.Vafruvant 2015-07-27 01:50:43			
			
						
                     
                 NewEggOk then, if you have searched through the codes and found no errors and it seems XP users are the only ones having this problem then I trust your judgement. The other programs like scoreboard, azuresets, setbgm, ect don't seem to have any issue, thankfully. Aside from that GS works wonderfully well and thank you for such a great program. 
 If anywone finds a way around this issue please let me know. Someday I will upgrade but I hear windows 8 isn't that good compared to 7 and 7 is hard to find. Thank you!
 offers all versions of Windows 7 at normal retail price.                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 363 
                
			
			By Asura.Vafruvant 2015-07-27 02:16:26			
			
						
                     
                 I tested this, it works for all steps, in and out of menu (pretarget only works for macros/typed in commands, but precast will work for everything) Code  function job_precast(spell, action, spellMap, eventArgs)
    local allRecasts = windower.ffxi.get_ability_recasts()
    local prestoCooldown = allRecasts[236]
    local FinishingMoves
    if buffactive['Finishing Move 1'] then
        FinishingMoves = 1
    elseif buffactive['Finishing Move 2'] then
        FinishingMoves = 2
    elseif buffactive['Finishing Move 3'] then
        FinishingMoves = 3
    elseif buffactive['Finishing Move 4'] then
        FinishingMoves = 4
    elseif buffactive['Finishing Move 5'] then
        FinishingMoves = 5
    elseif buffactive['Finishing Move 6'] then
        FinishingMoves = 6
    elseif buffactive['Finishing Move 7'] then
        FinishingMoves = 7
    else
        FinishingMoves = 0
    end
 
    if spell.english == "Climactic Flourish" and FinishingMoves < 1 then
        send_command('input /ja "Box Step" <t>;wait 3;input /ja "Climactic Flourish" <me>')
        eventArgs.cancel = true
    end
 
    if spell.type == 'Step' then
        if player.main_job_level >= 77 and prestoCooldown < 1 and not buffactive.Presto and FinishingMoves < 5 then
            send_command('input /ja "Presto" <me>;wait 1.1;input /ja '..spell.english..' <t>')
            eventArgs.cancel = true
        end
    end
end
I know you're MIA for a bit, so no rush, or maybe it's a simple fix someone else can see.
 
I'm getting: 
>> /ja "Box Step" <t> 
'...A command error occured' 
from the FFXI side of things, not in the windower log. 
And because of that, the command isn't being executed.
 
I'll try to Step, presto will activate, but the step won't occur.  I figured it was a timing issue here: 
send_command('input /ja "Presto" <me>;wait 1.1;input /ja '..spell.english..' <t>') 
so I tried changing the wait to fractions all the way up to 3 and still no luck, so I assume it's something else?
 
Also tried breaking the commands into separate parts just in case: 
send_command('input /ja "Presto" <me>') 
cast_delay(1.1) or send_command(wait 2) 
send_command('input /ja '..spell.english..' <t>')
 
but again, no luck. 
Not really a big issue, as my original script works, via macro's, but as you mentioned, not from the menus.
 
HUMP DAY!There must still be a conflict in your file somewhere, a doubled function or something. I just re-tested the function and took these screens:
 
Climactic Flourish Start: Climactic Flourish Finish: Then:
 
Box Step Start: Box Step Finish: 
                    [+]
                                              
            
                
                     Carbuncle.Akivatoo
                                                    
                                                                            
                                Server: Carbuncle Game: FFXI Posts: 263 
                
			
			By Carbuncle.Akivatoo 2015-07-27 08:04:37			
			
						
                     
                 can you say me why this din't work ? (even simple thing are pain to code for me ;_;) Code   function
 		if options.HybridDefenseModes = 'Reraise'
		then           
          equip(sets.reraise)
          disable('Head','Body')
		  elseif  options.HybridDefenseModes = 'none'
		  enable('Head','Body')
end
"options.HybridDefenseModes = {'None', 'Charm', 'Reraise'}" 
i cycle it with Alt+F11 and i wanna lock body+head when i'm on"reraise" and unlock when i'm on "none" and "charm" option                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 363 
                
			
			By Asura.Vafruvant 2015-07-27 22:27:39			
			
						
                     
                 Carbuncle.Akivatoo said: »can you say me why this din't work ? (even simple thing are pain to code for me ;_;) Code   function
 		if options.HybridDefenseModes = 'Reraise'
		then           
          equip(sets.reraise)
          disable('Head','Body')
		  elseif  options.HybridDefenseModes = 'none'
		  enable('Head','Body')
end
"options.HybridDefenseModes = {'None', 'Charm', 'Reraise'}" 
i cycle it with Alt+F11 and i wanna lock body+head when i'm on"reraise" and unlock when i'm on "none" and "charm" optionWhen you make a function, it must always have a name. If it is a function you are making from scratch, it can have any name you want. For example, if you wanted to make a function to analyze what steps you were using, you could name it step_check. The name will always have a closed set of parentheses after it. Inside the parentheses will be the variables used in the function, i.e. spells (magic or JA) and their actions would say (spell, action). In the case of Mote(Kinematics)-based files, you would also need spellMap and eventArgs, making it look like this: (spell, action, spellMap, eventArgs).
 
In this case, what you need is a job_state_change(stateField, newValue, oldValue). This will look at the event state_change (when you toggle or cycle one of your F-key states) and execute the command. You will need a function like this: Code  function job_state_change(stateField, newValue, oldValue)
	if stateField == 'HybridDefenseMode' then
		if newValue == 'Reraise' then
			equip(sets.reraise)
			disable('head','body')
		else
			enable('head','body')
			handle_equipping_gear(player.status)
		end
	end
endI haven't personally tested this, but it should work for what you need.                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 415 
                
			
			By Asura.Cambion 2015-07-28 00:47:53			
			
						
                     
                 There must still be a conflict in your file somewhere, a doubled function or something. I just re-tested the function and took these screens:
I assume this means I can't have more than 1: function job_post_precast(spell, action, spellMap, eventArgs)?
 
I currently have 4, lol.  So I suppose I need to combine them all?
 Code  -- Don't use Moonshade if TP is over 2750. (Tati or Jupiter Pearl)
function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.type == 'WeaponSkill' then
        if player.tp > 2750 then
        equip({ear2 = "Tati Earring"})
        end
    end
end
-- Custom Gear for Rudra's Storm when Climactic Flourish is active.
function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.type == 'WeaponSkill' then
            if spell.english == "Rudra's Storm" and buffactive['Climactic Flourish'] then
            equip({body="Enforcer's Harness"})
            end
    end
end
-- Vafruvant's that works for all ways of activation, JA and list, but fail step?
function job_precast(spell, action, spellMap, eventArgs)
    local allRecasts = windower.ffxi.get_ability_recasts()
    local prestoCooldown = allRecasts[236]
    local FinishingMoves
    if buffactive['Finishing Move 1'] then
        FinishingMoves = 1
    elseif buffactive['Finishing Move 2'] then
        FinishingMoves = 2
    elseif buffactive['Finishing Move 3'] then
        FinishingMoves = 3
    elseif buffactive['Finishing Move 4'] then
        FinishingMoves = 4
    elseif buffactive['Finishing Move 5'] then
        FinishingMoves = 5
    elseif buffactive['Finishing Move 6'] then
        FinishingMoves = 6
    elseif buffactive['Finishing Move 7'] then
        FinishingMoves = 7
    else
        FinishingMoves = 0
    end
 
    if spell.english == "Climactic Flourish" and FinishingMoves < 1 then
        send_command('input /ja "Box Step" <t>;wait 3;input /ja "Climactic Flourish" <me>')
        eventArgs.cancel = true
    end
 
    if spell.type == 'Step' then
        if player.main_job_level >= 77 and prestoCooldown < 1 and not buffactive.Presto and FinishingMoves < 5 then
            send_command('input /ja "Presto" <me>;wait 1.1;input /ja '..spell.english..' <t>')
            eventArgs.cancel = true
        end
    end
end
-- Job-specific hooks for standard casting events.
function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.type == "WeaponSkill" then
        if state.Buff['Climactic Flourish'] then
            equip(sets.buff['Climactic Flourish'])
        end
        if state.SkillchainPending.value == true then
            equip(sets.precast.Skillchain)
        end
    end
end 
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 363 
                
			
			By Asura.Vafruvant 2015-07-28 01:15:09			
			
						
                     
                 I assume this means I can't have more than 1: function job_post_precast(spell, action, spellMap, eventArgs)?
 I currently have 4, lol. So I suppose I need to combine them all?
Exactly. 
                    [+]
                                              
            
                
                     Carbuncle.Akivatoo
                                                    
                                                                            
                                Server: Carbuncle Game: FFXI Posts: 263 
                
			
			By Carbuncle.Akivatoo 2015-07-28 04:24:45			
			
						
                     
                 Code  function job_state_change(field, new_value, old_value)
    if field == 'HybridDefenseMode' then
        classes.CustomDefenseGroups:clear()
        classes.CustomDefenseGroups:append(new_value)
		    if stateField == 'Reraise' then
        if newValue == 'Reraise' then
            equip(sets.reraise)
            disable('head','body')
        else
            enable('head','body')
            handle_equipping_gear(player.status)
        end
    end
    end
endthis fonction seem's good, no crash on GS launch but the lock fonction didn't work                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 363 
                
			
			By Asura.Vafruvant 2015-07-28 12:36:46			
			
						
                     
                 Carbuncle.Akivatoo said: »Code  function job_state_change(field, new_value, old_value)
    if field == 'HybridDefenseMode' then
        classes.CustomDefenseGroups:clear()
        classes.CustomDefenseGroups:append(new_value)
		    if stateField == 'Reraise' then
        if newValue == 'Reraise' then
            equip(sets.reraise)
            disable('head','body')
        else
            enable('head','body')
            handle_equipping_gear(player.status)
        end
    end
    end
endthis fonction seem's good, no crash on GS launch but the lock fonction didn't workIt should work if you delete lines 4 and 13, them change line 6 to new_value instead of newValue.                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 415 
                
			
			By Asura.Cambion 2015-07-28 18:32:12			
			
						
                     
                 
Still no luck. :(
 
Wait... I just stumbled upon something. 
You listed the command as: function job_precast (spell, action, spellMap, eventArgs)
 
but referred to combining the others which are: 
function job_post_precast (spell, action, spellMap, eventArgs)
 
Probably my fault for listing them as the same function. 
Even when deleting all of my 'job_post_precast' functions yours still gives me the step error. 
I tried changing your script to job_post_precast in case it was just a mistake, and got the same error.
 
I cut it back into 2 pieces, splitting the post_precast and the job_precast, and that will execute the step, but will not execute presto prior.
 
For now, I've gone back to my original creation, which... is flawed, but works.  Here's my entire .lua if it helps you, because obviously I've done messed up, I cleared all of my gearsets, so it's easier on the eyes. Code  -- Initialization function for this job file.
function get_sets()
    mote_include_version = 2
    
    -- Load and initialize the include file.
    include('Mote-Include.lua')
end
-- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
function job_setup()
    state.Buff['Climactic Flourish'] = buffactive['Climactic Flourish'] or false
    state.CurrentStep = M{['description']='Current Step', 'Main', 'Alt'}
    state.SkillchainPending = M(false, 'Skillchain Pending')
    determine_haste_group()
end
-- Setup vars that are user-dependent.
function user_setup()
    state.OffenseMode:options('Normal', 'PDT', 'PDTH', 'Acc', 'Exp')
-- Additional local binds
    send_command('bind ^` input /ja "Chocobo Jig II" <me>')
    send_command('bind !` input /ja "Spectral Jig" <me>')
    select_default_macro_book()
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
    send_command('unbind ^`')
    send_command('unbind !`')
end
function init_gear_sets() 
-------Deleted for ease of eyes
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.type == "WeaponSkill" then
        if state.Buff['Climactic Flourish'] then
            equip(sets.buff['Climactic Flourish'])
        end
        if state.SkillchainPending.value == true then
            equip(sets.precast.Skillchain)
        end
    end
end
-- If you attempt to use Climactic Flourish, but have no finishing moves, this will automatically use Box Step and then immediately use Climactic Flourish afterwards.
-- If you attempt to step, this will automatically apply Presto if you are under 5 Finishing moves.  If you don't have the Job Points for 7 steps, this will need to be altered to maximize for 5 step cap.
function job_pretarget(spell, action, spellMap, eventArgs)
	local under1FMs = not buffactive['Finishing Move 1'] and not buffactive['Finishing Move 2'] and not buffactive['Finishing Move 3'] and not buffactive['Finishing Move 4'] and not buffactive['Finishing Move 5'] and not buffactive['Finishing Move 6'] and not buffactive['Finishing Move 7']
	if spell.english == "Climactic Flourish" and under1FMs then
			cast_delay(1.9)
			send_command('input /ja "Box Step" <t>')
	end
	if spell.type == 'Step' then
		local allRecasts = windower.ffxi.get_ability_recasts()
		local prestoCooldown = allRecasts[236]
		local under5FMs = not buffactive['Finishing Move 5'] and not buffactive['Finishing Move 6'] and not buffactive['Finishing Move 7']
		
		if player.main_job_level >= 77 and prestoCooldown < 1 and under5FMs then
			cast_delay(1.1)
			send_command('input /ja "Presto" <me>')
		end
	end
end
-- Don't use Moonshade if TP is over 2750. (Needs to be Tati or Jupiter Pearl)
function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.type == 'WeaponSkill' then
        if player.tp > 2750 then
        equip({ear2 = "Tati Earring"})
        end
    end
-- Custom Gear for Rudra's Storm when Climactic Flourish is active.
    if spell.type == 'WeaponSkill' then
            if spell.english == "Rudra's Storm" and buffactive['Climactic Flourish'] then
            equip({body="Enforcer's Harness"})
            end
    end
end
-- I think this applies skillchain gear(Maculele Bangles +1), if Wild Flourish successfully lands. --But doesn't work currently
function job_aftercast(spell, action, spellMap, eventArgs)
    if not spell.interrupted then
        if spell.english == "Wild Flourish" then
            state.SkillchainPending:set()
            send_command('wait 5;gs c unset SkillchainPending')
        elseif spell.type:lower() == "weaponskill" then
            state.SkillchainPending:toggle()
            send_command('wait 6;gs c unset SkillchainPending')
        end
    end
end
-- Called when a player gains or loses a buff.
function job_buff_change(buff,gain)
    if S{'haste','march','embrava','haste samba'}:contains(buff:lower()) then
        determine_haste_group()
        handle_equipping_gear(player.status)
    elseif buff == 'Saber Dance' then
        if gain then
            equip(sets.buff['Saber Dance'])
            disable('legs')
        else
            enable('legs')
            handle_equipping_gear(player.status)
        end
    elseif buff == 'Climactic Flourish' then
        if gain then
            equip(sets.buff['Climactic Flourish'])
            disable('head')
        else
            enable('head')
            handle_equipping_gear(player.status)
        end
    end
end
-- If you engage a mob, it'll check your current amount of haste buffs and equip your corresponding engaged set.
function job_status_change(new_status, old_status)
    if new_status == 'Engaged' then
        determine_haste_group()
    end
end
-- Checks your level of haste after each action you take.
function job_update(cmdParams, eventArgs)
    determine_haste_group()
end
-- If your HP is less than 80% this will trigger your Extra Regen Idle set.
function customize_idle_set(idleSet)
    if player.hpp < 80 and not areas.Cities:contains(world.area) then
        idleSet = set_combine(idleSet, sets.ExtraRegen)
    end
    
    return idleSet
end
function customize_melee_set(meleeSet)
    if state.DefenseMode.value ~= 'None' then
        if buffactive['Saber Dance'] then
            meleeSet = set_combine(meleeSet, sets.buff['Saber Dance'])
        end
        if state.Buff['Climactic Flourish'] then
            meleeSet = set_combine(meleeSet, sets.buff['Climactic Flourish'])
        end
    end
    
    return meleeSet
end
-- Step Switcher... deleting spams my chat log.
function job_self_command(cmdParams, eventArgs)
    if cmdParams[1] == 'step' then
        if cmdParams[2] == 't' then
            state.IgnoreTargetting:set()
        end
        local doStep = ''
        if state.UseAltStep.value == true then
            doStep = state[state.CurrentStep.current..'Step'].current
            state.CurrentStep:cycle()
        else
            doStep = state.MainStep.current
        end        
        
        send_command('@input /ja "'..doStep..'" <t>')
    end
end
-- This is used to define Haste Tiers
function determine_haste_group()
    -- High haste buffs:
    -- 2x Marches + Haste
    -- 2x Marches + Haste Samba
    -- 1x March + Haste + Haste Samba
    -- Embrava + any other haste buff
    
    -- Max haste buffs:
    -- Embrava + Haste/March + Haste Samba
    -- 2x March + Haste + Haste Samba
    classes.CustomMeleeGroups:clear()
    
    if buffactive.embrava and (buffactive.haste or buffactive.march) and buffactive['haste samba'] then
        classes.CustomMeleeGroups:append('MaxHaste')
    elseif buffactive.march == 2 and buffactive.haste and buffactive['haste samba'] then
        classes.CustomMeleeGroups:append('MaxHaste')
    elseif buffactive.embrava and (buffactive.haste or buffactive.march or buffactive['haste samba']) then
        classes.CustomMeleeGroups:append('HighHaste')
    elseif buffactive.march == 1 and buffactive.haste and buffactive['haste samba'] then
        classes.CustomMeleeGroups:append('HighHaste')
    elseif buffactive.march == 2 and (buffactive.haste or buffactive['haste samba']) then
        classes.CustomMeleeGroups:append('HighHaste')
    end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    if player.sub_job == 'SAM' then
        set_macro_page(1, 5)
    elseif player.sub_job == 'WAR' then
        set_macro_page(2, 5)
	elseif player.sub_job == 'RUN' then
        set_macro_page(3, 5)	
	elseif player.sub_job == 'BLU' then
        set_macro_page(4, 5)
	elseif player.sub_job == 'THF' then
        set_macro_page(9, 5)
	elseif player.sub_job == 'NIN' then
        set_macro_page(10, 5)
    else
        set_macro_page(2, 5)
    end
end
Apologies for the pain :(                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 363 
                
			
			By Asura.Vafruvant 2015-07-28 22:34:08			
			
						
                     
                 Well, you still have two job_post_precast functions, most likely why it was still messing up. I literally copied all your code, merged the post_precasts, removed your step stuff, put mine in and even re-worked it to cover all flourishes, cancel them if you don't have finishing moves or TP to step. Tested for all steps and all flourishes. Code  -- Initialization function for this job file.
function get_sets()
    mote_include_version = 2
     
    -- Load and initialize the include file.
    include('Mote-Include.lua')
end
 
-- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
function job_setup()
    state.Buff['Climactic Flourish'] = buffactive['Climactic Flourish'] or false
    state.CurrentStep = M{['description']='Current Step', 'Main', 'Alt'}
    state.SkillchainPending = M(false, 'Skillchain Pending')
    determine_haste_group()
end
 
-- Setup vars that are user-dependent.
function user_setup()
    state.OffenseMode:options('Normal', 'PDT', 'PDTH', 'Acc', 'Exp')
 
-- Additional local binds
    send_command('bind ^` input /ja "Chocobo Jig II" <me>')
    send_command('bind !` input /ja "Spectral Jig" <me>')
 
    select_default_macro_book()
end
 
-- Called when this job file is unloaded (eg: job change)
function user_unload()
    send_command('unbind ^`')
    send_command('unbind !`')
end
 
function init_gear_sets() 
-------Deleted for ease of eyes
end
 
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function job_precast(spell, action, spellMap, eventArgs)
	step_check(spell, action, spellMap, eventArgs)
end
function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.type == "WeaponSkill" then
        if state.Buff['Climactic Flourish'] then
            equip(sets.buff['Climactic Flourish'])
        end
        if state.SkillchainPending.value == true then
            equip(sets.precast.Skillchain)
        end
		-- Don't use Moonshade if TP is over 2750. (Needs to be Tati or Jupiter Pearl)
        if player.tp > 2750 then
			equip({ear2 = "Tati Earring"})
        end
		-- Custom Gear for Rudra's Storm when Climactic Flourish is active.
        if spell.english == "Rudra's Storm" and buffactive['Climactic Flourish'] then
            equip({body="Enforcer's Harness"})
        end
    end
end
 
-- I think this applies skillchain gear(Maculele Bangles +1), if Wild Flourish successfully lands. --But doesn't work currently
function job_aftercast(spell, action, spellMap, eventArgs)
    if not spell.interrupted then
        if spell.english == "Wild Flourish" then
            state.SkillchainPending:set()
            send_command('wait 5;gs c unset SkillchainPending')
        elseif spell.type:lower() == "weaponskill" then
            state.SkillchainPending:toggle()
            send_command('wait 6;gs c unset SkillchainPending')
        end
    end
end
-- If you attempt to use Climactic Flourish, but have no finishing moves, this will automatically use Box Step and then immediately use Climactic Flourish afterwards.
-- If you attempt to step, this will automatically apply Presto if you are under 5 Finishing moves.  If you don't have the Job Points for 7 steps, this will need to be altered to maximize for 5 step cap.
function step_check(spell, action, spellMap, eventArgs)
	local allRecasts = windower.ffxi.get_ability_recasts()
	local prestoCooldown = allRecasts[236]
	local FinishingMoves = buffactive['Finishing Move 1'] and 1
						or buffactive['Finishing Move 2'] and 2
						or buffactive['Finishing Move 3'] and 3
						or buffactive['Finishing Move 4'] and 4
						or buffactive['Finishing Move 5'] and 5
						or buffactive['Finishing Move 6'] and 6
						or buffactive['Finishing Move 7'] and 7
														   or 0
	if spell.english:endswith('Flourish') and FinishingMoves < 1 then
		if player.tp >= 100 or buffactive['Grand Pas'] then
			send_command('input /ja "Box Step" <t>;wait 3;input /ja '..spell.english..' '..spell.target.raw..'')
			eventArgs.cancel = true
		else
			add_to_chat(122,'***No Finishing Moves available to execute '..spell.english..' and not enough TP to produce any. Cancelling flourish.***')
			eventArgs.cancel = true
		end
	end
	if spell.english:endswith('Step') or spell.english == 'Quickstep' then
		if player.main_job_level >= 77 and player.main_job == 'DNC' and prestoCooldown < 1 and not buffactive.Presto and FinishingMoves < 5 then
			if player.tp >= 100 or buffactive['Trance'] then
				send_command('input /ja "Presto" <me>;wait 1.1;input /ja '..spell.english..' <t>')
				eventArgs.cancel = true
			else
				add_to_chat(122,'***Not enough TP available to execute '..spell.english..'. Cancelling step.***')
				eventArgs.cancel = true
			end
		end
	end
end
 
-- Called when a player gains or loses a buff.
function job_buff_change(buff,gain)
    if S{'haste','march','embrava','haste samba'}:contains(buff:lower()) then
        determine_haste_group()
        handle_equipping_gear(player.status)
    elseif buff == 'Saber Dance' then
        if gain then
            equip(sets.buff['Saber Dance'])
            disable('legs')
        else
            enable('legs')
            handle_equipping_gear(player.status)
        end
    elseif buff == 'Climactic Flourish' then
        if gain then
            equip(sets.buff['Climactic Flourish'])
            disable('head')
        else
            enable('head')
            handle_equipping_gear(player.status)
        end
    end
end
 
-- If you engage a mob, it'll check your current amount of haste buffs and equip your corresponding engaged set.
function job_status_change(new_status, old_status)
    if new_status == 'Engaged' then
        determine_haste_group()
    end
end
 
-- Checks your level of haste after each action you take.
function job_update(cmdParams, eventArgs)
    determine_haste_group()
end
 
-- If your HP is less than 80% this will trigger your Extra Regen Idle set.
function customize_idle_set(idleSet)
    if player.hpp < 80 and not areas.Cities:contains(world.area) then
        idleSet = set_combine(idleSet, sets.ExtraRegen)
    end
     
    return idleSet
end
 
function customize_melee_set(meleeSet)
    if state.DefenseMode.value ~= 'None' then
        if buffactive['Saber Dance'] then
            meleeSet = set_combine(meleeSet, sets.buff['Saber Dance'])
        end
        if state.Buff['Climactic Flourish'] then
            meleeSet = set_combine(meleeSet, sets.buff['Climactic Flourish'])
        end
    end
     
    return meleeSet
end
 
-- Step Switcher... deleting spams my chat log.
function job_self_command(cmdParams, eventArgs)
    if cmdParams[1] == 'step' then
        if cmdParams[2] == 't' then
            state.IgnoreTargetting:set()
        end
 
        local doStep = ''
        if state.UseAltStep.value == true then
            doStep = state[state.CurrentStep.current..'Step'].current
            state.CurrentStep:cycle()
        else
            doStep = state.MainStep.current
        end        
         
        send_command('@input /ja "'..doStep..'" <t>')
    end
end
 
-- This is used to define Haste Tiers
function determine_haste_group()
    -- High haste buffs:
    -- 2x Marches + Haste
    -- 2x Marches + Haste Samba
    -- 1x March + Haste + Haste Samba
    -- Embrava + any other haste buff
     
    -- Max haste buffs:
    -- Embrava + Haste/March + Haste Samba
    -- 2x March + Haste + Haste Samba
 
    classes.CustomMeleeGroups:clear()
     
    if buffactive.embrava and (buffactive.haste or buffactive.march) and buffactive['haste samba'] then
        classes.CustomMeleeGroups:append('MaxHaste')
    elseif buffactive.march == 2 and buffactive.haste and buffactive['haste samba'] then
        classes.CustomMeleeGroups:append('MaxHaste')
    elseif buffactive.embrava and (buffactive.haste or buffactive.march or buffactive['haste samba']) then
        classes.CustomMeleeGroups:append('HighHaste')
    elseif buffactive.march == 1 and buffactive.haste and buffactive['haste samba'] then
        classes.CustomMeleeGroups:append('HighHaste')
    elseif buffactive.march == 2 and (buffactive.haste or buffactive['haste samba']) then
        classes.CustomMeleeGroups:append('HighHaste')
    end
end
 
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
    if player.sub_job == 'SAM' then
        set_macro_page(1, 5)
    elseif player.sub_job == 'WAR' then
        set_macro_page(2, 5)
    elseif player.sub_job == 'RUN' then
        set_macro_page(3, 5)    
    elseif player.sub_job == 'BLU' then
        set_macro_page(4, 5)
    elseif player.sub_job == 'THF' then
        set_macro_page(9, 5)
    elseif player.sub_job == 'NIN' then
        set_macro_page(10, 5)
    else
        set_macro_page(2, 5)
    end
end 
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 415 
                
			
			By Asura.Cambion 2015-07-28 23:37:18			
			
						
                     
                 Well, you still have two job_post_precast functions, most likely why it was still messing up. I literally copied all your code, merged the post_precasts, removed your step stuff, put mine in and even re-worked it to cover all flourishes, cancel them if you don't have finishing moves or TP to step. Tested for all steps and all flourishes.
Right, but that one works, even with the 2. (Although I'll fix it regardless)
 
Just loaded yours exactly as you posted, and doesn't work for me. 
Same issue with climactic
 
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 363 
                
			
			By Asura.Vafruvant 2015-07-28 23:39:57			
			
						
                     
                 Just loaded yours exactly as you posted, and doesn't work for me.I literally have no idea. Do you use a personal globals file? There must be something else conflicting. There's no reason it works flawlessly on mine and not yours :(                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Siren Game: FFXI Posts: 116 
                
			
			By Siren.Blackroses 2015-08-05 00:13:48			
			
						
                     
                 Hello, 
I'm using Motenten SMN Gearswap, and I need explanations over two function in the gearswap in question :
 Code  -- Base duration for ward pacts.
    wards.durations = {
        ['Crimson Howl'] = 60, ['Earthen Armor'] = 60, ['Inferno Howl'] = 60, ['Heavenward Howl'] = 60,
        ['Rolling Thunder'] = 120, ['Fleet Wind'] = 120,
        ['Shining Ruby'] = 180, ['Frost Armor'] = 180, ['Lightning Armor'] = 180, ['Ecliptic Growl'] = 180,
        ['Glittering Ruby'] = 180, ['Hastega'] = 180, ['Noctoshield'] = 180, ['Ecliptic Howl'] = 180,
        ['Dream Shroud'] = 180,
        ['Reraise II'] = 3600
    }
    -- Icons to use when creating the custom timer.
    wards.icons = {
        ['Earthen Armor']   = 'spells/00299.png', -- 00299 for Titan
        ['Shining Ruby']    = 'spells/00043.png', -- 00043 for Protect
        ['Dream Shroud']    = 'spells/00304.png', -- 00304 for Diabolos
        ['Noctoshield']     = 'spells/00106.png', -- 00106 for Phalanx
        ['Inferno Howl']    = 'spells/00298.png', -- 00298 for Ifrit
        ['Hastega']         = 'spells/00358.png', -- 00358 for Hastega
        ['Rolling Thunder'] = 'spells/00104.png', -- 00358 for Enthunder
        ['Frost Armor']     = 'spells/00250.png', -- 00250 for Ice Spikes
        ['Lightning Armor'] = 'spells/00251.png', -- 00251 for Shock Spikes
        ['Reraise II']      = 'spells/00135.png', -- 00135 for Reraise
        ['Fleet Wind']      = 'abilities/00074.png', -- 
First of all, it dosnt seem to pickup the defined timers for the bloodpacts, and secondly, I was wondering if there are any other files or addons I need to use those custpm icons for bloodpacts.
 
Thanks!                                     
            
            
                
			
			By zaxtiss 2015-08-05 09:24:53			
			
						
                     
                 hey im trying to findout how to add my own self commands to my dnc GS its motes stuff so i know its something different                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 363 
                
			
			By Asura.Vafruvant 2015-08-07 09:43:51			
			
						
                     
                 hey im trying to findout how to add my own self commands to my dnc GS its motes stuff so i know its something differentIt depends on what your command is and when you want it to happen. If you want it to be something that happens after you cast a spell or use a JA, it needs to go in your job_aftercast. The actual text is:  Code  send_command('whatyouwant')whatyouwant will be just like you typed it in the console window.                                     
            
                
                     Bahamut.Khelek
                                                    
                                                                            
                                Server: Bahamut Game: FFXI Posts: 11 
                
			
			By Bahamut.Khelek 2015-08-12 11:28:56			
			
						
                     
                 I've found that gearswap stops me from doing anything for 10 seconds after macro trading a key in abyssea. I assume there is some sort of universal setting somewhere I can change for when you use an item, but I can't seem to find it, nor any info on it. Anyone know how to change this?                                     
            
                
                     Phoenix.Crumbs
                                                    
                                                                            
                                Server: Phoenix Game: FFXI Posts: 2 
                
			
			By Phoenix.Crumbs 2015-08-12 13:12:21			
			
						
                     
                 I've just grabbed Bokura's BST file . I haven't made any changes to the file whatsoever, but I'm getting errors that I have no idea how to fix. 
 
upon loading the file I immediately get: 
Error in the user function get_sets: attempt to call field 'Regen' (a table value)
 
any time I try to toggle through an array: 
Error in the user function self_command: attempt to index field 'JA' (a nil value).
 
I use pretty much all of Bokura's other files (which all have identical arrays) and haven't had any issues like this. If someone could take a look, or tell me how to debug and find the problem, I'd really appreciate it!
 
EDIT: figured it out -- author hadn't put commas after calling a set in his set_combines.                                     
            
                
                     Asura.Rinuko
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 144 
                
			
			By Asura.Rinuko 2015-08-16 08:54:22			
			
						
                     
                 Just finished level dnc to 99 and setup Mote's DNC lua.  
However it seeems be a problem with using Curing Waltz V for some reason.
http://pastebin.com/fu5kcjSz 
I tried to adjust/add it in mote-utility but no change                                     
            
                
                     Cerberus.Keeo
                                                    
                                                                            
                                Server: Cerberus Game: FFXI Posts: 118 
                
			
			By Cerberus.Keeo 2015-08-17 06:40:42			
			
						
                     
                 Hi guys returned to the game 2-3 weeks ago. when I left I was still using spellcast but I have seen that has been replaced with gearswap. I have no experience with lua but when I first started my spellcaste xml's I had no idea what I as doing and slowly build up a general understanding. 
I used to have a section on my spellcast that would allow a gambit type system to check my main characters stats and then using send get my whm mule to cast the relevant spell.
 
this was a section of my old spellcast xml.
 Code xml <var name="Gambit">0</var>
<!--=========================================================================
			Gambit style rules for whm mule using send addon.
			
		=============================================================================-->		
                 
	<if advanced='"$Gambit" == "1"'>
	  
		<if buffactive = "curse|Bane">
		<action type="command" when="precast">send @WHM /ma 'Cursna' PLAYERNAME</action>
		</if>
		
		<elseif buffactive = "doom">
        <action type="command" when="precast">send @WHM /ma 'Cursna' PLAYERNAME</action>
		</elseif>
		
		<elseif buffactive = "sleep">
        <action type="command" when="precast">send @WHM /ma 'Cure' PLAYERNAME</action>
		</elseif>
		
		<elseif HPPLT  = "60">
        <action type="command" when="precast">send @WHM /ma 'Cure VI' PLAYERNAME</action>
		</elseif> 
</if>
I used to be able to toggle it on and off as required.
 
how would I go about doing something like this with garswap
 
this is the sort of thing I was thinking but not sure if it will work, also not sure on toggles
 Code  function status_change (new,old)
		if buffactive ['paralyze'] then
		send_command('send @whm /ma "Paralyna" PLAYERNAME')
			
		if player.hpp < 90 then
        send_command('send @whm /ma "cure III" PLAYERNAME')
    
	end 
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Cerberus Game: FFXI Posts: 148 
                
			
			By Cerberus.Flaminglegion 2015-08-17 09:16:02			
			
						
                     
                 wb Keeo! 
status_change triggers on player status change as in Idle, Engaged, Resting, Dead, Zoning 
It works in Bokura's gs luas  because the status_change function is used to update your current gearset and it gets called in other places (when toggles are used, etc.) gain buffCode  
	if not midaction() then
		status_change(player.status)
	end might be what you want to use, but this will only trigger when you gain or lose a buff so there will be times it won't work or might clash with other things your mule is doing.
 Code  
function buff_change(buff,gain)
	buff = string.lower(buff)
	if buff == "paralyze" then -- paralyna --
		if gain then
			send_command('send mule Paralyna Keeo')
		end
	elseif buff == 'silence' then -- silence --
		if gain then
			send_command('send mule Silena Keeo')
	end
end
(modified from bokura's luas)
 
if you put your command to cure in there too then you'll only be curing if you had a change in buffs
 
if you wanted to write a function that works like your spellcast, you can make it without hooking onto an action then call it whenever you want it to run (manually, some loop or whenever you swing your weapon, etc.)
Player vitals Code  
function checkhp()
    if player.vitals.hpp < 60 then
		send_command('send mule C4 Keeo')
	elseif buffactive["Paralyze"] then
		send_command('send mule Paralyna Keeo')
	end
end
function self_command(command)
	if command == 'mulechecks' then
		checkhp()
	end
end
activate by typing //gs c mulechecks
 
If you're writing it as a standalone addon outside of GS you'll probably need 
    local player = windower.ffxi.get_player() 
after function checkhp()
 
If you look at Bokura's scripts you can see other self commands for examples of toggles in gs                                     
            
                
                     Carbuncle.Bukadan
                                                    
                                                                            
                                Server: Carbuncle Game: FFXI Posts: 280 
                
			
			By Carbuncle.Bukadan 2015-08-17 09:55:46			
			
						
                     
                 if those debuffs hit more than one player youll find yourself in the middle of casting it on someone when you needed to cast curaga or to paralyna a specific person (say someone is self skillchaining, got para'd when you were paralynaing someone else, wont get next chain off in time) also if youre casting something and someone gets para'd it might attempt to change the gear over? automating things like that isnt the best idea if you plan on getting into good habits. the difference between someone with good habits and someone with bad habits (waiting to be asked for hastes/refreshes/cures/buffs/na's) is night and day.                                     
            
                
                     Cerberus.Keeo
                                                    
                                                                            
                                Server: Cerberus Game: FFXI Posts: 118 
                
			
			By Cerberus.Keeo 2015-08-17 10:03:36			
			
						
                     
                 Thankyou
 I will test some of this out and see what I can get it to do. so unlike Spellcast, Gearswap does not cycle through the whole script each time you use an action? just the "function" you are doing?
 
 It may be better for me to try to use Autoexec for this function.
 
 this is not something I plan to use in group situations, that's why I would like to be able to toggle it on and off it just makes it super easy when farming jobpoint and such
 
            
                
                     Asura.Rinuko
                                                    
                                                                            
                                Server: Asura Game: FFXI Posts: 144 
                
			
			By Asura.Rinuko 2015-08-18 01:03:46			
			
						
                     
                 Just finished level dnc to 99 and setup Mote's DNC lua.  
However it seeems be a problem with using Curing Waltz V for some reason.
http://pastebin.com/fu5kcjSz 
I tried to adjust/add it in mote-utility but no changeHope someone knows a fix for this                                     
            
                
                     Carbuncle.ElvaanmoqGuildwork Premium 
                                                    
                                                                            
                                Server: Carbuncle Game: FFXI Posts: 243 
                
			
			By Carbuncle.Elvaanmoq 2015-08-18 05:30:53			
			
						
                     
                 Hi! 
I must confess that even since Spellcast was deprecated, I moved to Gearswap but never got the time to really look at it. I just used Mote's templates (along with his includes, of course) for the 3 jobs I decided to keep geared and just filled up my gear in there without looking at it much.
 
Now I want to do something that does not *seem* to be included at least on the example PLD.lua: I want to put some gear with cure spellcast time - / fast cast in the precast and then cure potency + / cure potency received + on the midcast, but the only reference to cure I find in the template is this section:
 Quote:  sets.midcast.Cure = {ammo="Impatiens",head="Adaman Barbuta",neck="Phalaina Locket",ear1="Hospitaler Earring",ear2="Cryptic Earring",
 body="Jumalik Mail",hands="Leyline Gloves",ring1="Kunaji Ring",ring2="Janniston Ring",
 back="Weard Mantle",waist="Chuq'aba Belt",legs="Founder's Hose",feet="Caballarius Leggings"}
I see there is some reference to precast fastcast earlier in the file:
 Quote:  sets.precast.FC = {ammo="Incantor Stone",head="Cizin Helm",ear1="Etiolation Earring",ear2="Loquacious Earring",hands="Leyline Gloves",ring2="Prolix Ring",legs="Enif Cosciales"}
 
 sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
But the sets.precast.FC should apply to all spells, not just Cure*
 
So, how do I make or where do I put the specific Cure* precast in the file?
 
Apologies in advance for the very basic question! I swear I had a good understanding of XML but I haven't had the time to learn anything about LUA.
 
Thanks!                                     
            
                
                     Cerberus.Tidis
                                                    
                                                                            
                                Server: Cerberus Game: FFXI Posts: 3927 
                
			
			By Cerberus.Tidis 2015-08-18 05:52:51			
			
						
                     
                 Very simple actually, you just need to have something like: Code  sets.precast.Cure{GEAR GOES HERE}
That's all it takes really.                                     
            
                
                     Carbuncle.ElvaanmoqGuildwork Premium 
                                                    
                                                                            
                                Server: Carbuncle Game: FFXI Posts: 243 
                
			
			By Carbuncle.Elvaanmoq 2015-08-18 06:20:33			
			
						
                     
                 Very simple actually, you just need to have something like: Code  sets.precast.Cure{GEAR GOES HERE}
That's all it takes really.
Ha! I imagined it was something simple, but found strange that Mote's template didn't have a sets.precast.Cure predefined.
 
Anyway, will try this later today, thanks a bunch! (and sorry for the simple questions :S).                                     
            
                
                     Carbuncle.ElvaanmoqGuildwork Premium 
                                                    
                                                                            
                                Server: Carbuncle Game: FFXI Posts: 243 
                
			
			By Carbuncle.Elvaanmoq 2015-08-18 11:23:06			
			
						
                     
                 Very simple actually, you just need to have something like: Code  sets.precast.Cure{GEAR GOES HERE}
That's all it takes really.
I think I may be doing something wrong.
 
I added this:
 Quote:  sets.precast.Cure = set_combine(sets.precast.FC, {body="Jumalik Mail"})
And after reloading went out of town and casted several cure 4 on myself, never I saw any of the precast.FC gear (or jumalik mail) to be equiped even for a split moment, always the sets.midcast.Cure.
 
So, either the equip gets equiped/switched for faster than the human eye can see, or there is no "precast" equip at all, what do you think?
 
Thanks!                                     
            
                
                     Ramuh.Austar
                                                    
                                                                            
                                Server: Ramuh Game: FFXI Posts: 10483 
                
			
			By Ramuh.Austar 2015-08-18 16:04:27			
			
						
                     
                 How would I make certain spells within an .lua their own category? For example if I wanted to make one set for several BLU spells with high enmity, without having to make a set for each individual spell, could I?
 I was thinking like
 enmity_spells = {['Flash', 'Actinic Burst', 'Temporal Shift']} or something.
 
            
                
                     Cerberus.Tidis
                                                    
                                                                            
                                Server: Cerberus Game: FFXI Posts: 3927 
                
			
			By Cerberus.Tidis 2015-08-18 16:10:30			
			
						
                     
                 Carbuncle.Elvaanmoq said: »Very simple actually, you just need to have something like: Code  sets.precast.Cure{GEAR GOES HERE}
That's all it takes really.
I think I may be doing something wrong.
 
I added this:
 Quote:  sets.precast.Cure = set_combine(sets.precast.FC, {body="Jumalik Mail"})
And after reloading went out of town and casted several cure 4 on myself, never I saw any of the precast.FC gear (or jumalik mail) to be equiped even for a split moment, always the sets.midcast.Cure.
 
So, either the equip gets equiped/switched for faster than the human eye can see, or there is no "precast" equip at all, what do you think?
 
Thanks!In the console type: gs showswaps
 
Now cast cure spells again and it will output what you are equipping in each phase, type gs showswaps to turn it off again.                                     
            
                
                     Carbuncle.ElvaanmoqGuildwork Premium 
                                                    
                                                                            
                                Server: Carbuncle Game: FFXI Posts: 243 
                
			
			By Carbuncle.Elvaanmoq 2015-08-19 08:27:50			
			
						
                     
                 In the console type: gs showswaps
 Now cast cure spells again and it will output what you are equipping in each phase, type gs showswaps to turn it off again.
Whoa! With this I was able to see that the precast gear defined in "sets.precast.FC" gets equipped when using a cure (it looks like the precast time is indeed faster than the human eye then, uh?) BUT for some reason, the body does not:
 Quote:  sets.precast.Cure = set_combine(sets.precast.FC, {body="Jumalik Mail"})
With this, and with showing swaps, I see that it puts all of the sets.precast.FC gear on but NOT the body, then it switches to the gear defined in sets.midcast.Cure (with the body defined in there), and at the end it switches to whatever aftercast is.
 
I also noticed that my enhancing magic precast isn't being used either!
 Quote:  sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
Siegel Sash never gets equipped when casting phalanx, but the gear defined in sets.midcast['Enhancing Magic'] does, during midcast.
 
Seems like an issue with combined sets on precast?
 
(Well, at least here I am, taking a look at LUA when I said I wouldn't take my time to learn anything about it :P).                                     
    
    
        
        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.
 |  |