|
GS Help please
Valefor.Pairak
Server: Valefor
Game: FFXI
Posts: 30
By Valefor.Pairak 2015-11-23 09:50:56
Yes, its me again, and in advance, sorry to keep asking the community questions, but I help a couple friends make scripts and they keep wanting special features, so I spend a couple days testing ideas and abusing google and if that fails I ask here, so thanks to all who assist =)
My current issue is in making a BLM script. My friend want it to diffrensiate between low tier and high tier, as well as having a magic burst set that overwrites either. My sollution to this so far is making 2 main sets, low tier and high tier, then adding some sub sets for reg nuking, acc nuking and burst nuking. But im having trouble with the index part of this. Im attaching the code here and if anyone can figgure out why its not working id apprisiate the help
Error is: (BLM.lua:419: attempt to index global 'HighNukes' (a nil value). Code
send_command('bind f9 gs c C1') --Burst--
send_command('bind f10 gs c C2') --Capa-
function file_unload()
if binds_on_unload then
binds_on_unload()
end
send_command('unbind f10')
send_command('unbind f9')
end
function user_setup()
select_default_macro_book()
state.CastingMode:options('Normal','Accuracy')
end
function get_sets()
send_command('wait 2;input /lockstyleset 29')
--Idle Sets--
sets.Idle = {}
sets.Idle = {
ammo="",
head="",
neck="",
ear1="Steelflash Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="Toro Cape",
waist="",
legs="",
feet=""}
--Precast Sets--
sets.Precast = {}
sets.Precast.FC = {}
sets.Precast.FC.Standard = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Precast.FC.Cures = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Precast.JA = {}
sets.Precast.JA['Mana Wall'] = {feet="Goetia Sabots +2"}
sets.Precast.JA.Manafont = {body="Sorcerer's Coat +2"}
--Midcast Sets--
sets.LowNukes = {}
sets.LowNukes.index = {'Normal','Accuracy','Burst'}
LowNukes_index = 1
sets.LowNukes = {
ammo="",
head="",
neck="",
ear1="Cryptic Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="Toro Cape",
legs="",
feet=""}
sets.LowNukes.Accuracy = {
ammo="",
head="",
neck="",
ear1="Cryptic Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="Toro Cape",
legs="",
feet=""}
sets.LowNukes.Burst = {
ammo="",
head="",
neck="",
ear1="Moonshade Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.HighNukes = {}
sets.HighNukes.index = {'Normal','Accuracy','Burst'}
HighNukes_index = 1
sets.HighNukes = {
ammo="",
head="",
neck="",
ear1="Hecate's Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="Toro Cape",
waist="",
legs="",
feet=""}
sets.HighNukes.Accuracy = {
ammo="",
head="",
neck="",
ear1="Cryptic Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="Toro Cape",
legs="",
feet=""}
sets.HighNukes.Burst = {
ammo="",
head="",
neck="",
ear1="Moonshade Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast = {}
sets.Midcast.Cures = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Stun = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast['Dark Magic'] = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Drain = {
ammo="",
head="",
neck="",
ear1="Evans Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="Toro Cape",
waist="",
legs="",
feet=""}
sets.Midcast.Aspir = sets.Midcast.Drain
sets.Midcast.Enhancing = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Enfeebling = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Stoneskin = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Regen = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Obi = {}
sets.Obi.Fire = {waist='Karin Obi',back='Twilight Cape'}
sets.Obi.Earth = {waist='Dorin Obi',back='Twilight Cape'}
sets.Obi.Water = {waist='Suirin Obi',back='Twilight Cape'}
sets.Obi.Wind = {waist='Furin Obi',back='Twilight Cape'}
sets.Obi.Ice = {waist='Hyorin Obi',back='Twilight Cape'}
sets.Obi.Thunder = {waist='Rairin Obi',back='Twilight Cape'}
sets.Obi.Light = {waist='Korin Obi',back='Twilight Cape'}
sets.Obi.Dark = {waist='Anrin Obi',back='Twilight Cape'}
sets.Capa = {
back="Mecisto. Mantle"}
--Aftercast Sets--
sets.Aftercast = {}
end
function precast(spell)
if spell.action_type == 'Magic' then
equip(sets.Precast.FC.Standard)
if string.find(spell.english,'Cur') and spell.name ~= 'Cursna' then
equip(sets.Precast.FC.Cure)
end
end
if spell.english == 'Penury' or spell.english == 'Parsimony' then
equip(sets.Precast.JA.PenuryParsimony)
end
if spell.english == 'Ebullience' or spell.english == 'Rapture' then
equip(sets.Precast.JA.EbullienceRapture)
end
if spell.english == 'Immanence' or spell.english == 'Perpetuation' then
equip(sets.Precast.JA.ImmanencePerpetuation)
end
end
function midcast(spell)
if spell.english == 'Cure' or spell.english == 'Cure II' or spell.english == 'Cure III' or spell.english == 'Cure IV' then
equip(sets.Midcast.Cures)
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if spell.english == 'Stone' or spell.english == 'Thunder' or spell.english == 'Water' or spell.english == 'Fire' or spell.english == 'Blizzard' or spell.english == 'Aero'
or spell.english == 'Stone II' or spell.english == 'Thunder II' or spell.english == 'Water II' or spell.english == 'Fire II' or spell.english == 'Blizzard II' or spell.english == 'Aero II'
or spell.english == 'Stonega' or spell.english == 'Thunderga' or spell.english == 'Waterga' or spell.english == 'Firega' or spell.english == 'Blizzaga' or spell.english == 'Aeroga'
or spell.english == 'Stonega II' or spell.english == 'Thunderga II' or spell.english == 'Waterga II' or spell.english == 'Firega II' or spell.english == 'Blizzaga II' or spell.english == 'Aeroga II'
or spell.english == 'Stonega III' or spell.english == 'Thunderga III' or spell.english == 'Waterga III' or spell.english == 'Firega III' or spell.english == 'Blizzaga III' or spell.english == 'Aeroga III'
then
equip(sets.LowNukes.LowNukesindex[LowNukes_index])
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if spell.english == 'Stone III' or spell.english == 'Thunder III' or spell.english == 'Water III' or spell.english == 'Fire III' or spell.english == 'Blizzard III' or spell.english == 'Aero III'
or spell.english == 'Stone IV' or spell.english == 'Thunder IV' or spell.english == 'Water IV' or spell.english == 'Fire IV' or spell.english == 'Blizzard IV' or spell.english == 'Aero IV'
or spell.english == 'Stone V' or spell.english == 'Thunder V' or spell.english == 'Water V' or spell.english == 'Fire V' or spell.english == 'Blizzard V' or spell.english == 'Aero V'
or spell.english == 'Stone VI' or spell.english == 'Thunder VI' or spell.english == 'Water VI' or spell.english == 'Fire VI' or spell.english == 'Blizzard VI' or spell.english == 'Aero VI'
or spell.english == 'Stonega IV' or spell.english == 'Thunderga IV' or spell.english == 'Waterga IV' or spell.english == 'Firega IV' or spell.english == 'Blizzaga IV' or spell.english == 'Aeroga IV'
or spell.english == 'Stoneja' or spell.english == 'Thunderja' or spell.english == 'Waterja' or spell.english == 'Firaja' or spell.english == 'Blizzaja' or spell.english == 'Aeroja'
then
equip(sets.HighNukes.HighNukesindex[HighNukes_index])
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if spell.english == 'Stoneskin' then
equip(sets.Midcast.Stoneskin)
if buffActive['Stoneskin'] then
send_command('@wait 2.5;@input //cancel Stoneskin')
end
end
if spell.english == 'Slow' or spell.english == 'Paralyze' or spell.english == 'Blind' or spell.english == 'Silence' or spell.english == 'Break' or spell.english == 'Sleep' or spell.english == 'Sleep II' or spell.english == 'Sleepga' or spell.english == 'Dispel' then
equip(sets.Midcast.Enfeebling)
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
function self_command(command)
if command == 'C1' then
HighNukes_index = HighNukes_index +1
if HighNukes_index > #sets.HighNukes then HighNukes_index = 1 end
add_to_chat(158,'Magic Gear: ' .. HighNukes.index[HighNukes_index])
equip(sets.HighNukes[sets.HighNukes.index[HighNukes_index]])
status_change(player.status)
elseif command == 'C2' 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)
end
end
function status_change(new,old)
if Capa == 'ON' then
equip(sets.Capa)
end
end
function aftercast(spell)
equip(sets.Idle.Standard)
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 job_aftercast(spell, action, spellMap, eventArgs)
-- Lock feet after using Mana Wall.
if not spell.interrupted then
if spell.english == 'Mana Wall' then
enable('feet')
equip(sets.buff['Mana Wall'])
disable('feet')
end
end
end
function job_buff_change(buff, gain)
-- Unlock feet when Mana Wall buff is lost.
if buff == "Mana Wall" and not gain then
enable('feet')
handle_equipping_gear(player.status)
end
end
function select_default_macro_book()
set_macro_page(1, 1)
end
Yes, its me again, and in advance, sorry to keep asking the community questions, but I help a couple friends make scripts and they keep wanting special features, so I spend a couple days testing ideas and abusing google and if that fails I ask here, so thanks to all who assist =)
My current issue is in making a BLM script. My friend want it to diffrensiate between low tier and high tier, as well as having a magic burst set that overwrites either. My sollution to this so far is making 2 main sets, low tier and high tier, then adding some sub sets for reg nuking, acc nuking and burst nuking. But im having trouble with the index part of this. Im attaching the code here and if anyone can figgure out why its not working id apprisiate the help
Error is: (BLM.lua:419: attempt to index global 'HighNukes' (a nil value). Code
send_command('bind f9 gs c C1') --Burst--
send_command('bind f10 gs c C2') --Capa-
function file_unload()
if binds_on_unload then
binds_on_unload()
end
send_command('unbind f10')
send_command('unbind f9')
end
function user_setup()
select_default_macro_book()
state.CastingMode:options('Normal','Accuracy')
end
function get_sets()
send_command('wait 2;input /lockstyleset 29')
--Idle Sets--
sets.Idle = {}
sets.Idle = {
ammo="",
head="",
neck="",
ear1="Steelflash Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="Toro Cape",
waist="",
legs="",
feet=""}
--Precast Sets--
sets.Precast = {}
sets.Precast.FC = {}
sets.Precast.FC.Standard = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Precast.FC.Cures = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Precast.JA = {}
sets.Precast.JA['Mana Wall'] = {feet="Goetia Sabots +2"}
sets.Precast.JA.Manafont = {body="Sorcerer's Coat +2"}
--Midcast Sets--
sets.LowNukes = {}
sets.LowNukes.index = {'Normal','Accuracy','Burst'}
LowNukes_index = 1
sets.LowNukes = {
ammo="",
head="",
neck="",
ear1="Cryptic Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="Toro Cape",
legs="",
feet=""}
sets.LowNukes.Accuracy = {
ammo="",
head="",
neck="",
ear1="Cryptic Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="Toro Cape",
legs="",
feet=""}
sets.LowNukes.Burst = {
ammo="",
head="",
neck="",
ear1="Moonshade Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.HighNukes = {}
sets.HighNukes.index = {'Normal','Accuracy','Burst'}
HighNukes_index = 1
sets.HighNukes = {
ammo="",
head="",
neck="",
ear1="Hecate's Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="Toro Cape",
waist="",
legs="",
feet=""}
sets.HighNukes.Accuracy = {
ammo="",
head="",
neck="",
ear1="Cryptic Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="Toro Cape",
legs="",
feet=""}
sets.HighNukes.Burst = {
ammo="",
head="",
neck="",
ear1="Moonshade Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast = {}
sets.Midcast.Cures = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Stun = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast['Dark Magic'] = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Drain = {
ammo="",
head="",
neck="",
ear1="Evans Earring",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="Toro Cape",
waist="",
legs="",
feet=""}
sets.Midcast.Aspir = sets.Midcast.Drain
sets.Midcast.Enhancing = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Enfeebling = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Stoneskin = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Midcast.Regen = {
ammo="",
head="",
neck="",
ear1="",
ear2="",
body="",
hands="",
ring1="",
ring2="",
back="",
waist="",
legs="",
feet=""}
sets.Obi = {}
sets.Obi.Fire = {waist='Karin Obi',back='Twilight Cape'}
sets.Obi.Earth = {waist='Dorin Obi',back='Twilight Cape'}
sets.Obi.Water = {waist='Suirin Obi',back='Twilight Cape'}
sets.Obi.Wind = {waist='Furin Obi',back='Twilight Cape'}
sets.Obi.Ice = {waist='Hyorin Obi',back='Twilight Cape'}
sets.Obi.Thunder = {waist='Rairin Obi',back='Twilight Cape'}
sets.Obi.Light = {waist='Korin Obi',back='Twilight Cape'}
sets.Obi.Dark = {waist='Anrin Obi',back='Twilight Cape'}
sets.Capa = {
back="Mecisto. Mantle"}
--Aftercast Sets--
sets.Aftercast = {}
end
function precast(spell)
if spell.action_type == 'Magic' then
equip(sets.Precast.FC.Standard)
if string.find(spell.english,'Cur') and spell.name ~= 'Cursna' then
equip(sets.Precast.FC.Cure)
end
end
if spell.english == 'Penury' or spell.english == 'Parsimony' then
equip(sets.Precast.JA.PenuryParsimony)
end
if spell.english == 'Ebullience' or spell.english == 'Rapture' then
equip(sets.Precast.JA.EbullienceRapture)
end
if spell.english == 'Immanence' or spell.english == 'Perpetuation' then
equip(sets.Precast.JA.ImmanencePerpetuation)
end
end
function midcast(spell)
if spell.english == 'Cure' or spell.english == 'Cure II' or spell.english == 'Cure III' or spell.english == 'Cure IV' then
equip(sets.Midcast.Cures)
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if spell.english == 'Stone' or spell.english == 'Thunder' or spell.english == 'Water' or spell.english == 'Fire' or spell.english == 'Blizzard' or spell.english == 'Aero'
or spell.english == 'Stone II' or spell.english == 'Thunder II' or spell.english == 'Water II' or spell.english == 'Fire II' or spell.english == 'Blizzard II' or spell.english == 'Aero II'
or spell.english == 'Stonega' or spell.english == 'Thunderga' or spell.english == 'Waterga' or spell.english == 'Firega' or spell.english == 'Blizzaga' or spell.english == 'Aeroga'
or spell.english == 'Stonega II' or spell.english == 'Thunderga II' or spell.english == 'Waterga II' or spell.english == 'Firega II' or spell.english == 'Blizzaga II' or spell.english == 'Aeroga II'
or spell.english == 'Stonega III' or spell.english == 'Thunderga III' or spell.english == 'Waterga III' or spell.english == 'Firega III' or spell.english == 'Blizzaga III' or spell.english == 'Aeroga III'
then
equip(sets.LowNukes.LowNukesindex[LowNukes_index])
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if spell.english == 'Stone III' or spell.english == 'Thunder III' or spell.english == 'Water III' or spell.english == 'Fire III' or spell.english == 'Blizzard III' or spell.english == 'Aero III'
or spell.english == 'Stone IV' or spell.english == 'Thunder IV' or spell.english == 'Water IV' or spell.english == 'Fire IV' or spell.english == 'Blizzard IV' or spell.english == 'Aero IV'
or spell.english == 'Stone V' or spell.english == 'Thunder V' or spell.english == 'Water V' or spell.english == 'Fire V' or spell.english == 'Blizzard V' or spell.english == 'Aero V'
or spell.english == 'Stone VI' or spell.english == 'Thunder VI' or spell.english == 'Water VI' or spell.english == 'Fire VI' or spell.english == 'Blizzard VI' or spell.english == 'Aero VI'
or spell.english == 'Stonega IV' or spell.english == 'Thunderga IV' or spell.english == 'Waterga IV' or spell.english == 'Firega IV' or spell.english == 'Blizzaga IV' or spell.english == 'Aeroga IV'
or spell.english == 'Stoneja' or spell.english == 'Thunderja' or spell.english == 'Waterja' or spell.english == 'Firaja' or spell.english == 'Blizzaja' or spell.english == 'Aeroja'
then
equip(sets.HighNukes.HighNukesindex[HighNukes_index])
if spell.element == world.weather_element or spell_element == world.day_element then
equip(sets.Obi[spell.element])
end
end
if spell.english == 'Stoneskin' then
equip(sets.Midcast.Stoneskin)
if buffActive['Stoneskin'] then
send_command('@wait 2.5;@input //cancel Stoneskin')
end
end
if spell.english == 'Slow' or spell.english == 'Paralyze' or spell.english == 'Blind' or spell.english == 'Silence' or spell.english == 'Break' or spell.english == 'Sleep' or spell.english == 'Sleep II' or spell.english == 'Sleepga' or spell.english == 'Dispel' then
equip(sets.Midcast.Enfeebling)
end
if spell.english == 'Sneak' then
send_command('@wait 1.8;cancel 71;')
end
end
function self_command(command)
if command == 'C1' then
HighNukes_index = HighNukes_index +1
if HighNukes_index > #sets.HighNukes then HighNukes_index = 1 end
add_to_chat(158,'Magic Gear: ' .. HighNukes.index[HighNukes_index])
equip(sets.HighNukes[sets.HighNukes.index[HighNukes_index]])
status_change(player.status)
elseif command == 'C2' 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)
end
end
function status_change(new,old)
if Capa == 'ON' then
equip(sets.Capa)
end
end
function aftercast(spell)
equip(sets.Idle.Standard)
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 job_aftercast(spell, action, spellMap, eventArgs)
-- Lock feet after using Mana Wall.
if not spell.interrupted then
if spell.english == 'Mana Wall' then
enable('feet')
equip(sets.buff['Mana Wall'])
disable('feet')
end
end
end
function job_buff_change(buff, gain)
-- Unlock feet when Mana Wall buff is lost.
if buff == "Mana Wall" and not gain then
enable('feet')
handle_equipping_gear(player.status)
end
end
function select_default_macro_book()
set_macro_page(1, 1)
end
|
|