|
Gearswap Support Thread
Carbuncle.Doryll
Serveur: Carbuncle
Game: FFXI
By Carbuncle.Doryll 2016-03-26 04:19:34
Thank you Flippant !
It would be cool if Gearswap updates could includes thes changements !
Serveur: Shiva
Game: FFXI
Posts: 15
By Shiva.Deathblossoms 2016-03-28 05:51:59
Hello all, so i have been having some trouble with my Lua file i have been working on for my thief that i have modded from bokura's lua files. my problem is that for some reason my gear will not change to reflect that i have scaled up my acc level from Low to High it will just stay in LowAcc gear or if i change the AccArray at the very beginning it will stay at the tier of ACC gear i want but if i change it at all while the lua file is loaded it will stay at my lowacc gear the rest of the time. so any and all help would be greatly welcomed at this time.
Code -- *** Credit goes to Flippant for helping me with Gearswap *** --
-- ** I Use Some of Motenten's Functions ** --
function get_sets()
AccIndex = 1
AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/Hybrid. Default ACC Set Is LowACC. The First TP Set Of Your Main Weapon Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
WeaponIndex = 1
WeaponArray = {"Melee","TH"} -- Default Sub Weapon Is Melee. Don't Input Main/Sub In TP Sets. Melee = Damage Type Dagger | TH = TH Type Dagger --
IdleIndex = 1
IdleArray = {"Movement","Regen"} -- Default Idle Set Is Movement --
SA = false
TA = false
TH = 'OFF' -- Set Default Full TH ON or OFF Here --
Rancor = 'OFF' -- Set Default Rancor ON or OFF Here --
Capa = 'OFF' -- Set Default Capacity Points+ Mantle ON or OFF Here --
target_distance = 5 -- Set Default Distance Here --
select_default_macro_book() -- Change Default Macro Book At The End --
sc_map = {SC1="Exenterator", SC2="HasteSamba", SC3="Ranged"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
sets.Idle = {
ammo="Aliyat Chakram",
head="Skulker's Bonnet +1",
neck="Asperity Necklace",
ear1="SteelFlash Earring",
ear2="Bladeborn Earring",
body="Emet Harness +1",
hands="Plun. Armlets +1",
ring1="Epona's Ring",
ring2="Rajas Ring",
back="Atheling Mantle",
waist="Windbuffet Belt +1",
legs="Herculean Trousers",
feet="Skulk. Poulaines"}
-- Regen Set --
sets.Idle.Regen = {}
-- Damage Type Daggers --
sets.Idle.Regen.Melee = set_combine(sets.Idle.Regen,{
main="Izhiikoh",
sub="Jugo Kukri +1"})
-- Damage & TH Types Daggers --
sets.Idle.Regen.TH = set_combine(sets.Idle.Regen,{
main="Izhiikoh",
sub="Jugo Kukri +1"})
-- Movement Set --
sets.Idle.Movement = set_combine(sets.Idle.Regen,{
feet="Jute Boots"})
-- Damage Type Daggers --
sets.Idle.Movement.Melee = set_combine(sets.Idle.Movement,{
main="Izhiikoh",
sub="Jugo Kukri +1"})
-- Damage & TH Types Daggers --
sets.Idle.Movement.TH = set_combine(sets.Idle.Movement,{
main="Izhiikoh",
sub="Jugo Kukri +1"})
-- Normal TP Sets --
sets.TP = {
ammo="Ginsen",
head="Felistris Mask",
neck="Asperity Necklace",
ear1="SteelFlash Earring",
ear2="Bladeborn Earring",
body="Emet Harness +1",
hands="Herculean Gloves",
ring1="Epona's Ring",
ring2="Rajas Ring",
back="Atheling Mantle",
waist="Chiner's Belt +1",
legs="Herculean Trousers",
feet="Skulk. Poulaines"}
sets.TP.MidACC = set_combine(sets.TP,{
ammo="Hasty Pinion +1",
head="Whirlpool Mask",
neck="Clotharius Torque",
body="Samnuha Coat",
hands="Plun. Armlets +1",
ring2="Patricius Ring",
waist="Windbuffet Belt +1",
legs="Samnuha Tights",
feet="Herculean Boots"})
sets.TP.HighACC = set_combine(sets.TP.MidACC,{
ammo="Seething Bomblet",
head="Skulker's Bonnet +1",
hands="Leyline Gloves"})
-- March x2 + (Haste or Samba) --
-- March + Haste + Samba --
-- (Embrava or Geo Haste) + (March or Haste or Samba) --
sets.TP.MidHaste = set_combine(sets.TP,{})
sets.TP.MidACC.MidHaste = set_combine(sets.TP.MidHaste,{})
sets.TP.HighACC.MidHaste = set_combine(sets.TP.MidACC.MidHaste,{})
-- March x2 + Haste + Samba --
-- Embrava + (March or Haste) + Samba --
-- Geo Haste + (March or Haste or Embrava) + Samba --
sets.TP.HighHaste = set_combine(sets.TP.MidHaste,{})
sets.TP.MidACC.HighHaste = set_combine(sets.TP.HighHaste,{})
sets.TP.HighACC.HighHaste = set_combine(sets.TP.MidACC.HighHaste,{})
-- Full TH TP Set --
sets.TP.TH = {
hands="Plun. Armlets +1",
waist="Chaac Belt",
feet="Skulk. Poulaines"}
-- Lock Capa Mantle --
sets.Capa = {
back="Mecisto. Mantle"}
-- TP Rancor ON Neck --
sets.TP.Rancor = {neck="Rancor Collar"}
-- TP Feint Set --
sets.TP.Feint = {legs="Plun. Culottes +1"}
-- PDT/MDT Sets --
sets.PDT = {
neck="Twilight Torque",
body="Emet Harness +1",
hands="Herculean Gloves",
ring1="Vocane Ring",
ring2="Defending Ring",
legs="Herculean Trousers",
feet="Herculean Boots"}
sets.MDT = set_combine(sets.PDT,{})
-- Hybrid/Evasion Sets --
sets.TP.Hybrid = set_combine(sets.PDT,{})
sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{})
sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{})
sets.Evasion = set_combine(sets.PDT,{})
-- WS Base Set --
sets.WS = {}
-- WS Sets --
sets.WS["Mercy Stroke"] = {}
sets.WS["Mercy Stroke"].SA = {hands="Skulk. Armlets +1"}
sets.WS["Mercy Stroke"].TA = {hands="Pill. Armlets +1"}
sets.WS.Exenterator = {
ammo="Ginsen",
head="Skulker's Bonnet +1",
neck="Asperity Necklace",
ear1="SteelFlash Earring",
ear2="Bladeborn Earring",
body="Samnuha Coat",
hands="Herculean Gloves",
ring1="K'ayres Ring",
ring2="Rajas Ring",
back="Atheling Mantle",
waist="Caudata Belt",
legs="Herculean Trousers",
feet="Herculean Boots"}
sets.WS.Exenterator.SA = set_combine(sets.WS.Exenterator,{hands="Skulk. Armlets +1"})
sets.WS.Exenterator.TA = set_combine(sets.WS.Exenterator,{hands="Pill. Armlets +1"})
sets.WS.Evisceration = {
ammo="Ginsen",
head="Skulker's Bonnet +1",
neck="Asperity Necklace",
ear1="SteelFlash Earring",
ear2="Bladeborn Earring",
body="Samnuha Coat",
hands="Herculean Gloves",
ring1="K'ayres Ring",
ring2="Rajas Ring",
back="Atheling Mantle",
waist="Chiner's Belt +1",
legs="Herculean Trousers",
feet="Herculean Boots"}
sets.WS.Evisceration.SA = set_combine(sets.WS.Evisceration,{hands="Skulk. Armlets +1"})
sets.WS.Evisceration.TA = set_combine(sets.WS.Evisceration,{hands="Pill. Armlets +1"})
sets.WS["Rudra's Storm"] = {
ammo="Ginsen",
head="Skulker's Bonnet +1",
neck="Asperity Necklace",
ear1="SteelFlash Earring",
ear2="Bladeborn Earring",
body="Samnuha Coat",
hands="Herculean Gloves",
ring1="K'ayres Ring",
ring2="Rajas Ring",
back="Atheling Mantle",
waist="Chiner's Belt +1",
legs="Herculean Trousers",
feet="Herculean Boots"}
sets.WS["Rudra's Storm"].SA = set_combine(sets.WS["Rudra's Storm"],{hands="Skulk. Armlets +1"})
sets.WS["Rudra's Storm"].TA = set_combine(sets.WS["Rudra's Storm"],{hands="Pill. Armlets +1"})
sets.WS["Aeolian Edge"] = {
ammo="Ginsen",
head="Skulker's Bonnet +1",
neck="Asperity Necklace",
ear1="SteelFlash Earring",
ear2="Bladeborn Earring",
body="Samnuha Coat",
hands="Herculean Gloves",
ring1="K'ayres Ring",
ring2="Rajas Ring",
back="Atheling Mantle",
waist="Caudata Belt",
legs="Herculean Trousers",
feet="Herculean Boots"}
sets.WS["Mandalic Stab"] = {
ammo="Ginsen",
head="Skulker's Bonnet +1",
neck="Asperity Necklace",
ear1="SteelFlash Earring",
ear2="Bladeborn Earring",
body="Samnuha Coat",
hands="Herculean Gloves",
ring1="K'ayres Ring",
ring2="Rajas Ring",
back="Atheling Mantle",
waist="Chiner's Belt +1",
legs="Herculean Trousers",
feet="Herculean Boots"}
-- JA Sets --
sets.JA = {}
TH_Gear = {hands="Plun. Armlets +1",waist="Chaac Belt",feet="Skulk. Poulaines"}
sets.JA.Conspirator = {body="Skulker's Vest +1"}
sets.JA.Accomplice = {head="Skulker's Bonnet +1"}
sets.JA.Collaborator = {head="Skulker's Bonnet +1"}
sets.JA["Perfect Dodge"] = {hands="Plun. Armlets +1"}
sets.JA.Steal = {hands="Pill. Armlets +1",legs="Pill. Culottes +1",feet="Pill. Poulaines +1"}
sets.JA.Flee = {feet="Pill. Poulaines +1"}
sets.JA.Despoil = {legs="Skulk. Culottes +1",feet="Skulk. Poulaines"}
sets.JA.Mug = {head="Plun. Bonnet +1"}
sets.JA.Hide = {body="Pillager's Vest +1"}
sets.JA.Provoke = TH_Gear
sets.JA["Sneak Attack"] = {
hands="Skulk. Armlets +1"}
sets.JA["Trick Attack"] = set_combine(sets.JA["Sneak Attack"],{hands="Pill. Armlets +1"})
-- Step Set --
sets.Step = set_combine({},TH_Gear)
-- Flourish Set --
sets.Flourish = set_combine({},TH_Gear)
-- Waltz Set --
sets.Waltz = {}
sets.Precast = {}
-- Fastcast Set --
sets.Precast.FastCast = {}
-- Utsusemi Precast Set --
sets.Precast.Utsusemi = set_combine(sets.Precast.FastCast,{neck="Magoraga Beads"})
sets.Midcast = {}
-- Magic Haste Set --
sets.Midcast.Haste = set_combine(sets.PDT,{})
end
function pretarget(spell,action)
if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
cancel_spell()
send_command('Aggressor')
elseif spell.action_type == 'Ranged Attack' and spell.target.distance > 24.9 then
cancel_spell()
add_to_chat(123, spell.name..' Canceled: [Out of Range]')
return
elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
cancel_spell()
add_to_chat(123, spell.name..' Canceled: [Out of Range]')
return
end
end
function pretarget(spell,action)
if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
cancel_spell()
send_command('input /item "Echo Drops" <me>')
elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
cancel_spell()
send_command('Aggressor')
elseif spell.action_type == 'Ranged Attack' and spell.target.distance > 24.9 then
cancel_spell()
add_to_chat(123, spell.name..' Canceled: [Out of Range]')
return
elseif spell.type == "WeaponSkill" and spell.target.distance > target_distance and player.status == 'Engaged' then -- Cancel WS If You Are Out Of Range --
cancel_spell()
add_to_chat(123, spell.name..' Canceled: [Out of Range]')
return
end
end
function precast(spell,action)
if spell.type == "WeaponSkill" then
if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
cancel_spell()
add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
return
else
equipSet = sets.WS
if equipSet[spell.english] then
equipSet = equipSet[spell.english]
end
if SA and equipSet["SA"] then
equipSet = equipSet["SA"]
end
if TA and equipSet["TA"] then
equipSet = equipSet["TA"]
end
if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
end
if spell.english == "Evisceration" and player.tp > 2990 then -- Equip Jupiter's Pearl When You Have 3000 TP --
equipSet = set_combine(equipSet,{ear1="Jupiter's Pearl"})
end
equip(equipSet)
end
elseif spell.type=="JobAbility" then
if sets.JA[spell.english] then
equip(sets.JA[spell.english])
end
if spell.english == "Sneak Attack" then
SA = true
end
if spell.english == "Trick Attack" then
TA = true
end
elseif spell.action_type == 'Magic' then
if spell.english:startswith('Utsusemi') then
if spell.english == 'Utsusemi: Ni' then
if buffactive['Copy Image (3)'] then
cancel_spell()
add_to_chat(123, spell.name .. ' Canceled: [3 Images]')
return
else
equip(sets.Precast.Utsusemi)
end
else
equip(sets.Precast.Utsusemi)
end
else
equip(sets.Precast.FastCast)
end
elseif spell.type == 'Step' then
equip(sets.Step)
elseif spell.type:endswith('Flourish') then
equip(sets.Flourish)
elseif spell.type == "Waltz" then
refine_waltz(spell,action)
equip(sets.Waltz)
elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
cast_delay(0.2)
send_command('cancel Sneak')
end
end
function midcast(spell,action)
if spell.action_type == 'Ranged Attack' then
equip(TH_Gear)
elseif spell.action_type == 'Magic' then
if spell.english:startswith('Utsusemi') then
if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)'] or buffactive['Copy Image (3)']) then
send_command('@wait 1.7;cancel Copy Image*')
end
equip(sets.Midcast.Haste)
elseif spell.english == 'Monomi: Ichi' then
if buffactive['Sneak'] then
send_command('@wait 1.7;cancel sneak')
end
equip(sets.Midcast.Haste)
else
equip(sets.Midcast.Haste)
end
end
end
function aftercast(spell,action)
if spell.type == "WeaponSkill" and not spell.interrupted then
send_command('wait 0.2;gs c TP')
end
status_change(player.status)
end
function status_change(new,old)
check_equip_lock()
if Armor == 'PDT' then
equip(sets.PDT)
elseif Armor == 'MDT' then
equip(sets.MDT)
elseif Armor == 'EVA' then
equip(sets.Evasion)
elseif new == 'Engaged' then
equipSet = sets.TP
if Armor == 'Hybrid' and equipSet["Hybrid"] then
equipSet = equipSet["Hybrid"]
end
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
if (buffactive.Embrava and (buffactive.March or buffactive.Haste) and buffactive['Haste Samba']) or (buffactive.March == 2 and buffactive.Haste and buffactive['Haste Samba']) or (buffactive[580] and (buffactive.March or buffactive.Haste or buffactive.Embrava) and buffactive['Haste Samba']) and equipSet["HighHaste"] then
equipSet = equipSet["HighHaste"]
end
if ((buffactive.Embrava or buffactive[580]) and (buffactive.March or buffactive.Haste or buffactive['Haste Samba'])) or (buffactive.March == 1 and buffactive.Haste and buffactive['Haste Samba']) or (buffactive.March == 2 and (buffactive.Haste or buffactive['Haste Samba'])) and equipSet["MidHaste"] then
equipSet = equipSet["MidHaste"]
end
if SA then
equipSet = set_combine(equipSet,sets.JA["Sneak Attack"])
end
if TA then
equipSet = set_combine(equipSet,sets.JA["Trick Attack"])
end
if buffactive.Feint then
equipSet = set_combine(equipSet,sets.TP.Feint)
end
if Rancor == 'ON' then -- Use Rancor Toggle For Rancor Collar --
equipSet = set_combine(equipSet,sets.TP.Rancor)
end
if TH == 'ON' then -- Use TH Toggle To Lock Full TH Set --
equipSet = set_combine(equipSet,sets.TP.TH)
end
equip(equipSet)
else
equipSet = sets.Idle
if equipSet[IdleArray[IdleIndex]] then
equipSet = equipSet[IdleArray[IdleIndex]]
end
if equipSet[WeaponArray[WeaponIndex]] then
equipSet = equipSet[WeaponArray[WeaponIndex]]
end
if buffactive['Reive Mark'] then -- Equip Ygnas's Resolve +1 During Reive --
equipSet = set_combine(equipSet,{neck="Ygnas's Resolve +1"})
end
if world.area:endswith('Adoulin') then
equipSet = set_combine(equipSet,{body="Councilor's Garb"})
end
equip(equipSet)
end
end
function buff_change(buff,gain)
buff = string.lower(buff)
if buff == "sneak attack" then
SA = gain
elseif buff == "trick attack" then
TA = gain
elseif buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
if gain then
send_command('timers create "Aftermath: Lv.3" 180 down;wait 150;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 15;input /echo Aftermath: Lv.3 [WEARING OFF IN 15 SEC.];wait 5;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
else
send_command('timers delete "Aftermath: Lv.3"')
add_to_chat(123,'AM3: [OFF]')
end
elseif buff == 'weakness' then -- Weakness Timer --
if gain then
send_command('timers create "Weakness" 300 up')
else
send_command('timers delete "Weakness"')
end
end
if not midaction() then
status_change(player.status)
end
end
--Macros--
send_command('bind f9 gs c C7') --PDT--
send_command('bind f6 gs c C1') --ACC Level--
send_command('bind f7 gs c C9') --Capa Mantle--
function file_unload()
if binds_on_unload then
binds_on_unload()
end
send_command('unbind f9')
send_command('unbind f7')
send_command('unbind f6')
end
-- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
function self_command(command)
if command == 'C1' then -- Accuracy Level Toggle --
AccIndex = (AccIndex % #AccArray) + 1
status_change(player.status)
add_to_chat(158,'Accuracy Level: ' .. AccArray[AccIndex])
elseif command == 'C17' then -- Sub Weapon Type Toggle --
WeaponIndex = (WeaponIndex % #WeaponArray) + 1
add_to_chat(158,'Sub Weapon Type: '..WeaponArray[WeaponIndex])
status_change(player.status)
elseif command == 'C5' then -- Auto Update Gear Toggle --
status_change(player.status)
add_to_chat(158,'Auto Update Gear')
elseif command == 'C2' then -- Hybrid Toggle --
if Armor == 'Hybrid' then
Armor = 'None'
add_to_chat(123,'Hybrid Set: [Unlocked]')
else
Armor = 'Hybrid'
add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
end
status_change(player.status)
elseif command == 'C9' then -- Full TH Set Toggle --
if TH == 'ON' then
TH = 'OFF'
add_to_chat(123,'Full TH Set: [Unlocked]')
else
TH = 'ON'
add_to_chat(158,'Full TH Set: [Locked]')
end
status_change(player.status)
elseif command == 'C7' then -- PDT Toggle --
if Armor == 'PDT' then
Armor = 'None'
add_to_chat(123,'PDT Set: [Unlocked]')
else
Armor = 'PDT'
add_to_chat(158,'PDT Set: [Locked]')
end
status_change(player.status)
elseif command == 'C15' then -- MDT Toggle --
if Armor == 'MDT' then
Armor = 'None'
add_to_chat(123,'MDT Set: [Unlocked]')
else
Armor = 'MDT'
add_to_chat(158,'MDT Set: [Locked]')
end
status_change(player.status)
elseif command == 'C4' then -- Capa Back Toggle --
if Capa == 'ON' then
Capa = 'OFF'
add_to_chat(123,'Capacity Mantle: [Unlocked]')
else
Capa = 'ON'
add_to_chat(158,'Capacity Mantle: [Locked]')
end
status_change(player.status)
elseif command == 'C3' then -- Evasion Toggle --
if Armor == 'EVA' then
Armor = 'None'
add_to_chat(123,'Evasion Set: [Unlocked]')
else
Armor = 'EVA'
add_to_chat(158,'Evasion Set: [Locked]')
end
status_change(player.status)
elseif command == 'C16' then -- Rancor Toggle --
if Rancor == 'ON' then
Rancor = 'OFF'
add_to_chat(123,'Rancor: [OFF]')
else
Rancor = 'ON'
add_to_chat(158,'Rancor: [ON]')
end
status_change(player.status)
elseif command == 'C8' then -- Distance Toggle --
if player.target.distance then
target_distance = math.floor(player.target.distance*10)/10
add_to_chat(158,'Distance: '..target_distance)
else
add_to_chat(123,'No Target Selected')
end
elseif command == 'C6' then -- Idle Toggle --
IdleIndex = (IdleIndex % #IdleArray) + 1
status_change(player.status)
add_to_chat(158,'Idle Set: ' .. IdleArray[IdleIndex])
elseif command == 'TP' then
add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
elseif command:match('^SC%d$') then
send_command('//' .. sc_map[command])
end
end
function check_equip_lock() -- Lock Equipment Here --
if player.equipment.range ~= 'empty' then
disable('range','ammo')
elseif player.equipment.left_ring == "Warp Ring" or player.equipment.left_ring == "Capacity Ring" or player.equipment.right_ring == "Warp Ring" or player.equipment.right_ring == "Capacity Ring" then
disable('ring1','ring2')
elseif player.equipment.back == "Mecisto. Mantle" or player.equipment.back == "Aptitude Mantle +1" or player.equipment.back == "Aptitude Mantle" then
disable('back')
else
enable('range','ammo','ring1','ring2','back')
end
end
function refine_waltz(spell,action)
if spell.type ~= 'Waltz' then
return
end
if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" or spell.name == "Divine Waltz II" then
return
end
local newWaltz = spell.english
local waltzID
local missingHP
if spell.target.type == "SELF" then
missingHP = player.max_hp - player.hp
elseif spell.target.isallymember then
local target = find_player_in_alliance(spell.target.name)
local est_max_hp = target.hp / (target.hpp/100)
missingHP = math.floor(est_max_hp - target.hp)
end
if missingHP ~= nil then
if player.sub_job == 'DNC' then
if missingHP < 40 and spell.target.name == player.name then
add_to_chat(123,'Full HP!')
cancel_spell()
return
elseif missingHP < 150 then
newWaltz = 'Curing Waltz'
waltzID = 190
elseif missingHP < 300 then
newWaltz = 'Curing Waltz II'
waltzID = 191
else
newWaltz = 'Curing Waltz III'
waltzID = 192
end
else
return
end
end
local waltzTPCost = {['Curing Waltz'] = 20, ['Curing Waltz II'] = 35, ['Curing Waltz III'] = 50}
local tpCost = waltzTPCost[newWaltz]
local downgrade
if player.tp < tpCost and not buffactive.trance then
if player.tp < 20 then
add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
cancel_spell()
return
elseif player.tp < 35 then
newWaltz = 'Curing Waltz'
elseif player.tp < 50 then
newWaltz = 'Curing Waltz II'
end
downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
end
if newWaltz ~= spell.english then
send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
if downgrade then
add_to_chat(158, downgrade)
end
cancel_spell()
return
end
if missingHP > 0 then
add_to_chat(158,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
end
end
function find_player_in_alliance(name)
for i,v in ipairs(alliance) do
for k,p in ipairs(v) do
if p.name == name then
return p
end
end
end
end
function sub_job_change(newSubjob, oldSubjob)
select_default_macro_book()
end
function set_macro_page(set,book)
if not tonumber(set) then
add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
return
end
if set < 1 or set > 10 then
add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
return
end
if book then
if not tonumber(book) then
add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
return
end
if book < 1 or book > 20 then
add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
return
end
send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
else
send_command('@input /macro set '..tostring(set))
end
end
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'WAR' then
set_macro_page(1, 12)
elseif player.sub_job == 'DNC' then
set_macro_page(1, 12)
elseif player.sub_job == 'NIN' then
set_macro_page(1, 12)
else
set_macro_page(1, 12)
end
end
Ragnarok.Flippant
Serveur: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-03-28 06:52:53
My first question would be if you have any haste buffs, since all of your mid- and high-haste sets are basically pointing to sets.TP (your lowacc set).
Serveur: Shiva
Game: FFXI
Posts: 15
By Shiva.Deathblossoms 2016-03-28 12:06:12
OMG thanks i did not even notice that was the problem thanks. I was able to fix it with this info.
Leviathan.Stamos
Serveur: Leviathan
Game: FFXI
Posts: 1239
By Leviathan.Stamos 2016-03-30 13:14:54
Since we're getting Wardrobe 2, and will have the room to do so. Was thinking about how I could add a DW set to a few jobs based on subjob. I know Mote's has a combatform for it on his. But, not a fan of his. Was thinking about WHM, RDM, GEO, and RUN. But here is my WHM. Essentially want it to fuction like Mote's, but don't know the correct way to do it for it be in DW or SW while engaged based on SJ
Pastebin
Ragnarok.Flippant
Serveur: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-03-30 19:32:50
First solution is to base TP set on subjob. The code would be rather simple, going after line 864:
Code if equipSet[player.sub_job] then
equipSet = equipSet[player.sub_job]
end
Your sets would look like sets.TP.NIN, sets.TP.MidACC.NIN, sets.TP.MidACC.HighHaste.NIN, etc.
The downside is that you'd have to make a set for both NIN and DNC subs.
Alternatively, (again after line 864)
Code if S{"DNC","NIN"}:contains(player.sub_job) then
equipSet = equipSet.DW
end
and then your sets would look like sets.TP.DW, sets.TP.MidAcc.DW, sets.TP.MidACC.HighHaste.DW, etc.
The former is more flexible, but the latter is more pragmatic.
Ragnarok.Jukiro
Serveur: Ragnarok
Game: FFXI
Posts: 198
By Ragnarok.Jukiro 2016-03-30 19:58:49
Ragnarok.Flippant said: »The former is more flexible, but the latter is more pragmatic.
don't you mean THE FOMOR?!
oh wait, wrong thread.
[+]
Leviathan.Stamos
Serveur: Leviathan
Game: FFXI
Posts: 1239
By Leviathan.Stamos 2016-03-30 20:09:53
Thanks. But neither worked. Both equipped my regular tp set
Ragnarok.Flippant
Serveur: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-03-30 20:21:56
My bad, should've checked the variable list. It's player.sub_job, not player.sub. Correcting original post :x
Leviathan.Stamos
Serveur: Leviathan
Game: FFXI
Posts: 1239
By Leviathan.Stamos 2016-03-30 20:26:02
Still just equipping regular TP set
I am sure I am derping somewhere /posts it after edit
Pastebin
Nvm. It was equipping the correct set. But then, it wasn't equipping my idle or anything
Ragnarok.Flippant
Serveur: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-03-30 20:44:23
Er umm. Well, you pasted it after line 864, after you made changes (added sets, I assume). So it's the wrong line 864 lol.
It should go after the lines that say: Code if buffactive.March == 2 or buffactive.March == 1 or buffactive[580] or buffactive['Mighty Guard'] and (buffactive.Embrava or buffactive.Haste) and equipSet["HighHaste"] then
equipSet = equipSet["HighHaste"]
end
It shouldn't affect idle at all, but maybe you pasted it in the right function earlier, but maybe the wrong line.
Leviathan.Stamos
Serveur: Leviathan
Game: FFXI
Posts: 1239
By Leviathan.Stamos 2016-03-30 20:52:58
Yep, that worked. Yeah, I had it right originally with the sub.job. Then edited it, and placed it back in the wrong place.
Thanks a lot!
Lakshmi.Diaboli
Serveur: Lakshmi
Game: FFXI
Posts: 17
By Lakshmi.Diaboli 2016-04-03 21:26:34
Hello,
Got a quick question, I am using a semi modified kinematic file and for some reason I cannot get Hachirin-no-obi to work with it.
Any one have any idea on how I could fix this error?
Here's a pastebin of my BLM script.
http://pastebin.com/sF4Y1BiE
Bismarck.Speedyjim
Serveur: Bismarck
Game: FFXI
Posts: 516
By Bismarck.Speedyjim 2016-04-03 21:30:41
Hello,
Got a quick question, I am using a semi modified kinematic file and for some reason I cannot get Hachirin-no-obi to work with it.
Any one have any idea on how I could fix this error?
Here's a pastebin of my BLM script.
http://pastebin.com/sF4Y1BiEYou have two job post_midcast functions on lines 385 & 398. Combine then into one and test again.
Lakshmi.Diaboli
Serveur: Lakshmi
Game: FFXI
Posts: 17
By Lakshmi.Diaboli 2016-04-03 21:47:37
Hmmm it's swapping on free nukes, but when flagged for magicburst its still defaulting to the refoccilation stone.
Code function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Elemental Magic' then
if spell.element == world.day_element or spell.element == world.weather_element then
equip(sets.midcast['Elemental Magic'], {waist="Hachirin-No-Obi"})
if spell.skill == 'Elemental Magic' and state.MagicBurst.value then
equip(sets.magic_burst)
end
end
end
I tried reversing it and still the same problem
Ragnarok.Flippant
Serveur: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-04-04 00:51:16
Well, you're equipping your magic burst set after you equip obi. Also, you don't want to nest the MB rules, because then you're only equipping your MB set if day/weather match.
Code function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
if spell.element == world.day_element or spell.element == world.weather_element then
equip({waist="Hachirin-No-Obi"})
end
end
end
Keep in mind that Mote's rules should already be handling most of your equip rules, so you don't need to equip your regular nuking set again; you just need to equip the sash. (Ideally, they should be handling your MB set too, but I'm not acquainted enough to tell you how to set that up correctly.)
Serveur: Asura
Game: FFXI
Posts: 5
By Asura.Fragiledream 2016-04-05 22:37:13
Found this lua in the SCH sticky. Keep getting the Two-Handed weapon error when switching from club/shield to staff/grip.
Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-- Original LUA by Fenrir.Motenten; edited by Bismarck.Speedyjim
-------------------------------------------------------------------------------------------------------------------
--[[
Custom commands:64
Shorthand versions for each strategem type that uses the version appropriate for
the current Arts.
In-game macro: /console gs c scholar xxx
Light Arts Dark Arts
gs c scholar light Light Arts/Addendum
gs c scholar dark Dark Arts/Addendum
gs c scholar cost Penury Parsimony
gs c scholar speed Celerity Alacrity
gs c scholar aoe Accession Manifestation
gs c scholar power Rapture Ebullience
gs c scholar duration Perpetuance
gs c scholar accuracy Altruism Focalization
gs c scholar enmity Tranquility Equanimity
gs c scholar skillchain Immanence
gs c scholar addendum Addendum: White Addendum: Black
--]]
-- Initialization function for this job file.
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
include('organizer-lib')
end
-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
info.addendumNukes = S{"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
update_active_strategems()
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('None', 'Normal')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal', 'PDT')
state.MagicBurst = M(false, 'Magic Burst')
info.low_nukes = S{"Stone", "Water", "Aero", "Fire", "Blizzard", "Thunder",
"Stone II", "Water II", "Aero II", "Fire II", "Blizzard II", "Thunder II",
"Stone III", "Water III", "Aero III", "Fire III", "Blizzard III", "Thunder III",
"Stone IV", "Water IV", "Aero IV", "Fire IV", "Blizzard IV", "Thunder IV",
"Stone V", "Water V", "Aero V", "Fire V", "Blizzard V", "Thunder V"}
info.mid_nukes = S{}
info.high_nukes = S{}
send_command('bind ` input /ma Stun <t>; wait 0.5; input /p Casting STUN → «¶«<t>«¶«.')
send_command('bind ^` gs c toggle MagicBurst')
send_command('bind !` gs c scholar skillchain')
send_command('bind ^- gs c scholar light')
send_command('bind ^= gs c scholar dark')
send_command('bind delete gs c scholar speed')
send_command('bind Home gs c scholar duration')
send_command('bind End gs c scholar aoe')
select_default_macro_book()
end
function user_unload()
send_command('unbind `')
send_command('unbind ^`')
send_command('unbind !`')
send_command('unbind ^-')
send_command('unbind ^=')
send_command('unbind delete')
send_command('unbind end')
send_command('unbind home')
end
-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Start defining the sets
--------------------------------------
-- Precast Sets
-- Precast sets to enhance JAs
sets.precast.JA['Tabula Rasa'] = {legs="Pedagogy Pants"}
sets.precast.JA['Dark Arts'] = {"Academic's Gown"}
sets.precast.JA['Light Arts'] = {"Academic's Pants"}
organizer_items = {agown="Academic's Gown"}
-- Fast cast sets for spells
-- FC +66%, Quick Magic +10% (cap)
sets.precast.FC = {main="Atinian Staff",sub="Vivid Strap",ammo="Incantor Stone",
head="Argute mortarboard +1",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquacious Earring",
body="Helios jacket",hands="Helios gloves",ring1="Weatherspoon Ring",ring2="Prolix Ring",
back="Ogapepo Cape",waist="Witful Belt",legs="Orvail pants",feet="Academic's Loafers"}
sets.precast.FC.Cure = set_combine(sets.precast.FC, {main="Serenity",head="Paean Mitra",ear1="Mendicant's Earring",body="Vanya Robe",hands="Gendewitha Gages +1",back="Pahtli Cape",feet="Vanya Clogs"})
sets.precast.FC.Curaga = sets.precast.FC.Cure
sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})
sets.precast.FC['Elemental Magic'] = set_combine(sets.precast.FC, {neck="Stoicheion Medal",ear1="Barkarole Earring"})
sets.precast.FC.Impact = set_combine(sets.precast.FC['Elemental Magic'], {head=empty,body="Twilight Cloak"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {}
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
-- Total MP: 2221 (Outside Escha), ???? (Inside Escha)
sets.precast.WS['Myrkr'] = {main="Akademos",sub="Niobid Strap",ammo="Ghastly Tathlum +1",
head="Kaabnax Hat",neck="Sanctity Necklace",ear1="Moonshade Earring",ear2="Etiolation Earring",
body="Amalric Doublet",hands="Otomi Gloves",ring1="Mephitas's Ring +1",ring2="Mephitas's Ring",
back="Pahtli Cape",waist="Luminary Sash",legs="Amalric Slops",feet="Medium's Sabots"}
-- Midcast Sets
sets.midcast.FastRecast = {back="Swith Cape"}
-- Cure Sets
-- Potency: +50%, Healing Skill: 615 total inc. Light Arts bonus, Enmity: -15, MND: +146, VIT: +135
sets.midcast.Cure = {main="Atinian Staff",sub="Curatio Grip",ammo="Incantor Stone",
head="Telchine cap",neck="Healing Torque",ear1="Influx Earring",ear2="Loquacious Earring",
body="Telchine Chasuble",hands="Telchine gloves",ring1="Ephedra Ring",ring2="Sirona's Ring",
back="Tempered Cape +1",waist="Bishop's Sash",legs="Academic's Pants",feet="Argute Loafers"}
-- Potency: +50%, Healing Skill: 567 total inc. Light Arts Bonus, MND: +152, VIT+ 131
sets.midcast.CureWithLightWeather = set_combine(sets.midcast.Cure, {
main="Chatoyant Staff",ear2="Mendicant's Earring",body="Chironic Doublet",back="Twilight Cape",waist="Korin Obi"})
sets.midcast.Curaga = sets.midcast.Cure
sets.midcast.Regen = {main="Eminent Wand",sub="Genbu's Shield",ammo="Savant's Treatise",
head="Arbatel Bonnet +1",neck="Incanter's Torque",ear1="Andoaa Earring",
body="Telchine Chasuble",hands="Telchine Gloves",
back="Bookworm's Cape",waist="Cascade Belt",legs="Telchine Braconi",feet="Telchine Pigaches"}
-- Enhancing Magic Sets
sets.midcast['Enhancing Magic'] = {main="Eminent Wand",sub="Genbu's Shield",ammo="Savant's Treatise",
head="Telchine Cap",body="Telchine Chasuble",hands="Telchine Gloves",legs="Telchine Braconi",feet="Telchine Pigaches",
ear1="Andoaa Earring",neck="Enhancing Torque",waist="Cascade Belt",}
sets.midcast.Cursna = {main="Gada",sub="Genbu's Shield",
neck="Malison Medallion",body="Vanya Robe",hands="Pedagogy Bracers +1",ring1="Haoma's Ring",ring2="Ephedra Ring",
back="Tempered Cape +1",waist="Bishop's Sash",legs="Academic's Pants +1",feet="Gendewitha Galoshes +1"}
sets.midcast.Stoneskin = set_combine(sets.midcast['Enhancing Magic'], {waist="Siegel Sash"})
sets.midcast.Protect = set_combine(sets.midcast['Enhancing Magic'], {ring1="Sheltered Ring"})
sets.midcast.Shell = set_combine(sets.midcast['Enhancing Magic'], {ring1="Sheltered Ring"})
sets.midcast.Haste = set_combine(sets.midcast.FastRecast, {head="Telchine Cap",body="Telchine Chasuble",hands="Telchine Gloves",legs="Telchine Braconi",feet="Telchine Pigaches"})
sets.midcast.Storm = sets.midcast.Haste
sets.midcast.Erase = sets.midcast.FastRecast
sets.midcast.Raise = sets.midcast.FastRecast
sets.midcast.Reraise = sets.midcast.FastRecast
-- Custom spell classes
sets.midcast.MndEnfeebles = {main="Atinian Staff",sub="Marcero Grip",ammo="Kalboron Stone",
head="Kaabnax Hat",neck="Enfeebling Torque",ear1="Influx Earring",ear2="Gwati Earring",
body="Haruspex coat",hands="Argute Bracers",ring1="Perception Ring",ring2="Angha Ring",
back="Ogapepo Cape",waist="Demonry Sash",legs="Orvail Pants",feet="Helios Boots"}
sets.midcast.IntEnfeebles = sets.midcast.MndEnfeebles
sets.midcast.ElementalEnfeeble = sets.midcast.IntEnfeebles
sets.midcast.Kaustra = set_combine(sets.midcast['Elemental Magic'], {head="Pixie Hairpin +1"})
sets.midcast['Dark Magic'] = {main="Atinian Staff",sub="Elder's Grip +1",ammo="Kalboran Stone",
head="Kaabnax Hat",neck="Dark Torque",ear1="Barkarole Earring",ear2="Gwati Earring",
body="Academic's Gown",hands="Wayfarer cuffs",ring1="Angha Ring",ring2="Perception Ring",
back="Bookworm's Cape",waist="Witful Belt",legs="Argute pants",feet="Wayfarer Clogs"}
sets.midcast.Drain = set_combine(sets.midcast['Dark Magic'], {ammo="Incantor Stone",
head="Pixie Hairpin +1",ear1="Hirudinea Earring",ear2="Loquacious Earring",body="Chironic Doublet",hands="Helios Gloves",waist="Fucho-no-obi",feet=merl_feet_MAB})
sets.midcast.Aspir = sets.midcast.Drain
sets.midcast.Stun = {main="Atinian Staff",sub="Vivid Strap",ammo="Incantor Stone",
head="Pedagogy Mortarboard +1",neck="Orunmila's Torque",ear1="Enchanter Earring +1",ear2="Loquac. Earring",
body="Merlinic Jubbah",hands="Helios Gloves",ring1="Sangoma Ring",ring2="Prolix Ring",
back="Swith Cape",waist="Witful Belt",legs="Orvail Pants",feet="Academic's Loafers"}
sets.midcast.Stun.Resistant = set_combine(sets.midcast.Stun, {})
-- Elemental Magic sets are default for handling all-tier nukes.
sets.midcast['Elemental Magic'] = {main="Atinian Staff",sub="Elder's Grip +1",ammo="Kalboran Stone",
head=merl_head_MB,neck="Saevus Pendant +1",ear1="Barkarole Earring",ear2="Friomisi Earring",
body="Helios band",hands="Helios gloves",ring1="Shiva Ring",ring2="Shiva Ring",
back="Toro Cape",waist="Belisama's Rope +1",legs="Merlinic Shalwar",feet=merl_feet_MAB}
-- sub="Zuuxowu Grip",head="Buremte Hat",body="Witching Robe",hands="Otomi Gloves",back="Bookworm's Cape",waist="Tengu-no-Obi",feet="Amalric Nails"
sets.midcast['Elemental Magic'].Resistant = set_combine(sets.midcast['Elemental Magic'], {neck="Sanctity Necklace",back="Bookworm's Cape"})
-- Custom refinements for certain nuke tiers (No longer used as of Jan/2016).
sets.midcast['Elemental Magic'].HighTierNuke = sets.midcast['Elemental Magic']
sets.midcast['Elemental Magic'].HighTierNuke.Resistant = sets.midcast['Elemental Magic'].Resistant
sets.midcast.Helix = set_combine(sets.midcast['Elemental Magic'], {neck="Sanctity Necklace",back="Bookworm's Cape"})
sets.midcast.Noctohelix = set_combine(sets.midcast.Helix, {head="Pixie Hairpin +1"})
sets.midcast.Luminohelix = set_combine(sets.midcast.Helix, {ring1="Weatherspoon Ring"})
sets.midcast.Impact = {main="Akademos",sub="Mephitis Grip",ammo="Hydrocera",
head=empty,neck="Sanctity Necklace",ear1="Barkarole Earring",ear2="Gwati Earring",
body="Twilight Cloak",hands=chiro_hands_MAB,ring1="Weatherspoon Ring",ring2="Sangoma Ring",
back="Refraction Cape",waist="Luminary Sash",legs="Chironic Hose",feet="Medium's Sabots"}
-- Sets to return to when not performing an action.
-- Resting sets
sets.resting = {main="Chatoyant Staff",sub="Mephitis Grip",
head="Wayfarer Circlet",neck="Rep. Silver Medal",
body="Wayfarer robe",hands="Wayfarer Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
waist="Cheviot Cape",legs="Wayfarer Slops",feet="Wayfarer Clogs"}
-- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
sets.idle.Town = {main="Eminent Wand",sub="Genbu's Shield",ammo="Incantor Stone",
head="Argute mortarboard +1",neck="Wiglen Gorget",ear1="Influx Earring",ear2="Loquacious Earring",
body="Helios jacket",hands="Helios gloves",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Cheviot Cape",waist="Flume Belt",legs="Telchine braconi",feet="Herald's Gaiters"}
sets.idle.Field = {main="Atinian Staff",sub="Elder's Grip +1",ammo="Incantor Stone",
head="Helios band",neck="Wiglen Gorget",ear1="Influx Earring",ear2="Loquacious Earring",
body="Academic's Gown",hands=chiro_hands_MAB,ring1="Defending Ring",ring2=gear.DarkRing.physical,
back="Cheviot Cape",waist="Flume Belt",legs="Telchine braconi",feet="Herald's Gaiters"}
sets.idle.PDT = {main="Eminent wand",sub="Genbu's Shield",ammo="Incantor Stone",
head="Wayfarer Circlet",neck="Wiglen Gorget",ear1="Influx Earring",ear2="Loquacious Earring",
body="Wayfarer robe",hands="Wayfarer Cuffs",ring1="Sheltered Ring",ring2="Paguroidea Ring",
back="Cheviot Cape",waist="Flume Belt",legs="Wayfarer Slops",feet="Wayfarer Clogs"}
sets.idle.Weak = sets.idle.Field
-- Defense sets
sets.defense.PDT = {main="Earth staff",sub="Achaq Grip",ammo="Incantor Stone",
head="Helios band",neck="Wiglen gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Helios jacket",hands="Helios gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
back="Umbra Cape",waist="Flume Belt",legs="Telchine braconi",feet="Helios boots"}
sets.defense.MDT = {
{main="Earth staff",sub="Achaq Grip",ammo="Incantor Stone",
head="Helios band",neck="Wiglen gorget",ear1="Bloodgem Earring",ear2="Loquacious Earring",
body="Helios jacket",hands="Helios gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
back="Umbra Cape",waist="Flume Belt",legs="Telchine braconi",feet="Helios boots"}
sets.Kiting = {feet="Herald's Gaiters"}
sets.latent_refresh = {waist="Fucho-no-obi"}
-- Engaged sets
-- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
-- sets if more refined versions aren't defined.
-- If you create a set with both offense and defense modes, the offense mode should be first.
-- EG: sets.engaged.Dagger.Accuracy.Evasion
-- Normal melee group
sets.engaged = {}
-- Buff sets: Gear that needs to be worn to actively enhance a current player buff.
sets.buff['Ebullience'] = {}
sets.buff['Rapture'] = {head="Arbatel Bonnet +1"}
sets.buff['Perpetuance'] = {hands="Arbatel Bracers +1"}
sets.buff['Immanence'] = {hands="Arbatel Bracers +1"}
sets.buff['Penury'] = {legs="Arbatel Pants +1"}
sets.buff['Parsimony'] = {legs="Arbatel Pants +1"}
sets.buff['Celerity'] = {feet="Pedagogy Loafers +1"}
sets.buff['Alacrity'] = {head=merl_head_MB,feet="Pedagogy Loafers +1"}
sets.buff['Stormsurge'] = {feet="Pedagogy Loafers +1"}
sets.buff['Klimaform'] = {feet="Arbatel Loafers +1"}
sets.buff.FullSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring",body="Pedagogy Gown +1",neck="Wiglen Gorget",ring1="Sheltered Ring",ring2="Paguroidea Ring"}
sets.buff.PDTSublimation = {head="Academic's Mortarboard +1",ear1="Savant's Earring",body="Pedagogy Gown +1"}
sets.magic_burst = {main="Akademos",sub="Niobid Strap",
head=merl_head_MB,neck="Mizukage-no-Kubikazari",hands="Amalric Gages",
ring1="Mujin Band",back="Seshaw Cape",feet=merl_feet_MB}
-- Cap: 40%
-- Akademos: 10%, Merlinic Hood: 4%, Mizukage: 10%, Seshaw: 5%, Merlinic Boots: 11% = 40%
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
function refine_various_spells(spell, action, spellMap, eventArgs)
aspirs = S{'Aspir','Aspir II'}
sleeps = S{'Sleep','Sleep II'}
sleepgas = S{'Sleepga'}
if not sleepgas:contains(spell.english) and not sleeps:contains(spell.english) and not aspirs:contains(spell.english) then
return
end
local newSpell = spell.english
local spell_recasts = windower.ffxi.get_spell_recasts()
local cancelling = 'All '..spell.english..' spells are on cooldown. Cancelling spell casting.'
if spell_recasts[spell.recast_id] > 0 then
if aspirs:contains(spell.english) then
if spell.english == 'Aspir' then
add_to_chat(122,cancelling)
eventArgs.cancel = true
return
elseif spell.english == 'Aspir II' then
newSpell = 'Aspir'
end
elseif sleeps:contains(spell.english) then
if spell.english == 'Sleep' then
add_to_chat(122,cancelling)
eventArgs.cancel = true
return
elseif spell.english == 'Sleep II' then
newSpell = 'Sleep'
end
elseif sleepgas:contains(spell.english) then
if spell.english == 'Sleepga' then
add_to_chat(122,cancelling)
eventArgs.cancel = true
return
end
end
end
if newSpell ~= spell.english then
send_command('@input /ma "'..newSpell..'" '..tostring(spell.target.raw))
eventArgs.cancel = true
return
end
end
function job_precast(spell, action, spellMap, eventArgs)
refine_various_spells(spell, action, spellMap, eventArgs)
if (spell.type:endswith('Magic') or spell.type == "Ninjutsu") then
if buffactive.Silence then
cancel_spell()
send_command('input /item "Echo Drops" <me>')
end
end
end
-- Run after the general midcast() is done.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.action_type == 'Magic' then
apply_grimoire_bonuses(spell, action, spellMap, eventArgs)
end
if spell.skill == 'Elemental Magic' then
if state.MagicBurst.value then
equip(sets.magic_burst)
end
end
end
function job_aftercast(spell)
if spell.english == 'Sleep' or spell.english == 'Sleepga' then
send_command('@wait 50;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.english == 'Sleep II' or spell.english == 'Sleepga II' then
send_command('@wait 80;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
elseif spell.english == 'Break' or spell.english == 'Breakga' then
send_command('@wait 20;input /echo ------- '..spell.english..' is wearing off in 10 seconds -------')
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff, gain)
if buff == "Sublimation: Activated" then
handle_equipping_gear(player.status)
end
end
-- Handle notifications of general user state change.
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Offense Mode' then
if newValue == 'Normal' then
disable('main','sub','range')
else
enable('main','sub','range')
end
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Custom spell mapping.
function job_get_spell_map(spell, default_spell_map)
if spell.action_type == 'Magic' then
if default_spell_map == 'Cure' or default_spell_map == 'Curaga' then
if world.weather_element == 'Light' then
return 'CureWithLightWeather'
end
elseif spell.skill == 'Enfeebling Magic' then
if spell.type == 'WhiteMagic' then
return 'MndEnfeebles'
else
return 'IntEnfeebles'
end
elseif spell.skill == 'Elemental Magic' then
if info.low_nukes:contains(spell.english) then
return 'LowTierNuke'
elseif info.mid_nukes:contains(spell.english) then
return 'MidTierNuke'
elseif info.high_nukes:contains(spell.english) then
return 'HighTierNuke'
end
end
end
end
function customize_idle_set(idleSet)
if state.Buff['Sublimation: Activated'] then
if state.IdleMode.value == 'Normal' then
idleSet = set_combine(idleSet, sets.buff.FullSublimation)
elseif state.IdleMode.value == 'PDT' then
idleSet = set_combine(idleSet, sets.buff.PDTSublimation)
end
end
if player.mpp < 51 then
idleSet = set_combine(idleSet, sets.latent_refresh)
end
return idleSet
end
-- Called by the 'update' self-command.
function job_update(cmdParams, eventArgs)
if cmdParams[1] == 'user' and not (buffactive['light arts'] or buffactive['dark arts'] or
buffactive['addendum: white'] or buffactive['addendum: black']) then
if state.IdleMode.value == 'Stun' then
send_command('@input /ja "Dark Arts" <me>')
else
send_command('@input /ja "Light Arts" <me>')
end
end
update_active_strategems()
update_sublimation()
end
-- Function to display the current relevant user state when doing an update.
-- Return true if display was handled, and you don't want the default info shown.
function display_current_job_state(eventArgs)
display_current_caster_state()
eventArgs.handled = true
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements self-commands.
-------------------------------------------------------------------------------------------------------------------
-- Called for direct player commands.
function job_self_command(cmdParams, eventArgs)
if cmdParams[1]:lower() == 'scholar' then
handle_strategems(cmdParams)
eventArgs.handled = true
end
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
-- Reset the state vars tracking strategems.
function update_active_strategems()
state.Buff['Ebullience'] = buffactive['Ebullience'] or false
state.Buff['Rapture'] = buffactive['Rapture'] or false
state.Buff['Perpetuance'] = buffactive['Perpetuance'] or false
state.Buff['Immanence'] = buffactive['Immanence'] or false
state.Buff['Penury'] = buffactive['Penury'] or false
state.Buff['Parsimony'] = buffactive['Parsimony'] or false
state.Buff['Celerity'] = buffactive['Celerity'] or false
state.Buff['Alacrity'] = buffactive['Alacrity'] or false
state.Buff['Klimaform'] = buffactive['Klimaform'] or false
end
function update_sublimation()
state.Buff['Sublimation: Activated'] = buffactive['Sublimation: Activated'] or false
end
-- Equip sets appropriate to the active buffs, relative to the spell being cast.
function apply_grimoire_bonuses(spell, action, spellMap)
if state.Buff.Perpetuance and spell.type =='WhiteMagic' and spell.skill == 'Enhancing Magic' then
equip(sets.buff['Perpetuance'])
end
if state.Buff.Rapture and (spellMap == 'Cure' or spellMap == 'Curaga') then
equip(sets.buff['Rapture'])
end
if spell.skill == 'Elemental Magic' then --or spellMap ~= 'ElementalEnfeeble'
if state.Buff.Ebullience and spell.english ~= 'Impact' then
equip(sets.buff['Ebullience'])
end
if state.Buff.Immanence then
equip(sets.buff['Immanence'])
end
if state.Buff.Klimaform and spell.element == world.weather_element then
equip(sets.buff['Klimaform'])
end
end
if state.Buff.Penury then equip(sets.buff['Penury']) end
if state.Buff.Parsimony then equip(sets.buff['Parsimony']) end
if state.Buff.Celerity then equip(sets.buff['Celerity']) end
if state.Buff.Alacrity then equip(sets.buff['Alacrity']) end
end
function display_current_caster_state()
local msg = ''
if state.OffenseMode.value ~= 'None' then
msg = msg .. 'Melee'
if state.CombatForm.has_value then
msg = msg .. ' (' .. state.CombatForm.value .. ')'
end
msg = msg .. ', '
end
msg = msg .. 'Idle ['..state.IdleMode.value..'], Casting ['..state.CastingMode.value..']'
add_to_chat(122, msg)
local currentStrats = get_current_strategem_count()
local arts
if buffactive['Light Arts'] or buffactive['Addendum: White'] then
arts = 'Light Arts'
elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
arts = 'Dark Arts'
else
arts = 'No Arts Activated'
end
add_to_chat(122, 'Current Available Strategems: ['..currentStrats..'], '..arts..'')
end
-- General handling of strategems in an Arts-agnostic way.
-- Format: gs c scholar <strategem>
function handle_strategems(cmdParams)
-- cmdParams[1] == 'scholar'
-- cmdParams[2] == strategem to use
if not cmdParams[2] then
add_to_chat(123,'Error: No strategem command given.')
return
end
local currentStrats = get_current_strategem_count()
local newStratCount = currentStrats - 1
local strategem = cmdParams[2]:lower()
if currentStrats > 0 and strategem ~= 'light' and strategem ~= 'dark' then
add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
elseif currentStrats == 0 then
add_to_chat(122, '***Out of strategems! Canceling...***')
return
end
if strategem == 'light' then
if buffactive['light arts'] then
send_command('input /ja "Addendum: White" <me>')
add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
elseif buffactive['addendum: white'] then
add_to_chat(122,'Error: Addendum: White is already active.')
elseif buffactive['dark arts'] or buffactive['addendum: black'] then
send_command('input /ja "Light Arts" <me>')
add_to_chat(122, '***Changing Arts! Current Charges Available: ['..currentStrats..']***')
else
send_command('input /ja "Light Arts" <me>')
end
elseif strategem == 'dark' then
if buffactive['dark arts'] then
send_command('input /ja "Addendum: Black" <me>')
add_to_chat(122, '***Current Charges Available: ['..newStratCount..']***')
elseif buffactive['addendum: black'] then
add_to_chat(122,'Error: Addendum: Black is already active.')
elseif buffactive['light arts'] or buffactive['addendum: white'] then
send_command('input /ja "Dark Arts" <me>')
add_to_chat(122, '***Changing Arts! Current Charges Available: ['..currentStrats..']***')
else
send_command('input /ja "Dark Arts" <me>')
end
elseif buffactive['light arts'] or buffactive['addendum: white'] then
if strategem == 'cost' then
send_command('@input /ja Penury <me>')
elseif strategem == 'speed' then
send_command('@input /ja Celerity <me>')
elseif strategem == 'aoe' then
send_command('@input /ja Accession <me>')
elseif strategem == 'power' then
send_command('@input /ja Rapture <me>')
elseif strategem == 'duration' then
send_command('@input /ja Perpetuance <me>')
elseif strategem == 'accuracy' then
send_command('@input /ja Altruism <me>')
elseif strategem == 'enmity' then
send_command('@input /ja Tranquility <me>')
elseif strategem == 'skillchain' then
add_to_chat(122,'Error: Light Arts does not have a skillchain strategem.')
elseif strategem == 'addendum' then
send_command('@input /ja "Addendum: White" <me>')
else
add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
end
elseif buffactive['dark arts'] or buffactive['addendum: black'] then
if strategem == 'cost' then
send_command('@input /ja Parsimony <me>')
elseif strategem == 'speed' then
send_command('@input /ja Alacrity <me>')
elseif strategem == 'aoe' then
send_command('@input /ja Manifestation <me>')
elseif strategem == 'power' then
send_command('@input /ja Ebullience <me>')
elseif strategem == 'duration' then
add_to_chat(122,'Error: Dark Arts does not have a duration strategem.')
elseif strategem == 'accuracy' then
send_command('@input /ja Focalization <me>')
elseif strategem == 'enmity' then
send_command('@input /ja Equanimity <me>')
elseif strategem == 'skillchain' then
send_command('@input /ja Immanence <me>')
elseif strategem == 'addendum' then
send_command('@input /ja "Addendum: Black" <me>')
else
add_to_chat(123,'Error: Unknown strategem ['..strategem..']')
end
else
add_to_chat(123,'No arts has been activated yet.')
end
end
function get_current_strategem_count()
local allRecasts = windower.ffxi.get_ability_recasts()
local stratsRecast = allRecasts[231]
local maxStrategems = math.floor(player.main_job_level + 10) / 20
local fullRechargeTime = 5*33
local currentCharges = math.floor(maxStrategems - maxStrategems * stratsRecast / fullRechargeTime)
return currentCharges
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
if player.sub_job == 'RDM' then
set_macro_page(1, 8)
elseif player.sub_job == 'BLM' then
set_macro_page(1, 8)
elseif player.sub_job == 'WHM' then
set_macro_page(2, 8)
end
end
By inkydo 2016-04-11 08:54:52
I am haven trouble understanding this part of the PUP lua i found someplace sorry i forget where...
Code -- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
-- List of pet weaponskills to check for
petWeaponskills = S{"Slapstick", "Knockout", "Magic Mortar",
"Chimera Ripper", "String Clipper", "Cannibal Blade", "Bone Crusher", "String Shredder",
"Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
-- Map automaton heads to combat roles
petModes = {
['Harlequin Head'] = 'Melee',
['Sharpshot Head'] = 'Ranged',
['Valoredge Head'] = 'Tank',
['Stormwaker Head'] = 'Magic',
['Soulsoother Head'] = 'Heal',
['Spiritreaver Head'] = 'Nuke'
}
-- Subset of modes that use magic
magicPetModes = S{'Nuke','Heal','Magic'}
-- Var to track the current pet mode.
state.PetMode = M{['description']='Pet Mode', 'None', 'Melee', 'Ranged', 'Tank', 'Magic', 'Heal', 'Nuke'}
end
I say this as It seems to work well,however i do not understand how i can improve on versatility of a a pup.
Petmodes are limited with this current config.... SS head is used Only for healing.... However My High hp and TANK only PDT setup like most pups use SS/VE. Is there a way to add a hybrid like this to the Petmodes?
Odin.Lygre
Serveur: Odin
Game: FFXI
Posts: 89
By Odin.Lygre 2016-04-11 21:22:41
Code
function get_pet_mode()
if pet.isvalid then
if pet.head == 'Soulsoother Head' then
if pet.frame == 'Stormwaker Frame' then
return 'Heal'
elseif pet.frame == 'Harlequin Frame' then
return 'Tank'
elseif pet.frame == 'Valoredge Frame' then
return 'Tank'
else
return 'None'
end
elseif pet.head == 'Valoredge Head' then
if pet.frame == 'Valoredge Frame' then
return 'Melee'
elseif pet.frame == 'Sharpshot Frame' then
return 'Melee'
else
return 'None'
end
elseif pet.head == 'Stormwaker Head' then
if pet.frame == 'Stormwaker Frame' then
return 'Magic'
else
return 'None'
end
elseif pet.head == 'Spiritreaver Head' then
if pet.frame == 'Stormwaker Frame' then
return 'Nuke'
else
return 'None'
end
elseif pet.head == 'Sharpshot Head' then
if pet.frame == 'Sharpshot Frame' then
return 'Ranged'
elseif pet.frame == 'Valoredge Frame' then
return 'Melee'
else
return 'None'
end
else
return 'None'
end
--return petModes[pet.head] or 'None'
else
return 'None'
end
end
I had the same qualm with it, so I changed the function to this. Just edit how you want your combinations of head+frame to be defined in terms of Melee, Ranged, Tank, Magic, Heal, Nuke.
By inkydo 2016-04-12 08:05:08
Code
function get_pet_mode()
if pet.isvalid then
if pet.head == 'Soulsoother Head' then
if pet.frame == 'Stormwaker Frame' then
return 'Heal'
elseif pet.frame == 'Harlequin Frame' then
return 'Tank'
elseif pet.frame == 'Valoredge Frame' then
return 'Tank'
else
return 'None'
end
elseif pet.head == 'Valoredge Head' then
if pet.frame == 'Valoredge Frame' then
return 'Melee'
elseif pet.frame == 'Sharpshot Frame' then
return 'Melee'
else
return 'None'
end
elseif pet.head == 'Stormwaker Head' then
if pet.frame == 'Stormwaker Frame' then
return 'Magic'
else
return 'None'
end
elseif pet.head == 'Spiritreaver Head' then
if pet.frame == 'Stormwaker Frame' then
return 'Nuke'
else
return 'None'
end
elseif pet.head == 'Sharpshot Head' then
if pet.frame == 'Sharpshot Frame' then
return 'Ranged'
elseif pet.frame == 'Valoredge Frame' then
return 'Melee'
else
return 'None'
end
else
return 'None'
end
--return petModes[pet.head] or 'None'
else
return 'None'
end
end
I had the same qualm with it, so I changed the function to this. Just edit how you want your combinations of head+frame to be defined in terms of Melee, Ranged, Tank, Magic, Heal, Nuke.
thanks for the help!! I am still new to GS and learning everyday, that said I think this code should replace this...
Code -- Get the pet mode value based on the equipped head of the automaton.
-- Returns nil if pet is not valid.
function get_pet_mode()
if pet.isvalid then
return petModes[pet.head] or 'None'
else
return 'None'
end
end
Also Would I remove this... Code -- Map automaton heads to combat roles
petModes = {
['Harlequin Head'] = 'Melee',
['Sharpshot Head'] = 'Ranged',
['Valoredge Head'] = 'Tank',
['Stormwaker Head'] = 'Magic',
['Soulsoother Head'] = 'Heal',
['Spiritreaver Head'] = 'Nuke'
}
and this would work properly then... Code -- Var to track the current pet mode.
state.PetMode = M{['description']='Pet Mode', 'None', 'Melee', 'Ranged', 'Tank', 'Magic', 'Heal', 'Nuke'}
Sorry if they are dumb questions.
By inkydo 2016-04-12 08:19:08
Quote: Sorry if they are dumb questions. Should have taken more time with the code...
Never mind Quote: Also Would I remove this...
Code
-- Map automaton heads to combat roles
petModes = {
['Harlequin Head'] = 'Melee',
['Sharpshot Head'] = 'Ranged',
['Valoredge Head'] = 'Tank',
['Stormwaker Head'] = 'Magic',
['Soulsoother Head'] = 'Heal',
['Spiritreaver Head'] = 'Nuke'
}
As this needs to be in it...took me a sec or 2 to figure out what you were doing, your additional logic compensates for it by returning it said state 'Melee' or 'tank'
thanks!
Serveur: Cerberus
Game: FFXI
Posts: 1786
By Cerberus.Shadowmeld 2016-04-12 08:58:23
Maybe try it this way?
Code
petmodes = {
['Harlequin Head'] = {},
['Soulsoother Head'] = {['Stormwaker Frame'] = 'Heal', ['Harlequin Frame'] = 'Tank', ['Valoredge Frame'] = 'Tank'},
['Valoredge Head'] = {['Valoredge Frame'] = 'Melee', ['Sharpshot Frame'] = 'Melee'},
['Stormwaker Head'] = {['Stormwaker Frame'] = 'Magic'},
['Spiritreaver Head'] = {['Stormwaker Frame'] = 'Nuke'},
['Sharpshot Head'] = {['Sharpshot Frame'] = 'Ranged', ['Valoredge Frame'] = 'Melee'}
}
function get_pet_mode()
if pet.isvalid then
return petmodes[pet.head][pet.frame] or 'None'
end
end
This way you don't significantly change or short circuit the functionality. It would just require expanding the petmodes table with the frame options. how I've done it above. Because the get_pet_mode function doesn't check if modes[pet.head] is not nil, you have to have the ['Harlequin Head'] = {} in petmodes or you'll get an error.
Edit: forgot petmodes
By inkydo 2016-04-12 09:36:21
Cerberus.Shadowmeld said: »Maybe try it this way?
Code
petmodes = {
['Harlequin Head'] = {},
['Soulsoother Head'] = {['Stormwaker Frame'] = 'Heal', ['Harlequin Frame'] = 'Tank', ['Valoredge Frame'] = 'Tank'},
['Valoredge Head'] = {['Valoredge Frame'] = 'Melee', ['Sharpshot Frame'] = 'Melee'},
['Stormwaker Head'] = {['Stormwaker Frame'] = 'Magic'},
['Spiritreaver Head'] = {['Stormwaker Frame'] = 'Nuke'},
['Sharpshot Head'] = {['Sharpshot Frame'] = 'Ranged', ['Valoredge Frame'] = 'Melee'}
}
function get_pet_mode()
if pet.isvalid then
return petmodes[pet.head][pet.frame] or 'None'
end
end
This way you don't significantly change or short circuit the functionality. It would just require expanding the petmodes table with the frame options. how I've done it above. Because the get_pet_mode function doesn't check if modes[pet.head] is not nil, you have to have the ['Harlequin Head'] = {} in petmodes or you'll get an error.
Edit: forgot petmodes
This is what i was trying to do in the first place, but could not figure out the proper way to add the body to the logic and create a alternate Head and body combo!
I will see what works best thanks all for input!
By Faelar 2016-04-14 10:24:24
Having trouble wrapping my head around Gearswap in general. 5 years ago I was an avid SpellCast user, but now that I've returned to the game it seems it's no longer used. For the past few days I have been going over Gearswap/lua tutorials but I'm still having trouble with it. I'm not trying to make anything fancy, just 2 types of lua: 1 for mages with idle, precast, cure, and regen sets....and one for DD with TP, WS, and idle sets. All the "basic" example luas I've looked at on the job guides posted here look more advanced than they say and are just confusing me even more.
Lakshmi.Byrth
VIP
Serveur: Lakshmi
Game: FFXI
Posts: 6184
By Lakshmi.Byrth 2016-04-14 10:30:44
I tried this as a generic Lua file:
http://pastebin.com/dp5EPCre
The rules are pretty simple.
[+]
By Faelar 2016-04-14 10:38:34
The sets I think I get, but when it gets down to the bottom and the functions, it goes over my head. ._.;
Lakshmi.Byrth
VIP
Serveur: Lakshmi
Game: FFXI
Posts: 6184
By Lakshmi.Byrth 2016-04-14 10:56:37
The precast function is called during a time period analogous to Spellcast's "precast" phase. The function executes from top to bottom, and equip commands are applied sequentially (and left to right within an equip command) in order to generate one set that will be equipped after the function ends.
So if you attempt to use a job ability, the precast function is called and it passes in the resources line for the job ability that's about to be used as a table (the "spell" variable). Tables are are collections of keys and their associated values. There are two ways to index them:
1) spell.prefix
2) spell["prefix"] or spell['prefix']
So spell.prefix (the first reference in the precast function) gives the value of the prefix key of the spell table. In this case, we're checking to see whether that value is "/jobability" in the first "if" statement, which it is.
Because it satisfies the conditional, it executes the following equip command: Code equip(sets.JA["Base"],sets.JA[spell.english] or {})
This adds the sets.JA["Base"] set (the set associated with the Base key of the table associated with the JA key of the sets table) and then the sets.JA[spell.english] set to the collection of gear we're trying to equip. "spell.english" is the spell's name, in this case. If it does not find sets.JA[spell.english], the function is passed an empty table "{}".
The first conditional was satisfied, so the "elseif" statements are skipped and the precast function ends. At this point, an equipment set has been generated and gearswap sends out a packet that puts the gear on.
By Faelar 2016-04-14 11:28:58
How do this look? Just trying to gauge if I understand it properly.
Please ignore the gear, it's very old.
Code function get_sets()
-- This set will be equipped when idle
sets.Idle = {
main="Owleyes",
sub="Genbu's Shield",
ammo="Incantor Stone",
head="Orison Cap +2",
body="Orison Bliaud +2",
hands="Serpentes Cuffs",
legs="Orsn. Pantaln. +2",
feet="Serpentes Sabots",
waist="Cleric's Belt",
neck="Twilight Torque",
left_ear="Loquac. Earring",
right_ear="Orison Earring",
left_ring="Omega Ring",
right_ring="Sirona's Ring",
-- This set will be equipped before magic is cast
sets.FastCast = {
ammo="Incantor Stone",
head="Walahra Turban",
body="Goliard Saio",
hands="Blessed Mitts",
legs="Blessed Trousers",
feet="Orsn. Duckbills +2",
waist="Austerity Belt",
neck="Orison Locket",
left_ear="Loquac. Earring",
right_ear="Orison Earring",
left_ring="Omega Ring",
right_ring="Sirona's Ring",
}
-- This set will be equipped before healing magic is cast
sets.Cure = {
main="Tefnut Wand",
sub="Genbu's Shield",
ammo="Incantor Stone",
head="Orison Cap +2",
body="Facio Bliaut",
hands="Augur's Gloves",
legs="Orsn. Pantaln. +2",
feet="Orsn. Duckbills +2",
waist="Austerity Belt",
neck="Orison Locket",
left_ear="Loquac. Earring",
right_ear="Orison Earring",
left_ring="Omega Ring",
right_ring="Sirona's Ring",
}
end
function precast(spell)
if spell.prefix == '/ma' then
-- Magic precast
equip(sets.FastCast)
end
end
function midcast(spell)
if spell.prefix == '/Cur' or spell.prefix == '/Cure' then
-- Magic Usage
equip(sets.Cure)
end
end
function aftercast(spell)
if player.status=='Idle' then
equip(sets.Idle)
end
end
Ragnarok.Flippant
Serveur: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-04-14 11:48:58
spell.prefix will return the full prefix to the action, like 'magic' instead of 'ma'.
It will also never be 'Cur' or 'Cure' because those are in the name of the spell, not the prefix (the prefix for these is still 'magic'). Instead, you want to know if the name of the spell contains those letters. One option is to use the find method.
Code function midcast(spell)
if string.find(spell.english,"Cur") and spell.english ~= "Cursna" then
-- Magic Usage
equip(sets.Cure)
end
end
Note that you don't also have to look for "Cure" because "Cur" is a part of "Cure" already. The second part, "spell.english ~= "Cursna"" means if the name of the spell is NOT Cursna, since you don't want to equip your cure sets for that. Alternatively, you can search for "Cure" or "Cura", which would include cures, curas, and curagas, and exclude Cursna.
Also, you have no closing brace for your sets.Idle set.
Just looking for someone to explain this addon a bit for me. It looks like it is an alternative to Spellcast.
Is it going to be replacing Spellcast? In which ways is it better or worse. I don't know any programming but I've slowly learned more and more about spellcast and the 'language' used in gearswap is confusing to me.
It says it uses packets so it potentially could be more detectable? but does that also eliminate any lag that spellcast may encounter?
I plan on redoing my PUP xml to include pet casting sets thanks to the new addon petschool. I'm just not sure if it's worth it to just wait until gearswap gets more popular or to go ahead and do it in spellcast.
If anyone could give me more info I'd greatly appreciate it.
|
|