|
Gearswap help ;_;
By Selindrile 2014-01-10 19:06:03
Trying to modify JSHidaka's monk file for my own use (thanks a lot if ya read here, been a big help), generally does what I want but I'm trying to add back in all the things I'm missing from my old spellcast, but I'm still apparently flabbergasted by the basics here, not quite sure what I'm doing wrong, I thought I'd be able to define midcast sets the same way precast sets were defined... here's what I've got at the moment:
Code
function get_sets()
--Precast Sets
sets.precast = {}
sets.precast['Utsusemi: Ichi'] = {neck="Magoraga Beads"}
sets.precast['Utsusemi: Ni'] = {neck="Magoraga Beads"}
sets.precast['Hundred Fists'] = {legs="Mel. Hose +2"}
sets.precast['Formless Strikes'] = {body="Mel. Cyclas +2"}
sets.precast.Counterstance = {feet="Melee Gaiters +2"}
-- sets.precast.Dodge = {feet="Anchorite's Gaiters"}
-- sets.precast.Boost = {hands="Anch. Gloves +1"}
sets.precast.Mantra = {feet="Melee Gaiters +2"}
-- sets.precast.Focus = {head="Anchor. Crown +1"}
sets.precast.Chakra = {
ammo="Soil Sachet",
head="Uk'uxkaj Cap",
body="Otronif Harness",
hands="Mel. Gloves +2",
legs="Nahtirah Trousers",
feet="Otronif Boots",
}
--VS Base Set
sets.precast.VSDD={
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Kheper Jacket",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Rancor Collar",
waist="Wanion Belt",
left_ear="Steelflash Earring",
right_ear="Bladeborn Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Atheling Mantle",
}
--VS Impetus Set
sets.precast.VSImpetus = set_combine(sets.precast.VSDD, {
body="Tantra Cyclas +2",
})
--VS Accuracy Base Set
sets.precast.VSACC={
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Otronif Harness",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Breeze Gorget",
waist="Light Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Letalis Mantle",
}
--VS Accuracy + Impetus Set
sets.precast.VSImpacc = set_combine(sets.precast.VSACC, {
body="Tantra Cyclas +2",
})
--Default Set for VS
sets.precast['Victory Smite'] = sets.precast.VSDD
--SS Base set
sets.precast.SSDD={
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Kheper Jacket",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Asperity Necklace",
waist="Wanion Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Atheling Mantle",
}
--SS Accuracy Set
sets.precast.SSACC= set_combine(sets.precast.SSDD, {
body="Otronif Harness",
waist="Light Belt",
back="Letalis Mantle",
})
--Default Set for SS
sets.precast['Shijin Spiral']= sets.precast.SSDD
-- FH Base Set
sets.precast.FHDD ={
}
-- FH Accuracy set
sets.precast.FHACC = set_combine(sets.precast.FHDD, {
})
-- Default set for FH
sets.precast['Final Heaven'] = sets.precast.FHDD
-- Others WS Set
sets.precast.WS = {
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Kheper Jacket",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Rancor Collar",
waist="Wanion Belt",
left_ear="Steelflash Earring",
right_ear="Bladeborn Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Atheling Mantle",
}
--Midcast Sets
sets.midcast['Utsusemi: Ichi'] = {back="Mujin Mantle"}
sets.midcast['Utsusemi: Ni'] = {back="Mujin Mantle"}
--TP sets
sets.TP = {}
sets.TP.DD = {
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Thaumas Coat",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Asperity Necklace",
waist="Cetl Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Atheling Mantle",
}
sets.TP.Acc = set_combine(sets.TP.DD, {
body="Otronif Harness",
waist="Hurch'lan Sash",
back="Letalis Mantle",
})
sets.TP.Hybrid= set_combine(sets.TP.Acc, {
neck="Twilight Torque",
waist="Black Belt",
left_ring="Dark Ring",
right_ring="Dark Ring",
back="Mollusca Mantle",
})
sets.TP.Impetus={
body="Tantra Cyclas +2",
}
--PDT/MDT Sets
sets.PDT ={
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Otronif Harness",
hands="Otronif Gloves",
legs="Otronif Brais",
feet="Otronif Boots",
neck="Twilight Torque",
waist="Black Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Dark Ring",
right_ring="Dark Ring",
back="Mollusca Mantle",
}
sets.MDT = set_combine(sets.PDT, {
})
--Aftercast Rule
sets.aftercast = {}
sets.aftercast.TP = sets.TP.DD
sets.aftercast.Idle = {
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Mel. Cyclas +2",
hands="Otronif Gloves",
legs="Otronif Brais",
feet="Hermes' Sandals",
neck="Twilight Torque",
waist="Black Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Dark Ring",
right_ring="Sheltered Ring",
back="Letalis Mantle",
}
end
function precast(spell,action)
if midaction() then
midaction_counter = midaction_counter + 1
if midaction_counter > 9 then
midaction(false)
midaction_counter = 0
else
return
end
else
midaction_counter = 0
end
if spell.english == 'Spectral Jig' and (buffactive['Sneak'])
then send_command('cancel sneak')
end
if sets.precast[spell.english] then
if buffactive['Impetus'] then
if sets.aftercast.TP == sets.TP.Acc then
sets.precast['Victory Smite'] = sets.precast.VSImpacc
else
if sets.aftercast.TP == sets.TP.DD then
sets.precast['Victory Smite'] = sets.precast.VSImpetus
end
end
end
equip(sets.precast[spell.english])
elseif spell.type=="WeaponSkill" then
equip(sets.precast.WS)
end
end
function midcast(spell,action)
if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
send_command('@wait 2.9; cancel 66; cancel 444')
end
if sets.midcast[spell.english] then
equip(sets.midcast[spell.english])
end
end
function aftercast(spell,action)
if player.status =='Engaged' then
if string.find(spell.english,'Boost') then
return
else
equip(sets.aftercast.TP)
end
else
equip(sets.aftercast.Idle)
end
end
function status_change(new,old)
if new == 'Engaged' then
equip(sets.aftercast.TP)
else
equip(sets.aftercast.Idle)
end
end
function buff_change(status,gain_or_loss)
if status == "Impetus" then
if gain_or_loss == "gain" then
if sets.aftercast.TP == sets.TP.Acc then
sets.precast['Victory Smite'] = sets.precast.VSImpacc
send_command('@input /echo Victory Smite WS Set = ImpAcc ')
else
sets.precast['Victory Smite'] = sets.precast.VSImpetus
send_command('@input /echo Victory Smite WS Set = VSImpetus ')
end
else
if sets.aftercast.TP == sets.TP.Acc then
sets.precast['Victory Smite'] = sets.precast.VSACC
send_command('@input /echo Victory Smite WS Set = Acc ')
else
equip(sets.TP.DD)
sets.aftercast.TP = sets.TP.DD
sets.precast['Victory Smite'] = sets.precast.VSDD
send_command('@input /echo Victory Smite WS Set = Normal ')
end
end
end
end
-- SE Macros /console gs c "command" [case sensitive]
function self_command(command)
if command == 'normal' then
equip(sets.TP.DD)
sets.aftercast.TP = sets.TP.DD
sets.precast['Victory Smite'] = sets.precast.VSDD
sets.precast['Shijin Spiral'] = sets.precast.SSDD
send_command('@input /echo Normal TP Set')
elseif command == 'acc' then
equip(sets.TP.Acc)
sets.aftercast.TP = sets.TP.Acc
sets.precast['Victory Smite'] = sets.precast.VSACC
sets.precast['Shijin Spiral'] = sets.precast.SSACC
send_command('@input /echo Accuracy TP Set')
elseif command == 'hybrid' then
equip(sets.TP.Hybrid)
sets.aftercast.TP = sets.TP.Hybrid
sets.precast['Victory Smite'] = sets.precast.VSACC
sets.precast['Shijin Spiral'] = sets.precast.SSACC
send_command('@input /echo Accuracy-DT TP Set')
elseif command == 'impetus' then
equip(sets.TP.Impetus)
sets.aftercast.TP = sets.TP.Impetus
sets.precast['Victory Smite'] = sets.precast.VSImpetus
sets.precast['Shijin Spiral'] = sets.precast.SSDD
send_command('@input /echo Impetus TP Set')
elseif command == 'PDT' then
equip(sets.PDT)
sets.aftercast.TP = sets.PDT
send_command('@input /echo PDT Set')
elseif command == 'MDT' then
equip(sets.MDT)
sets.aftercast.TP = sets.MDT
send_command('@input /echo MDT Set')
end
end
Error I'm getting is:
Selindrile_MNK.lua:121: attempt to index field 'midcast' (a nil value)
Was hoping someone might explain what I was doing wrong...
I'm sure the mistake is either in the way I'm trying to use the sets (line 121) or in the midcast definition (line 230) but I'm not sure what I'm doing wrong.
Leviathan.Arcon
VIP
サーバ: Leviathan
Game: FFXI
Posts: 660
By Leviathan.Arcon 2014-01-10 19:50:09
That's it. If the sets.midcast = {} is missing, the next line will not know what midcast is, and sets.midcast['Utsusemi: Ichi'] will throw an error.
Hades.Triet
サーバ: Hades
Game: FFXI
Posts: 1615
By Hades.Triet 2014-01-10 22:37:46
Curious question. For this code... Code function self_command(command)
if command == 'toggle TP set' then
if sets.aftercast.TP == sets.TP.DD then
sets.aftercast.TP = sets.TP.VW
send_command('@input /echo VW SET')
elseif sets.aftercast.TP == sets.TP.VW then
sets.aftercast.TP = sets.TP.DD
send_command('@input /echo DD SET')
end
elseif command == 'DT' then
equip(sets.DT)
end
end
...what would I have to type to toggle between sets?
Lakshmi.Byrth
VIP
サーバ: Lakshmi
Game: FFXI
Posts: 6137
By Lakshmi.Byrth 2014-01-10 23:06:16
In a macro:
/console gs c toggle TP set
or not in a macro:
//gs c toggle TP set
Hades.Triet
サーバ: Hades
Game: FFXI
Posts: 1615
By Hades.Triet 2014-01-10 23:10:02
Gracias! I used your MNK.lua as a template...lol thats what that is from :x
By Selindrile 2014-01-11 01:14:38
Thanks a to ya both, I didn't even notice that line in the precast to copy it... will try it soon.
Trying to modify JSHidaka's monk file for my own use (thanks a lot if ya read here, been a big help), generally does what I want but I'm trying to add back in all the things I'm missing from my old spellcast, but I'm still apparently flabbergasted by the basics here, not quite sure what I'm doing wrong, I thought I'd be able to define midcast sets the same way precast sets were defined... here's what I've got at the moment:
Code
function get_sets()
--Precast Sets
sets.precast = {}
sets.precast['Utsusemi: Ichi'] = {neck="Magoraga Beads"}
sets.precast['Utsusemi: Ni'] = {neck="Magoraga Beads"}
sets.precast['Hundred Fists'] = {legs="Mel. Hose +2"}
sets.precast['Formless Strikes'] = {body="Mel. Cyclas +2"}
sets.precast.Counterstance = {feet="Melee Gaiters +2"}
-- sets.precast.Dodge = {feet="Anchorite's Gaiters"}
-- sets.precast.Boost = {hands="Anch. Gloves +1"}
sets.precast.Mantra = {feet="Melee Gaiters +2"}
-- sets.precast.Focus = {head="Anchor. Crown +1"}
sets.precast.Chakra = {
ammo="Soil Sachet",
head="Uk'uxkaj Cap",
body="Otronif Harness",
hands="Mel. Gloves +2",
legs="Nahtirah Trousers",
feet="Otronif Boots",
}
--VS Base Set
sets.precast.VSDD={
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Kheper Jacket",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Rancor Collar",
waist="Wanion Belt",
left_ear="Steelflash Earring",
right_ear="Bladeborn Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Atheling Mantle",
}
--VS Impetus Set
sets.precast.VSImpetus = set_combine(sets.precast.VSDD, {
body="Tantra Cyclas +2",
})
--VS Accuracy Base Set
sets.precast.VSACC={
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Otronif Harness",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Breeze Gorget",
waist="Light Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Letalis Mantle",
}
--VS Accuracy + Impetus Set
sets.precast.VSImpacc = set_combine(sets.precast.VSACC, {
body="Tantra Cyclas +2",
})
--Default Set for VS
sets.precast['Victory Smite'] = sets.precast.VSDD
--SS Base set
sets.precast.SSDD={
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Kheper Jacket",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Asperity Necklace",
waist="Wanion Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Atheling Mantle",
}
--SS Accuracy Set
sets.precast.SSACC= set_combine(sets.precast.SSDD, {
body="Otronif Harness",
waist="Light Belt",
back="Letalis Mantle",
})
--Default Set for SS
sets.precast['Shijin Spiral']= sets.precast.SSDD
-- FH Base Set
sets.precast.FHDD ={
}
-- FH Accuracy set
sets.precast.FHACC = set_combine(sets.precast.FHDD, {
})
-- Default set for FH
sets.precast['Final Heaven'] = sets.precast.FHDD
-- Others WS Set
sets.precast.WS = {
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Kheper Jacket",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Rancor Collar",
waist="Wanion Belt",
left_ear="Steelflash Earring",
right_ear="Bladeborn Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Atheling Mantle",
}
--Midcast Sets
sets.midcast['Utsusemi: Ichi'] = {back="Mujin Mantle"}
sets.midcast['Utsusemi: Ni'] = {back="Mujin Mantle"}
--TP sets
sets.TP = {}
sets.TP.DD = {
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Thaumas Coat",
hands="Otronif Gloves",
legs="Manibozho Brais",
feet="Manibozho boots",
neck="Asperity Necklace",
waist="Cetl Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Epona's Ring",
right_ring="Rajas Ring",
back="Atheling Mantle",
}
sets.TP.Acc = set_combine(sets.TP.DD, {
body="Otronif Harness",
waist="Hurch'lan Sash",
back="Letalis Mantle",
})
sets.TP.Hybrid= set_combine(sets.TP.Acc, {
neck="Twilight Torque",
waist="Black Belt",
left_ring="Dark Ring",
right_ring="Dark Ring",
back="Mollusca Mantle",
})
sets.TP.Impetus={
body="Tantra Cyclas +2",
}
--PDT/MDT Sets
sets.PDT ={
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Otronif Harness",
hands="Otronif Gloves",
legs="Otronif Brais",
feet="Otronif Boots",
neck="Twilight Torque",
waist="Black Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Dark Ring",
right_ring="Dark Ring",
back="Mollusca Mantle",
}
sets.MDT = set_combine(sets.PDT, {
})
--Aftercast Rule
sets.aftercast = {}
sets.aftercast.TP = sets.TP.DD
sets.aftercast.Idle = {
ammo="Honed Tathlum",
head="Uk'uxkaj Cap",
body="Mel. Cyclas +2",
hands="Otronif Gloves",
legs="Otronif Brais",
feet="Hermes' Sandals",
neck="Twilight Torque",
waist="Black Belt",
left_ear="Bladeborn Earring",
right_ear="Steelflash Earring",
left_ring="Dark Ring",
right_ring="Sheltered Ring",
back="Letalis Mantle",
}
end
function precast(spell,action)
if midaction() then
midaction_counter = midaction_counter + 1
if midaction_counter > 9 then
midaction(false)
midaction_counter = 0
else
return
end
else
midaction_counter = 0
end
if spell.english == 'Spectral Jig' and (buffactive['Sneak'])
then send_command('cancel sneak')
end
if sets.precast[spell.english] then
if buffactive['Impetus'] then
if sets.aftercast.TP == sets.TP.Acc then
sets.precast['Victory Smite'] = sets.precast.VSImpacc
else
if sets.aftercast.TP == sets.TP.DD then
sets.precast['Victory Smite'] = sets.precast.VSImpetus
end
end
end
equip(sets.precast[spell.english])
elseif spell.type=="WeaponSkill" then
equip(sets.precast.WS)
end
end
function midcast(spell,action)
if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
send_command('@wait 2.9; cancel 66; cancel 444')
end
if sets.midcast[spell.english] then
equip(sets.midcast[spell.english])
end
end
function aftercast(spell,action)
if player.status =='Engaged' then
if string.find(spell.english,'Boost') then
return
else
equip(sets.aftercast.TP)
end
else
equip(sets.aftercast.Idle)
end
end
function status_change(new,old)
if new == 'Engaged' then
equip(sets.aftercast.TP)
else
equip(sets.aftercast.Idle)
end
end
function buff_change(status,gain_or_loss)
if status == "Impetus" then
if gain_or_loss == "gain" then
if sets.aftercast.TP == sets.TP.Acc then
sets.precast['Victory Smite'] = sets.precast.VSImpacc
send_command('@input /echo Victory Smite WS Set = ImpAcc ')
else
sets.precast['Victory Smite'] = sets.precast.VSImpetus
send_command('@input /echo Victory Smite WS Set = VSImpetus ')
end
else
if sets.aftercast.TP == sets.TP.Acc then
sets.precast['Victory Smite'] = sets.precast.VSACC
send_command('@input /echo Victory Smite WS Set = Acc ')
else
equip(sets.TP.DD)
sets.aftercast.TP = sets.TP.DD
sets.precast['Victory Smite'] = sets.precast.VSDD
send_command('@input /echo Victory Smite WS Set = Normal ')
end
end
end
end
-- SE Macros /console gs c "command" [case sensitive]
function self_command(command)
if command == 'normal' then
equip(sets.TP.DD)
sets.aftercast.TP = sets.TP.DD
sets.precast['Victory Smite'] = sets.precast.VSDD
sets.precast['Shijin Spiral'] = sets.precast.SSDD
send_command('@input /echo Normal TP Set')
elseif command == 'acc' then
equip(sets.TP.Acc)
sets.aftercast.TP = sets.TP.Acc
sets.precast['Victory Smite'] = sets.precast.VSACC
sets.precast['Shijin Spiral'] = sets.precast.SSACC
send_command('@input /echo Accuracy TP Set')
elseif command == 'hybrid' then
equip(sets.TP.Hybrid)
sets.aftercast.TP = sets.TP.Hybrid
sets.precast['Victory Smite'] = sets.precast.VSACC
sets.precast['Shijin Spiral'] = sets.precast.SSACC
send_command('@input /echo Accuracy-DT TP Set')
elseif command == 'impetus' then
equip(sets.TP.Impetus)
sets.aftercast.TP = sets.TP.Impetus
sets.precast['Victory Smite'] = sets.precast.VSImpetus
sets.precast['Shijin Spiral'] = sets.precast.SSDD
send_command('@input /echo Impetus TP Set')
elseif command == 'PDT' then
equip(sets.PDT)
sets.aftercast.TP = sets.PDT
send_command('@input /echo PDT Set')
elseif command == 'MDT' then
equip(sets.MDT)
sets.aftercast.TP = sets.MDT
send_command('@input /echo MDT Set')
end
end
Error I'm getting is:
Selindrile_MNK.lua:121: attempt to index field 'midcast' (a nil value)
Was hoping someone might explain what I was doing wrong...
I'm sure the mistake is either in the way I'm trying to use the sets (line 121) or in the midcast definition (line 230) but I'm not sure what I'm doing wrong.
|
|