Lua

Langues: JP EN DE FR
users online
Forum » FFXI » Jobs » Samurai » lua
lua
Offline
Posts: 10
By 3rbii 2021-06-24 19:50:42
Link | Citer | R
 
can anyone share an updated lua
Offline
Posts: 14593
By Pantafernando 2021-06-25 06:51:28
Link | Citer | R
 
Code
 print("Hello World, 25/06/2021")


I just updated it.

Enjoy
[+]
 Asura.Cambion
Offline
Serveur: Asura
Game: FFXI
user: Cambion
Posts: 415
By Asura.Cambion 2021-06-25 12:16:27
Link | Citer | R
 
How complex or simple are you looking for?
Offline
Posts: 10
By 3rbii 2021-06-26 12:55:17
Link | Citer | R
 
i dont mind complex , just looking for something practical.
 Asura.Cambion
Offline
Serveur: Asura
Game: FFXI
user: Cambion
Posts: 415
By Asura.Cambion 2021-06-26 16:41:56
Link | Citer | R
 
3rbii said: »
i dont mind complex , just looking for something practical.

I had a vision, that on paper was perfect. But in practice may not work for my intended audience. Regardless, this has everything broken down line by line, with full explanations built into the lua.

Cheat Sheet:
F9 Cycles Accuracy Gear
F10 Cycles DT Gear
CTRL+F9 Cycles WS Acc Mode
CTRL+F12 Cycles Idle sets
F12 is a status report that will tell you which modes you're currently in.

Windows Key + T = Treasure Hunter Mode
Windows Key + R = Re-raise items and Warp Rings
Windows Key + D = Dynamis Neck Lock
Windows Key + C = Capacity Back Lock

Feedback appreciated. I don't play Samurai, so no promises. But I've loaded it and verified there are no errors and all toggles work correctly.
Code
-- Initialization function for this job file.
function get_sets()
    mote_include_version = 2

    include('Mote-Include.lua')
end

-- Setup variables that are user-independent.
function job_setup()

    state.Buff.Hasso = buffactive.Hasso or false
    state.Buff.Seigan = buffactive.Seigan or false
    state.Buff.Sekkanoki = buffactive.Sekkanoki or false
    state.Buff.Sengikori = buffactive.Sengikori or false
    state.Buff['Meikyo Shisui'] = buffactive['Meikyo Shisui'] or false

    state.CP = M(false, "Capacity Points Mode")
	state.Warp = M(false, "Warp Mode")
	state.TH = M(false, "Treasure Hunter Mode")
	state.Dyna = M(false, "Dynamis Neck Mode")	
	state.CombatWeapon = M{['description']='Weapon', 'Normal', 'Chango', 'Naegling','ShiningOne','Loxotic','Montante'}

    lockstyleset = 17 --This will automatically apply the Lockstyle of your choice when you change to this job.
end

-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job.
-------------------------------------------------------------------------------------------------------------------

-- Gear Modes
function user_setup()
	state.OffenseMode:options('Normal', 'LowAcc', 'MidAcc', 'HighAcc') --Triggered with F9. This is the order in which they cycle, starts at normal, the first press will go to your lowest Acc set, and then cycle up to your highest.
	state.HybridMode:options('Normal', 'PLD', 'MAX', 'HIGH', 'MID', 'LOW') --Triggered with F10. This is the order in which they cycle, starts at normal, the first press will go to your highest DT set, and then cycle down to your lowest.
	state.IdleMode:options('Normal', 'Alt') --Triggered with Ctrl+F12.  This will cycle between your idle sets.
	state.WeaponskillMode:options('Normal', 'Acc') --Triggered with Ctrl+F9.  This will trigger the Acc variant of your WeaponSkill Sets.
	
-- Additional Key Binds.
	send_command('bind f9 gs c cycle OffenseMode') --F9 will incrementally add pieces of accuracy gear that you define in the 'Accuracy Sets'
	send_command('bind f10 gs c cycle HybridMode') --F10 will trigger your DT pieces of gear that you define in the 'DT Sets'
	send_command('bind @c gs c toggle CP') --WindowKey'C' will disable your back piece and equip your Capacity Point Cape
	send_command('bind @r gs c toggle Warp') --WindowKey'R' will disable your head, fingers, and ear1 to equip warp and reraise gear
	send_command('bind @t gs c toggle TH') --WindowKey'T' will disable your ???, to equip Treasure Hunter gear
	send_command('bind @d gs c toggle Dyna') --WindowKey'D' will disable your neck, to equip your JSE Neck for rank points	
	send_command('bind @w gs c cycle CombatWeapon') --WindowKey'W' will cycle through your different weapons
	send_command('bind ^f9 gs c cycle WeaponSkillMode') --Ctrl'F9' will cycle the Acc variant of your WeaponSkill Sets

    send_command('lua l gearinfo') --If you don't have GearInfo, Haste tiers won't work properly for dual wielders.

    select_default_macro_book()
    set_lockstyle()

    Haste = 0
    DW_needed = 0
    DW = false
    moving = false
    update_combat_form()
    determine_haste_group()
end

-- Erases the Key Binds above when you switch to another job.
function user_unload()
	send_command('unbind @c')
	send_command('unbind @r')
	send_command('unbind @t')
	send_command('unbind @d')
	send_command('unbind @w')	
	send_command('gs enable all')	
end

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

	sets.Enmity = {} -- Enmity

	sets.precast.FC = {} -- Fast Cast
	
	sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"}) --Special set for casting shadows, combines with your fast cast set

	sets.precast.JA.Meditate = {}
	sets.precast.JA['Warding Circle'] = {}
	sets.precast.JA['Blade Bash'] = {}
	
    ------------------------------------------------------------------------------------------------
    ------------------------------------- Weapon Skill Sets ----------------------------------------
    ------------------------------------------------------------------------------------------------

-- This is a default WS set that will be applied to every WS that isn't listed with its own set below.
    sets.precast.WS = {

	}

	sets.precast.WS['Tachi: Fudo'] = {}
	sets.precast.WS['Tachi: Shoha'] = {}
	sets.precast.WS['Tachi: Rana'] = {}
	sets.precast.WS['Tachi: Kasha'] = {}
	sets.precast.WS['Tachi: Gekko'] = {}
	sets.precast.WS['Tachi: Yukikaze'] = {}
	sets.precast.WS['Tachi: Ageha'] = {}
	sets.precast.WS['Tachi: Jinpu'] = {}
	
    sets.precast.WS.Acc = {}
	sets.precast.WS['Tachi: Fudo'].Acc = {}
	sets.precast.WS['Tachi: Shoha'].Acc = {}
	sets.precast.WS['Tachi: Rana'].Acc = {}
	sets.precast.WS['Tachi: Kasha'].Acc = {}
	sets.precast.WS['Tachi: Gekko'].Acc = {}
	sets.precast.WS['Tachi: Yukikaze'].Acc = {}
	sets.precast.WS['Tachi: Ageha'].Acc = {}
	sets.precast.WS['Tachi: Jinpu'].Acc = {}	

    ------------------------------------------------------------------------------------------------
    ----------------------------------------- Idle Sets --------------------------------------------
    ------------------------------------------------------------------------------------------------

--Idle sets can be cycled with Ctrl + F12, except for town, which is based on area automatically.
--I recommend equiping the set you want in game, then using //gs export to copy/paste the entire set.
--Just in case, I'll add one blank set if people want to do it manually, copy/paste as you please

    sets.idle = {
		Ammo="",
		Head="",
		Neck="",
		ear1="",
		ear2="",
		Body="",
		Hands="",
		Ring1="",
		Ring2="",
		back="",
		Waist="",
		Legs="",
		Feet="",
	}

    sets.idle.Alt = {

	}

    sets.idle.Town = {

	}
		
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Engaged Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------

	sets.engaged = {

	}

    ------------------------------------------------------------------------------------------------
    -------------------------------------- Dual Wield Sets -----------------------------------------
	------------------------------------------------------------------------------------------------

    -- No Magic Haste (??% DW to cap)
    sets.engaged.DW = {}

    -- 15% Magic Haste (??% DW to cap)
    sets.engaged.DW.LowHaste = {}

    -- 30% Magic Haste (??% DW to cap)
    sets.engaged.DW.MidHaste = {}

    -- 40% Magic Haste (??% DW to cap)
    sets.engaged.DW.HighHaste = {}

    -- 45% Magic Haste (??% DW to cap)
    sets.engaged.DW.MaxHaste = {}

	------------------------------------------------------------------------------------------------
    --------------------------------------- Accuracy Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------	
-- Define three tiers of Accuracy.  These sets are cycled with the F9 Button to increase accuracy in stages as desired, starting with the lowest amount first; Acc1
    sets.engaged.Acc1 = {} --
    sets.engaged.Acc2 = {} --
    sets.engaged.Acc3 = {} --

-- This is the function that combines all of the Acc sets, with all of your engaged sets.  NO EDITING NEEDED!!!
-- Base; Not Dual Wield
	sets.engaged.LowAcc = set_combine(sets.engaged, sets.engaged.Acc1)
	sets.engaged.MidAcc = set_combine(sets.engaged, sets.engaged.Acc2)
	sets.engaged.HighAcc = set_combine(sets.engaged, sets.engaged.Acc3)	
-- Base DW 
	sets.engaged.DW.LowAcc = set_combine(sets.engaged.DW, sets.engaged.Acc1)
	sets.engaged.DW.MidAcc = set_combine(sets.engaged.DW, sets.engaged.Acc2)
	sets.engaged.DW.HighAcc = set_combine(sets.engaged.DW, sets.engaged.Acc3)
-- LowHaste DW
	sets.engaged.DW.LowAcc.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.Acc1)
	sets.engaged.DW.MidAcc.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.Acc2)
	sets.engaged.DW.HighAcc.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.Acc3)
-- MidHaste DW
	sets.engaged.DW.LowAcc.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.Acc1)
	sets.engaged.DW.MidAcc.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.Acc2)
	sets.engaged.DW.HighAcc.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.Acc3)
-- HighHaste DW
	sets.engaged.DW.LowAcc.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.Acc1)
	sets.engaged.DW.MidAcc.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.Acc2)
	sets.engaged.DW.HighAcc.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.Acc3)
-- HighHaste DW
	sets.engaged.DW.LowAcc.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.LowAcc)
	sets.engaged.DW.MidAcc.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.MidAcc)
	sets.engaged.DW.HighAcc.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.HighAcc)

    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Hybrid Sets -------------------------------------------
    ------------------------------------------------------------------------------------------------
-- Define three tiers of Defense Taken.  These sets are cycled with the F10 Button, starting with the highest amount first; DT5.
	sets.engaged.DT1 = {} --
	sets.engaged.DT2 = {} --
	sets.engaged.DT3 = {} --
	sets.engaged.DT4 = {} --
	sets.engaged.DT5 = {} --

-- This is the function that combines all of the DT sets, with all of your engaged sets.  NO EDITING NEEDED!!!
-- No Haste Base
	sets.engaged.LOW = set_combine(sets.engaged, sets.engaged.DT1)	
	sets.engaged.MID = set_combine(sets.engaged, sets.engaged.DT2)
	sets.engaged.HIGH = set_combine(sets.engaged, sets.engaged.DT3)
	sets.engaged.MAX = set_combine(sets.engaged, sets.engaged.DT4)	
	sets.engaged.PLD = set_combine(sets.engaged, sets.engaged.DT5)	
-- No Haste DW
	sets.engaged.DW.LOW = set_combine(sets.engaged.DW, sets.engaged.DT1)	
	sets.engaged.DW.MID = set_combine(sets.engaged.DW, sets.engaged.DT2)
	sets.engaged.DW.HIGH = set_combine(sets.engaged.DW, sets.engaged.DT3)
	sets.engaged.DW.MAX = set_combine(sets.engaged.DW, sets.engaged.DT4)	
	sets.engaged.DW.PLD = set_combine(sets.engaged.DW, sets.engaged.DT5)
-- Low Haste DW
	sets.engaged.DW.LOW.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.DT1)
	sets.engaged.DW.MID.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.DT2)
	sets.engaged.DW.HIGH.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.DT3)
	sets.engaged.DW.MAX.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.DT4)
	sets.engaged.DW.PLD.LowHaste = set_combine(sets.engaged.DW.LowHaste, sets.engaged.DT5)	
-- Mid Haste DW
	sets.engaged.DW.LOW.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.DT1)	
	sets.engaged.DW.MID.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.DT2)
	sets.engaged.DW.HIGH.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.DT3)
	sets.engaged.DW.MAX.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.DT4)
	sets.engaged.DW.PLD.MidHaste = set_combine(sets.engaged.DW.MidHaste, sets.engaged.DT5)
-- High Haste DW
	sets.engaged.DW.LOW.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.DT1)	
	sets.engaged.DW.MID.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.DT2)
	sets.engaged.DW.HIGH.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.DT3)
	sets.engaged.DW.MAX.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.DT4)
	sets.engaged.DW.PLD.HighHaste = set_combine(sets.engaged.DW.HighHaste, sets.engaged.DT5)	
-- Max Haste DW
	sets.engaged.DW.LOW.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.DT1)	
	sets.engaged.DW.MID.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.DT2)	
	sets.engaged.DW.HIGH.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.DT3)
	sets.engaged.DW.MAX.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.DT4)
	sets.engaged.DW.PLD.MaxHaste = set_combine(sets.engaged.DW.MaxHaste, sets.engaged.DT5)

-- This is the function that combines all of your Acc Sets AND DT sets with your Engaged sets.	NO EDITING NEEDED!!!
-- Shield Base
	sets.engaged.LOW = set_combine(sets.engaged, sets.engaged.DT1)
	sets.engaged.LowAcc.LOW = set_combine(sets.engaged.LowAcc, sets.engaged.DT1)
	sets.engaged.MidAcc.LOW = set_combine(sets.engaged.MidAcc, sets.engaged.DT1)
	sets.engaged.HighAcc.LOW = set_combine(sets.engaged.HighAcc, sets.engaged.DT1)
	
	sets.engaged.MID = set_combine(sets.engaged, sets.engaged.DT2)
	sets.engaged.LowAcc.MID = set_combine(sets.engaged.LowAcc, sets.engaged.DT2)
	sets.engaged.MidAcc.MID = set_combine(sets.engaged.MidAcc, sets.engaged.DT2)
	sets.engaged.HighAcc.MID = set_combine(sets.engaged.HighAcc, sets.engaged.DT2)
	
	sets.engaged.HIGH = set_combine(sets.engaged, sets.engaged.DT3)
	sets.engaged.LowAcc.HIGH = set_combine(sets.engaged.LowAcc, sets.engaged.DT3)
	sets.engaged.MidAcc.HIGH = set_combine(sets.engaged.MidAcc, sets.engaged.DT3)
	sets.engaged.HighAcc.HIGH = set_combine(sets.engaged.HighAcc, sets.engaged.DT3)
	
	sets.engaged.MAX = set_combine(sets.engaged, sets.engaged.DT4)
	sets.engaged.LowAcc.MAX = set_combine(sets.engaged.LowAcc, sets.engaged.DT4)
	sets.engaged.MidAcc.MAX = set_combine(sets.engaged.MidAcc, sets.engaged.DT4)
	sets.engaged.HighAcc.MAX = set_combine(sets.engaged.HighAcc, sets.engaged.DT4)
	
	sets.engaged.PLD = set_combine(sets.engaged, sets.engaged.DT5)
	sets.engaged.LowAcc.PLD = set_combine(sets.engaged.LowAcc, sets.engaged.DT5)
	sets.engaged.MidAcc.PLD = set_combine(sets.engaged.MidAcc, sets.engaged.DT5)
	sets.engaged.HighAcc.PLD = set_combine(sets.engaged.HighAcc, sets.engaged.DT5)		

    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Weapon Sets -------------------------------------------
    ------------------------------------------------------------------------------------------------

-- This defines your weapons sets, which can be quickly cycled with the Windows Key + W.  I'm leaving my default Warrior Swaps here, so that people can see the example, and duplicate it for their specific job/weapons.
	sets.Chango = {main="Chango",sub="Utu Grip"}
	sets.Naegling = {main="Naegling",sub="Blurred Shield +1"}
	sets.ShiningOne = {main="Shining One",sub="Utu Grip"}
	sets.Loxotic = {main="Loxotic Mace +1",sub="Blurred Shield +1"}
	sets.Montante = {main="Montante +1",sub="Utu Grip"}
	
    ------------------------------------------------------------------------------------------------
    ---------------------------------------- Special Sets ------------------------------------------
    ------------------------------------------------------------------------------------------------

-- This defines special sets for things like warping, locking a CP cape, JSE neck, TH sets, etc.  I'm leaving my default gear here, so that people can see the example, and duplicate it for their specific gear.
	sets.Warp = {ring1="Dim. Ring (Holla)",ring2="Warp Ring",ear1="Reraise Earring",head="White Rarab Cap +1",}
	sets.CP = {back="Mecisto. Mantle"}
	sets.TH = {Ammo="Perfect Lucky Egg",Waist="Chaac Belt",Head="White Rarab Cap +1"}
	sets.Dyna = {neck="Warrior's bead necklace +2"}

-- This is for gear that enhances certain job abilities, where you have to KEEP the item on, during the duration of the buff, in order to receive the benefit.  This is where you define the set for the specific buff.
    sets.buff.Hasso = {}
    sets.buff.Seigan = {}
	sets.buff.Sekkanoki = {}
	sets.buff.Sengikori = {}
	sets.buff['Meikyo Shisui'] = {}
end

-------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------
-- I don't recommend touching anything below this line, unless you really know what you're doing.  Except for the Macro Sets.
-------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------

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

-- This automatically cancels Utsusei Ni, when you cast Ichi at the correct time, to allow it to go off, while not wasting shadows.
function job_precast(spell, action, spellMap, eventArgs)
    if spellMap == 'Utsusemi' then
        if buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)'] then
            cancel_spell()
            add_to_chat(123, '**!! '..spell.english..' Canceled: [3+ IMAGES] !!**')
            eventArgs.handled = true
            return
        elseif buffactive['Copy Image'] or buffactive['Copy Image (2)'] then
            send_command('cancel 66; cancel 444; cancel Copy Image; cancel Copy Image (2)')
        end
    end

-- This handles the forced equipping of the gearset, that enhances certain job abilities, where you have to keep the item on, in order to receive the benefit.  It's for my Dnc, but leaving as an example for general public.	

		if state.Buff.Sekkanoki then
            equip(sets.buff.Sekkanoki)
        end
        if state.Buff.Sengikori then
            equip(sets.buff.Sengikori)
        end
        if state.Buff.Seigan then
            equip(sets.buff.Seigan)
        end
        if state.Buff.Hasso then
            equip(sets.buff.Hasso)
        end
        if state.Buff.Sengikori then
            equip(sets.buff.Sengikori)
        end
        if state.Buff['Meikyo Shisui'] then
            equip(sets.buff['Meikyo Shisui'])
        end
		
end

-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- This tells the game to update your gear after you engage or disengage a mob.  Determines if you are Dual wielding or not, how much haste you currently have, and adjusts your gear accordinly.
function job_handle_equipping_gear(playerStatus, eventArgs)
    update_combat_form()
    determine_haste_group()
end

-- This tells the game to update your gear after each event or effect in game.  E.G. You recieve a haste spell, it calculates that you have 15% haste now, and adjusts your gear accordingly, if applicable.
function job_update(cmdParams, eventArgs)
    handle_equipping_gear(player.status)
end

-- This determines if you are dual wielding or not.
function update_combat_form()
    if DW == true then
        state.CombatForm:set('DW')
    elseif DW == false then
        state.CombatForm:reset()
    end
end

-- This handles the automatic gear equipping/locking of gearsets we defined above; while idle.
function customize_idle_set(idleSet)

	if state.CombatWeapon.value == 'Chango' then
		idleSet = set_combine(idleSet, sets.Chango)
	end
	
	if state.CombatWeapon.value == 'Naegling' then
		idleSet = set_combine(idleSet, sets.Naegling)
	end

	if state.CombatWeapon.value == 'ShiningOne' then
		idleSet = set_combine(idleSet, sets.ShiningOne)
	end
	
	if state.CombatWeapon.value == 'Loxotic' then
		idleSet = set_combine(idleSet, sets.Loxotic)
	end
	
	if state.CombatWeapon.value == 'Montante' then
		idleSet = set_combine(idleSet, sets.Montante)
	end		

    if state.CP.current == 'on' then
		equip(sets.CP)
		disable('back')
    else
		enable('back')
	end	
	
	if state.Warp.current == 'on' then
		equip(sets.Warp)
		disable('head')
		disable('ring1')
		disable('ring2')
		disable('ear1')		
	else
		enable('head')
		enable('ring1')
		enable('ring2')
		enable('ear1')			
    end

    if state.TH.current == 'on' then
		equip(sets.TH)
		disable('Ammo')
		disable('Waist')
		disable('Head')
    else
		enable('Ammo')
		enable('Waist')
		enable('Head')
	end
	
    if state.Dyna.current == 'on' then
		equip(sets.Dyna)
		disable('neck')
    else
		enable('neck')
	end		

    return idleSet
end

-- This handles the automatic gear equipping/locking of gearsets we defined above; while engaged.
function customize_melee_set(meleeSet)

	if state.CombatWeapon.value == 'Chango' then
		meleeSet = set_combine(meleeSet, sets.Chango)
	end
	
	if state.CombatWeapon.value == 'Naegling' then
		meleeSet = set_combine(meleeSet, sets.Naegling)
	end

	if state.CombatWeapon.value == 'ShiningOne' then
		meleeSet = set_combine(meleeSet, sets.ShiningOne)
	end
	
	if state.CombatWeapon.value == 'Loxotic' then
		meleeSet = set_combine(meleeSet, sets.Loxotic)
	end
	
	if state.CombatWeapon.value == 'Montante' then
		meleeSet = set_combine(meleeSet, sets.Montante)
	end	
	
    if state.CP.current == 'on' then
		equip(sets.CP)
		disable('back')
    else
		enable('back')
	end	

    if state.TH.current == 'on' then
		equip(sets.TH)
		disable('Ammo')
		disable('Waist')
		disable('Head')
    else
		enable('Ammo')
		enable('Waist')
		enable('Head')
	end

    if state.Dyna.current == 'on' then
		equip(sets.Dyna)
		disable('neck')
    else
		enable('neck')
	end

    return meleeSet
end

-- Function to display the current relevant user state when doing an update.
-- Set eventArgs.handled to true if display was handled, and you don't want the default info shown.
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.Kiting.value then
        msg = msg .. '[ Kiting Mode: ON ]'
    end

    msg = msg .. ' ]'

    add_to_chat(060, msg)

    eventArgs.handled = true
end

-------------------------------------------------------------------------------------------------------------------
-- Utility functions for haste and dual weild handling.  These can/should be updated for your specific job and can be customized as you wish.
-------------------------------------------------------------------------------------------------------------------

function determine_haste_group()
    classes.CustomMeleeGroups:clear()
    if DW == true then
        if DW_needed <= 1 then
            classes.CustomMeleeGroups:append('MaxHaste')		
        elseif DW_needed > 1 and DW_needed <= 12 then
            classes.CustomMeleeGroups:append('HighHaste')			
        elseif DW_needed > 12 and DW_needed <= 21 then
            classes.CustomMeleeGroups:append('MidHaste')				
        elseif DW_needed > 21 and DW_needed <= 39 then
            classes.CustomMeleeGroups:append('LowHaste')				
        elseif DW_needed > 39 then
            classes.CustomMeleeGroups:append('')
        end
    end
end

function job_self_command(cmdParams, eventArgs)
    gearinfo(cmdParams, eventArgs)
end

function gearinfo(cmdParams, eventArgs)
    if cmdParams[1] == 'gearinfo' then
        if type(tonumber(cmdParams[2])) == 'number' then
            if tonumber(cmdParams[2]) ~= DW_needed then
            DW_needed = tonumber(cmdParams[2])
            DW = true
            end
        elseif type(cmdParams[2]) == 'string' then
            if cmdParams[2] == 'false' then
        	    DW_needed = 0
                DW = false
      	    end
        end
        if type(tonumber(cmdParams[3])) == 'number' then
          	if tonumber(cmdParams[3]) ~= Haste then
              	Haste = tonumber(cmdParams[3])
            end
        end
        if type(cmdParams[4]) == 'string' then
            if cmdParams[4] == 'true' then
                moving = true
            elseif cmdParams[4] == 'false' then
                moving = false
            end
        end
        if not midaction() then
            job_update()
        end
    end
end

-------------------------------------------------------------------------------------------------------------------
-- Macro Palletes... Pallets... Palettes?
-------------------------------------------------------------------------------------------------------------------

-- Automatically loads a Macro Set by (Pallet, Book) when you change to this job or subjob.
function select_default_macro_book()
        -- Default macro set/book
        if player.sub_job == 'SAM' then
                set_macro_page(1, 1)
        elseif player.sub_job == 'NIN' then
                set_macro_page(10, 1)
        elseif player.sub_job == 'DRG' then
                set_macro_page(2, 1)				
        else
                set_macro_page(10, 1)
        end
end

function set_lockstyle()
    send_command('wait 2; input /lockstyleset ' .. lockstyleset)
end
[+]
Offline
Posts: 1448
By fillerbunny9 2021-06-26 17:35:08
Link | Citer | R
 
these threads are almost always looking for something with all the gear input already, as opposed to a functional skeleton or even an older, working .lua whose gear choices are simply outdated. I had someone get really offended when I posted the link to a swap I was using, but the gear was 2-3 years out of date at that point.
 Asura.Eiryl
Online
Serveur: Asura
Game: FFXI
user: Eiryl
By Asura.Eiryl 2021-06-26 17:37:03
Link | Citer | R
 
That should be pretty obvious. If they wanted to put in the minimum effort they would just use search and pull one up.
[+]
 Asura.Bippin
Offline
Serveur: Asura
Game: FFXI
user: Gunit
Posts: 1088
By Asura.Bippin 2021-06-26 17:41:22
Link | Citer | R
 
So a guide showing gear that some others use?

Cause you will have to enter gear into any Lua unless you have every item in it ready to go, but would have to look through everything anyways.
Offline
Posts: 223
By joemamma 2021-06-26 17:42:40
Link | Citer | R
 
C://DOS
C://DOS/RUN
RUN/DOS/RUN

This also works:

C://NERDS
C://NERDS/PROGRAM
PROGRAM/NERDS/PROGRAM
Offline
Posts: 14593
By Pantafernando 2021-06-26 17:50:44
Link | Citer | R
 
Its on my list of addons to make something extremelly easy to create base gears for any jobs, just needing to input /ADDONNAMEequip then it will automatically trigger a sound like FF8 junction *click* then an entire set gonna be created.

Expecting to start it this year. Probably gonna finish it in 2023.
necroskull Necro Bump Detected! [465 days between previous and next post]
 Asura.Sabishii
Offline
Serveur: Asura
Game: FFXI
user: Sabishii
Posts: 230
By Asura.Sabishii 2022-10-04 12:25:55
Link | Citer | R
 
Asura.Bippin said: »
So a guide showing gear that some others use?

Cause you will have to enter gear into any Lua unless you have every item in it ready to go, but would have to look through everything anyways.

You realize there's no LUAs linked in ANY of those guides?
And the AH guide doesn't have a lua, and there's only some barebones ***, a selindril's garbage lua, and something from a private server on the first page of Google search for "FFXI gearswap SAM lua". I only got two pages, and only the stuff on page one was relevant. I have part of a friend's lua, but he only sent me the part with gear in it, because he has one of those luas that separated the gear and the guts into 2 files. Need to get the whole set, then compile the gear into it to make one file.
Offline
Posts: 495
By Hopalong 2022-10-04 13:27:10
Link | Citer | R
 
I think people take several base luas and make their own. I suggest take whatever sam base lua you have and and splice in some of Arislan's stuff.

Stuff will break and you're really gonna have to research your own answers mostly. You're never gonna find an updated/ perfect lua until you refine your own, which isn't easy.
 Asura.Bippin
Offline
Serveur: Asura
Game: FFXI
user: Gunit
Posts: 1088
By Asura.Bippin 2022-10-04 14:40:38
Link | Citer | R
 
Asura.Sabishii said: »
You realize there's no LUAs linked in ANY of those guides?
I was not trying to link to any lua


fillerbunny9 said: »
these threads are almost always looking for something with all the gear input already, as opposed to a functional skeleton or even an older, working .lua whose gear choices are simply outdated. I had someone get really offended when I posted the link to a swap I was using, but the gear was 2-3 years out of date at that point.


I was replying to this if someone was looking for gear people use.

Edit: If you looking for a file someone posted one a few pages up.
Log in to post.