|
Scholar Gearswap .lua
Quetzalcoatl.Setsuai
サーバ: Quetzalcoatl
Game: FFXI
Posts: 61
By Quetzalcoatl.Setsuai 2014-06-20 21:06:31
I mean I was using the short hand syntax spellcast recognizes rather than the correct. I still have spellcast loaded for the moment so it was refering to my spellcast files (which are non-existant now).
Bismarck.Snprphnx
サーバ: Bismarck
Game: FFXI
Posts: 2707
By Bismarck.Snprphnx 2014-06-20 21:42:08
Yea. Gearswap and Spellcast don't like each other. Also, you can use the Shortcuts addon, which enables the spellcast shortcuts to be used with Gearswap.
サーバ: Odin
Game: FFXI
Posts: 3
By Odin.Nubbinater 2014-06-24 13:22:18
I'm having trouble with my obi swapping if anyone can help me out that would be great. The line i use is Code if (spell.skill == 'Elemental Magic' or string.find(spell.english,'Cur') or string.find(spell.english,'Bio') or string.find(spell.english,'Dia')) and not Non_Obi_Spells:contains(spell.english) and (world.day_element == spell.element or world.weather_element == spell.element) and sets.Obi[spell.element] and Obi == 'ON' then
equipSet = set_combine(equipSet,sets.Obi[spell.element])
based of bokura's gearswap.
My problem is getting it to work with any element other than ice, it works fine with ice but when i try thunder or healing it puts on my normal sets without obi. I can pastebin my whole file if that helps, any help is appreciated.
サーバ: Siren
Game: FFXI
Posts: 69
By Siren.Ulicaura 2014-06-25 15:38:52
Hi guys, I am using the standard template for SCH gearswap but there doesn't seem to be a capacity for a seperate Helix set, just nuking - can someone advise how I would make a seperate set please?
Necro Bump Detected!
[354 days between previous and next post]
By Bursto 2015-06-14 21:21:30
I am using this gs. I only posted my gear into it so far, but I get an error from line 229 when I use stratagems or sublimation. The error reads " failed attempt to concatenate field 'skill' (a nill value). Did I forget to fill something in?
Bismarck.Snprphnx
サーバ: Bismarck
Game: FFXI
Posts: 2707
By Bismarck.Snprphnx 2015-06-14 21:36:35
Post it to pastebin and post the link here.
By Bursto 2015-06-14 21:45:02
function get_sets()
sets = {}
sets.aftercast_Idle_noSub = {main="Keraunos",sub="Mephitis Grip",ammo="Incantor Stone",
neck="Twilight Torque",ear1="Nourishing earring",ear2="Loquacious Earring",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Defending Ring",ring2="Patricius ring",
back="Iximulew Cape",waist="Fucho-no-obi",legs="Assiduity Pants",feet="Serpentes Sabots"}
sets.aftercast_Idle_Sub = {main="Keraunos",sub="Mephitis Grip",ammo="Incantor Stone",
neck="Twilight Torque",ear1="Nourishing earring",ear2="Loquacious Earring",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Defending Ring",ring2="Patricius ring",
back="Iximulew Cape",waist="Fucho-no-obi",legs="Assiduity Pants",feet="Serpentes Sabots"}
sets.aftercast_Idle = sets.aftercast_Idle_noSub
sets.precast_FastCast = {ammo="Incantor Stone",head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",back="Swith Cape",legs="Orvail Pants",feet="Chelona Boots"}
sets.Resting = {main="Chatoyant Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Nares Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Chelona Boots"}
sets.midcast_ElementalMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_DarkMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_EnfeeblingMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Impact = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Embrava = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_EnhancingMagic = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",
back="Swith Cape",waist="Ninurta's Sash",legs="Orvail Pants",feet="Chelona Boots"}
sets.precast_Stun = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Cure = {main="Keraunos",sub="Mephitis Grip",head="Nahtirah Hat",ear1="Roundel Earring",ear2="Loquacious Earring",
neck="Orunmila's Torque",body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Patricius Ring",ring2="Kunaji Ring",
back="Tempered +1",waist="Witful Belt",legs="Nares Trews",feet="Regal pumps"}
sets.midcast_Helix = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Stoneskin = {main="Kirin's Pole",neck="Stone Gorget",waist="Siegel Sash",legs="Shedir Seraweels"}
sets.Obi = {}
sets.Obi.Fire = {waist='Karin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Earth = {waist='Dorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Water = {waist='Suirin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Wind = {waist='Furin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Ice = {waist='Hyorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Thunder = {waist='Rairin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Light = {waist='Korin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Dark = {waist='Anrin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.staves = {}
sets.staves.damage = {main="Keraunos"}
sets.staves.damage.Thunder = {main="Keraunos"}
sets.staves.damage.Fire = {main="Keraunos"}
sets.staves.accuracy = {main="Keraunos"}
sets.staves.damage.Thunder = {main="Keraunos"}
sets.staves.damage.Ice = {main="Keraunos"}
stuntarg = 'Shantotto'
end
function precast(spell,action)
if spell.english == 'Impact' then
cast_delay(2)
equip(sets['precast_FastCast'],{body="Twilight Cloak"})
if not buffactive['elemental seal'] then
add_to_chat(8,'--------- Elemental Seal is down ---------')
end
elseif spell.skill=='ElementalMagic' and spell.casttime < 3 then
cast_delay(0.1)
equip(sets.midcast_ElementalMagic)
if spell.element == 'Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element and sets.Obi[spell.element] then
equip(sets.Obi[spell.element])
end
elseif spell.english == 'Stun' then
cast_delay(0.1)
equip(sets['precast_Stun'])
if not buffactive.thunderstorm then
add_to_chat(8,'--------- Thunderstorm is down ---------')
elseif not buffactive.klimaform then
add_to_chat(8,'----------- Klimaform is down -----------')
end
if stuntarg ~= 'Shantotto' then
send_command('@input /t '..stuntarg..' ---- Byrth Stunned!!! ---- ')
end
else
equip(sets['precast_FastCast'])
cast_delay(0.5)
end
if (buffactive.alacrity or buffactive.celerity) and world.weather_element == spell.element then
equip({feet='Argute Loafers +2'})
end
end
function midcast(spell,action)
if string.find(spell.english,'Cur') then
equip(sets.midcast_Cure)
if spell.element == world.weather_element or spell_element == world.day_element then
equip({main="Chatoyant Staff"},sets.Obi[spell.element])
end
if buffactive.rapture then
equip({head="Savant's Bonnet +2"})
end
elseif spell.english == 'Impact' then
local tempset = sets['midcast_Impact']
tempset['body'] = 'Twilight Cloak'
tempset['head'] = empty
equip(tempset)
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
if sets.staves.damage[spell.element] then
equip(sets.staves.damage[spell.element])
end
elseif spell.skill=="ElementalMagic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
else
equip(sets.midcast_ElementalMagic)
if spell.element=='Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.english == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
elseif spell.skill == 'EnhancingMagic' then
if spell.english == 'Embrava' then
equip(sets['midcast_Embrava'])
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
end
if buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
else
weathercheck(spell.element,sets['midcast_'..spell.skill])
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
function aftercast(spell,action)
equip(sets['aftercast_Idle'])
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
function status_change(new,tab)
if new == 'Resting' then
equip(sets['Resting'])
else
equip(sets['aftercast_Idle'])
end
end
function buff_change(status,gain_or_loss)
if status == 'Sublimation: Complete' and gain_or_loss == 'gain' and not 'stunmode' then -- True whether gained or lost
sets.aftercast_Idle = sets.aftercast_Idle_noSub
elseif status == 'Sublimation: Activated' and gain_or_loss == 'gain' and not 'stunmode' then
sets.aftercast_Idle = sets.aftercast_Idle_Sub
end
equip(sets.aftercast_Idle)
end
function pet_midcast(spell,action)
end
function pet_aftercast(spell,action)
end
function self_command(command)
if command == 'stuntarg' then
stuntarg = target.name
elseif command == 'stunmode' then
windower.add_to_chat(100,'Stun Mode')
if sets.aftercast_Idle ~= sets.precast_Stun then
stunmode = true
sets.aftercast_Idle = sets.precast_Stun
elseif buffactive['Sublimation: Activated'] then
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_Sub
else
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_noSub
end
equip(sets.aftercast_Idle)
end
end
-- This function is user defined, but never called by GearSwap itself. It's just a user function that's only called from user functions. I wanted to check the weather and equip a weather-based set for some spells, so it made sense to make a function for it instead of replicating the conditional in multiple places.
function weathercheck(spell_element,set)
if spell_element == world.weather_element or spell_element == world.day_element then
equip(set,sets['Obi_'..spell_element])
else
equip(set)
end
end
Bismarck.Snprphnx
サーバ: Bismarck
Game: FFXI
Posts: 2707
By Bismarck.Snprphnx 2015-06-14 22:09:33
Please post it to pastebin and post the link. Seeing it like that with no line numbers is confusing.
Cerberus.Krystela
サーバ: Cerberus
Game: FFXI
Posts: 53
By Cerberus.Krystela 2015-06-14 22:12:10
Code function get_sets()
sets = {}
sets.aftercast_Idle_noSub = {main="Keraunos",sub="Mephitis Grip",ammo="Incantor Stone",
neck="Twilight Torque",ear1="Nourishing earring",ear2="Loquacious Earring",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Defending Ring",ring2="Patricius ring",
back="Iximulew Cape",waist="Fucho-no-obi",legs="Assiduity Pants",feet="Serpentes Sabots"}
sets.aftercast_Idle_Sub = {main="Keraunos",sub="Mephitis Grip",ammo="Incantor Stone",
neck="Twilight Torque",ear1="Nourishing earring",ear2="Loquacious Earring",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Defending Ring",ring2="Patricius ring",
back="Iximulew Cape",waist="Fucho-no-obi",legs="Assiduity Pants",feet="Serpentes Sabots"}
sets.aftercast_Idle = sets.aftercast_Idle_noSub
sets.precast_FastCast = {ammo="Incantor Stone",head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",back="Swith Cape",legs="Orvail Pants",feet="Chelona Boots"}
sets.Resting = {main="Chatoyant Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Nares Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Chelona Boots"}
sets.midcast_ElementalMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_DarkMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_EnfeeblingMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Impact = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Embrava = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_EnhancingMagic = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",
back="Swith Cape",waist="Ninurta's Sash",legs="Orvail Pants",feet="Chelona Boots"}
sets.precast_Stun = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Cure = {main="Keraunos",sub="Mephitis Grip",head="Nahtirah Hat",ear1="Roundel Earring",ear2="Loquacious Earring",
neck="Orunmila's Torque",body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Patricius Ring",ring2="Kunaji Ring",
back="Tempered +1",waist="Witful Belt",legs="Nares Trews",feet="Regal pumps"}
sets.midcast_Helix = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Stoneskin = {main="Kirin's Pole",neck="Stone Gorget",waist="Siegel Sash",legs="Shedir Seraweels"}
sets.Obi = {}
sets.Obi.Fire = {waist='Karin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Earth = {waist='Dorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Water = {waist='Suirin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Wind = {waist='Furin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Ice = {waist='Hyorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Thunder = {waist='Rairin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Light = {waist='Korin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Dark = {waist='Anrin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.staves = {}
sets.staves.damage = {main="Keraunos"}
sets.staves.damage.Thunder = {main="Keraunos"}
sets.staves.damage.Fire = {main="Keraunos"}
sets.staves.accuracy = {main="Keraunos"}
sets.staves.damage.Thunder = {main="Keraunos"}
sets.staves.damage.Ice = {main="Keraunos"}
stuntarg = 'Shantotto'
end
function precast(spell,action)
if spell.english == 'Impact' then
cast_delay(2)
equip(sets['precast_FastCast'],{body="Twilight Cloak"})
if not buffactive['elemental seal'] then
add_to_chat(8,'--------- Elemental Seal is down ---------')
end
elseif spell.skill=='ElementalMagic' and spell.casttime < 3 then
cast_delay(0.1)
equip(sets.midcast_ElementalMagic)
if spell.element == 'Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element and sets.Obi[spell.element] then
equip(sets.Obi[spell.element])
end
elseif spell.english == 'Stun' then
cast_delay(0.1)
equip(sets['precast_Stun'])
if not buffactive.thunderstorm then
add_to_chat(8,'--------- Thunderstorm is down ---------')
elseif not buffactive.klimaform then
add_to_chat(8,'----------- Klimaform is down -----------')
end
if stuntarg ~= 'Shantotto' then
send_command('@input /t '..stuntarg..' ---- Byrth Stunned!!! ---- ')
end
else
equip(sets['precast_FastCast'])
cast_delay(0.5)
end
if (buffactive.alacrity or buffactive.celerity) and world.weather_element == spell.element then
equip({feet='Argute Loafers +2'})
end
end
function midcast(spell,action)
if string.find(spell.english,'Cur') then
equip(sets.midcast_Cure)
if spell.element == world.weather_element or spell_element == world.day_element then
equip({main="Chatoyant Staff"},sets.Obi[spell.element])
end
if buffactive.rapture then
equip({head="Savant's Bonnet +2"})
end
elseif spell.english == 'Impact' then
local tempset = sets['midcast_Impact']
tempset['body'] = 'Twilight Cloak'
tempset['head'] = empty
equip(tempset)
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
if sets.staves.damage[spell.element] then
equip(sets.staves.damage[spell.element])
end
elseif spell.skill=="ElementalMagic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
else
equip(sets.midcast_ElementalMagic)
if spell.element=='Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.english == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
elseif spell.skill == 'EnhancingMagic' then
if spell.english == 'Embrava' then
equip(sets['midcast_Embrava'])
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
end
if buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
else
weathercheck(spell.element,sets['midcast_'..spell.skill])
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
function aftercast(spell,action)
equip(sets['aftercast_Idle'])
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
function status_change(new,tab)
if new == 'Resting' then
equip(sets['Resting'])
else
equip(sets['aftercast_Idle'])
end
end
function buff_change(status,gain_or_loss)
if status == 'Sublimation: Complete' and gain_or_loss == 'gain' and not 'stunmode' then -- True whether gained or lost
sets.aftercast_Idle = sets.aftercast_Idle_noSub
elseif status == 'Sublimation: Activated' and gain_or_loss == 'gain' and not 'stunmode' then
sets.aftercast_Idle = sets.aftercast_Idle_Sub
end
equip(sets.aftercast_Idle)
end
function pet_midcast(spell,action)
end
function pet_aftercast(spell,action)
end
function self_command(command)
if command == 'stuntarg' then
stuntarg = target.name
elseif command == 'stunmode' then
windower.add_to_chat(100,'Stun Mode')
if sets.aftercast_Idle ~= sets.precast_Stun then
stunmode = true
sets.aftercast_Idle = sets.precast_Stun
elseif buffactive['Sublimation: Activated'] then
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_Sub
else
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_noSub
end
equip(sets.aftercast_Idle)
end
end
-- This function is user defined, but never called by GearSwap itself. It's just a user function that's only called from user functions. I wanted to check the weather and equip a weather-based set for some spells, so it made sense to make a function for it instead of replicating the conditional in multiple places.
function weathercheck(spell_element,set)
if spell_element == world.weather_element or spell_element == world.day_element then
equip(set,sets['Obi_'..spell_element])
else
equip(set)
end
end
To help wit the no number confusion
Edit: From the look of iit that GS is using "old writings" nil value usually means that there is no base set. Your file is a mess and everything is all over the place, which makes it really hard to find errors.
Bismarck.Snprphnx
サーバ: Bismarck
Game: FFXI
Posts: 2707
By Bismarck.Snprphnx 2015-06-14 22:15:05
Cerberus.Krystela said: »Code function get_sets()
sets = {}
sets.aftercast_Idle_noSub = {main="Keraunos",sub="Mephitis Grip",ammo="Incantor Stone",
neck="Twilight Torque",ear1="Nourishing earring",ear2="Loquacious Earring",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Defending Ring",ring2="Patricius ring",
back="Iximulew Cape",waist="Fucho-no-obi",legs="Assiduity Pants",feet="Serpentes Sabots"}
sets.aftercast_Idle_Sub = {main="Keraunos",sub="Mephitis Grip",ammo="Incantor Stone",
neck="Twilight Torque",ear1="Nourishing earring",ear2="Loquacious Earring",
body="Respite Cloak",hands="Serpentes Cuffs",ring1="Defending Ring",ring2="Patricius ring",
back="Iximulew Cape",waist="Fucho-no-obi",legs="Assiduity Pants",feet="Serpentes Sabots"}
sets.aftercast_Idle = sets.aftercast_Idle_noSub
sets.precast_FastCast = {ammo="Incantor Stone",head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",back="Swith Cape",legs="Orvail Pants",feet="Chelona Boots"}
sets.Resting = {main="Chatoyant Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Nares Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Chelona Boots"}
sets.midcast_ElementalMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_DarkMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_EnfeeblingMagic = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Impact = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Embrava = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_EnhancingMagic = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",
back="Swith Cape",waist="Ninurta's Sash",legs="Orvail Pants",feet="Chelona Boots"}
sets.precast_Stun = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Cure = {main="Keraunos",sub="Mephitis Grip",head="Nahtirah Hat",ear1="Roundel Earring",ear2="Loquacious Earring",
neck="Orunmila's Torque",body="Heka's Kalasiris",hands="Bokwus Gloves",ring1="Patricius Ring",ring2="Kunaji Ring",
back="Tempered +1",waist="Witful Belt",legs="Nares Trews",feet="Regal pumps"}
sets.midcast_Helix = {main="Keraunos",sub="Mephitis Grip",ammo="Witchstone",
head="Hagondes Hat +1",
neck="Eddy necklace",ear1="Friomis Earring",ear2="Hecate's Earring",
body="Vanir Cotehardie",hands="Otomi Gloves",
ring1="Prolix ring",ring2="Acumen ring",
back="Toro Cape",waist="Yamabuki-no-obi",legs="Hagondes pants +1",
feet="Umbani Boots"}
sets.midcast_Stoneskin = {main="Kirin's Pole",neck="Stone Gorget",waist="Siegel Sash",legs="Shedir Seraweels"}
sets.Obi = {}
sets.Obi.Fire = {waist='Karin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Earth = {waist='Dorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Water = {waist='Suirin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Wind = {waist='Furin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Ice = {waist='Hyorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Thunder = {waist='Rairin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Light = {waist='Korin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Dark = {waist='Anrin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.staves = {}
sets.staves.damage = {main="Keraunos"}
sets.staves.damage.Thunder = {main="Keraunos"}
sets.staves.damage.Fire = {main="Keraunos"}
sets.staves.accuracy = {main="Keraunos"}
sets.staves.damage.Thunder = {main="Keraunos"}
sets.staves.damage.Ice = {main="Keraunos"}
stuntarg = 'Shantotto'
end
function precast(spell,action)
if spell.english == 'Impact' then
cast_delay(2)
equip(sets['precast_FastCast'],{body="Twilight Cloak"})
if not buffactive['elemental seal'] then
add_to_chat(8,'--------- Elemental Seal is down ---------')
end
elseif spell.skill=='ElementalMagic' and spell.casttime < 3 then
cast_delay(0.1)
equip(sets.midcast_ElementalMagic)
if spell.element == 'Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element and sets.Obi[spell.element] then
equip(sets.Obi[spell.element])
end
elseif spell.english == 'Stun' then
cast_delay(0.1)
equip(sets['precast_Stun'])
if not buffactive.thunderstorm then
add_to_chat(8,'--------- Thunderstorm is down ---------')
elseif not buffactive.klimaform then
add_to_chat(8,'----------- Klimaform is down -----------')
end
if stuntarg ~= 'Shantotto' then
send_command('@input /t '..stuntarg..' ---- Byrth Stunned!!! ---- ')
end
else
equip(sets['precast_FastCast'])
cast_delay(0.5)
end
if (buffactive.alacrity or buffactive.celerity) and world.weather_element == spell.element then
equip({feet='Argute Loafers +2'})
end
end
function midcast(spell,action)
if string.find(spell.english,'Cur') then
equip(sets.midcast_Cure)
if spell.element == world.weather_element or spell_element == world.day_element then
equip({main="Chatoyant Staff"},sets.Obi[spell.element])
end
if buffactive.rapture then
equip({head="Savant's Bonnet +2"})
end
elseif spell.english == 'Impact' then
local tempset = sets['midcast_Impact']
tempset['body'] = 'Twilight Cloak'
tempset['head'] = empty
equip(tempset)
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
if sets.staves.damage[spell.element] then
equip(sets.staves.damage[spell.element])
end
elseif spell.skill=="ElementalMagic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
else
equip(sets.midcast_ElementalMagic)
if spell.element=='Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.english == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
elseif spell.skill == 'EnhancingMagic' then
if spell.english == 'Embrava' then
equip(sets['midcast_Embrava'])
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
end
if buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
else
weathercheck(spell.element,sets['midcast_'..spell.skill])
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
function aftercast(spell,action)
equip(sets['aftercast_Idle'])
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
function status_change(new,tab)
if new == 'Resting' then
equip(sets['Resting'])
else
equip(sets['aftercast_Idle'])
end
end
function buff_change(status,gain_or_loss)
if status == 'Sublimation: Complete' and gain_or_loss == 'gain' and not 'stunmode' then -- True whether gained or lost
sets.aftercast_Idle = sets.aftercast_Idle_noSub
elseif status == 'Sublimation: Activated' and gain_or_loss == 'gain' and not 'stunmode' then
sets.aftercast_Idle = sets.aftercast_Idle_Sub
end
equip(sets.aftercast_Idle)
end
function pet_midcast(spell,action)
end
function pet_aftercast(spell,action)
end
function self_command(command)
if command == 'stuntarg' then
stuntarg = target.name
elseif command == 'stunmode' then
windower.add_to_chat(100,'Stun Mode')
if sets.aftercast_Idle ~= sets.precast_Stun then
stunmode = true
sets.aftercast_Idle = sets.precast_Stun
elseif buffactive['Sublimation: Activated'] then
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_Sub
else
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_noSub
end
equip(sets.aftercast_Idle)
end
end
-- This function is user defined, but never called by GearSwap itself. It's just a user function that's only called from user functions. I wanted to check the weather and equip a weather-based set for some spells, so it made sense to make a function for it instead of replicating the conditional in multiple places.
function weathercheck(spell_element,set)
if spell_element == world.weather_element or spell_element == world.day_element then
equip(set,sets['Obi_'..spell_element])
else
equip(set)
end
end
To help wit the no number confusion yea, but doing that, line 229 is just an 'else', and me copy/paste to pastebin, i get it looking for a weathercheck. that's why I asked him to do it, so there was no confusion
Cerberus.Krystela
サーバ: Cerberus
Game: FFXI
Posts: 53
By Cerberus.Krystela 2015-06-14 22:21:13
Bismarck.Snprphnx said: »yea, but doing that, line 229 is just an 'else', and me copy/paste to pastebin, i get it looking for a weathercheck. that's why I asked him to do it, so there was no confusion
Yeah, realised after changing it to a code
Cerberus.Krystela
サーバ: Cerberus
Game: FFXI
Posts: 53
By Cerberus.Krystela 2015-06-14 22:42:31
Bursto, it's weathercheck(spell.element,sets['midcast_'..spell.skill])
that doesn't work, I guess it tries to equip a skill set for sublimation/stratageme, which doesn't work because they aren't a "type of skill" like enhancing or enfeebling.
So it will give you an error everytime.
By Bursto 2015-06-15 19:42:30
By Bursto 2015-06-15 21:19:37
Removed the weathercheck line for now and everything works fine. Thanks for the help.
[+]
Necro Bump Detected!
[188 days between previous and next post]
By hyeirkhris 2015-12-20 09:59:23
anyone have a sch lua they wouldnt mind sharing?
By shawkky 2015-12-27 12:39:37
No seriously. Does anyone mind posting an up to date SCH lua? The one posted to this forum is severely outdated my current gear sets get red scribble and not swapping in. Hachirin-no-obi, ghastly tathlum +1 etc etc not even swapping. Myself and others interested in doing some serious Scholaring would be grateful, thanks.
Bismarck.Speedyjim
サーバ: Bismarck
Game: FFXI
Posts: 516
By Bismarck.Speedyjim 2016-01-18 01:37:14
[+]
サーバ: Odin
Game: FFXI
Posts: 18
By Odin.Niteanjel 2016-01-22 05:22:43
Dude you are amazeballs i wanted ot update my SCH Lua and you are a genius :) quick question do you use the Hachirin no Obi or Twilight Cape for weather nukes?
Carbuncle.Silverio
サーバ: Carbuncle
Game: FFXI
Posts: 8
By Carbuncle.Silverio 2016-02-16 17:29:58
scholar.lua
https://mega.nz/#!sldkiICQ
サーバ: Sylph
Game: FFXI
Posts: 2
By Sylph.Wingedangel 2016-03-10 16:11:05
Bismarck.Speedyjim said: »
So I've been using this one and adding my own gear in and making minor changes that I wanted.
However the stratagems counter seems to be off, constantly going from 4 to 2 and cancelling when I try to use strats with one left saying I don't have any.
I'm very new to luas and this is way over my head. I can just about handle treating it like it's spellcast with the pre/mid/aftercast commands.
Code 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 have 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
Above is (what I think is) the relevant code.
Thanks in advance!
Necro Bump Detected!
[45 days between previous and next post]
Asura.Ramsy
サーバ: Asura
Game: FFXI
Posts: 281
By Asura.Ramsy 2016-04-24 12:11:59
Anyone have an up to date lua they wouldn't mind sharing with me?
Bismarck.Speedyjim
サーバ: Bismarck
Game: FFXI
Posts: 516
By Bismarck.Speedyjim 2016-04-24 13:18:56
Anyone have an up to date lua they wouldn't mind sharing with me? https://drive.google.com/open?id=0ByGS22kY0-SpLUZBZmRmZjl4UWc
Bismarck.Speedyjim
サーバ: Bismarck
Game: FFXI
Posts: 516
By Bismarck.Speedyjim 2016-04-24 13:20:31
Sylph.Wingedangel said: »Bismarck.Speedyjim said: »
So I've been using this one and adding my own gear in and making minor changes that I wanted.
However the stratagems counter seems to be off, constantly going from 4 to 2 and cancelling when I try to use strats with one left saying I don't have any.
I'm very new to luas and this is way over my head. I can just about handle treating it like it's spellcast with the pre/mid/aftercast commands.
Code 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 have 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
Above is (what I think is) the relevant code.
Thanks in advance! If you don't have the 550 JP gift, change local fullRechargeTime = 5*33 to local fullRechargeTime = 5*48
Asura.Ramsy
サーバ: Asura
Game: FFXI
Posts: 281
By Asura.Ramsy 2016-04-24 23:32:43
Bismarck.Snprphnx said: »1. Copy/Edit the file and save it as a .lua file, as charactername.lua
2. save it into the \addons\Gearswap\data folder.
3. Load Gearswap in ffxi
From there, the file should be auto loaded and run. Is there any other steps besides this? I'm trying to load the lua posted above, but I keep getting no file name provided?
Necro Bump Detected!
[42 days between previous and next post]
Bahamut.Neb
サーバ: Bahamut
Game: FFXI
Posts: 189
By Bahamut.Neb 2016-06-05 19:24:54
My Ped feet are not equipping for Storms and I have the same sets as above anyone else having this issue?
サーバ: Odin
Game: FFXI
Posts: 177
By Odin.Speedyjim 2016-06-05 19:28:33
My Ped feet are not equipping for Storms and I have the same sets as above anyone else having this issue? Please post your LUA as nobody can effectively help without seeing it. Do us all a favour and use the code tags when pasting it, unlike the previous poster.
Posted below is a _SCH.lua file that I wrote using Byrths original file as an example, and tweaked and edited to work out any errors. I will not call it complete, due to me potentially missing specific rules for certain JAs or spells. However, I would say that it covers the majority of what is needed.
If you have any questions about it, please feel free to post them here for Byrths or myself to answer. Also, if you noticed I missed anything crucial, let me know and we can add it in.
This same file is included in the Gearswap download in the examples section, and I will try to keep it as up-to-date as possible.
Code function get_sets()
sets = {}
sets.aftercast_Idle_noSub = {main="Owleyes",sub="Genbu's Shield",ammo="Incantor Stone",
head="Savant's bonnet +2",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Serpentes Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Serpentes Sabots"}
sets.aftercast_Idle_Sub = {main="Owleyes",sub="Genbu's Shield",ammo="Incantor Stone",
head="Savant's bonnet +2",neck="Twilight Torque",ear1="Savant's Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Serpentes Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Serpentes Sabots"}
sets.aftercast_Idle = sets.aftercast_Idle_noSub
sets.precast_FastCast = {ammo="Incantor Stone",head="Nahtirah Hat",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",back="Swith Cape",legs="Orvail Pants",feet="Chelona Boots"}
sets.Resting = {main="Chatoyant Staff",sub="Mephitis Grip",
head="Nahtirah Hat",neck="Twilight Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Hagondes Coat",hands="Nares Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Shadow Mantle",waist="Korin Obi",legs="Nares Trews",feet="Chelona Boots"}
sets.midcast_ElementalMagic = {main="Atinian Staff",sub="Wizzan Grip",ammo="Witchstone",
head="Nares Cap",neck="Eddy Necklace",ear1="Hecate's Earring",ear2="Novio Earring",
body="Hagondes Coat",hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Icesoul Ring",
back="Searing Cape",waist="Maniacus Sash",legs="Hagondes Pants",feet="Bokwus Boots"}
sets.midcast_DarkMagic = {main="Chatoyant Staff",sub="Arbuda Grip",ammo="Hasty Pinion",
head="Appetence Crown",neck="Aesir Torque",ear1="Hirudinea Earring",ear2="Loquacious Earring",
body="Hedera Cotehardie",hands="Ayao's Gages",ring1="Balrahn's Ring",ring2="Excelsis Ring",
back="Merciful Cape",waist="Goading Belt",legs="Auspex Slops",feet="Bokwus Boots"}
sets.midcast_EnfeeblingMagic = {main="Atinian Staff",sub="Mephitis Grip",ammo="Savant's Treatise",
head="Nahtirah Hat",neck="Eddy Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Hedera Cotehardie",hands="Hagondes Cuffs",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Merciful Cape",waist="Cascade Belt",legs="Orvail Pants",feet="Rubeus Boots"}
sets.midcast_Impact = {main="Atinian Staff",sub="Wizzan Grip",ammo="Witchstone",
neck="Eddy Necklace",ear1="Hecate's Earring",ear2="Novio Earring",
hands="Yaoyotl Gloves",ring1="Strendu Ring",ring2="Icesoul Ring",
back="Searing Cape",waist="Maniacus Sash",legs="Hagondes Pants",feet="Bokwus Boots"}
sets.midcast_Embrava = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Savant's Treatise",
head="Svnt. Bonnet +2",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Savant's Bracers +2",
back="Merciful Cape",waist="Cascade Belt",legs="Shedir Seraweels",feet="Rubeus Boots"}
sets.midcast_EnhancingMagic = {main="Kirin's Pole",sub="Fulcio Grip",ammo="Incantor Stone",
head="Nahtirah Hat",neck="Colossus's Torque",ear1="Lifestorm Earring",ear2="Loquacious Earring",
body="Anhur Robe",hands="Gendewitha Gages",
back="Swith Cape",waist="Ninurta's Sash",legs="Orvail Pants",feet="Chelona Boots"}
sets.precast_Stun = {main="Apamajas II",sub="Mephitis Grip",ranged="Aureole",
head="Nahtirah Hat",neck="Eddy Necklace",ear1="Lifestorm Earring",ear2="Psystorm Earring",
body="Hedera Cotehardie",hands="Gendewitha Gages",ring1="Sangoma Ring",ring2="Maquette Ring",
back="Swith Cape",waist="Ninurta's Sash",legs="Bokwus Slops",feet="Argute Loafers +2"}
sets.midcast_Cure = {main="Chatoyant Staff",head="Paean Mitra",neck="Phalaina Locket",
body="Anhur Robe",hands="Bokwus Gloves",back="Oretanis's Cape",legs="Nares Trews"}
sets.midcast_Helix = {main="Chatoyant Staff",sub="Wizzan Grip",ammo="Snow Sachet",
head="Nahtirah Hat",neck="Stoicheion Medal",ear1="Hecate's Earring",ear2="Novio Earring",
body="Nares Saio",hands="Nares Cuffs",ring1="Icesoul Ring",ring2="Icesoul Ring",
back="Twilight Cape",waist="Wanion Belt",legs="Akasha Chaps",feet="Nares Clogs"}
sets.midcast_Stoneskin = {main="Kirin's Pole",neck="Stone Gorget",waist="Siegel Sash",legs="Shedir Seraweels"}
sets.Obi = {}
sets.Obi.Fire = {waist='Karin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Earth = {waist='Dorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Water = {waist='Suirin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Wind = {waist='Furin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Ice = {waist='Hyorin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Thunder = {waist='Rairin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Light = {waist='Korin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.Obi.Dark = {waist='Anrin Obi',back='Twilight Cape',lring='Zodiac Ring'}
sets.staves = {}
sets.staves.damage = {}
sets.staves.damage.Thunder = {main="Apamajas I"}
sets.staves.damage.Fire = {main="Atar I"}
sets.staves.accuracy = {}
sets.staves.damage.Thunder = {main="Apamajas II"}
sets.staves.damage.Ice = {main="Vourukasha II"}
stuntarg = 'Shantotto'
end
function precast(spell,action)
if spell.english == 'Impact' then
cast_delay(2)
equip(sets['precast_FastCast'],{body="Twilight Cloak"})
if not buffactive['elemental seal'] then
add_to_chat(8,'--------- Elemental Seal is down ---------')
end
elseif spell.skill=='ElementalMagic' and spell.casttime < 3 then
cast_delay(0.1)
equip(sets.midcast_ElementalMagic)
if spell.element == 'Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element and sets.Obi[spell.element] then
equip(sets.Obi[spell.element])
end
elseif spell.english == 'Stun' then
cast_delay(0.1)
equip(sets['precast_Stun'])
if not buffactive.thunderstorm then
add_to_chat(8,'--------- Thunderstorm is down ---------')
elseif not buffactive.klimaform then
add_to_chat(8,'----------- Klimaform is down -----------')
end
if stuntarg ~= 'Shantotto' then
send_command('@input /t '..stuntarg..' ---- Byrth Stunned!!! ---- ')
end
else
equip(sets['precast_FastCast'])
cast_delay(0.5)
end
if (buffactive.alacrity or buffactive.celerity) and world.weather_element == spell.element then
equip({feet='Argute Loafers +2'})
end
end
function midcast(spell,action)
if string.find(spell.english,'Cur') then
equip(sets.midcast_Cure)
if spell.element == world.weather_element or spell_element == world.day_element then
equip({main="Chatoyant Staff"},sets.Obi[spell.element])
end
if buffactive.rapture then
equip({head="Savant's Bonnet +2"})
end
elseif spell.english == 'Impact' then
local tempset = sets['midcast_Impact']
tempset['body'] = 'Twilight Cloak'
tempset['head'] = empty
equip(tempset)
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
if sets.staves.damage[spell.element] then
equip(sets.staves.damage[spell.element])
end
elseif spell.skill=="ElementalMagic" then
if string.find(spell.english,'helix') then
equip(sets['midcast_Helix'])
else
equip(sets.midcast_ElementalMagic)
if spell.element=='Earth' then
equip({neck="Quanpur Necklace"})
end
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if buffactive.ebullience then
equip({head="Savant's Bonnet +2"})
end
if buffactive.klimform then
equip ({feet="Savant's Loafers +2"})
end
elseif spell.english == 'Stoneskin' then
equip(sets['midcast_Stoneskin'])
elseif spell.skill == 'EnhancingMagic' then
if spell.english == 'Embrava' then
equip(sets['midcast_Embrava'])
if not buffactive.perpetuance then
add_to_chat(8,'--------- Perpetuance is down ---------')
end
if not buffactive.accession then
add_to_chat(8,'--------- Accession is down ---------')
end
if not buffactive.penury then
add_to_chat(8,'--------- Penury is down ---------')
end
end
if buffactive.perpetuance then
equip(sets['midcast_EnhancingMagic'],{hands="Savant's Bracers +2"})
else
equip(sets['midcast_EnhancingMagic'])
end
else
weathercheck(spell.element,sets['midcast_'..spell.skill])
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
function aftercast(spell,action)
equip(sets['aftercast_Idle'])
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
function status_change(new,tab)
if new == 'Resting' then
equip(sets['Resting'])
else
equip(sets['aftercast_Idle'])
end
end
function buff_change(status,gain_or_loss)
if status == 'Sublimation: Complete' and gain_or_loss == 'gain' and not 'stunmode' then -- True whether gained or lost
sets.aftercast_Idle = sets.aftercast_Idle_noSub
elseif status == 'Sublimation: Activated' and gain_or_loss == 'gain' and not 'stunmode' then
sets.aftercast_Idle = sets.aftercast_Idle_Sub
end
equip(sets.aftercast_Idle)
end
function pet_midcast(spell,action)
end
function pet_aftercast(spell,action)
end
function self_command(command)
if command == 'stuntarg' then
stuntarg = target.name
elseif command == 'stunmode' then
windower.add_to_chat(100,'Stun Mode')
if sets.aftercast_Idle ~= sets.precast_Stun then
stunmode = true
sets.aftercast_Idle = sets.precast_Stun
elseif buffactive['Sublimation: Activated'] then
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_Sub
else
stunmode = false
sets.aftercast_Idle = sets.aftercast_Idle_noSub
end
equip(sets.aftercast_Idle)
end
end
-- This function is user defined, but never called by GearSwap itself. It's just a user function that's only called from user functions. I wanted to check the weather and equip a weather-based set for some spells, so it made sense to make a function for it instead of replicating the conditional in multiple places.
function weathercheck(spell_element,set)
if spell_element == world.weather_element or spell_element == world.day_element then
equip(set,sets['Obi_'..spell_element])
else
equip(set)
end
end
|
|