RUN Gearswap Template

Language: JP EN DE FR
New Items
2023-11-19
users online
Forum » FFXI » Jobs » Rune Fencer » RUN Gearswap template
RUN Gearswap template
 Sylph.Jeanpaul
MSPaint Champion
Offline
Server: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2016-02-22 19:21:26
Link | Quote | Reply
 
I get asked about this a lot, so here's a template I give to people. Unlike other templates out there, this is a stand-alone lua file, so you don't need that extra Mote stuff. I also think this format is a lot simpler and I've added some notes to help new Gearswap users. Disregard gear choices since this is fairly dated from my own use. Enjoy!
Code
function get_sets()
                --Idle Sets--
                sets.Idle = {				ammo="Homiliary",
									  head="Futhark Bandeau +1",neck="Twilight Torque",ear1="Hearty Earring",ear2="Ethereal Earring",	
                                      body="Futhark coat +1",hands="Erilaz Gauntlets +1",ring1="Patricius Ring",ring2="Defending Ring",		
                                      back="Evasionist's Cape",waist="Flume Belt",legs="Erilaz Leg Guards +1",feet="Skadi's Jambeaux +1"}	
								  
                --TP Sets--
                sets.TP = {}
                sets.TP.index = {'Standard', 'Accuracy', 'DT', 'MDTacc'}
                TP_ind = 1
				--offensive melee set
				sets.TP.Standard = {		ammo="Ginsen",
									head="Dampening Tam",neck="Asperity Necklace",ear1="Brutal Earring",ear2="Ethereal Earring",
                                    body="Rawhide Vest",hands="Erilaz Gauntlets +1",ring1="Epona's Ring",ring2="Rajas Ring",
                                    back="Evasionist's Cape",waist="Chaac Belt",legs="Taeon Tights",feet="Futhark Boots +1"}                                                     
				--high accuracy/DT hybrid set
				sets.TP.Accuracy = {		ammo="Falcon Eye",
									head="Dampening Tam",neck="Twilight Torque",ear1="Steelflash Earring",ear2="Zennaroi Earring",		
                                    body="Emet Harness +1",hands="Erilaz Gauntlets +1",ring1="Patricius Ring",ring2="Defending Ring",	
                                    back="Evasionist's Cape",waist="Olseni Belt",legs="Taeon Tights",feet="Taeon Boots"}                  	                                  
				--full DT melee set
				sets.TP.DT = {				ammo="Falcon Eye",			
									head="Dampening Tam",neck="Twilight Torque",ear1="Hearty Earring",ear2="Zennaroi Earring",			
                                    body="Futhark coat +1",hands="Erilaz Gauntlets +1",ring1="Patricius Ring",ring2="Defending Ring",	
                                    back="Evasionist's Cape",waist="Flume Belt",legs="Erilaz Leg Guards +1",feet="Erilaz Greaves +1"}                                          
				--MDT melee set
				sets.TP.MDTacc = {			ammo="Falcon Eye",			
                                    head="Dampening Tam",neck="Twilight Torque",ear1="Steelflash Earring",ear2="Zennaroi Earring",			
                                    body="Rawhide Vest",hands="Erilaz Gauntlets +1",ring1="Shadow Ring",ring2="Defending Ring",			
                                    back="Evasionist's Cape",waist="Olseni Belt",legs="Runeist Trousers +1",feet="Taeon Boots"}			
									
                --Weaponskill Sets--
                sets.WS = {}     
				--multi, carries FTP
				sets.Resolution = {						ammo="Seething Bomblet +1",				
                                          head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Moonshade Earring",
                                          body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
                                          back="Evasionist's Cape",waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"} 
                --single, doesn't carry FTP
				sets.Single = {							ammo="Seething Bomblet +1",				
                                          head="Dampening Tam",neck="Fotia Gorget",ear1="Ishvara earring",ear2="Moonshade Earring",
                                          body="Rawhide Vest",hands="Rawhide Gloves",ring1="Ramuh Ring +1",ring2="Rajas Ring",
                                          back="Evasionist's Cape",waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"}  
                --single hit, benefits from DA
				sets.Cleave = {							ammo="Seething Bomblet +1",
                                          head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Zennaroi Earring",
                                          body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Ramuh Ring +1",
                                          back="Evasionist's Cape",waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"}
				--added effect
				sets.Shockwave = {						ammo="Falcon Eye",
                                          head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Zennaroi Earring",
                                          body="Samnuha Coat",hands="Leyline Gloves",ring1="Epona's Ring",ring2="Ramuh Ring +1",
                                          back="Evasionist's Cape",waist="Eschan Stone",legs="Lustratio Subligar +1",feet="Taeon Boots"}								
                --Requiescat
				sets.Req = {							ammo="Seething Bomblet +1",
                                          head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Moonshade Earring",
                                          body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
                                          back="Evasionist's Cape",waist="Fotia Belt",legs="Taeon Tights",feet="Taeon Boots"}										  
				--crit based
				sets.Vorp = {							ammo="Qirmiz Tathlum",
                                          head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Moonshade Earring",
                                          body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
                                          back="Evasionist's Cape",waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"}
				--magic WS
				sets.HercSlash = {						ammo="Seething Bomblet +1",
                                          head="Highwing Helm",neck="Deviant Necklace",lear="Hecate's Earring",rear="Friomisi earring",
                                          body="Samnuha Coat",hands="Leyline Gloves",ring1="Acumen Ring",
                                          back="Argochampsa Mantle",waist="Eschan Stone",legs="Limbo Trousers",feet="Adhemar Gamashes"}  
                
				sets.Utility = {}	
				--full PDT set for when stunned, etc.
				sets.Utility.PDT = {		ammo="Vanir Battery",
									head="Erilaz Galea +1",neck="Twilight Torque",ear1="Hearty Earring",ear2="Ethereal Earring",			
                                    body="Futhark coat +1",hands="Erilaz Gauntlets +1",ring1="Patricius Ring",ring2="Defending Ring",		
                                    back="Evasionist's Cape",waist="Flume Belt",legs="Erilaz Leg Guards +1",feet="Erilaz Greaves +1"}		
				--full MDT set for when stunned, etc
				sets.Utility.MDT = {		ammo="Vanir Battery",
									head="Dampening Tam",neck="Twilight Torque",ear1="Hearty Earring",ear2="Zennaroi Earring",			
                                    body="Rawhide Vest",hands="Erilaz Gauntlets +1",ring1="Shadow Ring",ring2="Defending Ring",				
                                    back="Engulfer Cape +1",waist="Olseni Belt",legs="Runeist Trousers +1",feet="Erilaz Greaves +1"}		
						
                --Job Ability Sets--
                sets.JA = {}
                sets.JA.Lunge = {ammo="Seething Bomblet +1",
								 head="Highwing Helm",neck="Deviant Necklace",lear="Hecate's Earring",rear="Friomisi earring",		
								 body="Samnuha Coat",hands="Leyline Gloves",ring1="Acumen Ring",						 
                                 back="Argochampsa Mantle",waist="Eschan Stone",legs="Limbo Trousers",feet="Adhemar Gamashes"}	
                sets.JA.Vallation = {body="Runeist Coat +1",legs="Futhark Trousers +1"}       
                sets.JA.Gambit = {hands="Runeist mitons +1"}
				sets.JA.Rayke = {feet="Futhark bottes +1"}	
				sets.JA.Battuta = {head="Futhark bandeau +1"}      
                sets.JA.Pflug = {feet="Runeist bottes +1"}				
				sets.JA.Pulse = {head="Erilaz Galea +1",legs="Runeist Trousers +1"}
			    			   
                --Precast Sets--
                --Fast Cast set
				sets.precast = {head="Runeist bandeau +1",
								body="Samnuha Coat",hands="Leyline Gloves",
													legs="Limbo Trousers"}
				sets.Phalanx = {head="Futhark bandeau +1",body="Taeon Tabard",legs="Futhark Trousers +1"}										
				--Enmity set for high hate generating spells and JAs				
				sets.Enmity =  {head="Highwing Helm",neck="Unmoving Collar +1",rear="Friomisi earring", 		
								body="Emet Harness +1",hands="Nilas Gloves",									
								back="Earthcry Mantle",legs="Erilaz Leg Guards",feet="Erilaz Greaves +1"}	
				--Magic acc for enfeebles, handy for VW
				sets.MagicAcc = {head="Dampening Tam",ear1="Gwati Earring",
								body="Samnuha Coat",hands="Leyline Gloves",
								waist="Salire Belt",legs="Runeist Trousers +1",feet="Iuitl Gaiters +1"}				
				
				--Toggle TP sets button, change if you want; currently ALT+F9 toggles forward, CTRL+F9 toggles backwards
				send_command('bind !f9 gs c toggle TP set')
				send_command('bind ^f9 gs c reverse TP set')
				--other stuff, don't touch
				ShadowType = 'None'
end

--the following section looks at the weather/day to see if the Hachirin-no-Obi is worth using
--add the following line to a section to have it check the element and equip the obi:
-->>>	mid_obi(spell.element,spell.name)
function mid_obi(spelement,spellname)
    if spelement == nil then
    spelement = "Light"
    end
    if spellname == nil then
    spellname = "Cure"
    end   
    elements = {}
        elements.list = S{'Fire','Ice','Wind','Earth','Lightning','Water','Light','Dark'}
        elements.number = {[0]="Fire",[1]="Ice",[2]="Wind",[3]="Earth",[4]="Lightning",[5]="Water",[6]="Light",[7]="Dark"}
        elements.weak = {['Light']='Dark', ['Dark']='Light', ['Fire']='Water', ['Ice']='Fire', ['Wind']='Ice', ['Earth']='Wind',
    ['Lightning']='Earth', ['Water']='Lightning'}
        weather = world.weather_element
        intensity = 1 + (world.weather_id % 2)
        day = world.day
        boost = 0
        obi = nil
       
	   for _,buff in pairs (windower.ffxi.get_player().buffs) do
            if buff > 177 and buff < 186 then
                weather = elements.number[(buff - 178)]
                intensity = 1
            elseif buff > 588 and buff < 597 then
                weather = elements.number[(buff - 589)]
                intensity = 2
            end
            if spellname == "Swipe" or spellname == "Lunge" or spellname == "Vivacious Pulse" then
                if buff > 522 and buff < 531 then
                spelement = elements.number[(buff - 523)]
                end
            end
        end
        if weather == spelement then
        boost = boost + intensity
        elseif weather == elements.weak[spelement] then
        boost = boost - intensity
        end
        if day == spelement then
        boost = boost + 1
        elseif day == elements.weak[spelement] then
        boost = boost - 1
        end
        if boost > 0 then
			if player.inventory["Hachirin-no-Obi"] or player.wardrobe["Hachirin-no-Obi"] then
				equip({waist="Hachirin-no-Obi"})
			end
        end
end
               
function precast(spell,abil)
		--equips favorite weapon if disarmed
		if player.equipment.main == "empty" or player.equipment.sub == "empty" then
				equip({main="Epeolatry",sub="Bloodrain Strap"})
		end
		if spell.action_type == 'Magic' then 
                equip(sets.Utility.PDT,sets.precast)			
        end  
		if spell.skill == 'Enhancing Magic' then
				equip({legs="Futhark Trousers +1"})
		end
		if string.find(spell.name,'Utsusemi') then
                equip({neck="Magoraga Beads"})
        end  
        if spell.name == 'Lunge' or spell.name == 'Swipe' then
                equip(sets.JA.Lunge)
				mid_obi(spell.element,spell.name)
        end      
		--prevents Valiance/Vallation/Liement from being prevented by each other (cancels whichever is active)
		if spell.name == 'Valiance' or spell.name == 'Vallation' or spell.name == 'Liement' then
				if buffactive['Valiance'] then
					cast_delay(0.2)
					windower.ffxi.cancel_buff(535)
				elseif buffactive['Vallation'] then
					cast_delay(0.2)
					windower.ffxi.cancel_buff(531)
				elseif buffactive['Liement'] then
					cast_delay(0.2)
					windower.ffxi.cancel_buff(537)
				end
		end
        if spell.name == 'Vallation' or spell.name == 'Valiance' then
                equip(sets.Enmity,sets.JA.Vallation)
        end  
        if spell.name == 'Pflug' then
                equip(sets.Enmity,sets.JA.Pflug)
        end      
		if spell.name == 'Elemental Sforzo' or spell.name == 'Liement' then
                equip(sets.Enmity,{body="Futhark Coat +1"})
        end      
        if spell.name == 'Gambit' then
                equip(sets.Enmity,sets.JA.Gambit)
        end
		if spell.name == 'Rayke' then
                equip(sets.Enmity,sets.JA.Rayke)
        end
        if spell.name == 'Battuta' then
                equip(sets.Enmity,sets.JA.Battuta)
        end
		if spell.name == 'Vivacious Pulse' then
                equip(sets.Enmity,sets.JA.Pulse)
				mid_obi(spell.element,spell.name)
        end
		if spell.name == 'One for All' or spell.name == 'Embolden' or spell.name == 'Odyllic Subterfuge' or spell.name == 'Warcry' 
		or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then	
				equip(sets.Enmity)
		end
		if spell.name == 'Resolution' or spell.name == 'Ruinator'  then
				equip(sets.Resolution)
		end
		if spell.name == 'Spinning Slash' 
		or spell.name == 'Ground Strike'
 		or spell.name == 'Upheaval' 
		or spell.name == 'Dimidiation' 
		or spell.name == 'Steel Cyclone'	
		or spell.name == 'Savage Blade'	then
				equip(sets.Single)
        end
		if spell.name == 'Shockwave' then
			equip(sets.Shockwave)
		end
		if spell.name == 'Fell Cleave' or spell.name == 'Circle Blade' then
                equip(sets.Cleave)
        end
		if spell.name == 'Requiescat' then
                equip(sets.Req)
        end
		if spell.name == 'Vorpal Blade' or spell.name == 'Rampage' then
                equip(sets.Vorp)
        end
		if spell.name == 'Herculean Slash' 
		or spell.name == 'Freezebite'  
		or spell.name == 'Sanguine Blade' 
		or spell.name == 'Red Lotus Blade'
		or spell.name == 'Seraph Blade' then
                equip(sets.HercSlash)
				mid_obi(spell.element,spell.name)
        end
		--prevents casting Utsusemi if you already have 3 or more shadows
		if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
			cancel_spell()
		end
		if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
				if TP_ind == 4 then
				equip(sets.Utility.MDT) else
				equip(sets.Utility.PDT)
				end
        end
		if buffactive.sleep and player.hp > 100 and player.status == "Engaged" then 
                equip({head="Frenzy Sallet"})
		end
end            
 
function midcast(spell,act,arg) 
		if spell.action_type == 'Magic' then 
                equip(sets.Utility.PDT,{head="Runeist bandeau +1"})			
        end  
		if spell.skill == 'Enhancing Magic' then
				equip({head="Erilaz Galea +1",legs="Futhark Trousers +1"})
				if spell.name == "Blink" or spell.name == "Stoneskin" or string.find(spell.name,'Utsusemi') then
					equip(sets.Utility.PDT,{head="Runeist bandeau +1",hands="Leyline Gloves"})
				elseif string.find(spell.name,'Bar') or spell.name=="Temper" then
					equip({hands="Runeist Mitons +1"})
				end
				if buffactive.embolden then
					equip({back="Evasionist's Cape"})
				end	
		end
		if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == "Stun" then 
                equip(sets.Enmity,{head="Runeist bandeau +1"})
        end 
		if spell.name == 'Phalanx' then
                equip(sets.Phalanx)
        end      
        if string.find(spell.name,'Regen') then
                equip({head="Runeist bandeau +1"})
        end
		if spell.name == "Repose" or spell.skill == 'Enfeebling Magic' or spell.skill == 'Dark Magic' then
				equip(sets.MagicAcc)
		end
		if spell.skill == 'Elemental Magic' then
				equip(sets.JA.Lunge)
				mid_obi(spell.element,spell.name)
		end
		--cancels Ni shadows (if there are only 1 or 2) when casting Ichi
		if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
				send_command('cancel Copy Image')
				send_command('cancel Copy Image (2)')
		end
end

function aftercast(spell)
		equip_current()
		if string.find(spell.name,'Utsusemi') and not spell.interrupted then
			if spell.name == 'Utsusemi: Ichi' then
			ShadowType = 'Ichi'
			elseif spell.name == 'Utsusemi: Ni' then
			ShadowType = 'Ni'
			end
		end
end

function status_change(new,old)
	equip_current()
end 
 
function equip_TP()
	equip(sets.TP[sets.TP.index[TP_ind]])
		--equips offensive gear despite being on defensive set if you have shadows
		if TP_ind == 3 and ((buffactive['Copy Image (2)'] or buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) or buffactive['Third Eye'] or buffactive['Blink']) then
			equip(sets.TP.Accuracy)
		end
		--equips DW gear if using two weapons
		if player.equipment.sub == "Tramontane Axe" or player.equipment.sub == "Pukulatmuj" or player.equipment.sub == "Anahera Sword" then
			equip({ear2="Suppanomimi"})
		end
		--equips offensive gear and relic boots during Battuta
		if buffactive.battuta then
			--remains on defensive set if Avoidance Down is active
			if buffactive['Avoidance Down'] then
			else
				if TP_ind == 3 then
					equip(sets.TP.Accuracy)
				end
			equip({feet="Futhark Boots +1"})
			end
		end
		--equip defensive gear when hit with terror/petrify/stun/sleep
		if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
				if TP_ind == 4 then
				equip(sets.Utility.MDT) else
				equip(sets.Utility.PDT)
				end
        end
		--equip Frenzy Sallet (will wake you up) if engaged, slept, and over 100 HP
		if buffactive.sleep and player.hp > 100 then 
            equip({head="Frenzy Sallet"})
		end
end

function equip_idle()
	equip(sets.Idle)
		--equips extra refresh gear when MP is below 75%
		if player.mpp < 75 then
			equip({body="Runeist Coat +1"})
		end
		--auto-equip defensive gear when hit with terror/petrify/stun/sleep
		if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
				if TP_ind == 4 then
				equip(sets.Utility.MDT) else
				equip(sets.Utility.PDT)
				end
        end
end

function buff_change(buff,gain)
	local buff = string.lower(buff)
		if buff == "terror" or buff == "petrification" or buff == "stun" or buff == "sleep" then
			if gain then  
				if TP_ind == 4 then
				equip(sets.Utility.MDT) else
				equip(sets.Utility.PDT)
				end
				if buff == "sleep" and player.hp > 100 and player.status == "Engaged" then 
				equip({head="Frenzy Sallet"})
				end
			else 
			equip_current()
			end
        end
end

function equip_current()
		if player.status == 'Engaged' then
		equip_TP()
		else
		equip_idle()
		end
end
			
function self_command(command)
		if command == 'toggle TP set' then
                TP_ind = TP_ind +1
                if TP_ind > #sets.TP.index then TP_ind = 1 end
                send_command('@input /echo <----- TP Set changed to '..sets.TP.index[TP_ind]..' ----->')
                equip_current()
		elseif command == 'reverse TP set' then
				TP_ind = TP_ind -1
				if TP_ind == 0 then TP_ind = #sets.TP.index end
                send_command('@input /echo <----- TP Set changed to '..sets.TP.index[TP_ind]..' ----->')
                equip_current()
		end
end
[+]
 Asura.Xelnok
Offline
Server: Asura
Game: FFXI
user: Xelnok
Posts: 38
By Asura.Xelnok 2016-02-22 20:57:16
Link | Quote | Reply
 
Awesome, was going to ask about a Lua that incorporates the frenzy sallet and switching gear when statused.

Thanks alot!
 Sylph.Jeanpaul
MSPaint Champion
Offline
Server: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2016-02-22 21:03:56
Link | Quote | Reply
 
I'll probably update it if I notice any errors or whatever
 Asura.Xelnok
Offline
Server: Asura
Game: FFXI
user: Xelnok
Posts: 38
By Asura.Xelnok 2016-02-25 18:20:20
Link | Quote | Reply
 
Any idea why this part isn't working when I have the DT set on with shadows up?

function equip_TP()
equip(sets.TP[sets.TP.index[TP_ind]])
--equips offensive gear despite being on defensive set if you have shadows
if TP_ind == 3 and ((buffactive['Copy Image (2)'] or buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) or buffactive['Third Eye'] or buffactive['Blink']) then
equip(sets.TP.Standard)
end

Thanks again for the GS, aside from this part its working perfectly.
 Sylph.Jeanpaul
MSPaint Champion
Offline
Server: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2016-02-25 18:30:54
Link | Quote | Reply
 
Is it never working? It should provided you are on set 3 (PDT), meleeing, and under the effect of any of the following buffs:

- Utsusemi (2 or more shadows; at 1 shadow remaining, PDT gear will go back on, as I designed this when AA Hume was my worst enemy)
- Blink (including the spell and Garuda's Aerial Armor)
- Third Eye (does not take Seigan into account, but that wouldn't matter)

Are you getting an error message? What set is being equipped when you have any of those statuses?
 Asura.Xelnok
Offline
Server: Asura
Game: FFXI
user: Xelnok
Posts: 38
By Asura.Xelnok 2016-02-25 21:22:41
Link | Quote | Reply
 
Sylph.Jeanpaul said: »
Is it never working? It should provided you are on set 3 (PDT), meleeing, and under the effect of any of the following buffs:

- Utsusemi (2 or more shadows; at 1 shadow remaining, PDT gear will go back on, as I designed this when AA Hume was my worst enemy)
- Blink (including the spell and Garuda's Aerial Armor)
- Third Eye (does not take Seigan into account, but that wouldn't matter)

Are you getting an error message? What set is being equipped when you have any of those statuses?

I have been switching over to DT (the third option)fighting random stuff in escha and have tried casting utsusemi: ichi/ni and blink and the gear never changes (it does change when I manually switch through sets though, so I know that part is working), no error pops up either, looking at the code it looks like it should work, not exactly sure why it isn't. I don't need to have any other addons installed for gearswap to read buffs do I?

Edit: It looks like it sometimes doesn't switch over when I engage the mob either, maybe it's an error on gearswaps end.
 Sylph.Jeanpaul
MSPaint Champion
Offline
Server: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2016-02-25 21:35:52
Link | Quote | Reply
 
Very strange. I won't have time to look at it tonight unfortunately, so you'll have to make due with it for now. The only other addon that this lua references is Cancel, which is for ensuring you don't negate your Wards. It's strange, because I have the exact same section in my own lua and it works fine.
 Asura.Xelnok
Offline
Server: Asura
Game: FFXI
user: Xelnok
Posts: 38
By Asura.Xelnok 2016-02-25 21:58:41
Link | Quote | Reply
 
Just tried the same exact code you posted before I modified it and it is still having issues when engaging and going idle, which is probably the same reason it isn't automatically switching gear when shadows are up.

No rush, thanks again for the help.
 Sylph.Jeanpaul
MSPaint Champion
Offline
Server: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2016-03-10 00:53:00
Link | Quote | Reply
 
Thanks to some help from Flippant on Ragnarok, the lua in the original post has been fixed, particularly with the issue you were experiencing. Note that the new version just contains the following changes:

Added this bit in its own section:
Code
function status_change(new,old)
	equip_current()
end

And also this in the buff_change section, right after the initial line:
Code
local buff = string.lower(buff)
 Quetzalcoatl.Khajit
Offline
Server: Quetzalcoatl
Game: FFXI
user: Khajit
Posts: 413
By Quetzalcoatl.Khajit 2016-03-13 14:10:04
Link | Quote | Reply
 
Just started plugging in my run stuff since i saw this lua. I kept on getting errors until I added "then" into the utsusemi section.
This is the appended code. I've not tested it yet so this could be an absolutely garbage fix.
Code
function aftercast(spell)
        equip_current()
        if string.find(spell.name,'Utsusemi') and not spell.interrupted then
            if spell.name == 'Utsusemi: Ichi' then
            ShadowType = 'Ichi' 
            elseif spell.name == 'Utsusemi: Ni' then
            ShadowType = 'Ni' 
            end
        end
end
Offline
Posts: 40
By Isilrhofal 2016-03-15 16:34:11
Link | Quote | Reply
 
Thank's for sharing.

I did adjust the file a little by adding/removing tabs, changing all lear/rear to ear1/ear2 for consistency and fixing the utsusemi part. Here the link for anyone interested:
http://pastebin.com/qrAEkzEx
 Sylph.Jeanpaul
MSPaint Champion
Offline
Server: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2016-03-15 16:56:25
Link | Quote | Reply
 
Good catch. Some of the aspects of this (like the Utsusemi thing) are part of a "general" file that I have which is referenced in my own lua. The errors here are essentially the parts of the general file that I forgot to paste over or weren't quite tested as I manually added them.
 Asura.Xelnok
Offline
Server: Asura
Game: FFXI
user: Xelnok
Posts: 38
By Asura.Xelnok 2016-03-15 19:19:45
Link | Quote | Reply
 
Has anyone successfully been able to get your gear to change when in -DT mode and casting shadows?

I was messing around with it, and I found if I am in -DT mode with shadows up, and then engage it will equip the correct (tp accuracy) set, but then when shadows drop it doesn't switch back to the DT set. If I engage without shadows it equips the DT set like it should, but when I then cast shadows I stay in the same set.

It seems that while engaged the gear won't switch depending on the buffs you have/don't have, I'm not sure if it is a plugin I am missing, or what is happening.

Thanks again for all the help, aside from this everything else is working correctly, tanked some vagary and everything worked well, (and I even got a Zennaroi Earring!)
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-03-15 21:07:25
Link | Quote | Reply
 
Tested it quickly. Has to do with the fact it takes a bit of time for the buffactive table to be updated, so it's going to return false immediately after shadows are put up. If you do a subsequent action, it will find the buff and change you into the accuracy set.

I handle these situations by maintaining my own variables using the buff_change function.
 Sylph.Jeanpaul
MSPaint Champion
Offline
Server: Sylph
Game: FFXI
user: JeanPaul
Posts: 2623
By Sylph.Jeanpaul 2016-03-15 22:03:32
Link | Quote | Reply
 
Ragnarok.Flippant said: »
Tested it quickly. Has to do with the fact it takes a bit of time for the buffactive table to be updated, so it's going to return false immediately after shadows are put up. If you do a subsequent action, it will find the buff and change you into the accuracy set.

I handle these situations by maintaining my own variables using the buff_change function.
So I guess the weakness is that it needs to hit that "equip current" function, which it's not doing with enough regularity?
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 658
By Ragnarok.Flippant 2016-03-16 02:51:24
Link | Quote | Reply
 
Well, there needs to be some sort of event to happen in order for the functions to be called. Your calls are fine; there is nothing more you can do that wouldn't become a potential nuisance. The issue is the buffactive table is not always reliable because it's a bit delayed, and you're trying to recognize that the buff is on a fraction of a second later. Even for the buffactive table to register SA or TA in time for a WS is not 100%, depending on how fast you are.

Instead, you can use buff_change to update a variable. This should run nearly instantly. The only issue with this is I'd look out for how the variable handles itself when going from 3 to 2 shadows, etc. If the gained buff is called before the lost buff, you could end up with a false negative. If this is the case, I can try to think of a different way to handle it, but that could potentially result in false positives, which would be even worse.
Code
function buff_change(buff,gain)
	local buff = string.lower(buff)
	if buff=="blink" or buff=="third eye" or buff=="copy image (2)" or buff=="copy image (3)" or buff=="copy image (4+)" then
		shadow_status = gain
		equip_current()
	end
end


For extra assurance, you can also update it using aftercast (but obviously only works for setting it to true).
Code
function aftercast(spell,action)
	if not spell.interrupted then
		if spell.english=="Blink" or spell.english=="Third Eye" or string.find(spell.english,"Utsusemi") then
			shadow_status = true
		end
		if string.find(spell.name,'Utsusemi') and then
			if spell.name == 'Utsusemi: Ichi' then
				ShadowType = 'Ichi'
			elseif spell.name == 'Utsusemi: Ni' then
				ShadowType = 'Ni'
			end
		end
	end
	equip_current()
end


Then, in your rules, you'd check for shadow_status.
Code
if TP_ind == 3 and shadow_status then


Also, be sure to initialize it in your get_sets(), although you technically don't need to.
Code
shadow_status = buffactive.Blink or buffactive["Third Eye"] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] or false
[+]
necroskull Necro Bump Detected! [78 days between previous and next post]
 Asura.Keaddo
Offline
Server: Asura
Game: FFXI
user: Kadas
Posts: 65
By Asura.Keaddo 2016-06-01 19:37:57
Link | Quote | Reply
 
I'm just about to get into RUN and this is perfect. Thank you once again :)

It's fairly different to syntax I'm used to, but it's pretty straightforward, I'll play with it as I learn how to play run :D
necroskull Necro Bump Detected! [310 days between previous and next post]
Offline
Posts: 4
By vaulout 2017-04-07 19:06:12
Link | Quote | Reply
 
So I just went through updating this for my use with gear that might not be the best, but it will give another look at some common gear you can sub to the original code.
Code
function get_sets()
                --Idle Sets--
                sets.Idle = {               ammo="Homiliary",
                                      head="Futhark Bandeau +1",neck="Twilight Torque",ear1="Hearty Earring",ear2="Ethereal Earring",   
                                      body="Futhark coat +1",hands="Erilaz Gauntlets +1",ring1="Patricius Ring",ring2="Defending Ring",     
                                      back="Evasionist's Cape",waist="Flume Belt",legs="Erilaz Leg Guards +1",feet="Skadi's Jambeaux +1"}   
                                   
                --TP Sets--
                sets.TP = {}
                sets.TP.index = {'Standard', 'Accuracy', 'DT', 'MDTacc'}
                TP_ind = 1
                --offensive melee set
                sets.TP.Standard = {        ammo="Ginsen",head={ name="Dampening Tam", augments={'DEX+10','Accuracy+15','Mag. Acc.+15','Quadruple Attack +3',}},
										body={ name="Rawhide Vest", augments={'HP+50','"Subtle Blow"+7','"Triple Atk."+2',}},hands={ name="Herculean Gloves", augments={'Accuracy+13 Attack+13','"Triple Atk."+2','AGI+7','Accuracy+11','Attack+11',}},
										legs={ name="Herculean Trousers", augments={'Attack+28','"Triple Atk."+3','Accuracy+7',}},feet={ name="Herculean Boots", augments={'"Triple Atk."+4','DEX+7','Accuracy+7','Attack+5',}},neck="Asperity Necklace",
										waist="Kentarch Belt +1",left_ear="Bladeborn Earring",right_ear="Steelflash Earring",left_ring="Epona's Ring",right_ring="Rajas Ring",back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','STR+6','"Store TP"+10',}},}                                                     
                --high accuracy/DT hybrid set
                sets.TP.Accuracy = {        ammo="Ginsen",
										head={ name="Dampening Tam", augments={'DEX+10','Accuracy+15','Mag. Acc.+15','Quadruple Attack +3',}},
										body="Meghanada Cuirie",hands={ name="Herculean Gloves", augments={'Accuracy+13 Attack+13','"Triple Atk."+2','AGI+7','Accuracy+11','Attack+11',}},
										legs={ name="Herculean Trousers", augments={'Attack+28','"Triple Atk."+3','Accuracy+7',}},feet={ name="Herculean Boots", augments={'"Triple Atk."+4','DEX+7','Accuracy+7','Attack+5',}},neck="Asperity Necklace",
										waist="Kentarch Belt +1",left_ear="Bladeborn Earring",right_ear="Steelflash Earring",left_ring="Epona's Ring",right_ring="Rajas Ring",
										back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','STR+6','"Store TP"+10',}}}                                                     
                --full DT melee set
                sets.TP.DT = {              ammo="Staunch Tathlum",head={ name="Fu. Bandeau +1", augments={'Enhances "Battuta" effect',}},body={ name="Futhark Coat +1", augments={'Enhances "Elemental Sforzo" effect',}},
										hands="Runeist Mitons +1",legs="Eri. Leg Guards +1",feet="Erilaz Greaves +1",neck="Loricate Torque",waist="Flume Belt",left_ear="Ethereal Earring",right_ear="Infused Earring",
										left_ring="Defending Ring",right_ring="Gelatinous Ring",back="Solemnity Cape",}                                          
                --MDT melee set
                sets.TP.MDTacc = {          ammo="Falcon Eye",          
										head="Dampening Tam",neck="Twilight Torque",ear1="Steelflash Earring",ear2="Zennaroi Earring",          
										body="Rawhide Vest",hands="Erilaz Gauntlets +1",ring1="Shadow Ring",ring2="Defending Ring",         
										back="Evasionist's Cape",waist="Olseni Belt",legs="Runeist Trousers +1",feet="Taeon Boots"}         
                                     
                --Weaponskill Sets--
                sets.WS = {}     
                --multi, carries FTP
                sets.Resolution = {         ammo="Aqreqaq Bomblet",head={ name="Rawhide Mask", augments={'DEX+10','STR+7','INT+7',}},
										body={ name="Rawhide Vest", augments={'HP+50','"Subtle Blow"+7','"Triple Atk."+2',}},hands={ name="Herculean Gloves", augments={'Accuracy+13 Attack+13','"Triple Atk."+2','AGI+7','Accuracy+11','Attack+11',}},
										legs={ name="Carmine Cuisses", augments={'HP+60','STR+10','INT+10',}},feet={ name="Rawhide Boots", augments={'STR+10','Attack+15','"Store TP"+5',}},neck="Chivalrous Chain",
										waist="Warwolf Belt",left_ear={ name="Moonshade Earring", augments={'Rng.Atk.+4','TP Bonus +25',}},right_ear="Steelflash Earring",left_ring="Rajas Ring",
										right_ring="Apate Ring",back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','STR+6','"Store TP"+10',}},} 									
				--single, doesn't carry FTP
                sets.Single = {            ammo="Ginsen",head="Aya. Zucchetto +1",body="Meghanada Cuirie",hands="Meghanada Gloves",legs={ name="Samnuha Tights", augments={'STR+6','DEX+8',}},
										feet="Aya. Gambieras +1",neck="Asperity Necklace",waist="Pipilaka Belt",left_ear={ name="Moonshade Earring", augments={'Rng.Atk.+4','TP Bonus +25',}},
										right_ear="Steelflash Earring",left_ring="Apate Ring",right_ring="Rajas Ring",back="Kayapa Cape",}  
                --single hit, benefits from DA
                sets.Cleave = {            ammo="Seething Bomblet +1",
                                        head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Zennaroi Earring",
                                        body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Ramuh Ring +1",
                                        back="Evasionist's Cape",waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"}
                --added effect
                sets.Shockwave = {         ammo="Falcon Eye",
                                        head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Zennaroi Earring",
                                        body="Samnuha Coat",hands="Leyline Gloves",ring1="Epona's Ring",ring2="Ramuh Ring +1",
                                        back="Evasionist's Cape",waist="Eschan Stone",legs="Lustratio Subligar +1",feet="Taeon Boots"}                                
                --Requiescat
                sets.Req = {               ammo="Seething Bomblet +1",
                                        head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Moonshade Earring",
                                        body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
                                        back="Evasionist's Cape",waist="Fotia Belt",legs="Taeon Tights",feet="Taeon Boots"}                                         
                --crit based
                sets.Vorp = {                           ammo="Qirmiz Tathlum",
                                          head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Moonshade Earring",
                                          body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
                                          back="Evasionist's Cape",waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"}
                --magic WS
                sets.HercSlash = {                      ammo="Seething Bomblet +1",
                                          head="Highwing Helm",neck="Deviant Necklace",lear="Hecate's Earring",rear="Friomisi earring",
                                          body="Samnuha Coat",hands="Leyline Gloves",ring1="Acumen Ring",
                                          back="Argochampsa Mantle",waist="Eschan Stone",legs="Limbo Trousers",feet="Adhemar Gamashes"}  
                 
                sets.Utility = {}   
                --full PDT set for when stunned, etc.
                sets.Utility.PDT = {        ammo="Staunch Tathlum",head={ name="Fu. Bandeau +1", augments={'Enhances "Battuta" effect',}},body={ name="Futhark Coat +1", augments={'Enhances "Elemental Sforzo" effect',}},
										hands="Runeist Mitons +1",legs="Eri. Leg Guards +1",feet="Erilaz Greaves +1",neck="Loricate Torque",waist="Flume Belt",left_ear="Ethereal Earring",right_ear="Infused Earring",
										left_ring="Defending Ring",right_ring="Gelatinous Ring",back="Solemnity Cape",}       
                --full MDT set for when stunned, etc
                sets.Utility.MDT = {        ammo="Vanir Battery",
                                    head="Dampening Tam",neck="Twilight Torque",ear1="Hearty Earring",ear2="Zennaroi Earring",          
                                    body="Rawhide Vest",hands="Erilaz Gauntlets +1",ring1="Shadow Ring",ring2="Defending Ring",             
                                    back="Engulfer Cape +1",waist="Olseni Belt",legs="Runeist Trousers +1",feet="Erilaz Greaves +1"}        
                         
                --Job Ability Sets--
                sets.JA = {}
                sets.JA.Lunge = {ammo="Seething Bomblet +1",
                                 head="Highwing Helm",neck="Deviant Necklace",lear="Hecate's Earring",rear="Friomisi earring",      
                                 body="Samnuha Coat",hands="Leyline Gloves",ring1="Acumen Ring",                         
                                 back="Argochampsa Mantle",waist="Eschan Stone",legs="Limbo Trousers",feet="Adhemar Gamashes"}  
                sets.JA.Vallation = {body="Runeist Coat +1",legs="Futhark Trousers +1"}       
                sets.JA.Gambit = {hands="Runeist mitons +1"}
                sets.JA.Rayke = {feet="Futhark bottes +1"}  
                sets.JA.Battuta = {head="Futhark bandeau +1"}      
                sets.JA.Pflug = {feet="Runeist bottes +1"}              
                sets.JA.Pulse = {head="Erilaz Galea +1",legs="Runeist Trousers +1"}
                                
                --Precast Sets--
                --Fast Cast set
                sets.precast = {head="Runeist bandeau +1",
                                body="Samnuha Coat",hands="Leyline Gloves",
                                legs="Limbo Trousers"}
                sets.Phalanx = {head="Futhark bandeau +1",body="Taeon Tabard",legs="Futhark Trousers +1"}                                       
                --Enmity set for high hate generating spells and JAs                
                sets.Enmity =  {ammo="Aqreqaq Bomblet",head={ name="Despair Helm", augments={'STR+15','Enmity+7','"Store TP"+3',}},
								body="Emet Harness",hands="Meghanada Gloves",legs="Eri. Leg Guards +1",feet="Erilaz Greaves +1",neck="Unmoving Collar",
								waist="Warwolf Belt",left_ear="Incubus Earring",right_ear="Friomisi Earring",back={ name="Evasionist's Cape", augments={'Enmity+3','"Dbl.Atk."+3','Damage taken-4%',}}}  
                --Magic acc for enfeebles, handy for VW
                sets.MagicAcc = {head="Dampening Tam",body="Samnuha Coat",hands="Leyline Gloves",
                                waist="Salire Belt",legs="Runeist Trousers +1"}             
                 
                --Toggle TP sets button, change if you want; currently ALT+F9 toggles forward, CTRL+F9 toggles backwards
                send_command('bind !f9 gs c toggle TP set')
                send_command('bind ^f9 gs c reverse TP set')
                --other stuff, don't touch
                ShadowType = 'None'
end
 
--the following section looks at the weather/day to see if the Hachirin-no-Obi is worth using
--add the following line to a section to have it check the element and equip the obi:
-->>>  mid_obi(spell.element,spell.name)
function mid_obi(spelement,spellname)
    if spelement == nil then
    spelement = "Light"
    end
    if spellname == nil then
    spellname = "Cure"
    end   
    elements = {}
        elements.list = S{'Fire','Ice','Wind','Earth','Lightning','Water','Light','Dark'}
        elements.number = {[0]="Fire",[1]="Ice",[2]="Wind",[3]="Earth",[4]="Lightning",[5]="Water",[6]="Light",[7]="Dark"}
        elements.weak = {['Light']='Dark', ['Dark']='Light', ['Fire']='Water', ['Ice']='Fire', ['Wind']='Ice', ['Earth']='Wind',
    ['Lightning']='Earth', ['Water']='Lightning'}
        weather = world.weather_element
        intensity = 1 + (world.weather_id % 2)
        day = world.day
        boost = 0
        obi = nil
        
       for _,buff in pairs (windower.ffxi.get_player().buffs) do
            if buff > 177 and buff < 186 then
                weather = elements.number[(buff - 178)]
                intensity = 1
            elseif buff > 588 and buff < 597 then
                weather = elements.number[(buff - 589)]
                intensity = 2
            end
            if spellname == "Swipe" or spellname == "Lunge" or spellname == "Vivacious Pulse" then
                if buff > 522 and buff < 531 then
                spelement = elements.number[(buff - 523)]
                end
            end
        end
        if weather == spelement then
        boost = boost + intensity
        elseif weather == elements.weak[spelement] then
        boost = boost - intensity
        end
        if day == spelement then
        boost = boost + 1
        elseif day == elements.weak[spelement] then
        boost = boost - 1
        end
        if boost > 0 then
            if player.inventory["Hachirin-no-Obi"] or player.wardrobe["Hachirin-no-Obi"] then
                equip({waist="Hachirin-no-Obi"})
            end
        end
end
                
function precast(spell,abil)
        --equips favorite weapon if disarmed
        if player.equipment.main == "empty" or player.equipment.sub == "empty" then
                equip({main="Epeolatry",sub="Bloodrain Strap"})
        end
        if spell.action_type == 'Magic' then 
                equip(sets.Utility.PDT,sets.precast)            
        end  
        if spell.skill == 'Enhancing Magic' then
                equip({legs="Futhark Trousers +1"})
        end
        if string.find(spell.name,'Utsusemi') then
                equip({neck="Magoraga Beads"})
        end  
        if spell.name == 'Lunge' or spell.name == 'Swipe' then
                equip(sets.JA.Lunge)
                mid_obi(spell.element,spell.name)
        end      
        --prevents Valiance/Vallation/Liement from being prevented by each other (cancels whichever is active)
        if spell.name == 'Valiance' or spell.name == 'Vallation' or spell.name == 'Liement' then
                if buffactive['Valiance'] then
                    cast_delay(0.2)
                    windower.ffxi.cancel_buff(535)
                elseif buffactive['Vallation'] then
                    cast_delay(0.2)
                    windower.ffxi.cancel_buff(531)
                elseif buffactive['Liement'] then
                    cast_delay(0.2)
                    windower.ffxi.cancel_buff(537)
                end
        end
        if spell.name == 'Vallation' or spell.name == 'Valiance' then
                equip(sets.Enmity,sets.JA.Vallation)
        end  
        if spell.name == 'Pflug' then
                equip(sets.Enmity,sets.JA.Pflug)
        end      
        if spell.name == 'Elemental Sforzo' or spell.name == 'Liement' then
                equip(sets.Enmity,{body="Futhark Coat +1"})
        end      
        if spell.name == 'Gambit' then
                equip(sets.Enmity,sets.JA.Gambit)
        end
        if spell.name == 'Rayke' then
                equip(sets.Enmity,sets.JA.Rayke)
        end
        if spell.name == 'Battuta' then
                equip(sets.Enmity,sets.JA.Battuta)
        end
        if spell.name == 'Vivacious Pulse' then
                equip(sets.Enmity,sets.JA.Pulse)
                mid_obi(spell.element,spell.name)
        end
        if spell.name == 'One for All' or spell.name == 'Embolden' or spell.name == 'Odyllic Subterfuge' or spell.name == 'Warcry' 
        or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then   
                equip(sets.Enmity)
        end
        if spell.name == 'Resolution' or spell.name == 'Ruinator'  then
                equip(sets.Resolution)
        end
        if spell.name == 'Spinning Slash' 
        or spell.name == 'Ground Strike'
        or spell.name == 'Upheaval' 
        or spell.name == 'Dimidiation' 
        or spell.name == 'Steel Cyclone'    
        or spell.name == 'Savage Blade' then
                equip(sets.Single)
        end
        if spell.name == 'Shockwave' then
            equip(sets.Shockwave)
        end
        if spell.name == 'Fell Cleave' or spell.name == 'Circle Blade' then
                equip(sets.Cleave)
        end
        if spell.name == 'Requiescat' then
                equip(sets.Req)
        end
        if spell.name == 'Vorpal Blade' or spell.name == 'Rampage' then
                equip(sets.Vorp)
        end
        if spell.name == 'Herculean Slash' 
        or spell.name == 'Freezebite'  
        or spell.name == 'Sanguine Blade' 
        or spell.name == 'Red Lotus Blade'
        or spell.name == 'Seraph Blade' then
                equip(sets.HercSlash)
                mid_obi(spell.element,spell.name)
        end
        --prevents casting Utsusemi if you already have 3 or more shadows
        if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
            cancel_spell()
        end
        if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
                if TP_ind == 4 then
                equip(sets.Utility.MDT) else
                equip(sets.Utility.PDT)
                end
        end
        if buffactive.sleep and player.hp > 100 and player.status == "Engaged" then 
                equip({head="Frenzy Sallet"})
        end
end            
  
function midcast(spell,act,arg) 
        if spell.action_type == 'Magic' then 
                equip(sets.Utility.PDT,{head="Runeist bandeau +1"})         
        end  
        if spell.skill == 'Enhancing Magic' then
                equip({head="Erilaz Galea +1",legs="Futhark Trousers +1"})
                if spell.name == "Blink" or spell.name == "Stoneskin" or string.find(spell.name,'Utsusemi') then
                    equip(sets.Utility.PDT,{head="Runeist bandeau +1",hands="Leyline Gloves"})
                elseif string.find(spell.name,'Bar') or spell.name=="Temper" then
                    equip({hands="Runeist Mitons +1"})
                end
                if buffactive.embolden then
                    equip({back="Evasionist's Cape"})
                end 
        end
        if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == "Stun" then 
                equip(sets.Enmity,{head="Runeist bandeau +1"})
        end 
        if spell.name == 'Phalanx' then
                equip(sets.Phalanx)
        end      
        if string.find(spell.name,'Regen') then
                equip({head="Runeist bandeau +1"})
        end
        if spell.name == "Repose" or spell.skill == 'Enfeebling Magic' or spell.skill == 'Dark Magic' then
                equip(sets.MagicAcc)
        end
        if spell.skill == 'Elemental Magic' then
                equip(sets.JA.Lunge)
                mid_obi(spell.element,spell.name)
        end
        --cancels Ni shadows (if there are only 1 or 2) when casting Ichi
        if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
                send_command('cancel Copy Image')
                send_command('cancel Copy Image (2)')
        end
end
 
function aftercast(spell)
        equip_current()
        if string.find(spell.name,'Utsusemi') and not spell.interrupted then
            if spell.name == 'Utsusemi: Ichi' then
            ShadowType = 'Ichi'
            elseif spell.name == 'Utsusemi: Ni' then
            ShadowType = 'Ni'
            end
        end
end
 
function status_change(new,old)
    equip_current()
end 
  
function equip_TP()
    equip(sets.TP[sets.TP.index[TP_ind]])
        --equips offensive gear despite being on defensive set if you have shadows
        if TP_ind == 3 and ((buffactive['Copy Image (2)'] or buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) or buffactive['Third Eye'] or buffactive['Blink']) then
            equip(sets.TP.Accuracy)
        end
        --equips DW gear if using two weapons
        if player.equipment.sub == "Tramontane Axe" or player.equipment.sub == "Pukulatmuj" or player.equipment.sub == "Anahera Sword" then
            equip({ear2="Suppanomimi"})
        end
        --equips offensive gear and relic boots during Battuta
        if buffactive.battuta then
            --remains on defensive set if Avoidance Down is active
            if buffactive['Avoidance Down'] then
            else
                if TP_ind == 3 then
                    equip(sets.TP.Accuracy)
                end
            equip({feet="Futhark Boots +1"})
            end
        end
        --equip defensive gear when hit with terror/petrify/stun/sleep
        if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
                if TP_ind == 4 then
                equip(sets.Utility.MDT) else
                equip(sets.Utility.PDT)
                end
        end
        --equip Frenzy Sallet (will wake you up) if engaged, slept, and over 100 HP
        if buffactive.sleep and player.hp > 100 then 
            equip({head="Frenzy Sallet"})
        end
end
 
function equip_idle()
    equip(sets.Idle)
        --equips extra refresh gear when MP is below 75%
        if player.mpp < 75 then
            equip({body="Runeist Coat +1"})
        end
        --auto-equip defensive gear when hit with terror/petrify/stun/sleep
        if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
                if TP_ind == 4 then
                equip(sets.Utility.MDT) else
                equip(sets.Utility.PDT)
                end
        end
end
 
function buff_change(buff,gain)
    local buff = string.lower(buff)
        if buff == "terror" or buff == "petrification" or buff == "stun" or buff == "sleep" then
            if gain then  
                if TP_ind == 4 then
                equip(sets.Utility.MDT) else
                equip(sets.Utility.PDT)
                end
                if buff == "sleep" and player.hp > 100 and player.status == "Engaged" then 
                equip({head="Frenzy Sallet"})
                end
            else 
            equip_current()
            end
        end
end
 
function equip_current()
        if player.status == 'Engaged' then
        equip_TP()
        else
        equip_idle()
        end
end
             
function self_command(command)
        if command == 'toggle TP set' then
                TP_ind = TP_ind +1
                if TP_ind > #sets.TP.index then TP_ind = 1 end
                send_command('@input /echo <----- TP Set changed to '..sets.TP.index[TP_ind]..' ----->')
                equip_current()
        elseif command == 'reverse TP set' then
                TP_ind = TP_ind -1
                if TP_ind == 0 then TP_ind = #sets.TP.index end
                send_command('@input /echo <----- TP Set changed to '..sets.TP.index[TP_ind]..' ----->')
                equip_current()
        end
end
necroskull Necro Bump Detected! [89 days between previous and next post]
 Asura.Berlon
Offline
Server: Asura
Game: FFXI
user: Berlack
Posts: 34
By Asura.Berlon 2017-07-06 06:52:08
Link | Quote | Reply
 
vaulout said: »
So I just went through updating this for my use with gear that might not be the best, but it will give another look at some common gear you can sub to the original code.
Code
function get_sets()
                --Idle Sets--
                sets.Idle = {               ammo="Homiliary",
                                      head="Futhark Bandeau +1",neck="Twilight Torque",ear1="Hearty Earring",ear2="Ethereal Earring",   
                                      body="Futhark coat +1",hands="Erilaz Gauntlets +1",ring1="Patricius Ring",ring2="Defending Ring",     
                                      back="Evasionist's Cape",waist="Flume Belt",legs="Erilaz Leg Guards +1",feet="Skadi's Jambeaux +1"}   
                                   
                --TP Sets--
                sets.TP = {}
                sets.TP.index = {'Standard', 'Accuracy', 'DT', 'MDTacc'}
                TP_ind = 1
                --offensive melee set
                sets.TP.Standard = {        ammo="Ginsen",head={ name="Dampening Tam", augments={'DEX+10','Accuracy+15','Mag. Acc.+15','Quadruple Attack +3',}},
										body={ name="Rawhide Vest", augments={'HP+50','"Subtle Blow"+7','"Triple Atk."+2',}},hands={ name="Herculean Gloves", augments={'Accuracy+13 Attack+13','"Triple Atk."+2','AGI+7','Accuracy+11','Attack+11',}},
										legs={ name="Herculean Trousers", augments={'Attack+28','"Triple Atk."+3','Accuracy+7',}},feet={ name="Herculean Boots", augments={'"Triple Atk."+4','DEX+7','Accuracy+7','Attack+5',}},neck="Asperity Necklace",
										waist="Kentarch Belt +1",left_ear="Bladeborn Earring",right_ear="Steelflash Earring",left_ring="Epona's Ring",right_ring="Rajas Ring",back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','STR+6','"Store TP"+10',}},}                                                     
                --high accuracy/DT hybrid set
                sets.TP.Accuracy = {        ammo="Ginsen",
										head={ name="Dampening Tam", augments={'DEX+10','Accuracy+15','Mag. Acc.+15','Quadruple Attack +3',}},
										body="Meghanada Cuirie",hands={ name="Herculean Gloves", augments={'Accuracy+13 Attack+13','"Triple Atk."+2','AGI+7','Accuracy+11','Attack+11',}},
										legs={ name="Herculean Trousers", augments={'Attack+28','"Triple Atk."+3','Accuracy+7',}},feet={ name="Herculean Boots", augments={'"Triple Atk."+4','DEX+7','Accuracy+7','Attack+5',}},neck="Asperity Necklace",
										waist="Kentarch Belt +1",left_ear="Bladeborn Earring",right_ear="Steelflash Earring",left_ring="Epona's Ring",right_ring="Rajas Ring",
										back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','STR+6','"Store TP"+10',}}}                                                     
                --full DT melee set
                sets.TP.DT = {              ammo="Staunch Tathlum",head={ name="Fu. Bandeau +1", augments={'Enhances "Battuta" effect',}},body={ name="Futhark Coat +1", augments={'Enhances "Elemental Sforzo" effect',}},
										hands="Runeist Mitons +1",legs="Eri. Leg Guards +1",feet="Erilaz Greaves +1",neck="Loricate Torque",waist="Flume Belt",left_ear="Ethereal Earring",right_ear="Infused Earring",
										left_ring="Defending Ring",right_ring="Gelatinous Ring",back="Solemnity Cape",}                                          
                --MDT melee set
                sets.TP.MDTacc = {          ammo="Falcon Eye",          
										head="Dampening Tam",neck="Twilight Torque",ear1="Steelflash Earring",ear2="Zennaroi Earring",          
										body="Rawhide Vest",hands="Erilaz Gauntlets +1",ring1="Shadow Ring",ring2="Defending Ring",         
										back="Evasionist's Cape",waist="Olseni Belt",legs="Runeist Trousers +1",feet="Taeon Boots"}         
                                     
                --Weaponskill Sets--
                sets.WS = {}     
                --multi, carries FTP
                sets.Resolution = {         ammo="Aqreqaq Bomblet",head={ name="Rawhide Mask", augments={'DEX+10','STR+7','INT+7',}},
										body={ name="Rawhide Vest", augments={'HP+50','"Subtle Blow"+7','"Triple Atk."+2',}},hands={ name="Herculean Gloves", augments={'Accuracy+13 Attack+13','"Triple Atk."+2','AGI+7','Accuracy+11','Attack+11',}},
										legs={ name="Carmine Cuisses", augments={'HP+60','STR+10','INT+10',}},feet={ name="Rawhide Boots", augments={'STR+10','Attack+15','"Store TP"+5',}},neck="Chivalrous Chain",
										waist="Warwolf Belt",left_ear={ name="Moonshade Earring", augments={'Rng.Atk.+4','TP Bonus +25',}},right_ear="Steelflash Earring",left_ring="Rajas Ring",
										right_ring="Apate Ring",back={ name="Ogma's cape", augments={'DEX+20','Accuracy+20 Attack+20','STR+6','"Store TP"+10',}},} 									
				--single, doesn't carry FTP
                sets.Single = {            ammo="Ginsen",head="Aya. Zucchetto +1",body="Meghanada Cuirie",hands="Meghanada Gloves",legs={ name="Samnuha Tights", augments={'STR+6','DEX+8',}},
										feet="Aya. Gambieras +1",neck="Asperity Necklace",waist="Pipilaka Belt",left_ear={ name="Moonshade Earring", augments={'Rng.Atk.+4','TP Bonus +25',}},
										right_ear="Steelflash Earring",left_ring="Apate Ring",right_ring="Rajas Ring",back="Kayapa Cape",}  
                --single hit, benefits from DA
                sets.Cleave = {            ammo="Seething Bomblet +1",
                                        head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Zennaroi Earring",
                                        body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Ramuh Ring +1",
                                        back="Evasionist's Cape",waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"}
                --added effect
                sets.Shockwave = {         ammo="Falcon Eye",
                                        head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Zennaroi Earring",
                                        body="Samnuha Coat",hands="Leyline Gloves",ring1="Epona's Ring",ring2="Ramuh Ring +1",
                                        back="Evasionist's Cape",waist="Eschan Stone",legs="Lustratio Subligar +1",feet="Taeon Boots"}                                
                --Requiescat
                sets.Req = {               ammo="Seething Bomblet +1",
                                        head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Moonshade Earring",
                                        body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
                                        back="Evasionist's Cape",waist="Fotia Belt",legs="Taeon Tights",feet="Taeon Boots"}                                         
                --crit based
                sets.Vorp = {                           ammo="Qirmiz Tathlum",
                                          head="Dampening Tam",neck="Fotia Gorget",ear1="Brutal earring",ear2="Moonshade Earring",
                                          body="Rawhide Vest",hands="Rawhide Gloves",ring1="Epona's Ring",ring2="Rajas Ring",
                                          back="Evasionist's Cape",waist="Fotia Belt",legs="Lustratio Subligar +1",feet="Lustratio Leggings +1"}
                --magic WS
                sets.HercSlash = {                      ammo="Seething Bomblet +1",
                                          head="Highwing Helm",neck="Deviant Necklace",lear="Hecate's Earring",rear="Friomisi earring",
                                          body="Samnuha Coat",hands="Leyline Gloves",ring1="Acumen Ring",
                                          back="Argochampsa Mantle",waist="Eschan Stone",legs="Limbo Trousers",feet="Adhemar Gamashes"}  
                 
                sets.Utility = {}   
                --full PDT set for when stunned, etc.
                sets.Utility.PDT = {        ammo="Staunch Tathlum",head={ name="Fu. Bandeau +1", augments={'Enhances "Battuta" effect',}},body={ name="Futhark Coat +1", augments={'Enhances "Elemental Sforzo" effect',}},
										hands="Runeist Mitons +1",legs="Eri. Leg Guards +1",feet="Erilaz Greaves +1",neck="Loricate Torque",waist="Flume Belt",left_ear="Ethereal Earring",right_ear="Infused Earring",
										left_ring="Defending Ring",right_ring="Gelatinous Ring",back="Solemnity Cape",}       
                --full MDT set for when stunned, etc
                sets.Utility.MDT = {        ammo="Vanir Battery",
                                    head="Dampening Tam",neck="Twilight Torque",ear1="Hearty Earring",ear2="Zennaroi Earring",          
                                    body="Rawhide Vest",hands="Erilaz Gauntlets +1",ring1="Shadow Ring",ring2="Defending Ring",             
                                    back="Engulfer Cape +1",waist="Olseni Belt",legs="Runeist Trousers +1",feet="Erilaz Greaves +1"}        
                         
                --Job Ability Sets--
                sets.JA = {}
                sets.JA.Lunge = {ammo="Seething Bomblet +1",
                                 head="Highwing Helm",neck="Deviant Necklace",lear="Hecate's Earring",rear="Friomisi earring",      
                                 body="Samnuha Coat",hands="Leyline Gloves",ring1="Acumen Ring",                         
                                 back="Argochampsa Mantle",waist="Eschan Stone",legs="Limbo Trousers",feet="Adhemar Gamashes"}  
                sets.JA.Vallation = {body="Runeist Coat +1",legs="Futhark Trousers +1"}       
                sets.JA.Gambit = {hands="Runeist mitons +1"}
                sets.JA.Rayke = {feet="Futhark bottes +1"}  
                sets.JA.Battuta = {head="Futhark bandeau +1"}      
                sets.JA.Pflug = {feet="Runeist bottes +1"}              
                sets.JA.Pulse = {head="Erilaz Galea +1",legs="Runeist Trousers +1"}
                                
                --Precast Sets--
                --Fast Cast set
                sets.precast = {head="Runeist bandeau +1",
                                body="Samnuha Coat",hands="Leyline Gloves",
                                legs="Limbo Trousers"}
                sets.Phalanx = {head="Futhark bandeau +1",body="Taeon Tabard",legs="Futhark Trousers +1"}                                       
                --Enmity set for high hate generating spells and JAs                
                sets.Enmity =  {ammo="Aqreqaq Bomblet",head={ name="Despair Helm", augments={'STR+15','Enmity+7','"Store TP"+3',}},
								body="Emet Harness",hands="Meghanada Gloves",legs="Eri. Leg Guards +1",feet="Erilaz Greaves +1",neck="Unmoving Collar",
								waist="Warwolf Belt",left_ear="Incubus Earring",right_ear="Friomisi Earring",back={ name="Evasionist's Cape", augments={'Enmity+3','"Dbl.Atk."+3','Damage taken-4%',}}}  
                --Magic acc for enfeebles, handy for VW
                sets.MagicAcc = {head="Dampening Tam",body="Samnuha Coat",hands="Leyline Gloves",
                                waist="Salire Belt",legs="Runeist Trousers +1"}             
                 
                --Toggle TP sets button, change if you want; currently ALT+F9 toggles forward, CTRL+F9 toggles backwards
                send_command('bind !f9 gs c toggle TP set')
                send_command('bind ^f9 gs c reverse TP set')
                --other stuff, don't touch
                ShadowType = 'None'
end
 
--the following section looks at the weather/day to see if the Hachirin-no-Obi is worth using
--add the following line to a section to have it check the element and equip the obi:
-->>>  mid_obi(spell.element,spell.name)
function mid_obi(spelement,spellname)
    if spelement == nil then
    spelement = "Light"
    end
    if spellname == nil then
    spellname = "Cure"
    end   
    elements = {}
        elements.list = S{'Fire','Ice','Wind','Earth','Lightning','Water','Light','Dark'}
        elements.number = {[0]="Fire",[1]="Ice",[2]="Wind",[3]="Earth",[4]="Lightning",[5]="Water",[6]="Light",[7]="Dark"}
        elements.weak = {['Light']='Dark', ['Dark']='Light', ['Fire']='Water', ['Ice']='Fire', ['Wind']='Ice', ['Earth']='Wind',
    ['Lightning']='Earth', ['Water']='Lightning'}
        weather = world.weather_element
        intensity = 1 + (world.weather_id % 2)
        day = world.day
        boost = 0
        obi = nil
        
       for _,buff in pairs (windower.ffxi.get_player().buffs) do
            if buff > 177 and buff < 186 then
                weather = elements.number[(buff - 178)]
                intensity = 1
            elseif buff > 588 and buff < 597 then
                weather = elements.number[(buff - 589)]
                intensity = 2
            end
            if spellname == "Swipe" or spellname == "Lunge" or spellname == "Vivacious Pulse" then
                if buff > 522 and buff < 531 then
                spelement = elements.number[(buff - 523)]
                end
            end
        end
        if weather == spelement then
        boost = boost + intensity
        elseif weather == elements.weak[spelement] then
        boost = boost - intensity
        end
        if day == spelement then
        boost = boost + 1
        elseif day == elements.weak[spelement] then
        boost = boost - 1
        end
        if boost > 0 then
            if player.inventory["Hachirin-no-Obi"] or player.wardrobe["Hachirin-no-Obi"] then
                equip({waist="Hachirin-no-Obi"})
            end
        end
end
                
function precast(spell,abil)
        --equips favorite weapon if disarmed
        if player.equipment.main == "empty" or player.equipment.sub == "empty" then
                equip({main="Epeolatry",sub="Bloodrain Strap"})
        end
        if spell.action_type == 'Magic' then 
                equip(sets.Utility.PDT,sets.precast)            
        end  
        if spell.skill == 'Enhancing Magic' then
                equip({legs="Futhark Trousers +1"})
        end
        if string.find(spell.name,'Utsusemi') then
                equip({neck="Magoraga Beads"})
        end  
        if spell.name == 'Lunge' or spell.name == 'Swipe' then
                equip(sets.JA.Lunge)
                mid_obi(spell.element,spell.name)
        end      
        --prevents Valiance/Vallation/Liement from being prevented by each other (cancels whichever is active)
        if spell.name == 'Valiance' or spell.name == 'Vallation' or spell.name == 'Liement' then
                if buffactive['Valiance'] then
                    cast_delay(0.2)
                    windower.ffxi.cancel_buff(535)
                elseif buffactive['Vallation'] then
                    cast_delay(0.2)
                    windower.ffxi.cancel_buff(531)
                elseif buffactive['Liement'] then
                    cast_delay(0.2)
                    windower.ffxi.cancel_buff(537)
                end
        end
        if spell.name == 'Vallation' or spell.name == 'Valiance' then
                equip(sets.Enmity,sets.JA.Vallation)
        end  
        if spell.name == 'Pflug' then
                equip(sets.Enmity,sets.JA.Pflug)
        end      
        if spell.name == 'Elemental Sforzo' or spell.name == 'Liement' then
                equip(sets.Enmity,{body="Futhark Coat +1"})
        end      
        if spell.name == 'Gambit' then
                equip(sets.Enmity,sets.JA.Gambit)
        end
        if spell.name == 'Rayke' then
                equip(sets.Enmity,sets.JA.Rayke)
        end
        if spell.name == 'Battuta' then
                equip(sets.Enmity,sets.JA.Battuta)
        end
        if spell.name == 'Vivacious Pulse' then
                equip(sets.Enmity,sets.JA.Pulse)
                mid_obi(spell.element,spell.name)
        end
        if spell.name == 'One for All' or spell.name == 'Embolden' or spell.name == 'Odyllic Subterfuge' or spell.name == 'Warcry' 
        or spell.name == 'Swordplay' or spell.name == 'Rayke' or spell.name == 'Meditate' or spell.name == 'Provoke' then   
                equip(sets.Enmity)
        end
        if spell.name == 'Resolution' or spell.name == 'Ruinator'  then
                equip(sets.Resolution)
        end
        if spell.name == 'Spinning Slash' 
        or spell.name == 'Ground Strike'
        or spell.name == 'Upheaval' 
        or spell.name == 'Dimidiation' 
        or spell.name == 'Steel Cyclone'    
        or spell.name == 'Savage Blade' then
                equip(sets.Single)
        end
        if spell.name == 'Shockwave' then
            equip(sets.Shockwave)
        end
        if spell.name == 'Fell Cleave' or spell.name == 'Circle Blade' then
                equip(sets.Cleave)
        end
        if spell.name == 'Requiescat' then
                equip(sets.Req)
        end
        if spell.name == 'Vorpal Blade' or spell.name == 'Rampage' then
                equip(sets.Vorp)
        end
        if spell.name == 'Herculean Slash' 
        or spell.name == 'Freezebite'  
        or spell.name == 'Sanguine Blade' 
        or spell.name == 'Red Lotus Blade'
        or spell.name == 'Seraph Blade' then
                equip(sets.HercSlash)
                mid_obi(spell.element,spell.name)
        end
        --prevents casting Utsusemi if you already have 3 or more shadows
        if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
            cancel_spell()
        end
        if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
                if TP_ind == 4 then
                equip(sets.Utility.MDT) else
                equip(sets.Utility.PDT)
                end
        end
        if buffactive.sleep and player.hp > 100 and player.status == "Engaged" then 
                equip({head="Frenzy Sallet"})
        end
end            
  
function midcast(spell,act,arg) 
        if spell.action_type == 'Magic' then 
                equip(sets.Utility.PDT,{head="Runeist bandeau +1"})         
        end  
        if spell.skill == 'Enhancing Magic' then
                equip({head="Erilaz Galea +1",legs="Futhark Trousers +1"})
                if spell.name == "Blink" or spell.name == "Stoneskin" or string.find(spell.name,'Utsusemi') then
                    equip(sets.Utility.PDT,{head="Runeist bandeau +1",hands="Leyline Gloves"})
                elseif string.find(spell.name,'Bar') or spell.name=="Temper" then
                    equip({hands="Runeist Mitons +1"})
                end
                if buffactive.embolden then
                    equip({back="Evasionist's Cape"})
                end 
        end
        if spell.name == 'Foil' or spell.name == 'Flash' or spell.name == "Stun" then 
                equip(sets.Enmity,{head="Runeist bandeau +1"})
        end 
        if spell.name == 'Phalanx' then
                equip(sets.Phalanx)
        end      
        if string.find(spell.name,'Regen') then
                equip({head="Runeist bandeau +1"})
        end
        if spell.name == "Repose" or spell.skill == 'Enfeebling Magic' or spell.skill == 'Dark Magic' then
                equip(sets.MagicAcc)
        end
        if spell.skill == 'Elemental Magic' then
                equip(sets.JA.Lunge)
                mid_obi(spell.element,spell.name)
        end
        --cancels Ni shadows (if there are only 1 or 2) when casting Ichi
        if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
                send_command('cancel Copy Image')
                send_command('cancel Copy Image (2)')
        end
end
 
function aftercast(spell)
        equip_current()
        if string.find(spell.name,'Utsusemi') and not spell.interrupted then
            if spell.name == 'Utsusemi: Ichi' then
            ShadowType = 'Ichi'
            elseif spell.name == 'Utsusemi: Ni' then
            ShadowType = 'Ni'
            end
        end
end
 
function status_change(new,old)
    equip_current()
end 
  
function equip_TP()
    equip(sets.TP[sets.TP.index[TP_ind]])
        --equips offensive gear despite being on defensive set if you have shadows
        if TP_ind == 3 and ((buffactive['Copy Image (2)'] or buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) or buffactive['Third Eye'] or buffactive['Blink']) then
            equip(sets.TP.Accuracy)
        end
        --equips DW gear if using two weapons
        if player.equipment.sub == "Tramontane Axe" or player.equipment.sub == "Pukulatmuj" or player.equipment.sub == "Anahera Sword" then
            equip({ear2="Suppanomimi"})
        end
        --equips offensive gear and relic boots during Battuta
        if buffactive.battuta then
            --remains on defensive set if Avoidance Down is active
            if buffactive['Avoidance Down'] then
            else
                if TP_ind == 3 then
                    equip(sets.TP.Accuracy)
                end
            equip({feet="Futhark Boots +1"})
            end
        end
        --equip defensive gear when hit with terror/petrify/stun/sleep
        if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
                if TP_ind == 4 then
                equip(sets.Utility.MDT) else
                equip(sets.Utility.PDT)
                end
        end
        --equip Frenzy Sallet (will wake you up) if engaged, slept, and over 100 HP
        if buffactive.sleep and player.hp > 100 then 
            equip({head="Frenzy Sallet"})
        end
end
 
function equip_idle()
    equip(sets.Idle)
        --equips extra refresh gear when MP is below 75%
        if player.mpp < 75 then
            equip({body="Runeist Coat +1"})
        end
        --auto-equip defensive gear when hit with terror/petrify/stun/sleep
        if buffactive['terror'] or buffactive['petrification'] or buffactive['stun'] or buffactive['sleep'] then
                if TP_ind == 4 then
                equip(sets.Utility.MDT) else
                equip(sets.Utility.PDT)
                end
        end
end
 
function buff_change(buff,gain)
    local buff = string.lower(buff)
        if buff == "terror" or buff == "petrification" or buff == "stun" or buff == "sleep" then
            if gain then  
                if TP_ind == 4 then
                equip(sets.Utility.MDT) else
                equip(sets.Utility.PDT)
                end
                if buff == "sleep" and player.hp > 100 and player.status == "Engaged" then 
                equip({head="Frenzy Sallet"})
                end
            else 
            equip_current()
            end
        end
end
 
function equip_current()
        if player.status == 'Engaged' then
        equip_TP()
        else
        equip_idle()
        end
end
             
function self_command(command)
        if command == 'toggle TP set' then
                TP_ind = TP_ind +1
                if TP_ind > #sets.TP.index then TP_ind = 1 end
                send_command('@input /echo <----- TP Set changed to '..sets.TP.index[TP_ind]..' ----->')
                equip_current()
        elseif command == 'reverse TP set' then
                TP_ind = TP_ind -1
                if TP_ind == 0 then TP_ind = #sets.TP.index end
                send_command('@input /echo <----- TP Set changed to '..sets.TP.index[TP_ind]..' ----->')
                equip_current()
        end
end


So just to confirm, you dont need an include for that one? I noticed you have augmented gear listed as well, if i use the export command of GS, I can simply replace it with my gear, and it'll work, right?

Edit: Holy mother of necros.. Opps.
Log in to post.