|  | 
    Barebones Summoner Gearswap
 
    
        
        
        
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Bahamut Game: FFXI Posts: 879 
                
			
			By Bahamut.Seekerstar 2015-10-03 19:24:18			
			
						
                     
                 I'm using this now; I've lost my GS virginity! WAlsoll, most of it, anyway, and someone kindly helped me fix my error issues (damn commas).
 Do I need to implement that line change? I was using it, and my FC seemed to be lower in damage than normal. Of course, it could be a series of resistance.
 
 Also, if one chooses to make macros, is there an actual delay if I stack multiple BP under the same macro?
 
 Example:
 
 /pet "Holy Mist" <t>
 /pet "Heavenly Strike" <t>
 etc...
 
 If I then execute a BP lower on the list, is it slower than if I had separate macros?
 
 Also, I've noticed that I swap back into idle set after using a BP, instead of my assault set while engaged. Is there a way to fix this?
 
 Sorry for so many questions, and thank you for this resource!
 
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Siren Game: FFXI Posts: 228 
                
			
			By Siren.Noxzema 2015-10-03 20:20:56			
			
						
                     
                 1: If you're referring to the line:  Code  
if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') then
That shouldn't affect your rage BPs at all, it just tells it to check to see if it's a Rage or Ward for determining sets.
 
2: I don't go that route, but I don't believe there's a difference, other than the chatlog spam.
 
3: That's the //gs c avatar (perp, tank, melee, acc) function, I believe the default will put you into your perp set. I have keys bound to cycle between the 4 toggles, makes it alot easier than needing to make 7 more macros in game.                                             
                    [+]
                                              
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Bahamut Game: FFXI Posts: 879 
                
			
			By Bahamut.Seekerstar 2015-10-03 22:21:02			
			
						
                     
                 ...that's what I was needing, the correct commands. Thank you.                                     
            
            
                
			
			By Aeyela 2015-10-04 02:04:42			
			
						
                     
                 Running well so far, except ran into another issue. When I'm in melee mode, I noticed that it won't return to the original set that I had on.i.e it'll keep my BP rage, ws set etc on after I use it, instead of swapping back to my melee set, even after disengaging.
I'm finding it hard to replicate this. Were you using a specific pet mode at the time, or have something toggled?                                     
            
            
                
			
			By Aeyela 2015-10-04 02:08:28			
			
						
                     
                 Bahamut.Seekerstar said: »Do I need to implement that line change? I was using it, and my FC seemed to be lower in damage than normal. Of course, it could be a series of resistance.
You should use it, as your Wards won't be using the correct gear sets without it.
 Bahamut.Seekerstar said: »Also, if one chooses to make macros, is there an actual delay if I stack multiple BP under the same macro?
I can't say that there's absolutely zero delay because I don't know for sure, but it's miniscule if there is one. If you prefer, I can add a section to the Lua where you can manage Blood Pact groupings and just use the one macro to trigger them all, like how summoning a Dark Spirit works?
 Bahamut.Seekerstar said: »Also, I've noticed that I swap back into idle set after using a BP, instead of my assault set while engaged. Is there a way to fix this?
As Noxzema pointed out, you just need to toggle avatar modes, as perp is the default.
 Bahamut.Seekerstar said: »Sorry for so many questions, and thank you for this resource!
It's fine, happy to help!                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Siren Game: FFXI Posts: 228 
                
			
			By Siren.Noxzema 2015-10-04 02:11:44			
			
						
                     
                 I know that I had the melee mode toggled, and I'd assume pet melee as well.
 I'll play around with it in a few and update.
 
 Edit: Yeah, it only seems to happen when I have melee mode active, pet mode doesn't seem to affect it.
 
            
                
                     Ragnarok.Hevans
                                                    
                                                                            
                                Server: Ragnarok Game: FFXI Posts: 15273 
                
			
			By Ragnarok.Hevans 2015-10-04 02:29:23			
			
						
                     
                 whoa whoa whoa
 
 who said you could play smn? i knew i shouldn't of let you get on mnk, crawl back to whm taru!
 
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Siren Game: FFXI Posts: 228 
                
			
			By Siren.Noxzema 2015-10-04 02:40:13			
			
						
                     
                 whoa whoa whoa
 
 who said you could play smn? i knew i shouldn't of let you get on mnk, crawl back to whm taru!
Well if a certain MP sponge rng didn't server hop, I woulda had a reason to maintain my whm.                                     
            
            
                
			
			By Elizabet 2015-10-04 03:10:55			
			
						
                     
                  If you prefer, I can add a section to the Lua where you can manage Blood Pact groupings and just use the one macro to trigger them all, like how summoning a Dark Spirit works?
I did this in my version based off yours. Do you want the code / review it?                                     
            
            
                
			
			By Aeyela 2015-10-04 04:25:18			
			
						
                     
                 Edit: Yeah, it only seems to happen when I have melee mode active, pet mode doesn't seem to affect it.
If you made any changes yourself could you post your full file? I just can't replicate this with my Lua.
 I did this in my version based off yours. Do you want the code / review it?
Sure!                                     
            
            
                
			
			By Elizabet 2015-10-04 05:25:07			
			
						
                     
                 Edit: Replace the whole self_command function with this one: Code  
function self_command(command)
 
    local commandArgs = command
     
    -- This command takes //gs c avatar mode, where mode is what you want, eg, tank, acc, melee, etc
    if #commandArgs:split(' ') >= 2 then
        commandArgs = T(commandArgs:split(' '))
        if commandArgs[1] == 'avatar' then
            if commandArgs[2] then
                mode = tostring(commandArgs[2])
                equip(sets.avatar[mode])
                windower.add_to_chat(8,'----- Avatar set to '..mode..' mode! -----')
            end
        elseif commandArgs[1] == 'toggle' then
            if commandArgs[2] == 'auto' then
             
                -- //gs c toggle auto will toggle auto blood pacts on and off. Auto blood pact will make your GS repeat BPs under Apogee or Conduit
                -- And by repeat I mean repeat. If Conduit is up, it will SPAM the BP until Conduit is down
                if autobp then
                    autobp = false
                    windower.add_to_chat(8,'----- Auto BP mode Disabled -----')
                else
                    autobp = true
                    windower.add_to_chat(8,'----- Auto BP mode Enabled -----')
                end
            elseif commandArgs[2] == 'melee' then
             
                -- //gs c toggle melee will toggle melee mode on and off.
                -- This basically locks the slots that will cause you to lose TP if changing them,
                -- As well as equip your melee set if you're engaged
 
                if meleeing then
                    meleeing = false
                    enable('main','sub','ranged')
                    windower.add_to_chat(8,'----- Weapons Unlocked, WILL LOSE TP -----')
                    idle(pet)
                else
                    meleeing=true
                    disable('main','sub','ranged')
                    windower.add_to_chat(8,'----- Weapons Locked, WILL NOT LOSE TP -----')
                    idle(pet)
                end
                 
            elseif commandArgs[2] == 'favor' then
                     
                -- //gs c toggle favor will toggle Favor mode on and off.
                -- It won't automatically toggle, as some people like having favor active without the gear swaps for maximum effectiveness
                -- You need to toggle prioritisation yourself
                if favor then
                    favor = false
                    windower.add_to_chat(8,"----- Avatar's Favor Mode OFF -----")
                else
                    favor = true
                    windower.add_to_chat(8,"----- Avatar's Favor Mode ON -----")
                end
			end
        end
		-- Handles executing blood pacts in a generic, avatar-agnostic way.
		-- //gs c pact [pacttype]
		elseif commandArgs[1]:lower() == 'pact' then
			if not pet.isvalid then
					windower.add_to_chat(122,'No avatar currently available. Returning to default macro set.')
					set_macros(1,2)
				return
			end
		  
			if not commandArgs[2] then
				windower.add_to_chat(123,'No pact type given.')
				return
			end
		  
			local pact = commandArgs[2]:lower()
		  
			if not pacts[pact] then
				windower.add_to_chat(123,'Unknown pact type: '..tostring(pact))
				return
			end
		  
			if pacts[pact][pet.name] then
				if pact == 'astralflow' and not buffactive['astral flow'] then
					windower.add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
					return
				end
		  
				-- Leave out target; let Shortcuts auto-determine it.
				send_command('@input /pet "'..pacts[pact][pet.name]..'"')
			else
				windower.add_to_chat(122,pet.name..' does not have a pact of type ['..pact..'].')
			end    
		end
    end
end
And in the include file: (or at the very top of your SMN.lua if you aren't using an include file. Code  
--[[
     Put: /console gs c pact [PactType] as your macro
	 
        PactType can be one of:
            cure
            curaga
            buffOffense
            buffDefense
            buffSpecial
            debuff1
            debuff2
            sleep
            nuke2
            nuke4
            bp70
            bp75 (merits and lvl 75-80 pacts)
			bp99
            astralflow
--]]
	pacts = {}
    pacts.cure = {['Carbuncle']='Healing Ruby'}
    pacts.curaga = {['Carbuncle']='Healing Ruby II', ['Garuda']='Whispering Wind', ['Leviathan']='Spring Water'}
    pacts.buffoffense = {['Carbuncle']='Glittering Ruby', ['Ifrit']='Crimson Howl', ['Garuda']='Hastega II', ['Ramuh']='Rolling Thunder',
        ['Fenrir']='Ecliptic Growl', ['Shiva']='Crystal Blessing'}
    pacts.buffdefense = {['Carbuncle']='Shining Ruby', ['Shiva']='Frost Armor', ['Garuda']='Aerial Armor', ['Titan']='Earthen Ward',
        ['Ramuh']='Lightning Armor', ['Fenrir']='Ecliptic Howl', ['Diabolos']='Noctoshield', ['Cait Sith']='Reraise II'}
    pacts.buffspecial = {['Ifrit']=' <staff_and_grip Howl', ['Garuda']='Fleet Wind', ['Titan']='Earthen Armor', ['Diabolos']='Dream Shroud',
        ['Carbuncle']='Soothing Ruby', ['Fenrir']='Heavenward Howl', ['Cait Sith']='Raise II'}
    pacts.debuff1 = {['Shiva']='Diamond Storm', ['Ramuh']='Shock Squall', ['Leviathan']='Tidal Roar', ['Fenrir']='Lunar Cry',
        ['Diabolos']='Pavor Nocturnus', ['Cait Sith']='Eerie Eye'}
    pacts.debuff2 = {['Shiva']='Sleepga', ['Leviathan']='Slowga', ['Fenrir']='Lunar Roar', ['Diabolos']='Somnolence', ['Ramuh']='Thunderspark'}
    pacts.sleep = {['Shiva']='Sleepga', ['Diabolos']='Nightmare', ['Cait Sith']='Mewing Lullaby'}
    pacts.nuke2 = {['Ifrit']='Fire II', ['Shiva']='Blizzard II', ['Garuda']='Aero II', ['Titan']='Stone II',
        ['Ramuh']='Thunder II', ['Leviathan']='Water II'}
    pacts.nuke4 = {['Ifrit']='Fire IV', ['Shiva']='Blizzard IV', ['Garuda']='Aero IV', ['Titan']='Stone IV',
        ['Ramuh']='Thunder IV', ['Leviathan']='Water IV'}
    pacts.bp70 = {['Ifrit']='Flaming Crush', ['Shiva']='Rush', ['Garuda']='Predator Claws', ['Titan']='Mountain Buster',
        ['Ramuh']='Chaotic Strike', ['Leviathan']='Spinning Dive', ['Carbuncle']='Meteorite', ['Fenrir']='Eclipse Bite',
        ['Diabolos']='Nether Blast',['Cait Sith']='Regal Gash'}
    pacts.bp75 = {['Ifrit']='Meteor Strike', ['Shiva']='Heavenly Strike', ['Garuda']='Wind Blade', ['Titan']='Geocrush',
        ['Ramuh']='Thunderstorm', ['Leviathan']='Grand Fall', ['Carbuncle']='Holy Mist', ['Fenrir']='Lunar Bay',
        ['Diabolos']='Night Terror', ['Cait Sith']='Level ? Holy'}
	pacts.bp99 = {['Ifrit']='Conflag Strike', ['Ramuh']='Volt Strike', ['Titan']='Crag Throw', ['Fenrir']='Impact', ['Diabolos']='Blindside'}
    pacts.astralflow = {['Ifrit']='Inferno', ['Shiva']='Diamond Dust', ['Garuda']='Aerial Blast', ['Titan']='Earthen Fury',
        ['Ramuh']='Judgment Bolt', ['Leviathan']='Tidal Wave', ['Carbuncle']='Searing Light', ['Fenrir']='Howling Moon',
        ['Diabolos']='Ruinous Omen', ['Cait Sith']="Altana's Favor"}
 
            
                
                     Quetzalcoatl.Frodnon
                                                    
                                                                            
                                Server: Quetzalcoatl Game: FFXI Posts: 31 
                
			
			By Quetzalcoatl.Frodnon 2015-10-04 09:07:18			
			
						
                     
                 Trying to find out why it's not swapping to Idle or avatar out idle gear at all. Code  function set_macros(sheet,book)
    if book then
        send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(sheet))
        return
    end
    send_command('@input /macro set '..tostring(sheet))
end
  
function set_style(sheet)
    send_command('@input /lockstyleset '..sheet)
end
  
bp_physical=S{'Punch','Rock Throw','Barracuda Dive','Claw','Axe Kick','Shock Strike','Camisado','Regal Scratch','Poison Nails','Moonlit Charge','Crescent Fang','Rock Buster','Tail Whip','Double Punch','Megalith Throw','Double Slap','Eclipse Bite','Mountain Buster','Spinning Dive','Predator Claws','Rush','Chaotic Strike','Crag Throw','Volt Strike'}
bp_hybrid=S{'Burning Strike','Flaming Crush'}
bp_magical=S{'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgment Bolt','Searing Light','Howling Moon','Ruinous Omen','Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II','Thunderspark','Somnolence','Meteorite','Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV','Nether Blast','Meteor Strike','Geocrush','Grand Fall','Wind Blade','Heavenly Strike','Thunderstorm','Level ? Holy','Holy Mist','Lunar Bay','Night Terror','Conflagration Strike'}
bp_debuff=S{'Lunar Cry','Mewing Lullaby','Nightmare','Lunar Roar','Slowga','Ultimate Terror','Sleepga','Eerie Eye','Tidal Roar','Diamond Storm','Shock Squall','Pavor Nocturnus'}
bp_buff=S{'Shining Ruby','Frost Armor','Rolling Thunder','Crimson Howl','Lightning Armor','Ecliptic Growl','Hastega','Noctoshield','Ecliptic Howl','Dream Shroud','Earthen Armor','Fleet Wind','Inferno Howl','Soothing Ruby','Heavenward Howl','Soothing Current','Hastega II','Crystal Blessing'}bp_other=S{'Healing Ruby','Raise II','Aerial Armor','Reraise II','Whispering Wind','Glittering Ruby','Earthen Ward','Spring Water','Healing Ruby II'} 
AvatarList=S{'Shiva','Ramuh','Garuda','Leviathan','Diabolos','Titan','Fenrir','Ifrit','Carbuncle','Fire Spirit','Air Spirit','Ice Spirit','Thunder Spirit','Light Spirit','Dark Spirit','Earth Spirit','Water Spirit','Cait Sith','Alexander','Odin','Atomos'}
spirit_element={Fire='Fire Spirit',Earth='Earth Spirit',Water='Water Spirit',Wind='Air Spirit',Ice='Ice Spirit',Lightning='Thunder Spirit',Light='Light Spirit',Dark='Dark Spirit'}
spirit_conflict={Fire='Ice',Earth='Lightning',Water='Fire',Wind='Earth',Ice='Wind',Lightning='Water',Light='Dark',Dark='Light'}
 
--include('global.lua') -- Just a collection of functions that I use in all my GearSwaps. See below (after this code block)
  
set_macros(1,2) -- Sheet, Book
  
function get_sets()
  
    -- My formatting is very easy to follow. All sets that pertain to my character doing things are under 'me'.
    -- All sets that are equipped to faciliate my avatar's behaviour or abilities are under 'avatar', eg, Perpetuation, Blood Pacts, etc
      
    sets.me = {}
    sets.avatar = {}
      
    -- Your idle set when you DON'T have an avatar out
    sets.me.idle = {
        main="Nirvana",
        sub="Oneiros Grip",
        ammo="Seraphicaller",
        head="Convoker's Horn +1",
        neck="Twilight Torque",
        lear="Evans Earring",
        rear="Moonshade Earring",
        body="Shomonjijoe +1",
        hands="Asteria Mitts +1",
        lring="Defending Ring",
        rring="Evoker's Ring",
        back= {name="Conveyance Cape", augments={'Summoning Magic Skill +1', 'Blood Pact Damage +4', 'Blood Pact Ability Delay II -2', 'Pet: Enmity +5'}},
        waist="Fucho-no-obi",
        legs="Assiduity Pants +1",
        feet="Herald's Gaiters"
    }
      
    -- Your MP Recovered Whilst Resting Set
    sets.me.resting = {
        main="Nirvana",
        sub="Oneiros Grip",
        ammo="Seraphicaller",
        head="Convoker's Horn +1",
        neck="Twilight Torque",
        lear="Evans Earring",
        rear="Moonshade Earring",
        body="Shomonjijoe +1",
        hands="Asteria Mitts +1",
        lring="Defending Ring",
        rring="Evoker's Ring",
        back= {name="Conveyance Cape", augments={'Summoning Magic Skill +1', 'Blood Pact Damage +4', 'Blood Pact Ability Delay II -2', 'Pet: Enmity +5'}},
        waist="Fucho-no-obi",
        legs="Assiduity Pants +1",
        feet="Herald's Gaiters"
    }
      
    -----------------------
    -- Perpetuation Related
    -----------------------
      
    -- Avatar's Out -- 
    -- This is the base for all perpetuation scenarios, as seen below
    sets.avatar.perp = {
    main="Nirvana",
    sub="Oneiros Grip",
    ammo="Seraphicaller",
    head="Beckoner's Horn +1",
    body="Shomonjijoe +1",
    hands="Asteria Mitts +1",
    legs="Assid. Pants +1",
    feet="Herald's Gaiters",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear={ name="Moonshade Earring", augments={'Mag. Acc.+4','Latent effect: "Refresh"+1',}},
    left_ring="Evoker's Ring",
    right_ring="Defending Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +1','Pet: Enmity+5','Blood Pact Dmg.+4','Blood Pact ab. del. II -3',}},
         
    }
  
    -- The following sets base off of perpetuation, so you can consider them idle sets.
    -- Set the relevant gear, bearing in mind it will overwrite the perpetuation item for that slot!
      
    -- When we want our avatar to stay alive
    sets.avatar.tank = set_combine(sets.avatar.perp,{
    main="Nirvana",
    sub="Oneiros Grip",
    ammo="Seraphicaller",
    head="Beckoner's Horn +1",
    body="Shomonjijoe +1",
    hands="Asteria Mitts +1",
    legs="Assid. Pants +1",
    feet="Herald's Gaiters",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear={ name="Moonshade Earring", augments={'Mag. Acc.+4','Latent effect: "Refresh"+1',}},
    left_ring="Evoker's Ring",
    right_ring="Defending Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +1','Pet: Enmity+5','Blood Pact Dmg.+4','Blood Pact ab. del. II -3',}},
    })
      
    -- When we want our avatar to shred
    sets.avatar.melee = set_combine(sets.avatar.perp,{
    main="Nirvana",
    sub="Oneiros Grip",
    ammo="Seraphicaller",
    head="Beckoner's Horn +1",
    body="Shomonjijoe +1",
    hands="Asteria Mitts +1",
    legs="Assid. Pants +1",
    feet="Herald's Gaiters",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear={ name="Moonshade Earring", augments={'Mag. Acc.+4','Latent effect: "Refresh"+1',}},
    left_ring="Evoker's Ring",
    right_ring="Defending Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +1','Pet: Enmity+5','Blood Pact Dmg.+4','Blood Pact ab. del. II -3',}},
    })
      
    -- When we want our avatar to hit
    sets.avatar.acc = set_combine(sets.avatar.perp,{
    main="Nirvana",
    sub="Oneiros Grip",
    ammo="Seraphicaller",
    head="Beckoner's Horn +1",
    body="Shomonjijoe +1",
    hands="Asteria Mitts +1",
    legs="Assid. Pants +1",
    feet="Herald's Gaiters",
    neck="Caller's Pendant",
    waist="Fucho-no-Obi",
    left_ear="Andoaa Earring",
    right_ear={ name="Moonshade Earring", augments={'Mag. Acc.+4','Latent effect: "Refresh"+1',}},
    left_ring="Evoker's Ring",
    right_ring="Defending Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +1','Pet: Enmity+5','Blood Pact Dmg.+4','Blood Pact ab. del. II -3',}},
 
 
        })
      
    -- When Avatar's Favor is active
    sets.avatar.favor = set_combine(sets.avatar.perp,{
        main="Nirvana",
        sub="Vox Grip",
        ammo="Seraphicaller",
        head="Beckoner's Horn +1",
        neck="Caller's Pendant",
        lear="Summoning Earring",
        rear="Andoaa Earring",
        body="Beckoner's Doublet +1",
        hands="Asteria Mitts +1",
        lring="Evoker's Ring",
        rring="Globidonta Ring",
        back= {name="Conveyance Cape", augments={'Summoning Magic Skill +5', 'Blood Pact Damage +1', 'Blood Pact Ability Delay II -1', 'Pet: Enmity +7'}},
        waist="Lucidity Sash",
        legs="Beckoner's Spats +1",
        feet="Marduk's Crackows +1"
    })
      
    ----------------------------
    -- Summoning Skill Related
    -- Including all blood pacts
    ----------------------------
      
    -- + Summoning Magic. This is a base set for max skill and blood pacts and we'll overwrite later as and when we need to
    sets.avatar.skill = {
        main= {name="Espiritus", augments={'Summoning Magic Skill +15', 'Pet: Magic Accuracy +30', 'Pet: Damage Taken -4%'}},
        sub="Vox Grip",
        ammo="Seraphicaller",
        head="Convoker's Horn +1",
        neck="Caller's Pendant",
        lear="Summoning Earring",
        rear="Andoaa Earring",
        body="Beckoner's Doublet +1",
        hands="Lammasu Mitts +1",
        lring="Evoker's Ring",
        rring="Globidonta Ring",
        back= {name="Conveyance Cape", augments={'Summoning Magic Skill +5', 'Blood Pact Damage +1', 'Blood Pact Ability Delay II -1', 'Pet: Enmity +7'}},
        waist="Lucidity Sash",
        legs="Beckoner's Spats +1",
        feet="Marduk's Crackows +1"
    }
      
    -------------------------
    -- Individual Blood Pacts
    -------------------------
      
    -- Physical damage
    sets.avatar.atk = set_combine(sets.avatar.skill,{
    main="Nirvana",
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Apogee Crown +1", augments={'MP+80','Pet: Attack+35','System: 2 ID: 116 Val: 7',}},
    body="Con. Doublet +1",
    hands={ name="Apogee Mitts +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
    legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
    feet={ name="Helios Boots", augments={'Pet: "Mag.Atk.Bns."+26','Pet: Crit.hit rate +4','Blood Pact Dmg.+6',}},
    neck={ name="Sacrifice Torque", augments={'Attack+3',}},
    waist="Mujin Obi",
    left_ear="Esper Earring",
    right_ear="Gelos Earring",
    left_ring="Evoker's Ring",
    right_ring="Thurandaut Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +1','Pet: Enmity+5','Blood Pact Dmg.+4','Blood Pact ab. del. II -3',}},
    })
      
    -- Magic Attack
    sets.avatar.mab = set_combine(sets.avatar.skill,{
        main={name="Espiritus", augments={'MP +50', 'Pet: "Magic Attack Bonus" +20', 'Pet: Magic Accuracy +20'}},
        sub="Vox Grip",
        ammo="Seraphicaller",
        head={ name="Apogee Crown +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
        body={ name="Apo. Dalmatica +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
        hands={ name="Apogee Mitts +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
        legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
        feet={ name="Helios Boots", augments={'Pet: "Mag.Atk.Bns."+26','Pet: Crit.hit rate +4','Blood Pact Dmg.+6',}},
        neck="Eidolon Pendant +1",
        waist="Incarnation Sash",
        left_ear="Esper Earring",
        right_ear="Gelos Earring",
        left_ring="Speaker's Ring",
        right_ring="Evoker's Ring",
        back={ name="Conveyance Cape", augments={'Summoning magic skill +1','Pet: Enmity+5','Blood Pact Dmg.+4','Blood Pact ab. del. II -3',}},
    })
  
    -- Hybrid
    sets.avatar.hybrid = set_combine(sets.avatar.skill,{
    main={name="Espiritus", augments={'MP +50', 'Pet: "Magic Attack Bonus" +20', 'Pet: Magic Accuracy +20'}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Apogee Crown +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
    body={ name="Apo. Dalmatica +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
    hands={ name="Apogee Mitts +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
    legs={ name="Apogee Slacks +1", augments={'MP+80','Pet: "Mag.Atk.Bns."+35','System: 2 ID: 116 Val: 7',}},
    feet={ name="Helios Boots", augments={'Pet: "Mag.Atk.Bns."+26','Pet: Crit.hit rate +4','Blood Pact Dmg.+6',}},
    neck="Eidolon Pendant +1",
    waist="Incarnation Sash",
    left_ear="Esper Earring",
    right_ear="Gelos Earring",
    left_ring="Speaker's Ring",
    right_ring="Fervor Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +1','Pet: Enmity+5','Blood Pact Dmg.+4','Blood Pact ab. del. II -3',}},
    })
      
    -- Magic Accuracy
    sets.avatar.macc = set_combine(sets.avatar.skill,{
    main={ name="Espiritus", augments={'Summoning magic skill +15','Pet: Mag. Acc.+30','System: 2 ID: 153 Val: 3',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head={ name="Helios Band", augments={'Pet: Mag. Acc.+29','Summoning magic skill +8',}},
    body={ name="Helios Jacket", augments={'Pet: Mag. Acc.+25','Summoning magic skill +7',}},
    hands="Lamassu Mitts +1",
    legs={ name="Helios Spats", augments={'Pet: Mag. Acc.+30','Summoning magic skill +7',}},
    feet={ name="Helios Boots", augments={'Pet: Mag. Acc.+27','Pet: Crit.hit rate +4','Summoning magic skill +8',}},
    neck="Caller's Pendant",
    waist="Incarnation Sash",
    left_ear="Andoaa Earring",
    right_ear="Smn. Earring",
    left_ring="Evoker's Ring",
    right_ring="Globidonta Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+7','Blood Pact Dmg.+1','Blood Pact ab. del. II -1',}},
    })
      
    -- Buffs
    sets.avatar.buff = set_combine(sets.avatar.skill,{
    main={ name="Espiritus", augments={'Summoning magic skill +15','Pet: Mag. Acc.+30','System: 2 ID: 153 Val: 3',}},
    sub="Vox Grip",
    ammo="Seraphicaller",
    head="Con. Horn +1",
    body="Beck. Doublet +1",
    hands="Lamassu Mitts +1",
    legs="Beck. Spats +1",
    feet="Mdk. Crackows +1",
    neck="Caller's Pendant",
    waist="Lucidity Sash",
    left_ear="Andoaa Earring",
    right_ear="Smn. Earring",
    left_ring="Evoker's Ring",
    right_ring="Globidonta Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+7','Blood Pact Dmg.+1','Blood Pact ab. del. II -1',}},
    })
      
      
    -- Combat Related Sets
      
    -- Melee
    -- The melee set combines with perpetuation, because we don't want to be losing all our MP whilst we swing our Staff
    -- Anything you equip here will overwrite the perpetuation/refresh in that slot.
    sets.me.melee = set_combine(sets.avatar.perp,{
        main="Nirvana",
        sub="Vox Grip",
        ammo="Seraphicaller",
        head="Convoker's Horn +1",
        neck="Asperity Necklace",
        lear="Zennaroi Earring",
        rear="Steelflash Earring",
        body="Beckoner's Doublet +1",
        hands="Asteria Mitts +1",
        lring="Ramuh Ring +1",
        rring="Rajas Ring",
        back= {name="Conveyance Cape", augments={'Summoning Magic Skill +5', 'Blood Pact Damage +4', 'Pet: Enmity +12'}},
        waist="Chaac Belt",
        legs="Enticer's Pants",
        feet="Beckoner's Pigaches"
    })
      
    ---------------
    -- Casting Sets
    ---------------
      
    sets.precast = {}
    sets.midcast = {}
    sets.aftercast = {}
      
    ----------
    -- Precast
    ----------
      
    -- Generic Casting Set that all others take off of. Here you should add all your fast cast 
    sets.precast.casting = {
        main="Nirvana",
        sub="Vox Grip",
        ammo="Sapience Orb",
        head="Natirah Hat",
        neck="Twilight Torque",
        lear="Loquacious Earring",
        rear="Eabani Earring",
        body="Anhur Robe",
        hands="Asteria Mitts +1",
        lring="Prolix Ring",
        rring="Defending Ring",
        back="Swith Cape",
        waist="Sailfi Belt",
        legs="Lengo Trousers",
        feet="Regal Pumps"
    }  
      
    ---------------------
    -- Ability Precasting
    ---------------------
      
    -- Blood Pact Ability Delay
    sets.precast.bp = {
        main= {name="Espiritus", augments={'Summoning Magic Skill +15', 'Pet: Magic Accuracy +30', 'Pet: Damage Taken -4%'}},
        sub="Vox Grip",
        ammo="Seraphicaller",
        head="Convoker's Horn +1",
        neck="Caller's Pendant",
        lear="Caller's Earring",
        rear="Summoning Earring",
        body="Glyphic Doublet +1",
        hands="Glyphic Bracers +1",
        lring="Evoker's Ring",
        rring="Thurundaut Ring",
        back= {name="Conveyance Cape", augments={'Summoning Magic Skill +2', 'Blood Pact Damage +3', 'Blood Pact Ability Delay II -2', 'Pet: Enmity +14'}},
        waist="Lucidity Sash",
        legs="Glyphic Spats +1",
        feet="Glyphic Pigaches +1"
    }
      
    -- Mana Cede
    sets.precast["Mana Cede"] = {
        hands="Beckoner's Bracers",
    }
      
    -- Astral Flow 
    sets.precast["Astral Flow"] = {
        head="Glyphic Horn +1",
      
    }
      
    -- Elemental Siphon, eg, Tatsumaki Thingies, Esper Stone, etc
     
    sets.precast["Elemental Siphon"] = {
    main={ name="Keraunos", augments={'Pet: Mag. Acc.+15','"Elemental Siphon"+25',}},
    sub="Vox Grip",
    ammo="Esper Stone +1",
    head={ name="Telchine Cap", augments={'"Elemental Siphon"+35',}},
    body={ name="Telchine Chas.", augments={'"Elemental Siphon"+35',}},
    hands={ name="Telchine Gloves", augments={'"Elemental Siphon"+35',}},
    legs={ name="Telchine Braconi", augments={'"Elemental Siphon"+35',}},
    feet="Beck. Pigaches +1",
    neck="Caller's Pendant",
    waist="Lucidity Sash",
    left_ear="Andoaa Earring",
    right_ear="Smn. Earring",
    left_ring="Evoker's Ring",
    right_ring="Globidonta Ring",
    back={ name="Conveyance Cape", augments={'Summoning magic skill +5','Pet: Enmity+7','Blood Pact Dmg.+1','Blood Pact ab. del. II -1',}},
         
    }
      
    ----------
    -- Midcast
    ----------
      
    -- We handle the damage and etc. in Pet Midcast later
      
    -- Whatever you want to equip mid-cast as a catch all for all spells, and we'll overwrite later for individual spells
    sets.midcast.casting = {
        main= {name="Espiritus", augments={'Summoning Magic Skill +15', 'Pet: Magic Accuracy +30', 'Pet: Damage Taken -4%'}},
        sub="Vox Grip",
        ammo="Seraphicaller",
        head="Psycloth Tiara",
        neck="Sacrifice Torque",
        lear="Andoaa Earring",
        rear="Gelos Earring",
        body="Convoker's Doublet +1",
        hands="Apogee Mitts",
        lring="Fervor Ring",
        rring="Thurundaut Ring",
        back=
        {name="Conveyance Cape", augments={'Summoning Magic Skill +5', 'Blood Pact Damage +4', 'Pet: Enmity +12'}},
        waist="Mujin Obi",
        legs="Apogee Slacks",
        feet="Glyphic Pigaches +1"
    }
      
    ------------
    -- Aftercast
    ------------
      
    -- I don't use aftercast sets, as we handle what to equip later depending on conditions using a function, eg, do we have an avatar out?
  
end
  
function precast(spell)
  
    -- Don't swap if we're in the middle of something or our pet's doing something
    -- Stops macro spam from interfering with an action GS is already handling
    if midaction() or pet_midaction() then
        return
    end
      
    -- If we're doing a blood pact, equip our delay set IF Apogee or Astral Conduit are not active
    if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') and not (buffactive['Astral Conduit'] or buffactive['Apogee']) then
      
        equip(sets.precast.bp)
          
    elseif spell.type == 'SummonerPact' then
      
        -- This chunk of code handles Elemental Siphon. It will look at the current day and weather and cancel the spell to summon
        -- the right elemental. Your elemental siphon macro should summon a Dark Spirit to trigger this check
          
        -- These use the included lists in global.lua to determine the right spirit to summon
              
        if spell.name == 'Dark Spirit' then
            if world.weather_element == 'Dark' then
              
                -- Dark Weather is active, lets the spell go ahead and equips summoning precast
                equip(sets.precast.summoning)
                  
            elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then
              
                -- It's not dark weather but there is some weather up, cancels dark and summons the right spirit
                cancel_spell()
                send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
                equip(sets.precast.summoning)
                  
            elseif world.day_element == 'Dark' then
              
                -- It's darksday so allow the dark spirit to go ahead and equip summoning
                equip(sets.precast.summoning)
                  
            else
              
                -- There is no weather up and it's not darksday, so summon the current day's spirit
                cancel_spell()             
                send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
                equip(sets.precast.summoning)
                  
            end
        else
          
            -- We're not summoning Dark Spirit, so we don't want to Siphon, which means we're summoning an avatar
            equip(sets.precast.summoning)
              
        end
          
    -- Moving on to other types of magic
    elseif spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
      
        -- Stoneskin Precast
        if spell.name == 'Stoneskin' then
          
            windower.ffxi.cancel_buff(37)--[[Cancels stoneskin, not delayed incase you get a Quick Cast]]
            equip(sets.precast.stoneskin)
              
        -- Cure Precast
        elseif spell.name:match('Cure') or spell.name:match('Cura') then
          
            equip(sets.precast.cure)
              
        -- Enhancing Magic
        elseif spell.skill == 'Enhancing Magic' then
          
            equip(sets.precast.enhancing)
              
            if spell.name == 'Sneak' then
                windower.ffxi.cancel_buff(71)--[[Cancels Sneak]]
            end
        else
          
            -- For everything else we go with max fastcast
            equip(sets.precast.casting)
              
        end
          
    -- Summoner Abilities
    -- We use a catch all here, if the set exists for an ability, use it
    -- This way we don't need to write a load of different code for different abilities, just make a set
      
    elseif sets.precast[spell.name] then
        equip(sets.precast[spell.name])
    end
      
end
  
function midcast(spell)
  
    -- If our pet is doing something, prevents us swapping equipment too early
    if pet_midaction() then
        return
    end
      
    -- No need to annotate all this, it's fairly logical. Just equips the relevant sets for the relevant magic
    if spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
        if spell.name == 'Stoneskin' then
            equip(sets.midcast.stoneskin)
        elseif spell.name:match('Cure') or spell.name:match('Cura') then
            equip(sets.midcast.cure)
        elseif spell.skill == 'Enhancing Magic' then
            equip(sets.midcast.enhancing)
            if spell.name:match('Protect') or spell.name:match('Shell') then
                equip({rring="Sheltered Ring"})
            end
        else
            equip(sets.midcast.casting)
        end
    elseif spell.name == 'Elemental Siphon' then
      
        -- Siphon Set
        equip(sets.midcast.siphon)
          
        -- Checks if pet matches weather
        if pet.element == world.weather_element then
            equip(sets.midcast.siphon,{main="Chatoyant Staff"--[[Take advantage of the weather boost]]})
        end
          
    -- And our catch all, if a set exists for this spell use it
    elseif sets.midcast[spell.name] then
        equip(sets.midcast[spell.name])
          
    -- Remember those WS Sets we defined? :)
    elseif sets.me[spell.name] then
        equip(sets.me[spell.name])
    end
end
  
function aftercast(spell)
  
    -- If our pet's doing something, Stop!
    if pet_midaction() then
        return
    end
      
    -- If not a blood pact or summon
    if spell and (not spell.type or not string.find(spell.type,'BloodPact') and not AvatarList:contains(spell.name) or spell.interrupted) then
      
        -- Then initiate idle function to check which set should be equipped
        idle(pet)
          
    end
end
  
function pet_midcast(spell)
  
    -- Our pet is doing something
    if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') then
      
        -- We're going to check the lists in global.lua for matches and equip the relevant sets
          
        if bp_physical:contains(spell.name) then
          
            equip(sets.avatar.atk)
              
        elseif bp_hybrid:contains(spell.name) then
          
            equip(sets.avatar.hybrid)
            if pet.name == 'Ifrit' then
                equip({rring="Fervor Ring"})--[[Change rring to lring if you put Evoker's on your right hand]]
            end
              
        elseif bp_magical:contains(spell.name) then
          
            equip(sets.avatar.mab)
            if pet.name == 'Ifrit' then
                equip({rring="Fervor Ring"})--[[Change rring to lring if you put Evoker's on your right hand]]
            end
  
        elseif bp_debuff:contains(spell.name) then
          
            equip(sets.avatar.macc)
              
        elseif bp_buff:contains(spell.name) then
          
            equip(sets.avatar.buff)
              
        elseif bp_other:contains(spell.name) then
          
            equip(sets.avatar.other)
              
        elseif spell.name == 'Perfect Defense' then
          
            equip(sets.avatar.skill)
              
        else
          
            equip(sets.avatar.skill)
              
        end
    end
end
  
function pet_aftercast(spell)
      
    -- Pet aftercast is simply a check for whether Conduit and Apogee are up, and then a call to our aftercast function
    -- We have a variable called autobp that we set to true or false with commands to auto repeat BPs for us
    if (buffactive['Apogee'] or buffactive['Astral Conduit']) and autobp then
        send_command('input /pet "%s" <t>':format(spell.name))
        return
    end
      
    idle(pet)
      
end
  
function idle(pet)
 
    -- This function is called after every action, and handles which set to equip depending on what we're doing
    -- We check if we're meleeing because we don't want to idle in melee gear when we're only engaged for trusts
     
    if favor then
     
        -- Avatar's favor takes priority!
        equip(sets.me.favor)
         
    elseif meleeing and player.status=='Engaged' then
     
        -- We're both engaged and meleeing
        equip(sets.me.melee)
         
    elseif pet.isvalid then
         
        -- We have a pet out but we're not meleeing, set the right idle set
        equip(sets.avatar[mode])
 
    else
     
        -- We're not meleeing and we have no pet out
        equip(sets.me.idle)
         
    end
end
  
function status_change(new,old)
    if new == 'Engaged' then
      
        -- If we engage check our meleeing status
        idle(pet)
          
    elseif new=='Resting' then
      
        -- We're resting
        equip(sets.me.resting)
    end
end
  
function pet_change(pet,gain)
  
    -- When we summon or release an avatar
    idle(pet)
  
end
  
  
function self_command(command)
  
    local commandArgs = command
      
    -- This command takes //gs c avatar mode, where mode is what you want, eg, tank, acc, melee, etc
    if #commandArgs:split(' ') >= 2 then
        commandArgs = T(commandArgs:split(' '))
        if commandArgs[1] == 'avatar' then
            if commandArgs[2] then
                mode = tostring(commandArgs[2])
                equip(sets.avatar[mode])
                windower.add_to_chat(8,'----- Avatar set to '..mode..' mode! -----')
            end
        elseif commandArgs[1] == 'toggle' then
            if commandArgs[2] == 'auto' then
              
                -- //gs c toggle auto will toggle auto blood pacts on and off. Auto blood pact will make your GS repeat BPs under Apogee or Conduit
                -- And by repeat I mean repeat. If Conduit is up, it will SPAM the BP until Conduit is down
                if autobp then
                    autobp = false
                    windower.add_to_chat(8,'----- Auto BP mode Disabled -----')
                else
                    autobp = true
                    windower.add_to_chat(8,'----- Auto BP mode Enabled -----')
                end
            elseif commandArgs[2] == 'melee' then
              
                -- //gs c toggle melee will toggle melee mode on and off.
                -- This basically locks the slots that will cause you to lose TP if changing them,
                -- As well as equip your melee set if you're engaged
  
                if meleeing then
                    meleeing = false
                    enable('main','sub','ranged')
                    windower.add_to_chat(8,'----- Weapons Unlocked, WILL LOSE TP -----')
                    idle(pet)
                else
                    meleeing=true
                    disable('main','sub','ranged')
                    windower.add_to_chat(8,'----- Weapons Locked, WILL NOT LOSE TP -----')
                    idle(pet)
                end
                  
            elseif commandArgs[2] == 'favor' then
                      
                -- //gs c toggle favor will toggle Favor mode on and off.
                -- It won't automatically toggle, as some people like having favor active without the gear swaps for maximum effectiveness
                -- You need to toggle prioritisation yourself
                if favor then
                    favor = false
                    windower.add_to_chat(8,"----- Avatar's Favor Mode OFF -----")
                else
                    favor = true
                    windower.add_to_chat(8,"----- Avatar's Favor Mode ON -----")
                end
                  
            end
        end
    end
end
  
-- Required variables and their initial value
meleeing = false
autobp = false
favor = true
mode = "perp" 
            
            
                
			
			By Aeyela 2015-10-04 10:00:49			
			
						
                     
                 I'll have to take a longer look at this, as your Lua is the same as the OP minus the gear listings. There's obviously a problem somewhere, I'll try and figure out where.                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Siren Game: FFXI Posts: 228 
                
			
			By Siren.Noxzema 2015-10-04 10:22:11			
			
						
                     
                 Quetzalcoatl.Frodnon said: »Trying to find out why it's not swapping to Idle or avatar out idle gear at all.
I tested your lua, it seems to be because of the favor = true, I couldn't get it to swap off of the idle set actually. Tried changing it to false, and it seems to be swapping around fine.
 
Also, I figured out my issue also, I forgot that I had played around with it, and changed the name of the sets.me.melee set.
 
Edit: For my lua, I made 2 favor sets, 1 is a new avatar mode with 512 skill (so I can still keep some perp/refresh), then for the actual favor mode I have set for 575 skill.                                     
            
            
                
			
			By Aeyela 2015-10-04 10:23:57			
			
						
                     
                 Alright, well the Favor does take priority when toggled. The syntax for that is correct. Do you recall manually setting it to true before encountering these problems?                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Siren Game: FFXI Posts: 228 
                
			
			By Siren.Noxzema 2015-10-04 10:40:32			
			
						
                     
                 Found it, he still had the function calling for sets.me.favor, when the set is sets.avatar.favor. I knew this sounded familiar, not sure why I forgot about it in just a few days...
 Also, any idea why my keybinds would still try to work when using his lua? I hit it out of habit, and it still swapped toggles. They all worked except for cycling pet modes, though it would try.
 
            
            
                
			
			By Elizabet 2015-10-04 11:22:05			
			
						
                     
                 The original lua didn't have cycling pet mode.                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Siren Game: FFXI Posts: 228 
                
			
			By Siren.Noxzema 2015-10-04 11:41:54			
			
						
                     
                 Right, but why would it still use binds that aren't on the .lua? On mine I have  Code  windower.send_command('bind f9 gs c avatar mode')
windower.send_command('bind !f10 gs c toggle favor')
windower.send_command('bind !f9 gs c toggle auto')
windower.send_command('bind ^f12 gs c toggle melee')
and they still worked on Frodnons lua, even though it didn't have them.                                     
            
            
                
			
			By Aeyela 2015-10-04 13:30:50			
			
						
                     
                 Found it, he still had the function calling for sets.me.favor, when the set is sets.avatar.favor. I knew this sounded familiar, not sure why I forgot about it in just a few days...
Okay, glad you got to the bottom of it!
 Also, any idea why my keybinds would still try to work when using his lua? I hit it out of habit, and it still swapped toggles. They all worked except for cycling pet modes, though it would try.Right, but why would it still use binds that aren't on the .lua? On mine I have  Code  windower.send_command('bind f9 gs c avatar mode')
windower.send_command('bind !f10 gs c toggle favor')
windower.send_command('bind !f9 gs c toggle auto')
windower.send_command('bind ^f12 gs c toggle melee')
and they still worked on Frodnons lua, even though it didn't have them.
The binds themselves will work on any Lua that's using the self_commands, providing it follows the correct syntax. So the Lua he's using is from the OP, which has all the toggle etc commands configured. Any manner of binds would work providing they all send a recognised command to the Lua.
 Quetzalcoatl.Frodnon said: »Trying to find out why it's not swapping to Idle or avatar out idle gear at all.
Pet_Change is responsible for that when you summon or release the avatar and it's syntax is correct in your Lua. Did you have Favor toggled? Looking through the ordering of my code it could be that it's still prioritising even with no pet out. I can't be sure as I'm finding it hard to replicate your Lua's behaviour with my own.
 
Let's try something though. In the idle() function, change the first non-comment line from:
 
To
 Code  if favor and pet.isvalid then
And see if that fixes it.                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Hades Game: FFXI Posts: 11 
                
			
			By Hades.Ramorakomo 2015-10-04 14:09:33			
			
						
                     
                 Please help. I'm not the best with gearswap but I know a bit.I've tried to add the /console gs c bp75 commands and nothing happens. When I hit f9 it just says "avatar set to mode mode" am I missing a file that makes it reconize the ..mode.. thing? that seems important with bloodpacts too
 
 sigh... I guess I need "Shortcuts" addon
 
 Turned on shortcut, still no luck.
 
            
            
                
			
			By Elizabet 2015-10-04 21:29:06			
			
						
                     
                 Please help. I'm not the best with gearswap but I know a bit.I've tried to add the /console gs c bp75 commands and nothing happens.
Looks like you are missing the code that needs to be added in the self_command function (the first code snippet on my post above) Which is really the meat and potatoes.
 
I editted the post above so you can just copy over the whole self_command function (should be easier)
 
The second code snippet, only defines what bloodpact corresponds to which shorthand (ex: lets the code know bp70 means Pred claws if you have garuda up) You need this either at the top of your smn.lua or in your include file.
 When I hit f9 it just says "avatar set to mode mode" am I missing a file that makes it reconize the ..mode.. thing? that seems important with bloodpacts too
I removed that part sorry!! That's something unrelated to the handling of the bloodpacts. That's cause I personally use f9 to cycle within the avatar (perp, tank, melee, acc) modes.  (To add that, I made a post about it previous page ).
 
Also, you do need the shortcuts addon.                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Hades Game: FFXI Posts: 11 
                
			
			By Hades.Ramorakomo 2015-10-04 22:45:22			
			
						
                     
                 Can this gearswap handle augmented gear?                                     
            
            
                
			
			By Elizabet 2015-10-04 22:57:20			
			
						
                     
                 Can this gearswap handle augmented gear?
Any Gearswap can, that's only depending on you to define in your sets. Then have rules to define when to use what sets.                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Hades Game: FFXI Posts: 11 
                
			
			By Hades.Ramorakomo 2015-10-04 23:28:30			
			
						
                     
                 WOOT! I did it, I guess I just *** it up the first time. feels good when you get your gs working when your a noob... I was trying to replicate my bst gs. I wasn't sure if it was missing libs the more advanced gearswaps had.                                     
            
                
                     Bahamut.Dannyl
                                                    
                                                                            
                                Server: Bahamut Game: FFXI Posts: 1600 
                
			
			By Bahamut.Dannyl 2015-10-04 23:33:48			
			
						
                     
                 reading this makes me want to bring out smn from its storage.  Every job needs a post like this.  Good job !                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Hades Game: FFXI Posts: 11 
                
			
			By Hades.Ramorakomo 2015-10-04 23:34:53			
			
						
                     
                 I copied word for word your self_command thing. Still nothing... :(                                     
            
            
                
			
			By Elizabet 2015-10-05 00:32:20			
			
						
                     
                 I copied word for word your self_command thing. Still nothing... :(
Can you post your whole SMN.lua?                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Hades Game: FFXI Posts: 11 
                
			
			By Hades.Ramorakomo 2015-10-05 01:21:11			
			
						
                     
                 Code  --[[
     Put: /console gs c pact [PactType] as your macro
      
        PactType can be one of:
            cure
            curaga
            buffOffense
            buffDefense
            buffSpecial
            debuff1
            debuff2
            sleep
            nuke2
            nuke4
            bp70
            bp75 (merits and lvl 75-80 pacts)
            bp99
            astralflow
--]]
    pacts = {}
    pacts.cure = {['Carbuncle']='Healing Ruby'}
    pacts.curaga = {['Carbuncle']='Healing Ruby II', ['Garuda']='Whispering Wind', ['Leviathan']='Spring Water'}
    pacts.buffoffense = {['Carbuncle']='Glittering Ruby', ['Ifrit']='Crimson Howl', ['Garuda']='Hastega II', ['Ramuh']='Rolling Thunder',
        ['Fenrir']='Ecliptic Growl', ['Shiva']='Crystal Blessing'}
    pacts.buffdefense = {['Carbuncle']='Shining Ruby', ['Shiva']='Frost Armor', ['Garuda']='Aerial Armor', ['Titan']='Earthen Ward',
        ['Ramuh']='Lightning Armor', ['Fenrir']='Ecliptic Howl', ['Diabolos']='Noctoshield', ['Cait Sith']='Reraise II'}
    pacts.buffspecial = {['Ifrit']=' <staff_and_grip Howl', ['Garuda']='Fleet Wind', ['Titan']='Earthen Armor', ['Diabolos']='Dream Shroud',
        ['Carbuncle']='Soothing Ruby', ['Fenrir']='Heavenward Howl', ['Cait Sith']='Raise II'}
    pacts.debuff1 = {['Shiva']='Diamond Storm', ['Ramuh']='Shock Squall', ['Leviathan']='Tidal Roar', ['Fenrir']='Lunar Cry',
        ['Diabolos']='Pavor Nocturnus', ['Cait Sith']='Eerie Eye'}
    pacts.debuff2 = {['Shiva']='Sleepga', ['Leviathan']='Slowga', ['Fenrir']='Lunar Roar', ['Diabolos']='Somnolence', ['Ramuh']='Thunderspark'}
    pacts.sleep = {['Shiva']='Sleepga', ['Diabolos']='Nightmare', ['Cait Sith']='Mewing Lullaby'}
    pacts.nuke2 = {['Ifrit']='Fire II', ['Shiva']='Blizzard II', ['Garuda']='Aero II', ['Titan']='Stone II',
        ['Ramuh']='Thunder II', ['Leviathan']='Water II'}
    pacts.nuke4 = {['Ifrit']='Fire IV', ['Shiva']='Blizzard IV', ['Garuda']='Aero IV', ['Titan']='Stone IV',
        ['Ramuh']='Thunder IV', ['Leviathan']='Water IV'}
    pacts.bp70 = {['Ifrit']='Flaming Crush', ['Shiva']='Rush', ['Garuda']='Predator Claws', ['Titan']='Mountain Buster',
        ['Ramuh']='Chaotic Strike', ['Leviathan']='Spinning Dive', ['Carbuncle']='Meteorite', ['Fenrir']='Eclipse Bite',
        ['Diabolos']='Nether Blast',['Cait Sith']='Regal Gash'}
    pacts.bp75 = {['Ifrit']='Meteor Strike', ['Shiva']='Heavenly Strike', ['Garuda']='Wind Blade', ['Titan']='Geocrush',
        ['Ramuh']='Thunderstorm', ['Leviathan']='Grand Fall', ['Carbuncle']='Holy Mist', ['Fenrir']='Lunar Bay',
        ['Diabolos']='Night Terror', ['Cait Sith']='Level ? Holy'}
    pacts.bp99 = {['Ifrit']='Conflag Strike', ['Ramuh']='Volt Strike', ['Titan']='Crag Throw', ['Fenrir']='Impact', ['Diabolos']='Blindside'}
    pacts.astralflow = {['Ifrit']='Inferno', ['Shiva']='Diamond Dust', ['Garuda']='Aerial Blast', ['Titan']='Earthen Fury',
        ['Ramuh']='Judgment Bolt', ['Leviathan']='Tidal Wave', ['Carbuncle']='Searing Light', ['Fenrir']='Howling Moon',
        ['Diabolos']='Ruinous Omen', ['Cait Sith']="Altana's Favor"}
include('global.lua') -- Just a collection of functions that I use in all my GearSwaps. See below (after this code block)
set_macros(2,3) -- Sheet, Book
 
function get_sets()
 
    -- My formatting is very easy to follow. All sets that pertain to my character doing things are under 'me'.
    -- All sets that are equipped to faciliate my avatar's behaviour or abilities are under 'avatar', eg, Perpetuation, Blood Pacts, etc
     
    sets.me = {}
    sets.avatar = {}
	-- AUGMENTED GEAR
        prep_feet = {name="Helios boots", augments={'"Avatar perpetuation cost" -3','Blood Pact Dmg.+7','Pet: Attack+22 Pet: Rng.Atk.+22',}}
	attack_feet = {name="Helios boots", augments={'Pet: Crit. hit rate +4%','Blood Pact Dmg.+6','Pet: "Mag.Atk.Bns."+22',}}
   
    -- Your idle set when you DON'T have an avatar out
    sets.me.idle = {
        main="Keraunos",
        sub="Vox Grip",
        ranged="",
        ammo="Seraphicaller",
        head="Glyphic horn +1",
        neck="Twilight torque",
        lear="handler's earring",
        rear="handler's earring +1",
        body="Shomonjijoe +1",
        hands="Serpentes cuffs",
        lring="shadow ring",
        rring="Warp ring",
        back="Convoyance cape",
        waist="Cimmerian sash",
        legs="Assiduity pants +1",
        feet="serpentes sabots"
    }
     
    -- Your MP Recovered Whilst Resting Set
    sets.me.resting = { 
       main="Keraunos",
        sub="Vox Grip",
        ranged="",
        ammo="Seraphicaller",
        head="Glyphic horn +1",
        neck="Twilight torque",
        lear="handler's earring",
        rear="handler's earring +1",
        body="Shomonjijoe +1",
        hands="Serpentes cuffs",
        lring="shadow ring",
        rring="Warp ring",
        back="Convoyance cape",
        waist="Cimmerian sash",
        legs="Assiduity pants +1",
        feet="serpentes sabots"
    }
     
    -----------------------
    -- Perpetuation Related
    -----------------------
     
    -- Avatar's Out --  
    -- This is the base for all perpetuation scenarios, as seen below
    sets.avatar.perp = {
        main="Keraunos",
        sub="Vox Grip",
        ranged="",
        ammo="Seraphicaller",
        head="Beckoner's horn +1",
        neck="caller's pendant",
        lear="handler's earring",
        rear="handler's earring +1",
        body="Shomonjijoe +1",
        hands="Glyphic bracers +1",
        lring="Thurandaut ring",
        rring="Evoker's ring",
        back="Convoyance cape",
        waist="Cimmerian sash",
        legs="Assiduity pants +1",
        feet=prep_feet
    }
 
    -- The following sets base off of perpetuation, so you can consider them idle sets.
    -- Set the relevant gear, bearing in mind it will overwrite the perpetuation item for that slot!
     
    -- When we want our avatar to stay alive
    sets.avatar.tank = set_combine(sets.avatar.perp,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- When we want our avatar to shred
    sets.avatar.melee = set_combine(sets.avatar.perp,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- When we want our avatar to hit
    sets.avatar.acc = set_combine(sets.avatar.perp,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- When Avatar's Favori s active
    sets.avatar.favor = set_combine(sets.avatar.perp,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    ----------------------------
    -- Summoning Skill Related
    -- Including all blood pacts
    ----------------------------
     
    -- + Summoning Magic. This is a base set for max skill and blood pacts and we'll overwrite later as and when we need to
    sets.avatar.skill = {
        main="",
        sub="vox grip",
        ranged="",
        ammo="",
        head="",
        neck="caller's pendant",
        lear="",
        rear="",
        body="",
        hands="glyphic bracer's +1",
        lring="",
        rring="Evoker's ring",
        back="Convoyance cape",
        waist="Cimmerian sash",
        legs="",
        feet=""
    }
     
    -------------------------
    -- Individual Blood Pacts
    -------------------------
     
    -- Physical damage
    sets.avatar.atk = set_combine(sets.avatar.skill,{
        main="Espiritus",
        sub="Vox Grip",
        ranged="",
        ammo="",
        head="helios band",
        neck="caller's pendant",
        lear="gelos earring",
        rear="handler's earring +1",
        body="Convoker's doublet +1",
        hands="glyphic bracers +1",
        lring="thurandaut ring",
        rring="Evoker's ring",
        back="conveyance cape",
        waist="Cimmerian sash",
        legs="Helios spats",
        feet=attack_feet
    })
     
    -- Magic Attack
    sets.avatar.mab = set_combine(sets.avatar.skill,{
       main="Espiritus",
        sub="Vox Grip",
        ranged="",
        ammo="",
        head="Helios band",
        neck="caller's pendant",
        lear="gelos earring",
        rear="handler's earring +1",
        body="Convoker's doublet +1",
        hands="glyphic bracers +1",
        lring="thurandaut ring",
        rring="Evoker's ring",
        back="conveyance cape",
        waist="Cimmerian sash",
        legs="Helios spats",
        feet=attack_feet
    })
 
    -- Hybrid
    sets.avatar.hybrid = set_combine(sets.avatar.skill,{
        main="Espiritus",
        sub="Vox Grip",
        ranged="",
        ammo="",
        head="Helios band",
        neck="caller's pendant",
        lear="gelos earring",
        rear="handler's earring +1",
        body="Convoker's doublet +1",
        hands="glyphic bracers +1",
        lring="thurandaut ring",
        rring="Evoker's ring",
        back="conveyance cape",
        waist="Cimmerian sash",
        legs="Helios spats",
        feet=attack_feet
    })
     
    -- Other
    sets.avatar.other = set_combine(sets.avatar.skill,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- Combat Related Sets
     
    -- Melee
    -- The melee set combines with perpetuation, because we don't want to be losing all our MP whilst we swing our Staff
    -- Anything you equip here will overwrite the perpetuation/refresh in that slot.
    sets.me.melee = set_combine(sets.avatar.perp,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- Shattersoul. Weapon Skills do not work off perpetuation as it only stays equipped for a moment
    sets.me["Shattersoul"] = {
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    }
    sets.me["Garland of Bliss"] = {
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    }
     
    -- Feel free to add new weapon skills, make sure you spell it the same as in game. These are the only two I ever use though
 
    ---------------
    -- Casting Sets
    ---------------
     
    sets.precast = {}
    sets.midcast = {}
    sets.aftercast = {}
     
    ----------
    -- Precast
    ----------
     
    -- Generic Casting Set that all others take off of. Here you should add all your fast cast  
    sets.precast.casting = {
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    }   
     
    -- Summoning Magic Cast time - gear
    sets.precast.summoning = set_combine(sets.precast.casting,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- Enhancing Magic, eg. Siegal Sash, etc
    sets.precast.enhancing = set_combine(sets.precast.casting,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
 
    -- Stoneskin casting time -, works off of enhancing -
    sets.precast.stoneskin = set_combine(sets.precast.enhancing,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- Curing Precast, Cure Spell Casting time -
    sets.precast.cure = set_combine(sets.precast.casting,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    ---------------------
    -- Ability Precasting
    ---------------------
     
    -- Blood Pact Ability Delay
    sets.precast.bp = {
        main="Espirtus",
        sub="",
        ranged="",
        ammo="",
        head="Glyphic horn +1",
        neck="",
        lear="Caller's earring",
        rear="",
        body="Glyphic doublet +1",
        hands="Glyphic bracers +1",
        lring="",
        rring="",
        back="Conveyance cape",
        waist="",
        legs="",
        feet="Glyphic pigaches +1"
    }
     
    -- Mana Cede
    sets.precast["Mana Cede"] = {
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    }
     
    -- Astral Flow  
    sets.precast["Astral Flow"] = {
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    }
     
    -- Elemental Siphon, eg, Tatsumaki Thingies, Esper Stone, etc
    sets.precast.siphon = set_combine(sets.avatar.skill,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    ----------
    -- Midcast
    ----------
     
    -- We handle the damage and etc. in Pet Midcast later
     
    -- Whatever you want to equip mid-cast as a catch all for all spells, and we'll overwrite later for individual spells
    sets.midcast.casting = {
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    }
     
    -- Enhancing
    sets.midcast.enhancing = set_combine(sets.midcast.casting,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- Stoneskin
    sets.midcast.stoneskin = set_combine(sets.midcast.enhancing,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    -- Cure Potency
    sets.midcast.cure = set_combine(sets.midcast.casting,{
        main="",
        sub="",
        ranged="",
        ammo="",
        head="",
        neck="",
        lear="",
        rear="",
        body="",
        hands="",
        lring="",
        rring="",
        back="",
        waist="",
        legs="",
        feet=""
    })
     
    ------------
    -- Aftercast
    ------------
     
    -- I don't use aftercast sets, as we handle what to equip later depending on conditions using a function, eg, do we have an avatar out?
 
end
 
function precast(spell)
 
    -- Don't swap if we're in the middle of something or our pet's doing something
    -- Stops macro spam from interfering with an action GS is already handling
    if midaction() or pet_midaction() then
        return
    end
     
    -- If we're doing a blood pact, equip our delay set IF Apogee or Astral Conduit are not active
    if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') and not (buffactive['Astral Conduit'] or buffactive['Apogee']) then
     
        equip(sets.precast.bp)
         
    elseif spell.type == 'SummonerPact' then
     
        -- This chunk of code handles Elemental Siphon. It will look at the current day and weather and cancel the spell to summon
        -- the right elemental. Your elemental siphon macro should summon a Dark Spirit to trigger this check
         
        -- These use the included lists in global.lua to determine the right spirit to summon
             
        if spell.name == 'Dark Spirit' then
            if world.weather_element == 'Dark' then
             
                -- Dark Weather is active, lets the spell go ahead and equips summoning precast
                equip(sets.precast.summoning)
                 
            elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then
             
                -- It's not dark weather but there is some weather up, cancels dark and summons the right spirit
                cancel_spell()
                send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
                equip(sets.precast.summoning)
                 
            elseif world.day_element == 'Dark' then
             
                -- It's darksday so allow the dark spirit to go ahead and equip summoning
                equip(sets.precast.summoning)
                 
            else
             
                -- There is no weather up and it's not darksday, so summon the current day's spirit
                cancel_spell()              
                send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
                equip(sets.precast.summoning)
                 
            end
        else
         
            -- We're not summoning Dark Spirit, so we don't want to Siphon, which means we're summoning an avatar
            equip(sets.precast.summoning)
             
        end
         
    -- Moving on to other types of magic
    elseif spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
     
        -- Stoneskin Precast
        if spell.name == 'Stoneskin' then
         
            windower.ffxi.cancel_buff(37)--[[Cancels stoneskin, not delayed incase you get a Quick Cast]]
            equip(sets.precast.stoneskin)
             
        -- Cure Precast
        elseif spell.name:match('Cure') or spell.name:match('Cura') then
         
            equip(sets.precast.cure)
             
        -- Enhancing Magic
        elseif spell.skill == 'Enhancing Magic' then
         
            equip(sets.precast.enhancing)
             
            if spell.name == 'Sneak' then
                windower.ffxi.cancel_buff(71)--[[Cancels Sneak]]
            end
        else
         
            -- For everything else we go with max fastcast
            equip(sets.precast.casting)
             
        end
         
    -- Summoner Abilities
    -- We use a catch all here, if the set exists for an ability, use it
    -- This way we don't need to write a load of different code for different abilities, just make a set
     
    elseif sets.precast[spell.name] then
        equip(sets.precast[spell.name])
    end
     
end
 
function midcast(spell)
 
    -- If our pet is doing something, prevents us swapping equipment too early
    if pet_midaction() then
        return
    end
     
    -- No need to annotate all this, it's fairly logical. Just equips the relevant sets for the relevant magic
    if spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
        if spell.name == 'Stoneskin' then
            equip(sets.midcast.stoneskin)
        elseif spell.name:match('Cure') or spell.name:match('Cura') then
            equip(sets.midcast.cure)
        elseif spell.skill == 'Enhancing Magic' then
            equip(sets.midcast.enhancing)
            if spell.name:match('Protect') or spell.name:match('Shell') then
                equip({rring="Sheltered Ring"})
            end
        else
            equip(sets.midcast.casting)
        end
    elseif spell.name == 'Elemental Siphon' then
     
        -- Siphon Set
        equip(sets.midcast.siphon)
         
        -- Checks if pet matches weather
        if pet.element == world.weather_element then
            equip(sets.midcast.siphon,{main="Chatoyant Staff"--[[Take advantage of the weather boost]]})
        end
         
    -- And our catch all, if a set exists for this spell use it
    elseif sets.midcast[spell.name] then
        equip(sets.midcast[spell.name])
         
    -- Remember those WS Sets we defined? :)
    elseif sets.me[spell.name] then
        equip(sets.me[spell.name])
    end
end
 
function aftercast(spell)
 
    -- If our pet's doing something, Stop!
    if pet_midaction() then
        return
    end 
     
    -- If not a blood pact or summon
    if spell and (not spell.type or not string.find(spell.type,'BloodPact') and not AvatarList:contains(spell.name) or spell.interrupted) then
     
        -- Then initiate idle function to check which set should be equipped
        idle(pet)
         
    end
end
 
function pet_midcast(spell)
 
    -- Our pet is doing something
    if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') then
     
        -- We're going to check the lists in global.lua for matches and equip the relevant sets
         
        if bp_physical:contains(spell.name) then
         
            equip(sets.avatar.atk)
             
        elseif bp_hybrid:contains(spell.name) then
         
            equip(sets.avatar.hybrid)
            if pet.name == 'Ifrit' then
                equip({rring="Fervor Ring"})--[[Change rring to lring if you put Evoker's on your right hand]]
            end
             
        elseif bp_magical:contains(spell.name) then
         
            equip(sets.avatar.mab)
            if pet.name == 'Ifrit' then
                equip({rring="Fervor Ring"})--[[Change rring to lring if you put Evoker's on your right hand]]
            end
 
        elseif bp_debuff:contains(spell.name) then
         
            equip(sets.avatar.macc)
             
        elseif bp_buff:contains(spell.name) then
         
            equip(sets.avatar.buff)
             
        elseif bp_other:contains(spell.name) then
         
            equip(sets.avatar.other)
             
        elseif spell.name == 'Perfect Defense' then
         
            equip(sets.avatar.skill)
             
        else
         
            equip(sets.avatar.skill)
             
        end
    end 
end
 
function pet_aftercast(spell)
     
    -- Pet aftercast is simply a check for whether Conduit and Apogee are up, and then a call to our aftercast function
    -- We have a variable called autobp that we set to true or false with commands to auto repeat BPs for us
    if (buffactive['Apogee'] or buffactive['Astral Conduit']) and autobp then
        send_command('input /pet "%s" <t>':format(spell.name))
        return
    end
     
    idle(pet)
     
end
 
function idle(pet)
 
    -- This function is called after every action, and handles which set to equip depending on what we're doing
    -- We check if we're meleeing because we don't want to idle in melee gear when we're only engaged for trusts
     
    if favor then
     
        -- Avatar's favor takes priority!
        equip(sets.me.favor)
         
    elseif meleeing and player.status=='Engaged' then
     
        -- We're both engaged and meleeing
        equip(sets.me.melee)
         
    elseif pet.isvalid then
         
        -- We have a pet out but we're not meleeing, set the right idle set
        equip(sets.avatar[mode])
 
    else
     
        -- We're not meleeing and we have no pet out
        equip(sets.me.idle)
         
    end
end
 
function status_change(new,old)
    if new == 'Engaged' then
     
        -- If we engage check our meleeing status
        idle(pet)
         
    elseif new=='Resting' then
     
        -- We're resting
        equip(sets.me.resting)
    end
end
 
function pet_change(pet,gain)
 
    -- When we summon or release an avatar
    idle(pet)
 
end
 
 
function self_command(command)
  
    local commandArgs = command
      
    -- This command takes //gs c avatar mode, where mode is what you want, eg, tank, acc, melee, etc
    if #commandArgs:split(' ') >= 2 then
        commandArgs = T(commandArgs:split(' '))
        if commandArgs[1] == 'avatar' then
            if commandArgs[2] then
                mode = tostring(commandArgs[2])
                equip(sets.avatar[mode])
                windower.add_to_chat(8,'----- Avatar set to '..mode..' mode! -----')
            end
        elseif commandArgs[1] == 'toggle' then
            if commandArgs[2] == 'auto' then
              
                -- //gs c toggle auto will toggle auto blood pacts on and off. Auto blood pact will make your GS repeat BPs under Apogee or Conduit
                -- And by repeat I mean repeat. If Conduit is up, it will SPAM the BP until Conduit is down
                if autobp then
                    autobp = false
                    windower.add_to_chat(8,'----- Auto BP mode Disabled -----')
                else
                    autobp = true
                    windower.add_to_chat(8,'----- Auto BP mode Enabled -----')
                end
            elseif commandArgs[2] == 'exping' then
              
                -- //gs c toggle melee will toggle melee mode on and off.
                -- This basically locks the slots that will cause you to lose TP if changing them,
                -- As well as equip your melee set if you're engaged
  
                if exping then
                    exping = false
                    enable('back')
                    windower.add_to_chat(8,'----- Cape Unlocked, WILL LOSE EXP -----')
                    idle(pet)
                else
                    exping=true
                    disable('back')
                    windower.add_to_chat(8,'----- Cape Locked, WILL NOT LOSE EXP -----')
                    idle(pet)
                end
                  
            elseif commandArgs[2] == 'favor' then
                      
                -- //gs c toggle favor will toggle Favor mode on and off.
                -- It won't automatically toggle, as some people like having favor active without the gear swaps for maximum effectiveness
                -- You need to toggle prioritisation yourself
                if favor then
                    favor = false
                    windower.add_to_chat(8,"----- Avatar's Favor Mode OFF -----")
                else
                    favor = true
                    windower.add_to_chat(8,"----- Avatar's Favor Mode ON -----")
                end
            -- Handles executing blood pacts in a generic, avatar-agnostic way.
            -- //gs c pact [pacttype]
            elseif commandArgs[1]:lower() == 'pact' then
                if not pet.isvalid then
                        windower.add_to_chat(122,'No avatar currently available. Returning to default macro set.')
                        set_macros(1,2)
                    return
                end
               
                if not commandArgs[2] then
                    windower.add_to_chat(123,'No pact type given.')
                    return
                end
               
                local pact = commandArgs[2]:lower()
               
                if not pacts[pact] then
                    windower.add_to_chat(123,'Unknown pact type: '..tostring(pact))
                    return
                end
               
                if pacts[pact][pet.name] then
                    if pact == 'astralflow' and not buffactive['astral flow'] then
                        windower.add_to_chat(122,'Cannot use Astral Flow pacts at this time.')
                        return
                    end
               
                    -- Leave out target; let Shortcuts auto-determine it.
                    send_command('@input /pet "'..pacts[pact][pet.name]..'"')
                else
                    windower.add_to_chat(122,pet.name..' does not have a pact of type ['..pact..'].')
                end    
            end
        end
    end
end
 
-- Required variables and their initial value
meleeing = false
autobp = false
favor = false
mode = "perp" 
            
            
                
			
			By Elizabet 2015-10-05 02:30:36			
			
						
                     
                 That looks fine at glance, I'll test once I get home but just noticed... Quote:  I've tried to add the /console gs c bp75 commands and nothing happens. 
is "/console gs c bp75" your macro? If yes, that may be your problem. It needs to be:
 Quote:  /console gs c pact bp75
or
 Quote:  /console gs c pact bp70
or
 Quote:  /console gs c pact buffDefense
etc...                                     
            
                
                    
                    
                    
                                                            
                                                    
                                                                            
                                Server: Hades Game: FFXI Posts: 11 
                
			
			By Hades.Ramorakomo 2015-10-05 03:17:00			
			
						
                     
                 /console gs c pact bp75 = what I use.                                     
    
    
        
        GitHub: Thanks to Elizabet for hosting this on GitHub
People have been having issues with Mote's SMN Gearswap recently. After lengthy conversations on the topic as well as going through his files, I believe the files themselves are to blame. Several people, evidently myself included, have not had issues with custom SMN Lua files. As a result, and due to several requests, I've decided to post my Lua to provide a viable alternative to Mote's. I make no elaborate claims that this is better (or worse, for that matter), I'm sharing purely so people can try it for themselves.
 
I give my personal guarantee that everything worked 100% at the time of posting, tested numerous times with Abyssea Revitalizers.
 
The inline comments should assist you in setting this up. You'll find it's much simpler than most SMN Luas. With no disrespect meant to people who have helped people out with Gear Swap, I find SMN Luas in particular to be way more complicated than they need to be, often containing dozens of lines of superfluous code.
What this Lua is: What this Lua is not:SimpleDoes not rely on lengthy includes or libraries, which will make it easier to trouble shoot should part of it not be working correctly at some pointCut and paste ready. I've even taken the liberty of not adding gear so you can type yours in quicker
 ComplicatedNirvana ready. I don't and will never own a Nirvana so Aftermaths are moot to me. If enough people want this, I'm happy to add it thoughThe best of the bestest all others suck etc, judge for yourself
 
With that said, here we go. This comes in two files: firstly, global.lua, which contains a list of blood pacts and what not, as well as a couple of my own functions that I use in all my Lua files (like auto style lock, macro books, etc.) The second file is the lua file itself that you'll need to add your equipment to. Be sure to remove blank lines when you're done (ie, hands="".)
 
You can put the global.lua file contents at the start of your SMN.lua file if you prefer, that way you have no includes.
Global.lua: SMN.Lua:Code  function set_macros(sheet,book)
	if book then 
		send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(sheet))
		return
	end
	send_command('@input /macro set '..tostring(sheet))
end
function set_style(sheet)
	send_command('@input /lockstyleset '..sheet)
end
bp_physical=S{'Punch','Rock Throw','Barracuda Dive','Claw','Axe Kick','Shock Strike','Camisado','Regal Scratch','Poison Nails','Moonlit Charge','Crescent Fang','Rock Buster','Tail Whip','Double Punch','Megalith Throw','Double Slap','Eclipse Bite','Mountain Buster','Spinning Dive','Predator Claws','Rush','Chaotic Strike','Crag Throw','Volt Strike'}bp_hybrid=S{'Burning Strike','Flaming Crush'}bp_magical=S{'Inferno','Earthen Fury','Tidal Wave','Aerial Blast','Diamond Dust','Judgment Bolt','Searing Light','Howling Moon','Ruinous Omen','Fire II','Stone II','Water II','Aero II','Blizzard II','Thunder II','Thunderspark','Somnolence','Meteorite','Fire IV','Stone IV','Water IV','Aero IV','Blizzard IV','Thunder IV','Nether Blast','Meteor Strike','Geocrush','Grand Fall','Wind Blade','Heavenly Strike','Thunderstorm','Level ? Holy','Holy Mist','Lunar Bay','Night Terror','Conflag Strike'}bp_debuff=S{'Lunar Cry','Mewing Lullaby','Nightmare','Lunar Roar','Slowga','Ultimate Terror','Sleepga','Eerie Eye','Tidal Roar','Diamond Storm','Shock Squall','Pavor Nocturnus'}bp_buff=S{'Shining Ruby','Frost Armor','Rolling Thunder','Crimson Howl','Lightning Armor','Ecliptic Growl','Hastega','Noctoshield','Ecliptic Howl','Dream Shroud','Earthen Armor','Fleet Wind','Inferno Howl','Soothing Ruby','Heavenward Howl','Soothing Current','Hastega II','Crystal Blessing'}bp_other=S{'Healing Ruby','Raise II','Aerial Armor','Reraise II','Whispering Wind','Glittering Ruby','Earthen Ward','Spring Water','Healing Ruby II'} AvatarList=S{'Shiva','Ramuh','Garuda','Leviathan','Diabolos','Titan','Fenrir','Ifrit','Carbuncle','Fire Spirit','Air Spirit','Ice Spirit','Thunder Spirit','Light Spirit','Dark Spirit','Earth Spirit','Water Spirit','Cait Sith','Alexander','Odin','Atomos'}spirit_element={Fire='Fire Spirit',Earth='Earth Spirit',Water='Water Spirit',Wind='Air Spirit',Ice='Ice Spirit',Lightning='Thunder Spirit',Light='Light Spirit',Dark='Dark Spirit'}spirit_conflict={Fire='Ice',Earth='Lightning',Water='Fire',Wind='Earth',Ice='Wind',Lightning='Water',Light='Dark',Dark='Light'}Code  include('global.lua') -- Just a collection of functions that I use in all my GearSwaps. See below (after this code block)
set_macros(1,2) -- Sheet, Book
function get_sets()
	-- My formatting is very easy to follow. All sets that pertain to my character doing things are under 'me'.
	-- All sets that are equipped to faciliate my avatar's behaviour or abilities are under 'avatar', eg, Perpetuation, Blood Pacts, etc
	
	sets.me = {}
	sets.avatar = {}
	
	-- Your idle set when you DON'T have an avatar out
	sets.me.idle = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	
	-- Your MP Recovered Whilst Resting Set
	sets.me.resting = {	
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	
	-----------------------
	-- Perpetuation Related
	-----------------------
	
	-- Avatar's Out --	
	-- This is the base for all perpetuation scenarios, as seen below
	sets.avatar.perp = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	-- The following sets base off of perpetuation, so you can consider them idle sets.
	-- Set the relevant gear, bearing in mind it will overwrite the perpetuation item for that slot!
	
	-- When we want our avatar to stay alive
	sets.avatar.tank = set_combine(sets.avatar.perp,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- When we want our avatar to shred
	sets.avatar.melee = set_combine(sets.avatar.perp,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- When we want our avatar to hit
	sets.avatar.acc = set_combine(sets.avatar.perp,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- When Avatar's Favori s active
	sets.avatar.favor = set_combine(sets.avatar.perp,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	----------------------------
	-- Summoning Skill Related
	-- Including all blood pacts
	----------------------------
	
	-- + Summoning Magic. This is a base set for max skill and blood pacts and we'll overwrite later as and when we need to
	sets.avatar.skill = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	
	-------------------------
	-- Individual Blood Pacts
	-------------------------
	
	-- Physical damage
	sets.avatar.atk = set_combine(sets.avatar.skill,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Magic Attack
	sets.avatar.mab = set_combine(sets.avatar.skill,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	-- Hybrid
	sets.avatar.hybrid = set_combine(sets.avatar.skill,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Magic Accuracy
	sets.avatar.macc = set_combine(sets.avatar.skill,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Buffs
	sets.avatar.buff = set_combine(sets.avatar.skill,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Other
	sets.avatar.other = set_combine(sets.avatar.skill,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Combat Related Sets
	
	-- Melee
	-- The melee set combines with perpetuation, because we don't want to be losing all our MP whilst we swing our Staff
	-- Anything you equip here will overwrite the perpetuation/refresh in that slot.
	sets.me.melee = set_combine(sets.avatar.perp,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Shattersoul. Weapon Skills do not work off perpetuation as it only stays equipped for a moment
	sets.me["Shattersoul"] = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	sets.me["Garland of Bliss"] = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	
	-- Feel free to add new weapon skills, make sure you spell it the same as in game. These are the only two I ever use though
	---------------
	-- Casting Sets
	---------------
	
	sets.precast = {}
	sets.midcast = {}
	sets.aftercast = {}
	
	----------
	-- Precast
	----------
	
	-- Generic Casting Set that all others take off of. Here you should add all your fast cast	
	sets.precast.casting = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}	
	
	-- Summoning Magic Cast time - gear
	sets.precast.summoning = set_combine(sets.precast.casting,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Enhancing Magic, eg. Siegal Sash, etc
	sets.precast.enhancing = set_combine(sets.precast.casting,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	-- Stoneskin casting time -, works off of enhancing -
	sets.precast.stoneskin = set_combine(sets.precast.enhancing,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Curing Precast, Cure Spell Casting time -
	sets.precast.cure = set_combine(sets.precast.casting,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	---------------------
	-- Ability Precasting
	---------------------
	
	-- Blood Pact Ability Delay
	sets.precast.bp = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	
	-- Mana Cede
	sets.precast["Mana Cede"] = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	
	-- Astral Flow	
	sets.precast["Astral Flow"] = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	
	-- Elemental Siphon, eg, Tatsumaki Thingies, Esper Stone, etc
	sets.precast.siphon = set_combine(sets.avatar.skill,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	----------
	-- Midcast
	----------
	
	-- We handle the damage and etc. in Pet Midcast later
	
	-- Whatever you want to equip mid-cast as a catch all for all spells, and we'll overwrite later for individual spells
	sets.midcast.casting = {
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	}
	
	-- Enhancing
	sets.midcast.enhancing = set_combine(sets.midcast.casting,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Stoneskin
	sets.midcast.stoneskin = set_combine(sets.midcast.enhancing,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	-- Cure Potency
	sets.midcast.cure = set_combine(sets.midcast.casting,{
		main="",
		sub="",
		ranged="",
		ammo="",
		head="",
		neck="",
		lear="",
		rear="",
		body="",
		hands="",
		lring="",
		rring="",
		back="",
		waist="",
		legs="",
		feet=""
	})
	
	------------
	-- Aftercast
	------------
	
	-- I don't use aftercast sets, as we handle what to equip later depending on conditions using a function, eg, do we have an avatar out?
end
function precast(spell)
	-- Don't swap if we're in the middle of something or our pet's doing something
	-- Stops macro spam from interfering with an action GS is already handling
    if midaction() or pet_midaction() then
        return
    end
	
	-- If we're doing a blood pact, equip our delay set IF Apogee or Astral Conduit are not active
    if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') and not (buffactive['Astral Conduit'] or buffactive['Apogee']) then
	
        equip(sets.precast.bp)
		
    elseif spell.type == 'SummonerPact' then
	
		-- This chunk of code handles Elemental Siphon. It will look at the current day and weather and cancel the spell to summon
		-- the right elemental. Your elemental siphon macro should summon a Dark Spirit to trigger this check
		
		-- These use the included lists in global.lua to determine the right spirit to summon
			
        if spell.name == 'Dark Spirit' then
            if world.weather_element == 'Dark' then
			
				-- Dark Weather is active, lets the spell go ahead and equips summoning precast
                equip(sets.precast.summoning)
				
			elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then
			
				-- It's not dark weather but there is some weather up, cancels dark and summons the right spirit
                cancel_spell()
                send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element]))
				equip(sets.precast.summoning)
				
            elseif world.day_element == 'Dark' then
			
				-- It's darksday so allow the dark spirit to go ahead and equip summoning
                equip(sets.precast.summoning)
				
            else
			
				-- There is no weather up and it's not darksday, so summon the current day's spirit
                cancel_spell()				
                send_command('input /ma "%s" <me>':format(spirit_element[world.day_element]))
				equip(sets.precast.summoning)
				
            end
		else
		
			-- We're not summoning Dark Spirit, so we don't want to Siphon, which means we're summoning an avatar
			equip(sets.precast.summoning)
			
		end
		
	-- Moving on to other types of magic
	elseif spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
	
		-- Stoneskin Precast
        if spell.name == 'Stoneskin' then
		
            windower.ffxi.cancel_buff(37)--[[Cancels stoneskin, not delayed incase you get a Quick Cast]]
            equip(sets.precast.stoneskin)
			
		-- Cure Precast
        elseif spell.name:match('Cure') or spell.name:match('Cura') then
		
            equip(sets.precast.cure)
			
		-- Enhancing Magic
        elseif spell.skill == 'Enhancing Magic' then
		
            equip(sets.precast.enhancing)
			
            if spell.name == 'Sneak' then
                windower.ffxi.cancel_buff(71)--[[Cancels Sneak]]
            end
        else
		
			-- For everything else we go with max fastcast
            equip(sets.precast.casting)
			
        end
		
	-- Summoner Abilities
	-- We use a catch all here, if the set exists for an ability, use it
	-- This way we don't need to write a load of different code for different abilities, just make a set
	
	elseif sets.precast[spell.name] then
        equip(sets.precast[spell.name])
    end
	
end
function midcast(spell)
	-- If our pet is doing something, prevents us swapping equipment too early
    if pet_midaction() then
        return
    end
	
	-- No need to annotate all this, it's fairly logical. Just equips the relevant sets for the relevant magic
	if spell.type == 'WhiteMagic' or spell.type == 'BlackMagic' then
        if spell.name == 'Stoneskin' then
            equip(sets.midcast.stoneskin)
        elseif spell.name:match('Cure') or spell.name:match('Cura') then
            equip(sets.midcast.cure)
        elseif spell.skill == 'Enhancing Magic' then
            equip(sets.midcast.enhancing)
			if spell.name:match('Protect') or spell.name:match('Shell') then
				equip({rring="Sheltered Ring"})
            end
        else
            equip(sets.midcast.casting)
        end
    elseif spell.name == 'Elemental Siphon' then
	
		-- Siphon Set
        equip(sets.precast.siphon)
		
		-- Checks if pet matches weather
        if pet.element == world.weather_element then
            equip(sets.precast.siphon,{main="Chatoyant Staff"--[[Take advantage of the weather boost]]})
		end
		
	-- And our catch all, if a set exists for this spell use it
	elseif sets.midcast[spell.name] then
		equip(sets.midcast[spell.name])
		
	-- Remember those WS Sets we defined? :)
	elseif sets.me[spell.name] then
		equip(sets.me[spell.name])
	end
end
function aftercast(spell)
	-- If our pet's doing something, Stop!
    if pet_midaction() then
        return
    end	
	
	-- If not a blood pact or summon
	if spell and (not spell.type or not string.find(spell.type,'BloodPact') and not AvatarList:contains(spell.name) or spell.interrupted) then
	
		-- Then initiate idle function to check which set should be equipped
		idle(pet)
		
	end
end
function pet_midcast(spell)
	-- Our pet is doing something
    if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') then
	
		-- We're going to check the lists in global.lua for matches and equip the relevant sets
		
		if bp_physical:contains(spell.name) then
		
            equip(sets.avatar.atk)
			
        elseif bp_hybrid:contains(spell.name) then
		
            equip(sets.avatar.hybrid)
			if pet.name == 'Ifrit' then
				equip({rring="Fervor Ring"})--[[Change rring to lring if you put Evoker's on your right hand]]
			end
			
        elseif bp_magical:contains(spell.name) then
		
			equip(sets.avatar.mab)
			if pet.name == 'Ifrit' then
				equip({rring="Fervor Ring"})--[[Change rring to lring if you put Evoker's on your right hand]]
			end
		elseif bp_debuff:contains(spell.name) then
		
            equip(sets.avatar.macc)
			
        elseif bp_buff:contains(spell.name) then
		
            equip(sets.avatar.buff)
			
        elseif bp_other:contains(spell.name) then
		
            equip(sets.avatar.other)
			
        elseif spell.name == 'Perfect Defense' then
		
			equip(sets.avatar.skill)
			
		else
		
			equip(sets.avatar.skill)
			
		end
	end	
end
function pet_aftercast(spell)
	
	-- Pet aftercast is simply a check for whether Conduit and Apogee are up, and then a call to our aftercast function
	-- We have a variable called autobp that we set to true or false with commands to auto repeat BPs for us
    if (buffactive['Apogee'] or buffactive['Astral Conduit']) and autobp then
        send_command('input /pet "%s" <t>':format(spell.name))
		return
	end
	
	idle(pet)
	
end
function idle(pet)
	-- This function is called after every action, and handles which set to equip depending on what we're doing
	-- We check if we're meleeing because we don't want to idle in melee gear when we're only engaged for trusts
	
	if favor then
	
		-- Avatar's favor takes priority!
		equip(sets.avatar.favor)
		
	elseif meleeing and player.status=='Engaged' then
	
		-- We're both engaged and meleeing
		equip(sets.me.melee)
		
	elseif pet.isvalid then
		
		-- We have a pet out but we're not meleeing, set the right idle set
		equip(sets.avatar[mode])
	else
	
		-- We're not meleeing and we have no pet out
		equip(sets.me.idle)
		
	end
end
function status_change(new,old)
    if new == 'Engaged' then
	
		-- If we engage check our meleeing status
		idle(pet)
		
	elseif new=='Resting' then
	
		-- We're resting
        equip(sets.me.resting)
	else
		idle(pet)
	end
end
function pet_change(pet,gain)
	-- When we summon or release an avatar
    idle(pet)
end
function self_command(command)
	local commandArgs = command
	
	-- This command takes //gs c avatar mode, where mode is what you want, eg, tank, acc, melee, etc
    if #commandArgs:split(' ') >= 2 then
        commandArgs = T(commandArgs:split(' '))
		if commandArgs[1] == 'avatar' then
			if commandArgs[2] then
				mode = tostring(commandArgs[2])
				equip(sets.avatar[mode])
				windower.add_to_chat(8,'----- Avatar set to '..mode..' mode! -----')
			end
		elseif commandArgs[1] == 'toggle' then
			if commandArgs[2] == 'auto' then
			
				-- //gs c toggle auto will toggle auto blood pacts on and off. Auto blood pact will make your GS repeat BPs under Apogee or Conduit
				-- And by repeat I mean repeat. If Conduit is up, it will SPAM the BP until Conduit is down
				if autobp then
					autobp = false
					windower.add_to_chat(8,'----- Auto BP mode Disabled -----')
				else
					autobp = true
					windower.add_to_chat(8,'----- Auto BP mode Enabled -----')
				end
			elseif commandArgs[2] == 'melee' then
			
				-- //gs c toggle melee will toggle melee mode on and off.
				-- This basically locks the slots that will cause you to lose TP if changing them,
				-- As well as equip your melee set if you're engaged
				if meleeing then
					meleeing = false
					enable('main','sub','ranged')
					windower.add_to_chat(8,'----- Weapons Unlocked, WILL LOSE TP -----')
					idle(pet)
				else
					meleeing=true
					disable('main','sub','ranged')
					windower.add_to_chat(8,'----- Weapons Locked, WILL NOT LOSE TP -----')
					idle(pet)
				end
				
			elseif commandArgs[2] == 'favor' then
					
				-- //gs c toggle favor will toggle Favor mode on and off.
				-- It won't automatically toggle, as some people like having favor active without the gear swaps for maximum effectiveness
				-- You need to toggle prioritisation yourself
				if favor then
					favor = false
					windower.add_to_chat(8,"----- Avatar's Favor Mode OFF -----")
				else
					favor = true
					windower.add_to_chat(8,"----- Avatar's Favor Mode ON -----")
				end
				
			end
		end
	end
end
-- Required variables and their initial value
meleeing = false
autobp = false
favor = false
mode = "perp"
Here's a run down on commands:
//gs c avatar [mode] 
Replace [mode] with either: perp, tank, melee, acc to set your avatar's idling equipment to a particular setup. Perp is for maximum perp- and refresh, tank for tanking, melee for doing maximum physical damage and acc for accuracy.
//gs c toggle melee 
This will toggle your character between melee mode. Initially set to false, enabling this will idle to your melee set when engaged as well as disable slots that changing items in would remove TP. With this turned off being engaged will not equip your melee gear, so you can stay engaged for the purposes of trusts whilst keeping your relevant perpetuation gear on.
//gs c toggle auto 
Initially turned off, using this command will toggle auto blood pacts on Apogee and Conduit. By auto I literally mean auto. Using a blood pact with this on will use it again instantly if you have Apogee or Conduit up. If you have Conduit up, your character will spam abilities until you either toggle this off or Conduit drops.
//gs c toggle favor 
Initially turned off, this command will toggle your character into favor prioritisation mode. This means that, with this on, Avatar's Favor set will override other idle sets, including melee. Using Avatar's Favor will not  toggle this automatically. One particular problem with lots of Luas is this assumption is made, and most end users don't know how to disable it.
 
There are times and places we want maximum Favor power, and they are quite limited. You be the judge and set this yourself when you want it.
 
--
 
If you have any questions or problems, please reply and I'll try and help. |  |