Pld Lua Error

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » FFXI » Jobs » Paladin » pld lua error
pld lua error
Offline
Posts: 121
By hamany9 2016-08-15 01:09:23
Link | Quote | Reply
 
keep getting error when loading my pld lua file, double checked script and can't find anything wrong:


-------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------

-- Initialization function for this job file.
function get_sets()
mote_include_version = 2

-- Load and initialize the include file.
include('Mote-Include.lua')
end

-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
state.Buff.Sentinel = buffactive.sentinel or false
state.Buff.Cover = buffactive.cover or false
state.Buff.Doom = buffactive.Doom or false
end

-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------

-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('Normal', 'Acc')
state.HybridMode:options('Normal', 'PDT', 'Reraise')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.PhysicalDefenseMode:options('PDT', 'HP', 'Reraise', 'Charm')
state.MagicalDefenseMode:options('MDT', 'HP', 'Reraise', 'Charm')

state.ExtraDefenseMode = M{['description']='Extra Defense Mode', 'None', 'MP', 'Knockback', 'MP_Knockback'}
state.EquipShield = M(false, 'Equip Shield w/Defense')

update_defense_mode()

send_command('bind ^f11 gs c cycle MagicalDefenseMode')
send_command('bind !f11 gs c cycle ExtraDefenseMode')
send_command('bind @f10 gs c toggle EquipShield')
send_command('bind @f11 gs c toggle EquipShield')

select_default_macro_book()
end

function user_unload()
send_command('unbind ^f11')
send_command('unbind !f11')
send_command('unbind @f10')
send_command('unbind @f11')
end


-- Define sets and vars used by this job file.
function init_gear_sets()
--------------------------------------
-- Precast sets
--------------------------------------

-- Precast sets to enhance JAs
sets.precast.JA['Invincible'] = {legs="Caballarius Breeches"}
sets.precast.JA['Holy Circle'] = {feet="Reverence Leggings +1"}
sets.precast.JA['Shield Bash'] = {hands="Caballarius Gauntlets"}
sets.precast.JA['Sentinel'] = {feet="Caballarius Leggings"}
sets.precast.JA['Rampart'] = {head="Caballarius Coronet"}
sets.precast.JA['Fealty'] = {body="Caballarius Surcoat"}
sets.precast.JA['Divine Emblem'] = {feet="Creed Sabatons +2"}
sets.precast.JA['Cover'] = {head="Reverence Coronet +1"}

-- add mnd for Chivalry
sets.precast.JA['Chivalry'] = {
head="Sulevia's mask +1",
body="Sulevia's platemail +1",hands="Sulevia's Gauntlets +1",ring1="Leviathan Ring",ring2="Aquasoul Ring",
back="Weard Mantle",legs="Sulevia's cuisses +1",feet="Sulevia's leggings"}


-- Waltz set (chr and vit)
sets.precast.Waltz = {ammo="Sonia's Plectrum",
head="Reverence Coronet +1",
body="Gorney Haubert +1",hands="Reverence Gauntlets +1",ring2="Asklepian Ring",
back="Iximulew Cape",waist="Caudata Belt",legs="Reverence Breeches +1",feet="Whirlpool Greaves"}

-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}

sets.precast.Step = {waist="Chaac Belt"}
sets.precast.Flourish1 = {waist="Chaac Belt"}

-- Fast cast sets for spells

sets.precast.FC = {ammo="Incantor Stone",
head="Souveran schaller",neck="Orunmila's torque",ear1="Etiolation Earring",ear2="Loquatious Earring",
body="Odyssean chestplate",hands="Leyline gloves",ring1="Prolix Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Nierenschutz",legs="Souveran diechlings",feet="Odyssean Greaves"}

sets.precast.FC['Enhancing Magic'] = set_combine(sets.precast.FC, {waist="Siegel Sash"})


-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {ammo="Ginsen",
head="Sulevia's mask +1",neck="Fotia gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Sulevia's platemail +1",hands="Sulevia's Gauntlets +1",ring1="Ifrit Ring",ring2="Ifrit ring",
back="Weard Mantle",waist="Fotia belt",legs="Sulevia's cuisses +1",feet="Sulevia's leggings +1"}

sets.precast.WS.Acc = {ammo="Ginsen",
head="Sulevia's mask +1",neck="Fotia gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Sulevia's platemail +1",hands="Sulevia's Gauntlets +1",ring1="Ifrit Ring",ring2="Ifrit ring",
back="Weard Mantle",waist="Fotia belt",legs="Sulevia's cuisses +1",feet="Sulevia's leggings +1"}

-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {ring1="Leviathan Ring",ring2="Aquasoul Ring"})
sets.precast.WS['Requiescat'].Acc = set_combine(sets.precast.WS.Acc, {ring1="Leviathan Ring"})

sets.precast.WS['Chant du Cygne'] = set_combine(sets.precast.WS, {hands="Sulevia's Gauntlets +1",ring1="Rajas Ring",ring2="Hetairoi ring",waist="Fotia Belt"})
sets.precast.WS['Chant du Cygne'].Acc = set_combine(sets.precast.WS.Acc, {waist="Fotia Belt"})

sets.precast.WS['Sanguine Blade'] = {ammo="Pemphredo tathlum",
head="Jumalik helm",neck="Eddy Necklace",ear1="Friomisi Earring",ear2="Hecate's Earring",
body="Jumalik mail",hands="Leyline gloves",ring1="Acumen Ring",ring2="Defending Ring",
back="Philidor mantle",waist="Yamabuki-no-obi",legs="Sulevia's cuisses +1",feet="Sulevia's leggings +1"}

sets.precast.WS['Atonement'] = {ammo="Ginsen",
head="Sulevia's mask +1",neck="Fotia gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Sulevia's platemail +1",hands="Sulevia's Gauntlets +1",ring1="Ifrit Ring",ring2="Ifrit ring",
back="Weard Mantle",waist="Fotia belt",legs="Sulevia's cuisses +1",feet="Sulevia's leggings +1"}

--------------------------------------
-- Midcast sets
--------------------------------------

sets.midcast.FastRecast = {ammo="Homiliary",
head="Souveran schaller",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Nierenschutz",legs="Souveran diechlings",feet="Souveran schuhs"}

sets.midcast.Enmity = {ammo="Iron Gobbet",
head="Souveran schaller",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Nierenschutz",legs="Souveran diechlings",feet="Souveran schuhs"}

sets.midcast.Flash = set_combine(sets.midcast.Enmity, {legs="Souveran diechlings"})

sets.midcast.Stun = sets.midcast.Flash

sets.midcast.Cure = {ammo="Iron Gobbet",
head="Souveran schaller",neck="Loricate torque +1",ear1="Mending Earring",ear2="Nourishing Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Solemnity cape",waist="Nierenschutz",legs="Souveran diechlings",feet="Souveran schuhs"}

sets.midcast['Enhancing Magic'] = {neck="Colossus's Torque",waist="Olympus Sash",legs="Reverence Breeches +1"}

sets.midcast.Protect = {ring1="Sheltered Ring"}
sets.midcast.Shell = {ring1="Sheltered Ring"}

--------------------------------------
-- Idle/resting/defense/etc sets
--------------------------------------

sets.Reraise = {head="Twilight Helm", body="Twilight Mail"}

sets.resting = {neck="Creed Collar",
ring1="Sheltered Ring",ring2="Paguroidea Ring",
waist="Austerity Belt"}


-- Idle sets
sets.idle = {ammo="Homiliary",
head="Jumalik helm",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Nierenschutz",legs="Carmine cuisses",feet="Souveran schuhs"}

sets.idle.Town = {ammo="Homiliary",
head="Jumalik helm",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Nierenschutz",legs="Carmine cuisses",feet="Souveran schuhs"}

sets.idle.Weak = {ammo="Homiliary",
head="Jumalik helm",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Nierenschutz",legs="Carmine cuisses",feet="Souveran schuhs"}

sets.idle.Weak.Reraise = set_combine(sets.idle.Weak, sets.Reraise)

sets.Kiting = {legs="Carmine Cuisses"}

sets.latent_refresh = {waist="Fucho-no-obi"}


--------------------------------------
-- Defense sets
--------------------------------------

-- Extra defense sets. Apply these on top of melee or defense sets.
sets.Knockback = {back="Philidor Mantle"}
sets.MP = {neck="Creed Collar",waist="Flume Belt",ear1="Ethereal earring"}
sets.MP_Knockback = {neck="Creed Collar",waist="Flume Belt",ear1="Ethereal earring",back="Repulse Mantle"}

-- If EquipShield toggle is on (Win+F10 or Win+F11), equip the weapon/shield combos here
-- when activating or changing defense mode:
sets.PhysicalShield = {main="Anahera Sword",sub="Ochgain"} -- Ochain
sets.MagicalShield = {main="Anahera Sword",sub="Aegis"} -- Aegis

-- Basic defense sets.

sets.defense.PDT = {ammo="Iron Gobbet",
head="Souveran schaller",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Creed baudrier",legs="Souveran diechlings",feet="Souveran schuhs"}
sets.defense.HP = {ammo="Iron Gobbet",
head="Souveran schaller",neck="Loricate torque +1",ear1="Ondowa Earring",ear2="Ondowa Earring +1",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Creed baudrier",legs="Souveran diechlings",feet="Souveran schuhs"}
sets.defense.Reraise = {ammo="Iron Gobbet",
head="Twilight helm",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Twilight mail",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Creed baudrier",legs="Souveran diechlings",feet="Souveran schuhs"}
sets.defense.Charm = {ammo="Iron Gobbet",
head="Souveran schaller",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Creed baudrier",legs="Souveran diechlings",feet="Souveran schuhs"}
-- To cap MDT with Shell IV (52/256), need 76/256 in gear.
-- Shellra V can provide 75/256, which would need another 53/256 in gear.
sets.defense.MDT = {ammo="Iron Gobbet",
head="Souveran schaller",neck="Loricate torque +1",ear1="Ethereal Earring",ear2="Thureous Earring",
body="Souveran cuirass",hands="Souveran handschuhs",ring1="Vocane Ring",ring2="Defending ring",
back="Philidor Mantle",waist="Creed baudrier",legs="Souveran diechlings",feet="Souveran schuhs"}


--------------------------------------
-- Engaged sets
--------------------------------------

sets.engaged = {ammo="Ginsen",
head="Valorous mask",neck="Asperity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="V",hands="Sulevia's Gauntlets +1",ring1="Rajas Ring",ring2="Petrov Ring",
back="Weard Mantle",waist="Sarissaphoroi Belt",legs="Carmine cuisses",feet="Valorous Greaves"}

sets.engaged.Acc = {ammo="Ginsen",
head="Valorous mask",neck="Sanctity Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
body="Valorous mail",hands="Sulevia's Gauntlets +1",ring1="Rajas Ring",ring2="Petrov Ring",
back="Weard Mantle",waist="Sarissaphoroi Belt",legs="Carmine cuisses",feet="Valorous Greaves"}

sets.engaged.DW = {ammo="Ginsen",
head="Otomi Helm",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Gorney Haubert +1",hands="Cizin Mufflers",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Atheling Mantle",waist="Cetl Belt",legs="Cizin Breeches",feet="Whirlpool Greaves"}

sets.engaged.DW.Acc = {ammo="Ginsen",
head="Yaoyotl Helm",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Gorney Haubert +1",hands="Buremte Gloves",ring1="Rajas Ring",ring2="K'ayres Ring",
back="Weard Mantle",waist="Zoran's Belt",legs="Cizin Breeches",feet="Whirlpool Greaves"}

sets.engaged.PDT = set_combine(sets.engaged, {body="Souveran cuirass",neck="Loricate torque +1",ring1="Defending Ring"})
sets.engaged.Acc.PDT = set_combine(sets.engaged.Acc, {body="Souveran cuirass",neck="Loricate torque +1",ring1="Defending Ring"})
sets.engaged.Reraise = set_combine(sets.engaged, sets.Reraise)
sets.engaged.Acc.Reraise = set_combine(sets.engaged.Acc, sets.Reraise)

sets.engaged.DW.PDT = set_combine(sets.engaged.DW, {body="Reverence Surcoat +1",neck="Twilight Torque",ring1="Defending Ring"})
sets.engaged.DW.Acc.PDT = set_combine(sets.engaged.DW.Acc, {body="Reverence Surcoat +1",neck="Twilight Torque",ring1="Defending Ring"})
sets.engaged.DW.Reraise = set_combine(sets.engaged.DW, sets.Reraise)
sets.engaged.DW.Acc.Reraise = set_combine(sets.engaged.DW.Acc, sets.Reraise)


--------------------------------------
-- Custom buff sets
--------------------------------------

sets.buff.Doom = {ring2="Saida Ring"}
sets.buff.Cover = {head="Reverence Coronet +1", body="Caballarius Surcoat"}
end


-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------

function job_midcast(spell, action, spellMap, eventArgs)
-- If DefenseMode is active, apply that gear over midcast
-- choices. Precast is allowed through for fast cast on
-- spells, but we want to return to def gear before there's
-- time for anything to hit us.
-- Exclude Job Abilities from this restriction, as we probably want
-- the enhanced effect of whatever item of gear applies to them,
-- and only one item should be swapped out.
if state.DefenseMode.value ~= 'None' and spell.type ~= 'JobAbility' then
handle_equipping_gear(player.status)
eventArgs.handled = true
end
end

-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------

-- Called when the player's status changes.
function job_state_change(field, new_value, old_value)
classes.CustomDefenseGroups:clear()
classes.CustomDefenseGroups:append(state.ExtraDefenseMode.current)
if state.EquipShield.value == true then
classes.CustomDefenseGroups:append(state.DefenseMode.current .. 'Shield')
end

classes.CustomMeleeGroups:clear()
classes.CustomMeleeGroups:append(state.ExtraDefenseMode.current)
end

-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------

-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
update_defense_mode()
end

-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if player.mpp < 51 then
idleSet = set_combine(idleSet, sets.latent_refresh)
end
if state.Buff.Doom then
idleSet = set_combine(idleSet, sets.buff.Doom)
end

return idleSet
end

-- Modify the default melee set after it was constructed.
function customize_melee_set(meleeSet)
if state.Buff.Doom then
meleeSet = set_combine(meleeSet, sets.buff.Doom)
end

return meleeSet
end

function customize_defense_set(defenseSet)
if state.ExtraDefenseMode.value ~= 'None' then
defenseSet = set_combine(defenseSet, sets[state.ExtraDefenseMode.value])
end

if state.EquipShield.value == true then
defenseSet = set_combine(defenseSet, sets[state.DefenseMode.current .. 'Shield'])
end

if state.Buff.Doom then
defenseSet = set_combine(defenseSet, sets.buff.Doom)
end

return defenseSet
end


function display_current_job_state(eventArgs)
local msg = 'Melee'

if state.CombatForm.has_value then
msg = msg .. ' (' .. state.CombatForm.value .. ')'
end

msg = msg .. ': '

msg = msg .. state.OffenseMode.value
if state.HybridMode.value ~= 'Normal' then
msg = msg .. '/' .. state.HybridMode.value
end
msg = msg .. ', WS: ' .. state.WeaponskillMode.value

if state.DefenseMode.value ~= 'None' then
msg = msg .. ', Defense: ' .. state.DefenseMode.value .. ' (' .. state[state.DefenseMode.value .. 'DefenseMode'].value .. ')'
end

if state.ExtraDefenseMode.value ~= 'None' then
msg = msg .. ', Extra: ' .. state.ExtraDefenseMode.value
end

if state.EquipShield.value == true then
msg = msg .. ', Force Equip Shield'
end

if state.Kiting.value == true then
msg = msg .. ', Kiting'
end

if state.PCTargetMode.value ~= 'default' then
msg = msg .. ', Target PC: '..state.PCTargetMode.value
end

if state.SelectNPCTargets.value == true then
msg = msg .. ', Target NPCs'
end

add_to_chat(122, msg)

eventArgs.handled = true
end

-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------

function update_defense_mode()
if player.equipment.main == 'Kheshig Blade' and not classes.CustomDefenseGroups:contains('Kheshig Blade') then
classes.CustomDefenseGroups:append('Kheshig Blade')
end

if player.sub_job == 'NIN' or player.sub_job == 'DNC' then
if player.equipment.sub and not player.equipment.sub:contains('Shield') and
player.equipment.sub ~= 'Aegis' and player.equipment.sub ~= 'Ochain' then
state.CombatForm:set('DW')
else
state.CombatForm:reset()
end
end
end


-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(5, 5)
elseif player.sub_job == 'NIN' then
set_macro_page(5, 5)
elseif player.sub_job == 'RDM' then
set_macro_page(5, 5)
else
set_macro_page(5, 5)
end
end

Contact GitHub API Training Shop Blog About
© 2016 GitHub, Inc. Terms Privacy Security Status Help
Offline
Posts: 121
By hamany9 2016-08-15 01:35:23
Link | Quote | Reply
 
>>>>>>>>>>Contact GitHub API Training Shop Blog About
© 2016 GitHub, Inc. Terms Privacy Security Status Help


LOOOOOOOOOOOOOOOOOOOOOL last line, that was the prob hahaha
[+]
 Valefor.Omnys
Offline
Server: Valefor
Game: FFXI
user: omnys
Posts: 1749
By Valefor.Omnys 2016-08-15 10:41:23
Link | Quote | Reply
 
I lol'd.

3 things:

1. Wrap lua code in [ code ] tags. If you're providing your whole file, it keeps line numbers relevant.
Code
function example(argument)
  -- see how nice this looks
end


2. Always give the error that you're given. "Keep getting error" doesn't tell anything. I saw this last night and stopped reading when you didn't provide anything more descriptive.

3. When you are copying from github's webpages, you'll see a few rectangular buttons on the right hand side. One of these says "Raw", click that and copy from there, like this.
Log in to post.