|
:contains?
Lakshmi.Elidyr
Server: Lakshmi
Game: FFXI
Posts: 911
By Lakshmi.Elidyr 2017-05-15 20:37:45
Does this not work anymore?
Edit: I guess I could be more specific...
Code if table:contains(name) then ...
Fenrir.Caiir
VIP
Server: Fenrir
Game: FFXI
Posts: 199
By Fenrir.Caiir 2017-05-15 21:09:05
{}:contains() is not valid because a table has no default contains method. T{}, S{}, L{}, etc are wrappers to tables that have many methods available to them, including contains, thanks to libraries. For general purposes, S{} is the most efficient at this particular operation, though just comparing equality (==) is faster (much uglier, though).
Lakshmi.Elidyr
Server: Lakshmi
Game: FFXI
Posts: 911
By Lakshmi.Elidyr 2017-05-15 23:03:48
Write, it was just an example. I have this:
Code
table = S{buncha strings}
if table:contains("random string name") then
**do stuff** in case that wasn't assumed.
end
Not working at all like it was. I had to change a bunch of stuff I already had written a while back because it wasn't working.
I just ended up making my own function anyway. Code function contains(t, v)
for i, val in ipairs(t) do
if val == v then
return true
end
end
return false
end
Ragnarok.Kenshi
Server: Ragnarok
Game: FFXI
Posts: 123
By Ragnarok.Kenshi 2017-05-16 05:06:39
You gotta call the tables library Code
require 'tables'
table = S{buncha strings}
if table:contains("random string name") then
**do stuff** in case that wasn't assumed.
end
Lakshmi.Elidyr
Server: Lakshmi
Game: FFXI
Posts: 911
By Lakshmi.Elidyr 2017-05-16 08:18:20
You gotta call the tables library Code
require 'tables'
table = S{buncha strings}
if table:contains("random string name") then
**do stuff** in case that wasn't assumed.
end
I think Gearswap has it instanced already, maybe the scope of things I'm unable to use?
Lakshmi.Elidyr
Server: Lakshmi
Game: FFXI
Posts: 911
By Lakshmi.Elidyr 2017-05-16 10:30:11
Recalled inside, seems to be working. I figured once it was instanced inside Gearswap I should of had access inside my file.
Leviathan.Vow
Server: Leviathan
Game: FFXI
Posts: 125
By Leviathan.Vow 2017-05-17 08:44:52
You should not have to call require in your file to access the tables or sets libraries. You don't have to track down the error if you don't want to, but -- somewhere in your code -- you've written something that modifies your user environment in a way that is not immediately clear to me.
Lakshmi.Byrth
VIP
Server: Lakshmi
Game: FFXI
Posts: 6168
By Lakshmi.Byrth 2017-05-17 08:46:26
Don't use common terms like "table" for your global variables. Something like that is almost certainly causing your problem.
Lakshmi.Elidyr
Server: Lakshmi
Game: FFXI
Posts: 911
By Lakshmi.Elidyr 2017-05-17 10:15:53
Don't use common terms like "table" for your global variables. Something like that is almost certainly causing your problem.
I was only using for examples sake. I completely understand what you mean. I just put a require in my library fixed everything. Thank you though Byrth.
Lakshmi.Elidyr
Server: Lakshmi
Game: FFXI
Posts: 911
By Lakshmi.Elidyr 2017-05-17 10:29:20
Ill post code just for full understanding sake. I am rebuilding everything from scratch though so a lot of my stuff if missing, but still functions at this current moment. I started this because it just fit my play style, and everything works the way I want it to. May not be the best, but that's okay.
Blue Mage LUA Example:
Main File
Code --[[ Elidyr : Gearswap v2.4.1
V241 - 05/17/2017 :
+ Rewriting from scratch, a lot of old functions removed from logic, and added in to new libraries.
+ Separated library for specific job, and gear sets.
> Need to work on self command with help text for editing file.
V240 - 05/05/2017 :
+ Lot's of new features, and changes to a majority of code.
+ More separation between main code and the equipment portion for configurability.
+ Adding all new functionality for multi-boxing due to adjustments with updates affecting the way key binds work, and send addon glitch if 1 account disconnects.
+ Specific libraries built directly in to gearswap based on job to prevent function mirroring using chat parsing.
+ Adding multiple event checks to create multi-box events, moved from buddypal addon. (Chat, Specific Actions, Pinger)
V235 - 05/02/2017 :
+ Removed commands library, as most features are implemented in to buddypal addon now.
V233 - 04/05/2017 :
+ Added auto-loading of buddypal addon.
V232 - 05/21/2016 :
+ Added commands for Auto-Warp Ring on accounts through commands library.
V231 - 04/21/2016 :
+ Minor adjustments, removed some test code from files.
V229 - 04/18/2016 :
+ Removed logitech shortcuts for crafting, and treasure hunter sets.
+ Adjusted some keybinds locations.
+ Cleaned up some code, made it shorter / cleaner.
V228 - 03/27/2016 :
+ Changed naming scheme for library loader to use shorthand job name.
V227 - 03/06/2016 :
+ Changed naming scheme for library loader to allow support for multi-boxing accounts and using different library files.
+ Added LocalSelfCommand function in main file to separate core commands from job specific self commands.
V226 - 03/05/2016 :
+ Added aftercast check to determine status; if engaged go back to TP set, else goto idle set.
V225 - 03/04/2016 :
+ Fixed status change function cause gear to not switch back to idle sets.
V224 - 03/03/2016 :
+ Added in functions for pet events, and also adjust some function errors.
V223 - 02/23/2016 :
+ Added in quick toggles for Crafting, Kiting, Trasure Hunter, Magic Damage Taken, and Magic Evasion sets.
+ Moved core settings, key-binds, and variables in to the main GearSwap file to separate from job specific settings, key-binds, and variables.
V222 - 02/20/2016 :
+ New weaponskill logic; now automatically detects which set to use instead of having to manually insert in to core logic.
V221 - 02/07/2016 :
+ Added formulas, and stat caps to the top of the file to help when making builds.
V220 - 02/01/2016 :
+ Re-Wrote structure to include job specific functions for handling specific logic for that job. Cleaned / Added some notes to help understand code.
+ Added Dual Box toggle for enabling specific dual box features.
+ Added Debug toggle to enable extended debug information in chat log. (Is used by default in Logitech Keyboard section below.)
V121 - 01/25/2016 : Re-structured format to make it easier to read, and adjusted / added notes.
Important Information when building sets
*Gear Haste Cap - 25% (256/1024)
*Magic Haste Cap - 43.75% (448/1024)
*Job Ability Haste - 25% (256/1024).
*Delay Cap - 80%
Dual Wield > (1 - 30% Dual Wield)×(1024 - 256 Equipment Haste - 150 Magic Haste - 101 Job Ability Haste)÷1024 = 35.3%, or 64.7% Delay reduction
Martial Arts > (480 Base Delay + 86 Weapon Delay - 200 Martial Arts Delay)×(1024 - 256 Equipment Haste - 150 Magic Haste - 51 Job Ability Haste)=202.6
*Fast Cast Cap - 80% floor( [1-Fast Cast] * ( [1-Haste] * ( 1.5 * Recast ) ) )
*Cure Potency Cap - 50%
*Cure Cast Time Cap - 20%
*Cure Received Cap - 30%
*Physical Damage Taken - 50%
Protect V > Increases defense by 175.
*Magical Damage Taken - 50% Magic Damage You Take = Floor( (Magic Damage you would have Taken)×(100% (-% Magic Damage Taken -% Damage Taken) -% Aegis Magic Damage Taken )÷( 1 + MDB÷100 ) )
Shell V > Reduces magic damage taken by 62/256 (24%).
*Breath Damage Taken - 50%
]]--
require('tables')
require('strings')
require('queues')
function get_sets()
-- **Keybind Settings** ^(Control) | !(Alt) | @(Windows Key)
-- (Combat Modes)
send_command('bind @f1 gs c _modeNA') -- Idle while not in combat mode.
send_command('bind @f2 gs c _modeTP') -- Idle while engaged in combat.
send_command('bind @f3 gs c _modeMID') -- Equip while casting (Midcast).
send_command('bind @f4 gs c _modeWS') -- Set Weaponskill mode.
-- (Gear-Specific Modes)
--send_command('bind @f5 gs c ') -- Open Command slot
send_command('bind @f6 gs c _modeLOCKW') -- Lock Weapon, Sub, and Ranged for Trials or No TP loss.
send_command('bind @f7 gs c _modeLOCKG') -- Lock Head, Body, Hands, Legs, and Feet for trials.
send_command('bind @f8 gs c _modeLOCKC') -- Lock Back for capacity point farming.
-- These are mode default variables. Be careful adjusting as it may cause unwanted changes to your gearswap.
_modeNAi = 1; -- Idle Sets Variable.
_modeTPi = 1; -- TP Sets Variable.
_modeMIDi = 1; -- Midcast Sets Variable.
_modeWSi = 1; -- Weaponskill Sets Variable.
_modeLOCKWi = 1; -- Lock Weapons Variable.
_modeLOCKGi = 1; -- Lock All Gear Variable.
_modeLOCKCi = 1; -- Lock Capacity Set Variable.
-- Include job-specific library.
include('/library/' .. player.name .. player.main_job .. 'Library.lua')
-- Initialize all settings from library.
LoadSettings()
-- **Unload Keybind Settings**
function file_unload()
send_command('unbind @`')
send_command('unbind @f1')
send_command('unbind @f2')
send_command('unbind @f3')
send_command('unbind @f4')
send_command('unbind @f5')
send_command('unbind @f6')
send_command('unbind @f7')
send_command('unbind @f8')
send_command('unbind @f9')
send_command('unbind @f10')
send_command('unbind @f11')
send_command('unbind @f12')
send_command('unbind @1')
send_command('unbind @2')
send_command('unbind @3')
send_command('unbind @4')
send_command('unbind @5')
send_command('unbind @6')
send_command('unbind @7')
send_command('unbind @8')
send_command('unbind @9')
send_command('unbind @0')
send_command('unbind @-')
send_command('unbind @=')
send_command('unbind @insert')
send_command('unbind @delete')
send_command('unbind @home')
send_command('unbind @end')
-- [G]Keys for Logitech Keyboards (Have to match binds in Logitech Profile)
send_command('unbind ^!@f1')
send_command('unbind ^!@f2')
send_command('unbind ^!@f3')
send_command('unbind ^!@f4')
send_command('unbind ^!@f5')
send_command('unbind ^!@f6')
send_command('unbind ^!@f7')
send_command('unbind ^!@f8')
send_command('unbind ^!@f9')
send_command('unbind !@f1')
send_command('unbind !@f2')
send_command('unbind !@f3')
send_command('unbind !@f4')
send_command('unbind !@f5')
send_command('unbind !@f6')
send_command('unbind !@f7')
send_command('unbind !@f8')
send_command('unbind !@f9')
send_command('unbind ^@f1')
send_command('unbind ^@f2')
send_command('unbind ^@f3')
send_command('unbind ^@f4')
send_command('unbind ^@f5')
send_command('unbind ^@f6')
send_command('unbind ^@f7')
send_command('unbind ^@f8')
send_command('unbind ^@f9')
send_command('@ autoexec clear')
end
end
function precast(spell, act)
LocalPrecast(spell, act)
end
function midcast(spell,act)
LocalMidcast(spell, act)
end
function aftercast(spell, act)
-- Equip selected TP set if engaged on a mob.
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
-- Not engaged then default back to Idle set.
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
LocalAftercast(spell, act)
if spell.type == "WeaponSkill" then
add_to_chat(12, '[[---------- TP Return: '.. player.tp ..'. ----------]]')
end
end
function status_change(new, old)
-- Equip selected TP set if engaged on a mob.
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
-- Capacity mode locked, use the ring when engaging.
if _modeLOCKCi == 2 then send_command('input /item "Trizek Ring" <me>') end
-- Not engaged then default back to Idle set.
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
LocalStatusChange(new, old)
end
function buff_change(name, gain)
if gain then
if name == 'Aftermath: Lv.3' then
send_command('timers c "AM3" 180 up "Aftermath"')
elseif name == 'Aftermath: Lv.2' then
send_command('timers c "AM2" 180 up "Aftermath"')
elseif name == 'Aftermath: Lv.1' then
send_command('timers c "AM1" 180 up "Aftermath"')
end
if name == 'weakness' then
send_command('timers c "Weakness" 300 up "Weakness"')
end
else
if name == 'Aftermath: Lv.3' then
send_command('timers d "AM3"')
elseif name == 'Aftermath: Lv.2' then
send_command('timers d "AM2"')
elseif name == 'Aftermath: Lv.1' then
send_command('timers d "AM1"')
elseif name == 'encumbrance' then
windower.send_command('gs c dt_end;')
end
if name == 'weakness' then
send_command('timers d "Weakness"')
end
end
LocalBuffChange(name, gain)
end
function pet_change(pet, gain)
LocalPetChange(pet, gain)
end
function pet_midcast(spell)
LocalPetMidcast(spell)
end
function pet_aftercast(spell)
LocalPetAftercast(spell)
end
function pet_status_change(new, old)
LocalPetStatusChange(new, old)
end
function self_command(command)
-- Toggle for Idle Mode.
if command == '_modeNA' then
-- Keeps track of variable.
if _modeNAi < 3 then _modeNAi = _modeNAi + 1 else _modeNAi = 1 end
add_to_chat(55, '<< Current Idle Mode: '..sets.NA.Mode[_modeNAi]..'. >>')
equip(sets.NA[sets.NA.Mode[_modeNAi]])
-- Toggle for TP Mode.
elseif command == '_modeTP' then
-- Keeps track of variable.
if _modeTPi < 5 then _modeTPi = _modeTPi + 1 else _modeTPi = 1 end
add_to_chat(55, '<< Current TP Mode: '..sets.TP.Mode[_modeTPi]..'. >>')
equip(sets.TP[sets.TP.Mode[_modeTPi]])
-- Toggle for Midcasting Mode.
elseif command == '_modeMID' then
-- Keeps track of variable.
if _modeMIDi < 4 then _modeMIDi = _modeMIDi + 1 else _modeMIDi = 1 end
add_to_chat(55, '<< Current Midcast Mode: '..sets.MID.Mode[_modeMIDi]..'. >>')
equip(sets.MID[sets.MID.Mode[_modeMIDi]])
-- Toggle for Weaponskill Mode.
elseif command == '_modeWS' then
-- Keeps track of variable.
if _modeWSi < 2 then _modeWSi = _modeWSi + 1 else _modeWSi = 1 end
if _modeWSi == 1 then
add_to_chat(55, '<< Weaponskill mode: Attack. >>')
elseif _modeWSi == 2 then
add_to_chat(55, '<< Weaponskill mode: Accuracy. >>')
end
-- Toggle for locking weapons while doing trials or no TP Loss.
elseif command == '_modeLOCKW' then
if _modeLOCKWi < 2 then _modeLOCKWi = _modeLOCKWi + 1 else _modeLOCKWi = 1 end
if _modeLOCKWi == 1 then
add_to_chat(55, '<< Weapon|Sub|Ranged slots are now Unlocked. >>')
enable('main','sub','range')
elseif _modeLOCKWi == 2 then
add_to_chat(55, '<< Weapon|Sub|Ranged slots are now Locked. >>')
disable('main','sub','range')
end
-- Lock all equipment slots.
elseif command == '_modeLOCKG' then
-- Keeps track of variable.
if _modeLOCKGi < 2 then _modeLOCKGi = _modeLOCKGi + 1 else _modeLOCKGi = 1 end
if _modeLOCKGi == 1 then
add_to_chat(55, '<< Gear Lock Mode: Disabled. >>')
enable('main','sub','range','ammo','head','neck','ear1','ear2','body','hands','ring1','ring2','back','waist','legs','feet')
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
elseif _modeLOCKGi == 2 then
add_to_chat(55, '<< Gear Lock Mode: Enabled. >>')
disable('main','sub','range','ammo','head','neck','ear1','ear2','body','hands','ring1','ring2','back','waist','legs','feet')
end
-- Lock back slot, and ring for Capacity Point farming.
elseif command == '_modeLOCKC' then
-- Keeps track of variable.
if _modeLOCKCi < 2 then _modeLOCKCi = _modeLOCKCi + 1 else _modeLOCKCi = 1 end
if _modeLOCKCi == 1 then
add_to_chat(55, '<< Capacity Mode: Disabled. >>')
enable('back','ring2')
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
elseif _modeLOCKCi == 2 then
add_to_chat(55, '<< Capacity Mode: Enabled. >>')
equip(sets.Capacity)
disable('back','ring2')
end
LocalSelfCommand(command)
end
end
Job Library
Code --[[ Blue Mage : Template ]]--
-- All main settings for file located here. Initiates all key bind functions, and set default variables.
function LoadSettings()
-- ** Multibox Settings.
r = require 'resources'
require('/buddypal/bpcore.lua')
--bpLoadLibrary() -- Load Buddypal Library
--loadBLUSettings() -- Load job specific features for multiboxing.
-- ** Keybind Settings** ^(Control) | !(Alt) | @(Windows Key)
-- ** Job Specific Key Binds
send_command('bind @f5 gs c _modeLEARN') -- Enable gear for learning Blue Magic spells.
-- Requires azuresets add-on.
send_command('bind @f9 input //azuresets spellset dps-max') -- MAX DPS Spellset.
send_command('bind @f10 input //azuresets spellset dps-mab') -- MAX MAB Spellset.
send_command('bind @f11 input //azuresets spellset farming') -- Farming Spellset.
send_command('bind @f12 input //azuresets spellset hybrid1') -- Hybrid Spellset.
-- Job specific key binds.
send_command('bind @1 input /ja "Chain Affinity" <me>') -- CA.
send_command('bind @2 input /ja "Efflux" <me>') -- Efflux.
send_command('bind @3 input /ja "Burst Affinity" <me>') -- BA.
send_command('bind @0 input /ja "Diffusion" <me>') -- Diffusion.
send_command('bind @insert input /ja "Unbridled Learning" <me>') -- Unbridled Learning.
send_command('bind @delete input /ja "Unbridled Wisdom" <me>') -- Unbridled Wisdom.
-- These are job-specific variables. Be careful adjusting as it may cause unwanted changes to your gearswap.
_modeLEARNi = 1;
-- ** Include Gearsets library.
include('/library/gear/Elidyr_BLU_Gear.lua')
-- ** Load Gearsets from gear library
LoadGear()
-- ** List of all spells that have special gearsets. If spells are added to list, they will be parsed in logic for specific sets when used.
bluemage = {}
bluemage.effect = S{'Sudden Lunge','Tail Slap','Benthic Typhoon','Sweeping Gouge','Saurian Slide','Thermal Pulse','Ice Break','Sandspin','Temporal Shift','Corrosive Ooze','Acrid Stream','Water Bomb','Rending Deluge','Blank Gaze','Geist Wall','Osmosis','Mortal Ray','Voracious Trunk'}
bluemage.dark = S{'Blood Saber','Blood Drain','Digest','Death Ray','MP Drainkiss','Eyes On Me','Sandspray','Everyone. Grudge','Dark Orb','Atra. Libations','Palling Salvo','Tenebral Crush'}
bluemage.skill = S{'Occultation','Mighty Guard','Magic Barrier','Digest','Diamondhide','Metallic Body'}
bluemage.maxhp = S{'White Wind'}
enable('main','sub','range','ammo','head','neck','ear1','ear2','body','hands','ring1','ring2','back','waist','legs','feet')
end
function LocalPrecast(spell, act)
print(spell.name)
print(spell.prefix)
print(spell.targets)
print(spell.type)
print(spell.skill)
-- Handles all logic if Job Ability is used.
if spell.type == 'JobAbility' then
if sets.JobAbility[spell.english] then
equip(sets.JobAbility[spell.english])
end
end
-- Handles all logic if Ranged Attack is used.
if spell.name == 'Ranged' then
end
-- Handles all logic if a Weaponskill is used.
if spell.type == 'WeaponSkill' then
if _modeWSi == 1 then
if sets.WSATT[spell.name] then
equip(sets.WSATT[spell.name])
else
equip(sets.WSATT['Default'])
end
elseif _modeWSi == 2 then
if sets.WSACC[spell.name] then
equip(sets.WSACC[spell.name])
else
equip(sets.WSACC['Default'])
end
end
end
-- Handles all logic before a spell is cast.
if spell.skill == "Divine Magic" then
equip(sets.Magic.Precast)
elseif spell.skill == "Enhancing Magic" then
if string.find(spell.name:lower(), 'stoneskin') then
equip(sets.Stoneskin)
else
equip(sets.Magic.Precast)
end
elseif spell.skill == "Elemental Magic" then
equip(sets.Magic.Precast)
elseif spell.skill == "Healing Magic" then
equip(sets.Magic.Precast)
elseif spell.skill == "Enfeebling Magic" then
equip(sets.Magic.Precast)
elseif spell.skill == "Dark Magic" then
equip(sets.Magic.Precast)
elseif spell.skill == "Blue Magic" then
equip(sets.Magic.PreBlueMagic)
elseif spell.skill == "Ninjutsu" then
equip(sets.Magic.Precast)
end
end
function LocalMidcast(spell, act)
-- Handles all logic if Job Ability is used.
if spell.type == 'JobAbility' then
if sets.JobAbility[spell.english] then
equip(sets.JobAbility[spell.english])
end
end
-- Handles all logic if Ranged Attack is used.
if spell.name == 'Ranged' then
end
-- Handles all logic if a Weaponskill is used.
if spell.type == 'WeaponSkill' then
if _modeWSi == 1 then
if sets.WSATT[spell.name] then
equip(sets.WSATT[spell.name])
else
equip(sets.WSATT['Default'])
end
elseif _modeWSi == 2 then
if sets.WSACC[spell.name] then
equip(sets.WSACC[spell.name])
else
equip(sets.WSACC['Default'])
end
end
end
-- Handles all logic after a spell is cast.
if spell.skill == "Divine Magic" then
equip(sets.Magic.PreEnfeebling)
elseif spell.skill == "Enhancing Magic" then
if string.find(spell.name:lower(), 'stoneskin') then
equip(sets.Stoneskin)
else
equip(sets.Magic.EnhancingMagic)
end
elseif spell.skill == "Elemental Magic" then
elseif spell.skill == "Healing Magic" then
elseif spell.skill == "Enfeebling Magic" then
elseif spell.skill == "Dark Magic" then
elseif spell.skill == "Blue Magic" then
-- Determine which midcast set to equip based on spell type (element).
if spell.element == "None" then
-- Job Ability Logic: Certain gear must remain on when spell is cast for the JA to be enhanced. (CA/BA/Efflux/Diffusion)
--Start scan for specific Blue Magic spells.
if bluemage.effect:contains(spell.name) then
equip(sets.AdditionalEffect)
else
equip(sets.PhysicalBlue)
end
else
--Start scan for specific Blue Magic spells.
if bluemage.effect:contains(spell.name) then
equip(sets.AdditionalEffect)
elseif bluemage.dark:contains(spell.name) then
equip(sets.MID[sets.MID.Mode[_modeMIDi]], sets.DarkOnly)
elseif bluemage.skill:contains(spell.name) then
equip(sets.MaxSkill)
elseif bluemage.maxhp:contains(spell.name) then
equip(sets.MaxHP)
else
equip(sets.MID[sets.MID.Mode[_modeMIDi]])
end
end
elseif spell.skill == "Ninjutsu" then
end
end
function LocalAftercast(spell, act)
-- Equip selected TP set if engaged on a mob.
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
-- Not engaged then default back to Idle set.
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
if string.find(spell.name:lower(), 'chain affinity') then
send_command('@ input /p ** Blue Mage: Self-SC going! **')
end
end
function LocalStatusChange(new, old)
end
function LocalBuffChange(name, gain)
--Handle logic for gaining and loosing buffs.
if gain then
-- Handle Diffusion logic when buff is gained.
if name == 'Diffusion' then
equip(sets.JobAbility['Diffusion'])
disable('feet')
-- Handle Efflux logic when buff is gained.
elseif name == 'Efflux' then
equip(sets.JobAbility['Efflux'])
disable('legs')
-- Handle Chain Affinity logic when buff is gained.
elseif name == 'Chain Affinity' then
equip(sets.JobAbility['Chain Affinity'])
disable('head','feet')
end
else
-- Handle Diffusion logic when buff is lost.
if name == 'Diffusion' then
enable('feet')
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
-- Handle Efflux logic when buff is lost.
elseif name == 'Efflux' then
enable('legs')
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
-- Handle Chain Affinity logic when buff is lost.
elseif name == 'Chain Affinity' then
enable('head','feet')
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
end
end
end
function LocalPetChange(pet, gain)
end
function LocalPetMidcast(spell)
end
function LocalPetAftercast(spell)
end
function LocalPetStatusChange(new, old)
end
function LocalSelfCommand(command)
--Toggle for locking into Blue Mage spell learning mode.
if command == '_modeLEARN' then
if _modeLEARNi < 2 then _modeLEARNi = _modeLEARNi + 1 else _modeLEARNi = 1 end
if _modeLEARNi == 1 then
add_to_chat(600, '** Spell Learning Mode Disabled!')
enable('main','sub','range','ammo','head','neck','ear1','ear2','body','hands','ring1','ring2','back','waist','legs','feet')
if player.status == 'Engaged' then
equip(sets.TP[sets.TP.Mode[_modeTPi]])
else
equip(sets.NA[sets.NA.Mode[_modeNAi]])
end
elseif _modeLEARNi == 2 then
add_to_chat(600, '** Spell Learning Mode Enabled!')
equip(sets.Learning)
disable('main','sub','range','ammo','head','neck','ear1','ear2','body','hands','ring1','ring2','back','waist','legs','feet')
end
end
end
Gear File
Code --[[ Blue Mage : Gearsets ]]--
function LoadGear()
-- ** List of all Job Ability sets. Will always equip this set when the assigned Job Ability is used.
sets.JobAbility = {}
-- ARTIFACT ENHANCEMENTS
sets.JobAbility['Valiance'] = {hands = "Runeist's Coat +1"}
sets.JobAbility['Vallation'] = {hands = "Runeist's Coat +1"}
sets.JobAbility['Gambit'] = {hands = "Runeist's Mitons"}
sets.JobAbility['Pflug'] = {hands = "Runeist's Boots"}
-- RELIC ENHANCEMENTS
sets.JobAbility['Battuta'] = {head = "Futhark Bandeau +1"}
sets.JobAbility['Elemental Sforzo'] = {body = "Futhark Coat +1"}
sets.JobAbility['Swordplay'] = {hands = "Futhark Mitons +1"}
sets.JobAbility['Embolden'] = {legs = "Futhark Trousers +1"}
sets.JobAbility['Rayke'] = {feet = "Futhark Boots +1"}
-- EMPYREAN ENHANCEMENTS
sets.JobAbility['Vivacious Pulse'] = {head = "Erilaz Galea +1"}
sets.JobAbility['Inquartata'] = {legs = "Erilaz Leg Guards +1"}
-- ** List of all idle sets. Will always equip this set when engaged, and not performing any other actions.
sets.NA = {}
sets.NA.Mode = {'IDLE','PDT','MDT'}
-- Idle Build
sets.NA.IDLE =
{ammo = "Brigantia Pebble",
head = "Ayanmo Zucchetto +1",
neck = "Twilight Torque",
ear1 = "Ethereal Earring",
ear2 = "Handler's Earring +1",
body = "Hagondes Coat +1",
hands = "Serpentes Cuffs",
ring1 = "Paguroidea Ring",
ring2 = "Sheltered Ring",
back = "Solemnity Cape",
waist = "Flume Belt",
legs = "Carmine Cuisses +1",
feet = "Serpentes Sabots"}
-- Physical Damage Taken Build
sets.NA.PDT =
{ammo = "Brigantia Pebble",
head = "Ayanmo Zucchetto +1",
neck = "Twilight Torque",
ear1 = "Ethereal Earring",
ear2 = "Handler's Earring +1",
body = "Emet Harness +1",
hands = { name="Herculean Gloves", augments={'Attack+22','Phys. dmg. taken -4%','STR+7',}},
ring1 = "Defending Ring",
ring2 = { name="Dark Ring", augments={'Magic dmg. taken -4%','Phys. dmg. taken -4%',}},
back = "Solemnity Cape",
waist = "Flume Belt",
legs = { name="Herculean Trousers", augments={'Phys. dmg. taken -5%','CHR+10','Accuracy+15',}},
feet = { name="Herculean Boots", augments={'Accuracy+9 Attack+9','"Triple Atk."+3','Accuracy+12','Attack+11',}}}
-- Magical Damage Taken Build
sets.NA.MDT =
{ammo = "Brigantia Pebble",
head = "Ayanmo Zucchetto +1",
neck = "Twilight Torque",
ear1 = "Ethereal Earring",
ear2 = "",
body = "Emet Harness +1",
hands = "Iuitl Wristbands +1",
ring1 = "Defending Ring",
ring2 = "Dark Ring", augments={'Magic Dmg. Taken -4%','Phys. Dmg. Taken -4%'},
back = "Umbra Cape",
waist = "Flume Belt",
legs = "Hagondes Pants +1",
feet = "Iuitl Gaiters +1"}
-- ** List of all melee sets. Will always equip this set when engaged, and not performing any other actions.
sets.TP = {}
sets.TP.Mode = {'TP1','TP2','TP3','PDT','MDT'}
-- Low Accuracy Build
sets.TP.TP1 =
{ammo = "Ginsen",
head = "Adhemar Bonnet",
neck = "Asperity Necklace",
ear1 = "Brutal Earring",
ear2 = "Suppanomimi",
body = "Adhemar Jacket",
hands = "Adhemar Wristbands",
ring1 = "Petrov Ring",
ring2 = "Epona's Ring",
back = { name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}},
waist = "Kentarch Belt +1",
legs = "Samnuha Tights",
feet = { name="Herculean Boots", augments={'Accuracy+9 Attack+9','"Triple Atk."+3','Accuracy+12','Attack+11',}}}
-- Mid Accuracy Build
sets.TP.TP2 =
{ammo = "Ginsen",
head = "Adhemar Bonnet",
neck = "Asperity Necklace",
ear1 = "Digni. Earring",
ear2 = "Suppanomimi",
body = "Adhemar Jacket",
hands = "Adhemar Wristbands",
ring1 = "Rajas Ring",
ring1 = "Petrov Ring",
back = { name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}},
waist = "Kentarch Belt +1",
legs = "Samnuha Tights",
feet = { name="Herculean Boots", augments={'Accuracy+9 Attack+9','"Triple Atk."+3','Accuracy+12','Attack+11',}}}
-- High Accuracy Build
sets.TP.TP3 =
{ammo = "Falcon Eye",
head = "Carmine Mask",
neck = "Iqabi Necklace",
ear1 = "Dudgeon Earring",
ear2 = "Heartseeker Earring",
body = "Adhemar Jacket",
hands = "Adhemar Wristbands",
ring1 = "Rajas Ring",
ring2 = "Ramuh Ring",
back = { name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}},
waist = "Kentarch Belt +1",
legs = "Carmine Cuisses +1",
feet = { name="Herculean Boots", augments={'Accuracy+9 Attack+9','"Triple Atk."+3','Accuracy+12','Attack+11',}}}
-- Physical Damage Taken Build
sets.TP.PDT =
{ammo = "Brigantia Pebble",
head = "Ayanmo Zucchetto +1",
neck = "Twilight Torque",
ear1 = "Ethereal Earring",
ear2 = "Handler's Earring +1",
body = "Emet Harness +1",
hands = { name="Herculean Gloves", augments={'Attack+22','Phys. dmg. taken -4%','STR+7',}},
ring1 = "Defending Ring",
ring2 = { name="Dark Ring", augments={'Magic dmg. taken -4%','Phys. dmg. taken -4%',}},
back = "Solemnity Cape",
waist = "Flume Belt",
legs = { name="Herculean Trousers", augments={'Phys. dmg. taken -5%','CHR+10','Accuracy+15',}},
feet = { name="Herculean Boots", augments={'Accuracy+9 Attack+9','"Triple Atk."+3','Accuracy+12','Attack+11',}}}
-- Magical Damage Taken Build
sets.TP.MDT =
{ammo = "Brigantia Pebble",
head = "Ayanmo Zucchetto +1",
neck = "Twilight Torque",
ear1 = "Handler's Earring",
ear2 = "Suppanomimi",
body = "Emet Harness +1",
hands = "Rawhide Gloves",
ring1 = "Defending Ring",
ring2 = "Dark Ring", augments={'Magic Dmg. Taken -4%','Phys. Dmg. Taken -4%'},
back = "Umbra Cape",
waist = "Flume Belt",
legs = "Samnuha Tights",
feet = "Herculean Boots"}
-- ** List of all midcasting sets. Will always midcast in this set when casting elemental magic.
sets.MID = {}
sets.MID.Mode = {'MAB','ACC','BURST','BURSTACC'}
-- Magic Attack Bonus Build
sets.MID.MAB =
{ammo = "Ghastly Tathlum +1",
head = "Jhakri Coronal +1",
neck = "Eddy Necklace",
ear1 = "Hecate's Earring",
ear2 = "Friomisi Earring",
body = "Jhakri Robe +2",
hands = "Amalric Gages",
ring1 = "Stikini Ring",
ring2 = "Shiva Ring +1",
back = "Toro Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
-- Magic Accuracy Build
sets.MID.ACC =
{ammo = "Ghastly Tathlum +1",
head = "Jhakri Coronal +1",
neck = "Eddy Necklace",
ear1 = "Hecate's Earring",
ear2 = "Friomisi Earring",
body = "Jhakri Robe +2",
hands = "Jhakri Cuffs +1",
ring1 = "Stikini Ring",
ring2 = "Stikini Ring",
back = "Toro Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
-- Magic Burst Build
sets.MID.BURST =
{ammo = "Ghastly Tathlum +1",
head = "Jhakri Coronal +1",
neck = "Eddy Necklace",
ear1 = "Hecate's Earring",
ear2 = "Friomisi Earring",
body = "Jhakri Robe +2",
hands = "Amalric Gages",
ring1 = "Locus Ring",
ring2 = "Mujin Band",
back = "Toro Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
-- Magic Burst Accuracy Build
sets.MID.BURSTACC =
{ammo = "Ghastly Tathlum +1",
head = "Jhakri Coronal +1",
neck = "Incanter's Torque",
ear1 = "Hecate's Earring",
ear2 = "Friomisi Earring",
body = "Jhakri Robe +2",
hands = "Jhakri Gages +1",
ring1 = "Locus Ring",
ring2 = "Mujin Band",
back = "Toro Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
-- ** List of all weaponskill sets. Will always weaponskill in default unless specific set is made.
sets.WSATT = {}
sets.WSATT['Default'] =
{ammo = "Jukukik Feather",
head = "Adhemar Bonnet",
neck = "Light Gorget",
ear1 = "Brutal Earring",
ear2 = "Bladeborn Earring",
body = "Adhemar Jacket",
hands = "Adhemar Wristbands",
ring1 = "Ramuh Ring",
ring2 = "Epona's Ring",
back = "Rancorous Mantle",
waist = "Light Belt",
legs = "Samnuha Tights",
feet = "Adhemar Gamashes"}
sets.WSATT['Savage Blade'] =
{ammo = "Amar Cluster",
head = { name="Herculean Helm", augments={'Accuracy+14 Attack+14','STR+12','Attack+9',}},
neck = "Caro Necklace",
ear1 = "Ishvara Earring",
ear2 = "Bladeborn Earring",
body = "Adhemar Jacket",
hands = { name="Herculean Gloves", augments={'STR+8','Accuracy+19 Attack+19',}},
ring1 = "Rufescent Ring",
ring2 = "Ifrit's Ring +1",
back = "Buquwik Cape",
waist = "Prosilio Belt +1",
name = "Carmine Cuisses +1",
feet = { name="Herculean Boots", augments={'Weapon skill damage +4%','STR+6','Attack+15',}}}
sets.WSATT['Chant du Cygne'] =
{ammo = "Jukukik Feather",
head = "Adhemar Bonnet",
neck = "Light Gorget",
ear1 = "Mache Earring",
ear2 = "Brutal Earring",
body = "Adhemar Jacket",
hands = "Adhemar Wristbands",
ring1 = "Apate Ring",
ring2 = "Epona's Ring",
back = { name="Rosmerta's Cape", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+7','Crit.hit rate+10',}},
waist = "Light Belt",
legs = "Samnuha Tights",
feet = "Thereoid Greaves"}
sets.WSATT['Sanguine Blade'] =
{ammo = "Ghastly Tathlum +1",
head = "Jhakri Coronal +1",
neck = "Eddy Necklace",
ear1 = "Hecate's Earring",
ear2 = "Friomisi Earring",
body = "Jhakri Robe +2",
hands = "Amalric Gages",
ring1 = "Shiva Ring",
ring2 = "Shiva Ring",
back = "Toro Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
sets.WSATT['Requiescat'] =
{ammo = "Amar Cluster",
head = { name="Herculean Helm", augments={'Accuracy+14 Attack+14','STR+12','Attack+9',}},
neck = "Caro Necklace",
ear1 = "Ishvara Earring",
ear2 = "Bladeborn Earring",
body = "Adhemar Jacket",
hands = { name="Herculean Gloves", augments={'STR+8','Accuracy+19 Attack+19',}},
ring1 = "Apate Ring",
ring2 = "Ifrit's Ring +1",
back = "Buquwik Cape",
waist = "Prosilio Belt +1",
name = "Carmine Cuisses +1",
feet = { name="Herculean Boots", augments={'Weapon skill damage +4%','STR+6','Attack+15',}}}
sets.WSACC = {}
sets.WSACC['Default'] =
{}
-- ** List of all magic sets to be used during midcast. Must setup appropriately.
sets.Magic = {}
sets.Magic.HealingMagic =
{}
sets.Magic.HealingMagicMax =
{}
sets.Magic.HealingMagicSelf =
{}
sets.Magic.EnhancingMagic =
{}
sets.Magic.EnfeeblingMagic =
{}
sets.Magic.DarkMagic =
{}
-- ** List of all magic sets to be used during precast. Must setup appropriately.
sets.Magic.Precast =
{head = "Carmine Mask",
neck = "Orunmila's Torque",
ear1 = "",
ear2 = "Loquac. Earring",
body = "Telchine Chas.",
hands = "Leyline Gloves",
ring1 = "Prolix Ring",
ring2 = "Weather. Ring",
back = "Swith Cape +1",
waist = "Witful Belt",
legs = "Psycloth Lappas",
feet = ""}
sets.Magic.PreHealing =
{}
sets.Magic.PreEnfeebling =
{}
sets.Magic.PreStoneskin =
{}
sets.Magic.PreBlueMagic =
{head = "Carmine Mask",
neck = "Orunmila's Torque",
ear1 = "",
ear2 = "Loquac. Earring",
body = "Telchine Chas.",
hands = "Leyline Gloves",
ring1 = "Prolix Ring",
ring2 = "Weather. Ring",
back = "Swith Cape +1",
waist = "Witful Belt",
legs = "Psycloth Lappas",
feet = ""}
-- ** List of all sets that target a specific action. Must be manually setup in functions below.
sets.Learning =
{ammo = "Mavi Tathlum",
head = "Iuitl Headgear +1",
neck = "Twilight Torque",
ear1 = "Brutal Earring",
ear2 = "Suppanomimi",
body = "Assim. Jubbah +1",
hands = "Assim. Bazu. +1",
ring1 = "Stikini Ring",
ring2 = "Stikini Ring",
back = "Cornflower Cape",
waist = "Flume Belt",
legs = "Mavi Tayt +2",
feet = "Luhlaza Charuqs +1"}
sets.PhysicalBlue =
{ammo = "Falcon Eye",
head = "Jhakri Coronal +1",
neck = "Caro Necklace",
ear1 = "",
ear2 = "",
body = "Jhakri Robe +2",
hands = "Jhakri Cuffs +1",
ring1 = "Ifrit Ring",
ring2 = "Ifrit Ring +1",
back = "Cornflower Cape",
waist = "Prosilio Belt +1",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
sets.AdditionalEffect =
{ammo = "Falcon Eye",
head = "Carmine Mask",
neck = "",
ear1 = "Gwati Earring",
ear2 = "Digni. Earring",
body = "Jhakri Robe +2",
hands = "Rawhide Gloves",
ring1 = "Stikini Ring",
ring2 = "Stikini Ring",
back = "Cornflower Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
sets.DarkOnly =
{ammo = "Pemphredo Tathlum",
head = "Carmine Mask",
neck = "Incanter's Torque",
ear1 = "Gwati Earring",
ear2 = "Digni. Earring",
body = "Jhakri Robe +2",
hands = "Rawhide Gloves",
ring1 = "Stikini Ring",
ring2 = "Stikini Ring",
back = "Cornflower Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
sets.MaxHP =
{ammo = "Pemphredo Tathlum",
head = "Carmine Mask",
neck = "Incanter's Torque",
ear1 = "Gwati Earring",
ear2 = "Digni. Earring",
body = "Jhakri Robe +2",
hands = "Rawhide Gloves",
ring1 = "Stikini Ring",
ring2 = "Stikini Ring",
back = "Cornflower Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
sets.MaxSkill =
{ammo = "Pemphredo Tathlum",
head = "Carmine Mask",
neck = "Incanter's Torque",
ear1 = "Gwati Earring",
ear2 = "Digni. Earring",
body = "Jhakri Robe +2",
hands = "Rawhide Gloves",
ring1 = "Stikini Ring",
ring2 = "Stikini Ring",
back = "Cornflower Cape",
waist = "Aswang Sash",
legs = "Jhakri Slops +1",
feet = "Jhakri Pigaches +1"}
sets.Stoneskin =
{head = "Umuthi Hat",
ear1 = "Earthcry Earring",
ear2 = "Andoaa Earring",
hands = "Carapacho Cuffs",
waist = "Olympus Sash",
legs = "Haven Hose"}
sets.Capacity =
{ring2 = "Trizek Ring",
back = "Mecisto. Mantle"}
sets.Kite =
{ammo = "",
head = "",
neck = "",
ear1 = "",
ear2 = "",
body = "",
hands = "",
ring1 = "",
ring2 = "",
back = "",
waist = "",
legs = "Carmine Cuisses +1",
feet = ""}
sets.MDT =
{ammo = "",
head = "",
neck = "",
ear1 = "",
ear2 = "",
body = "",
hands = "",
ring1 = "",
ring2 = "",
back = "",
waist = "",
legs = "",
feet = ""}
sets.MEV =
{ammo = "",
head = "",
neck = "",
ear1 = "",
ear2 = "",
body = "",
hands = "",
ring1 = "",
ring2 = "",
back = "",
waist = "",
legs = "",
feet = ""}
end
The event in question was a function inside the include file in the job library. Specifically this bit here: Code -- ** Multibox Settings.
r = require 'resources'
require('/buddypal/bpcore.lua')
--bpLoadLibrary() -- Load Buddypal Library
--loadBLUSettings() -- Load job specific features for multiboxing.
Does this not work anymore?
Edit: I guess I could be more specific...
Code if table:contains(name) then ...
|
|