Item Search
     
BG-Wiki Search
+ Reply to Thread
Page 1 of 22 1 2 3 11 ... LastLast
Results 1 to 20 of 421
  1. #1
    Special at 11:30 or w/e
    Sweaty Dick Punching Enthusiast

    Join Date
    Feb 2012
    Posts
    10,267
    BG Level
    9
    FFXIV Character
    Kalmado Espiritu
    FFXIV Server
    Gilgamesh
    FFXI Server
    Sylph
    Blog Entries
    4

    Gearswap Help Thread 2: this time it makes sense

    Because I suck at this gearswap shit. Anyways, carry on.

    Quote Originally Posted by Taint View Post
    I'm trying to add some Acc gear functions to a new gearswap. (I want 4 options instead of the 2 I've been using)

    Here is the error message:

    Gearswap: Loaded your Sirtaint_BLU.lua file!
    Gearswap: Lua runtime error: gearswap/flow.lua:346:
    Gearswap has detected an error in the user function get_set:
    ...86)windower4/addons/gearswap/data/Sirtaint_BLU.lua:34: attempt to call global 'update_combat_form' (a nil value)

    Here is my lua.
    Spoiler: show

    -------------------------------------------------------------------------------------------------------------------
    -- 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.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
    end

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

    -- Setup vars that are user-dependent.
    function user_setup()
    state.OffenseModeptions('Normal', 'LowAcc', 'MidAcc', 'MaxAcc')
    state.HybridModeptions('Normal', 'LightPDT', 'FullPDT')
    state.WeaponskillModeptions('Normal', 'LowAcc', 'MaxAcc')
    state.PhysicalDefenseModeptions('PDT', 'Reraise')

    update_combat_form()

    -- Additional local binds
    send_command('bind ^` input /ja "Hasso" <me>')
    send_command('bind !` input /ja "Seigan" <me>')

    select_default_macro_book()
    end


    -- Called when this job file is unloaded (eg: job change)
    function user_unload()
    send_command('unbind ^`')
    send_command('unbind !-')
    end


    -- Define sets and vars used by this job file.
    function init_gear_sets()
    --------------------------------------
    -- Start defining the sets
    --------------------------------------

    -- Precast Sets
    -- Precast sets to enhance JAs
    sets.precast.JA.Meditate = {head="Wakido Kabuto",hands="Sakonji Kote +1",back="Smertrios's Mantle"}
    sets.precast.JA['Warding Circle'] = {head="Myochin Kabuto"}
    sets.precast.JA['Blade Bash'] = {hands="Sakonji Kote +1"}
    sets.precast.JA.Hasso = {hands="Wakido Kote +3"}

    -- Waltz set (chr and vit)
    sets.precast.Waltz = {ammo="Sonia's Plectrum",
    head="Yaoyotl Helm",
    body="Otronif Harness +1",hands="Buremte Gloves",ring1="Spiral Ring",
    back="Iximulew Cape",waist="Caudata Belt",legs="Karieyh Brayettes +1",feet="Otronif Boots +1"}

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


    -- Weaponskill sets
    -- Default set for any weaponskill that isn't any more specifically defined
    sets.precast.WS = {}
    sets.precast.WS.LowAcc = {}
    sets.precast.WS.MaxAcc = {}

    -- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
    sets.precast.WS['Savage Blade'] = set_combine(sets.precast.WS, {neck="Fotia Gorget"})
    sets.precast.WS['Savage Blade'].LowAcc = set_combine(sets.precast.WS.LowAcc, {neck="Fotia Gorget"})
    sets.precast.WS['Savage Blade'].MaxAcc = set_combine(sets.precast.WS.MaxACC, {waist="Fotia Belt"})




    -- Midcast Sets
    sets.midcast.FastRecast = {
    head="Yaoyotl Helm",
    body="Otronif Harness +1",hands="Otronif Gloves",
    legs="Phorcys Dirs",feet="Otronif Boots +1"}


    -- Sets to return to when not performing an action.

    -- Resting sets
    sets.resting = {neck="Wiglen Gorget",ring1="Sheltered Ring",ring2="Paguroidea Ring"}


    -- Idle sets (default idle set not needed since the other three are defined, but leaving for testing purposes)
    sets.idle.Town = {
    ammo="Staunch Tathlum +1",
    head="Twilight Helm",
    body="Hiza. Haramaki +1",
    hands={ name="Sakonji Kote +1", augments={'Enhances "Blade Bash" effect',}},
    legs="Arjuna Breeches",
    feet="Danzo Sune-Ate",
    neck="Sanctity Necklace",
    waist="Flume Belt",
    left_ear="Odnowa Earring",
    right_ear="Odnowa Earring +1",
    left_ring="Sheltered Ring",
    right_ring="Paguroidea Ring",
    back="Shadow Mantle"}

    sets.idle.Field = {
    ammo="Staunch Tathlum +1",
    head="Twilight Helm",
    body="Hiza. Haramaki +1",
    hands={ name="Sakonji Kote +1", augments={'Enhances "Blade Bash" effect',}},
    legs="Arjuna Breeches",
    feet="Danzo Sune-Ate",
    neck="Sanctity Necklace",
    waist="Flume Belt",
    left_ear="Odnowa Earring",
    right_ear="Odnowa Earring +1",
    left_ring="Sheltered Ring",
    right_ring="Paguroidea Ring",
    back="Shadow Mantle"}

    sets.idle.Weak = {
    ammo="Staunch Tathlum +1",
    head="Twilight Helm",
    body="Twilight Mail",
    hands={ name="Sakonji Kote +1", augments={'Enhances "Blade Bash" effect',}},
    legs="Arjuna Breeches",
    feet="Danzo Sune-Ate",
    neck="Sanctity Necklace",
    waist="Flume Belt",
    left_ear="Odnowa Earring",
    right_ear="Odnowa Earring +1",
    left_ring="Sheltered Ring",
    right_ring="Paguroidea Ring",
    back="Shadow Mantle"}

    -- Defense sets
    sets.defense.PDT = {
    ammo="Staunch Tathlum +1",
    head="Ken. Jinpachi",
    body="Wakido Domaru +3",
    hands="Sakonji Kote +1",
    legs="Ken. Hakama",
    feet="Plumb Boots",
    neck="Loricate Torque +1",
    waist="Flume Belt +1",
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Defending Ring",
    right_ring="Dark Ring",
    back="Moonbeam Cape",
    }

    sets.defense.Reraise = {
    head="Twilight Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
    body="Twilight Mail",hands="Buremte Gloves",ring1="Defending Ring",ring2="Paguroidea Ring",
    back="Shadow Mantle",waist="Flume Belt",legs="Karieyh Brayettes +1",feet="Otronif Boots +1"}

    sets.defense.MDT = {ammo="Demonry Stone",
    head="Yaoyotl Helm",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
    body="Otronif Harness +1",hands="Otronif Gloves",ring1="Defending Ring",ring2="Shadow Ring",
    back="Engulfer Cape",waist="Flume Belt",legs="Karieyh Brayettes +1",feet="Otronif Boots +1"}

    sets.Kiting = {feet="Danzo Sune-ate"}

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

    -- Engaged sets

    -- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
    -- sets if more refined versions aren't defined.
    -- If you create a set with both offense and defense modes, the offense mode should be first.
    -- EG: sets.engaged.Dagger.Accuracy.Evasion

    -- Normal melee group
    -- Delay 450 GK, 25 Save TP => 65 Store TP for a 5-hit (25 Store TP in gear)
    sets.engaged = {
    ammo="Ginsen",
    head="Flam. Zucchetto +2",
    body="Kasuga domaru +1",
    hands="Wakido kote +3",
    legs="Ryuo hakama +1",
    feet="Ryuo Sune-Ate +1",
    neck="Moonlight nodowa",
    waist="Ioskeha Belt",
    left_ear="Telos Earring",
    right_ear="Dedition Earring",
    left_ring="Niqmaddu Ring",
    right_ring="Flamma Ring",
    back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10',}},
    }
    sets.engaged.LowAcc = {
    ammo="Ginsen",
    head="Flam. Zucchetto +2",
    body="Kendatsuba samue",
    hands="Wakido Kote +3",
    legs="Kendatsuba hakama",
    feet="Flam. gambieras +2",
    neck="Moonlight Nodowa",
    waist="Ioskeha Belt",
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Niqmaddu Ring",
    right_ring="Flamma Ring",
    back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10',}},
    }

    sets.engaged.MidAcc = {
    ammo="Ginsen",
    head="Flam. Zucchetto +2",
    body="Kendatsuba samue",
    hands="Wakido Kote +3",
    legs="Kendatsuba hakama",
    feet="Flam. gambieras +2",
    neck="Moonlight Nodowa",
    waist="Ioskeha Belt",
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Niqmaddu Ring",
    right_ring="Flamma Ring",
    back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10',}},
    }

    sets.engaged.MaxAcc = {
    ammo="Ginsen",
    head="Flam. Zucchetto +2",
    body="Kendatsuba samue",
    hands="Wakido Kote +3",
    legs="Kendatsuba hakama",
    feet="Flam. gambieras +2",
    neck="Moonlight Nodowa",
    waist="Ioskeha Belt",
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Niqmaddu Ring",
    right_ring="Flamma Ring",
    back={ name="Smertrios's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','Accuracy+10','"Dbl.Atk."+10',}},
    }

    sets.engaged.PDT = {ammo="Staunch Tathlum +1",
    head="Ken. Jinpachi",
    body="Wakido Domaru +3",
    hands="Wakido Kote +3",
    legs="Ken. Hakama",
    feet="Ryuo Sune-Ate +1",
    neck="Loricate Torque +1",
    waist="Ioskeha Belt",
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Defending Ring",
    right_ring={ name="Dark Ring", augments={'Magic dmg. taken -5%','Phys. dmg. taken -5%',}},
    back="Moonbeam Cape",
    }
    sets.engaged.LowAcc.PDT = {ammo="Staunch Tathlum +1",
    head="Ken. Jinpachi",
    body="Wakido Domaru +3",
    hands="Wakido Kote +3",
    legs="Ken. Hakama",
    feet="Ryuo Sune-Ate +1",
    neck="Loricate Torque +1",
    waist="Ioskeha Belt",
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Defending Ring",
    right_ring={ name="Dark Ring", augments={'Magic dmg. taken -5%','Phys. dmg. taken -5%',}},
    back="Moonbeam Cape",
    }

    sets.engaged.MidAcc.PDT = {ammo="Staunch Tathlum +1",
    head="Ken. Jinpachi",
    body="Wakido Domaru +3",
    hands="Wakido Kote +3",
    legs="Ken. Hakama",
    feet="Ryuo Sune-Ate +1",
    neck="Loricate Torque +1",
    waist="Ioskeha Belt",
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Defending Ring",
    right_ring={ name="Dark Ring", augments={'Magic dmg. taken -5%','Phys. dmg. taken -5%',}},
    back="Moonbeam Cape",
    }

    sets.engaged.MaxAcc.PDT = {ammo="Staunch Tathlum +1",
    head="Ken. Jinpachi",
    body="Wakido Domaru +3",
    hands="Wakido Kote +3",
    legs="Ken. Hakama",
    feet="Ryuo Sune-Ate +1",
    neck="Loricate Torque +1",
    waist="Ioskeha Belt",
    left_ear="Cessance Earring",
    right_ear="Telos Earring",
    left_ring="Defending Ring",
    right_ring={ name="Dark Ring", augments={'Magic dmg. taken -5%','Phys. dmg. taken -5%',}},
    back="Moonbeam Cape",
    }


    sets.engaged.Reraise = {}
    sets.engaged.LowAcc.Reraise = {}
    sets.engaged.MidAcc.Reraise = {}
    sets.engaged.MaxAcc.Reraise = {}


    end


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

    -- Set eventArgs.handled to true if we don't want any automatic target handling to be done.
    function job_pretarget(spell, action, spellMap, eventArgs)
    if spell.type == 'WeaponSkill' then
    -- Change any GK weaponskills to polearm weaponskill if we're using a polearm.
    if player.equipment.main=='Quint Spear' or player.equipment.main=='Quint Spear' then
    if spell.english:startswith("Tachi:") then
    send_command('@input /ws "Penta Thrust" '..spell.target.raw)
    eventArgs.cancel = true
    end
    end
    end
    end

    -- Run after the default precast() is done.
    -- eventArgs is the same one used in job_precast, in case information needs to be persisted.
    function job_post_precast(spell, action, spellMap, eventArgs)
    if spell.type:lower() == 'weaponskill' then
    if state.Buff.Sekkanoki then
    equip(sets.buff.Sekkanoki)
    end
    if state.Buff.Sengikori then
    equip(sets.buff.Sengikori)
    end
    if state.Buff['Meikyo Shisui'] then
    equip(sets.buff['Meikyo Shisui'])
    end
    end
    end


    -- Run after the default midcast() is done.
    -- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
    function job_post_midcast(spell, action, spellMap, eventArgs)
    -- Effectively lock these items in place.
    if state.HybridMode.value == 'Reraise' or
    (state.DefenseMode.value == 'Physical' and state.PhysicalDefenseMode.value == 'Reraise') then
    equip(sets.Reraise)
    end
    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_combat_form()
    end

    -- Set eventArgs.handled to true if we don't want the automatic display to be run.
    function display_current_job_state(eventArgs)

    end

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



    -- Select default macro book on initial load or subjob change.
    function select_default_macro_book()
    set_macro_page(1, 1)
    end



    Userfunctions (unedited from motenns)

    Spoiler: show

    --Copyright (c) 2013~2016, Byrthnoth
    --All rights reserved.

    --Redistribution and use in source and binary forms, with or without
    --modification, are permitted provided that the following conditions are met:

    -- * Redistributions of source code must retain the above copyright
    -- notice, this list of conditions and the following disclaimer.
    -- * Redistributions in binary form must reproduce the above copyright
    -- notice, this list of conditions and the following disclaimer in the
    -- documentation and/or other materials provided with the distribution.
    -- * Neither the name of <addon name> nor the
    -- names of its contributors may be used to endorse or promote products
    -- derived from this software without specific prior written permission.

    --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
    --ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    --WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    --DISCLAIMED. IN NO EVENT SHALL <your name> BE LIABLE FOR ANY
    --DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    --(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    --LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    --ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    --(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    --SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


    -- Functions that are directly exposed to users --


    function set_language(lang)
    if _global.current_event ~= 'get_sets' then
    error('\nGearSwap: set_language() is only valid in the get_sets function', 2)
    return
    end
    if lang and type(lang) == 'string' and (lang == 'english' or lang == 'japanese') then
    rawset(_G,'language',lang)
    refresh_globals()
    else
    error('\nGearSwap: set_language() was passed an invalid value ('..tostring(lang)..'). (must be a string)', 2)
    end
    end

    function debug_mode(boolean)
    if type(boolean) == "boolean" then _settings.debug_mode = boolean
    elseif boolean == nil then
    _settings.debug_mode = true
    else
    error('\nGearSwap: show_swaps() was passed an invalid value ('..tostring(boolean)..'). (true/no value/nil=on, false=off)', 2)
    end
    end

    function show_swaps(boolean)
    if type(boolean) == "boolean" then _settings.show_swaps = boolean
    elseif boolean == nil then
    _settings.show_swaps = true
    else
    error('\nGearSwap: show_swaps() was passed an invalid value ('..tostring(boolean)..'). (true/no value/nil=on, false=off)', 2)
    end
    end

    function cancel_spell(boolean)
    if _global.current_event ~= 'precast' and _global.current_event ~= 'pretarget' and _global.current_event ~= 'filtered_action' then
    error('\nGearSwap: cancel_spell() is only valid in the precast, pretarget, or filtered_action functions', 2)
    return
    end
    if type(boolean) == "boolean" then _global.cancel_spell = boolean
    elseif boolean == nil then
    _global.cancel_spell = true
    else
    error('\nGearSwap: cancel_spell() was passed an invalid value ('..tostring(boolean)..'). (true/no value/nil=Cancel the spell, false=do not cancel the spell)', 2)
    end
    end

    function move_spell_target(position_table)
    if _global.current_event ~= 'precast' then
    error('\nGearSwap: move_spell_target() is only valid in the precast function', 2)
    return
    end

    if type(position_table) == 'table' and type(position_table.x or position_table.X) == 'number' and
    type(position_table.y or position_table.Y) == 'number' and
    type(position_table.z or positino_table.Z) == 'number' then
    _global.target_arrow.x = position_table.x or position_table.X
    _global.target_arrow.y = position_table.y or position_table.Y
    _global.target_arrow.z = position_table.z or position_table.Z
    print_set(_global.target_arrow)
    else
    error('\nGearSwap: move_spell_target() was passed an invalid value ('..tostring(position_table)..'). Should be a table with x, y, and z keys (offset from target)', 2)
    end
    end

    function change_target(name)
    if _global.current_event ~= 'pretarget' then
    error('\nGearSwap: change_target() is only valid in the pretarget function', 2)
    return
    end
    if name and type(name)=='string' then
    if valid_target(name) then
    _,_global.new_target = valid_target(name)
    else
    error('\nGearSwap: change_target() was passed an invalid value ('..tostring(name)..'). (must be a valid target)', 2)
    end
    else
    error('\nGearSwap: change_target() was passed an invalid value ('..tostring(name)..'). (must be a string)', 2)
    end
    end

    function cast_delay(delay)
    if _global.current_event ~= 'precast' and _global.current_event ~= 'pretarget' then
    error('\nGearSwap: cast_delay() is only valid in the precast and pretarget functions', 2)
    return
    end
    if tonumber(delay) then
    _global[_global.current_event.."_cast_delay"] = tonumber(delay)
    else
    error('\nGearSwap: cast_delay() was passed an invalid value ('..tostring(delay)..'). (cast delay must be a number of seconds)', 2)
    end
    end

    -- Combines the provided gear sets into a new set. Returns the result.
    function set_combine(...)
    return set_merge(false,{}, ...)
    end

    -- Combines the provided gear sets into the equip_list set.
    function equip(...)
    set_merge(true,equip_list, ...)
    end

    function disable(...)
    local disable_tab = {...}
    if type(disable_tab[1]) == 'table' then
    disable_tab = disable_tab[1] -- Compensates for people passing a table instead of a series of strings.
    end
    for i,v in pairs(disable_tab) do
    if slot_map[v] then
    rawset(disable_table,slot_map[v],true)
    else
    error('\nGearSwap: disable error, passed an unrecognized slot name. ('..tostring(v)..')',2)
    end
    end
    end

    function enable(...)
    local enable_tab = {...}
    if type(enable_tab[1]) == 'table' then
    enable_tab = enable_tab[1] -- Compensates for people passing a table instead of a series of strings.
    end
    local sending_table = {}
    for i,v in pairs(enable_tab) do
    local local_slot = get_default_slot(v)
    if local_slot then
    disable_table[toslotid(v)] = false
    if not_sent_out_equip[local_slot] then
    sending_table[local_slot] = not_sent_out_equip[local_slot]
    not_sent_out_equip[local_slot] = nil
    end
    else
    error('\nGearSwap: enable error, passed an unrecognized slot name. ('..tostring(v)..')',2)
    end
    end

    return sending_table
    end

    function user_enable(...)
    local sending_table = enable(...)

    if table.length(sending_table) > 0 then
    equip(sending_table)
    end
    return sending_table
    end

    function command_enable(...)
    local sending_table = enable(...)

    if table.length(sending_table) > 0 then
    refresh_globals()
    equip_sets('equip_command',nil,sending_table)
    end
    end

    function print_set(set,title)
    if not set then
    if title then
    error('\nGearSwap: print_set error, '..windower.to_shift_jis(tostring(title))..' set is nil.', 2)
    else
    error('\nGearSwap: print_set error, set is nil.', 2)
    end
    return
    elseif type(set) ~= 'table' then
    if title then
    error('\nGearSwap: print_set error, '..windower.to_shift_jis(tostring(title))..' set is not a table.', 2)
    else
    error('\nGearSwap: print_set error, set is not a table.', 2)
    end
    end
    if table.length(set) == 0 then
    if title then
    msg.add_to_chat(1,'------------------'.. windower.to_shift_jis(tostring(title))..' -- Empty Table -----------------')
    else
    msg.add_to_chat(1,'-------------------------- Empty Table -------------------------')
    end
    return
    elseif title then
    msg.add_to_chat(1,'------------------------- '..windower.to_shift_jis(tostring(title))..' -------------------------')
    else
    msg.add_to_chat(1,'----------------------------------------------------------------')
    end
    local function print_element(key,value)
    if type(value) == 'table' and value.name then
    msg.add_to_chat(8,windower.to_shift_jis(tostring(k ey))..' '..windower.to_shift_jis(tostring(value.name))..' (Adv.)')
    else
    msg.add_to_chat(8,windower.to_shift_jis(tostring(k ey))..' '..windower.to_shift_jis(tostring(value)))
    end
    end
    local function cmp_key(key,tab)
    for k in pairs(tab) do
    if k:lower() == key:lower() then
    return k
    end
    end
    end

    if #set == table.length(set) then -- If it is a list (keyed by continuous whole number starting at 1), then print it out in order
    for key,value in ipairs(set) do
    print_element(key,value)
    end
    else -- Otherwise, try to print out the gear in order and then everything else.
    for _,key in ipairs({'main','sub','ranged','range','ammo','head ','neck','lear','ear1','learring','left_ear','rear ','ear2','rearring','right_ear','body','hands','lr ing','ring1','left_ring','rring','ring2','right_ri ng','back','waist','legs','feet'}) do
    local k = cmp_key(key,set)
    if k then
    print_element(k,set[k])
    end
    end
    for key,value in pairs(set) do
    if not slot_map[key] then
    print_element(key,set[key])
    end
    end
    end
    msg.add_to_chat(1,'----------------------------------------------------------------')
    end

    function send_cmd_user(command)
    if string.byte(1) ~= 0x40 then
    command='@'..command
    end
    windower.send_command(command)
    end

    function register_event_user(str,func)
    if type(func)~='function' then
    error('\nGearSwap: windower.register_event() was passed an invalid value ('..tostring(func)..'). (must be a function)', 2)
    elseif type(str) ~= 'string' then
    error('\nGearSwap: windower.register_event() was passed an invalid value ('..tostring(str)..'). (must be a string)', 2)
    end
    local id = windower.register_event(str,user_equip_sets(func))
    registered_user_events[id] = true
    return id
    end

    function raw_register_event_user(str,func)
    if type(func)~='function' then
    error('\nGearSwap: windower.register_event() was passed an invalid value ('..tostring(func)..'). (must be a function)', 2)
    elseif type(str) ~= 'string' then
    error('\nGearSwap: windower.register_event() was passed an invalid value ('..tostring(str)..'). (must be a string)', 2)
    end
    local id = windower.register_event(str,setfenv(func,user_env) )
    registered_user_events[id] = true
    return id
    end

    function unregister_event_user(id)
    if type(id)~='number' then
    error('\nGearSwap: windower.unregister_event() was passed an invalid value ('..tostring(id)..'). (must be a number)', 2)
    end
    windower.unregister_event(id)
    registered_user_events[id] = nil
    end

    function user_equip_sets(func)
    return setfenv(function(...)
    if not gearswap.gearswap_disabled then
    gearswap.refresh_globals(true)
    return gearswap.equip_sets(func,nil,...)
    end
    end,user_env)
    end

    function user_unhandled_command(func)
    if type(func) ~= 'function' then
    error('\nGearSwap: unhandled_command was passed an invalid value ('..tostring(func)..'). (must be a function)', 2)
    end
    unhandled_command_events[#unhandled_command_events+1] = setfenv(func,user_env)
    end

    function include_user(str, load_include_in_this_table)
    if not (type(str) == 'string') then
    error('\nGearSwap: include() was passed an invalid value ('..tostring(str)..'). (must be a string)', 2)
    end

    str = str:lower()
    if type(package.loaded[str]) == 'table' then
    return package.loaded[str]
    elseif T{'pack'}:contains(str) then
    return
    end

    if str:sub(-4)~='.lua' then str = str..'.lua' end
    local path, loaded_values = pathsearch({str})

    if not path then
    error('\nGearSwap: Cannot find the include file ('..tostring(str)..').', 2)
    end

    local f, err = loadfile(path)
    if f and not err then
    if load_include_in_this_table and type(load_include_in_this_table) == 'table' then
    setmetatable(load_include_in_this_table, {__index=user_env._G})
    setfenv(f, load_include_in_this_table)
    pcall(f, load_include_in_this_table)
    return load_include_in_this_table
    else
    setfenv(f,user_env)
    return f()
    end
    else
    error('\nGearSwap: Error loading file ('..tostring(str)..'): '..err, 2)
    end
    end

    -- Allow the user to set a path subdirectory to check when searching for included files.
    -- This path is checked as a subdirectory to each fixed path, before the fixed path itself is checked.
    -- Path argument can only be a string; otherwise this is set to nil.
    function user_include_path(path)
    if type(path) == 'string' then
    include_user_path = path
    else
    include_user_path = nil
    end
    end


    function user_midaction(bool)
    if bool == false then
    for i,v in pairs(command_registry) do
    if v.midaction then
    command_registry[i].midaction = false
    end
    end
    end

    for i,v in pairs(command_registry) do
    if type(v) == 'table' and v.midaction then
    return true, v.spell
    end
    end

    return false
    end

    function user_pet_midaction(bool)
    if bool == false then
    for i,v in pairs(command_registry) do
    if v.pet_midaction then
    command_registry.pet_midaction = false
    end
    end
    end

    for i,v in pairs(command_registry) do
    if v.pet_midaction then
    return true, v.spell
    end
    end

    return false
    end

    function add_to_chat_user(num,str)
    local backup_str
    if type(num) == 'string' then
    -- It was passed a string as the first argument.
    str = not tonumber(str) and str or num
    num = 8
    elseif not num and str and type(str) == 'string' then
    -- It only needs the number.
    num=8
    end

    if language == 'japanese' then
    msg.add_to_chat(num,windower.to_shift_jis(str))
    else
    msg.add_to_chat(num,str)
    end
    end


    function user_sleep(delay)
    if not delay then
    error('\nGearSwap: coroutine.sleep() not passed a delay value', 2)
    elseif type(delay) ~= 'number' or delay < 0 then
    error('\nGearSwap: coroutine.sleep() was passed an invalid value ('..tostring(delay)..'). (must be a number >= 0)', 2)
    else
    coroutine.yield('sleep',delay)
    end
    end

    function user_yield()
    coroutine.yield('yield')
    end


    -- Define the user windower functions.
    user_windower = {register_event = register_event_user, raw_register_event = raw_register_event_user,
    unregister_event = unregister_event_user, send_command = send_cmd_user,add_to_chat=add_to_chat_user}
    user_coroutine = coroutine
    user_coroutine.sleep = user_sleep
    user_coroutine.yield = user_yield
    setmetatable(user_windower,{__index=windower})



    Maybe I'm going about it wrong? My goal is 4 acc options for gear sets.

  2. #2
    RIDE ARMOR
    Join Date
    Jun 2010
    Posts
    15
    BG Level
    1
    FFXI Server
    Lakshmi

    The error that you're getting is from trying to call a function that doesn't exist, namely update_combat_form(). The easiest way to resolve that specific error is to add

    function update_combat_form()
    end

    to the end of your lua file (or remove all calls to update_combat_form()).

  3. #3
    A. Body
    Join Date
    Jun 2007
    Posts
    4,445
    BG Level
    7
    FFXIV Character
    Sir Taint
    FFXIV Server
    Gilgamesh
    FFXI Server
    Cerberus

    Quote Originally Posted by danpelope View Post
    The error that you're getting is from trying to call a function that doesn't exist, namely update_combat_form(). The easiest way to resolve that specific error is to add

    function update_combat_form()
    end

    to the end of your lua file (or remove all calls to update_combat_form()).

    Do you mind explaining what that does?

    And the fix is leave the “update combat forms” already existing and add a final one at the end?

  4. #4

    Quote Originally Posted by Taint View Post
    Do you mind explaining what that does?

    And the fix is leave the “update combat forms” already existing and add a final one at the end?
    the reason is there is have no function to call called update_combat_form
    there is not one in your code or in motes code
    it looks like you copied it from someone elses code and put it in your code

  5. #5
    A. Body
    Join Date
    Jun 2007
    Posts
    4,445
    BG Level
    7
    FFXIV Character
    Sir Taint
    FFXIV Server
    Gilgamesh
    FFXI Server
    Cerberus

    Quote Originally Posted by dlsmd View Post
    the reason is there is have no function to call called update_combat_form
    there is not one in your code or in motes code
    it looks like you copied it from someone elses code and put it in your code

    Thanks for all the info.

    The base stems right from Moten's stash:

    https://github.com/Kinematics/GearSw...master/SAM.lua


    26

    27 -- Setup vars that are user-dependent.
    28 function user_setup()
    29 state.OffenseModeptions('Normal', 'Acc')
    30 state.HybridModeptions('Normal', 'PDT', 'Reraise')
    31 state.WeaponskillModeptions('Normal', 'Acc', 'Mod')
    32 state.PhysicalDefenseModeptions('PDT', 'Reraise')
    33

    34 update_combat_form()
    35
    36 -- Additional local binds
    37 send_command('bind ^` input /ja "Hasso" <me>')
    38 send_command('bind !` input /ja "Seigan" <me>')
    39

    40 select_default_macro_book()
    41 end


    I'm updating that LUA and trying to add more set options. It works fine with the above listed items. When I add more set options (normal, lowacc,midacc,maxacc) I get the error. Hope this helps.

  6. #6

    Quote Originally Posted by Taint View Post
    Thanks for all the info.

    The base stems right from Moten's stash:

    https://github.com/Kinematics/GearSw...master/SAM.lua


    26

    27 -- Setup vars that are user-dependent.
    28 function user_setup()
    29 state.OffenseModeptions('Normal', 'Acc')
    30 state.HybridModeptions('Normal', 'PDT', 'Reraise')
    31 state.WeaponskillModeptions('Normal', 'Acc', 'Mod')
    32 state.PhysicalDefenseModeptions('PDT', 'Reraise')
    33

    34 update_combat_form()
    35
    36 -- Additional local binds
    37 send_command('bind ^` input /ja "Hasso" <me>')
    38 send_command('bind !` input /ja "Seigan" <me>')
    39

    40 select_default_macro_book()
    41 end


    I'm updating that LUA and trying to add more set options. It works fine with the above listed items. When I add more set options (normal, lowacc,midacc,maxacc) I get the error. Hope this helps.
    ok on motes file he has this at line 285
    Code:
    function update_combat_form()
        if areas.Adoulin:contains(world.area) and buffactive.ionis then
            state.CombatForm:set('Adoulin')
        else
            state.CombatForm:reset()
        end
    end
    if you used motes as you base you missed it in your code around line 381

  7. #7
    Salvage Bans
    Join Date
    Dec 2006
    Posts
    888
    BG Level
    5
    FFXI Server
    Leviathan

    really basic question about keybinds- how do I differenciate between the zero key above the letters (NOT the one I want to bind) and the zero key on the numberpad (the one I DO want to bind)?

  8. #8
    A. Body
    Join Date
    Jun 2007
    Posts
    4,445
    BG Level
    7
    FFXIV Character
    Sir Taint
    FFXIV Server
    Gilgamesh
    FFXI Server
    Cerberus

    Quote Originally Posted by danpelope View Post
    The error that you're getting is from trying to call a function that doesn't exist, namely update_combat_form(). The easiest way to resolve that specific error is to add

    function update_combat_form()I
    end

    to the end of your lua file (or remove all calls to update_combat_form()).
    This ended up working. Thanks!

  9. #9
    Melee Summoner
    Join Date
    Dec 2009
    Posts
    35
    BG Level
    1
    FFXI Server
    Sylph

    I was wandering if someone had a code to make you change spell if the spell you trying to cast is still on timer?

  10. #10

    Quote Originally Posted by Celebrindor View Post
    really basic question about keybinds- how do I differenciate between the zero key above the letters (NOT the one I want to bind) and the zero key on the numberpad (the one I DO want to bind)?
    this is an O: O
    this is a zero: 0
    -so O are round and zeros are flattened but this is based on the font you use
    Quote Originally Posted by darkreign View Post
    I was wandering if someone had a code to make you change spell if the spell you trying to cast is still on timer?
    Code:
    if not windower.ffxi.get_spell_recasts()[spell.recast_id] == 0 then
        cancel_spell()
        send_command('input your_spell_command_here')
    end

  11. #11
    Radsourceful

    Join Date
    Jul 2007
    Posts
    1,964
    BG Level
    6
    FFXI Server
    Bismarck

    Quote Originally Posted by Celebrindor View Post
    really basic question about keybinds- how do I differenciate between the zero key above the letters (NOT the one I want to bind) and the zero key on the numberpad (the one I DO want to bind)?
    Haven't tried this myself, but based on http://www.ffxiah.com/forum/topic/47...board-buttons/ you'll want to try "bind numpad0 _____"

  12. #12
    Melee Summoner
    Join Date
    Dec 2009
    Posts
    35
    BG Level
    1
    FFXI Server
    Sylph

    can someone help me with my files I don't understand why my twilight cape and my hachirin-no-obi( both in my include under gear.elementa.obi or cape) do not equip while im under aurorastorm.

    Register to see the NSFW content
    Register to see the NSFW content

  13. #13
    Old Merits
    Join Date
    Nov 2015
    Posts
    1,181
    BG Level
    6
    FFXI Server
    Asura
    WoW Realm
    Cho'gall

    Quote Originally Posted by darkreign View Post
    I was wandering if someone had a code to make you change spell if the spell you trying to cast is still on timer?
    If you are looking for a spell degradation setup so that you cast the next lower rank spell of the same element, there is a way to do that.

    Put this at the beginning of the file:
    Spoiler: show
    Code:
    degrade_tables = {}
    degrade_tables.Fire = {"Fire","Fire II","Fire III","Fire IV","Fire V","Fire VI","Firaga","Firaga II","Firaga III","Firaja"}
    degrade_tables.Stone = {"Stone","Stone II","Stone III","Stone IV","Stone V","Stone VI","Stonega","Stonega II","Stonega III","Stoneja"}
    degrade_tables.Aero = {"Aero","Aero II","Aero III","Aero IV","Aero V","Aero VI","Aeroga","Aeroga II","Aeroga III","Aeroja"}
    degrade_tables.Water = {"Water","Water II","Water III","Water IV","Water V","Water VI","Waterga","Waterga II","Waterga III","Waterja"}
    degrade_tables.Blizzard = {"Blizzard","Blizzard II","Blizzard III","Blizzard IV","Blizzard V","Blizzard VI","Blizzaga","Blizzaga II","Blizzaga III","Blizzaja"}
    degrade_tables.Thunder = {"Thunder","Thunder II","Thunder III","Thunder IV","Thunder V","Thunder VI","Thundaga","Thundaga II","Thundaga III","Thundaja"}
    degrade_tables.Cure = {"Cure","Cure II","Cure III","Cure IV","Cure V","Cure VI","Curaga","Curaga II","Curaga III","Curaga IV","Curaga V"}


    Then in the section for gear sets, add the set:
    Code:
    sets.SpaeCoat = {body="Spaekona's Coat +3"}
    Adjust it to whichever version you have for BLM. You can change the set name as long as you change it in the code below as well, and/or add a rule for similar gear for non-BLM jobs.

    Then put these functions at the end of the file:
    Spoiler: show
    Code:
    function mpcheck(spell)
    	if spell.mppaftercast < 50 then
    		equip(sets.SpaeCoat)
    	end
    end
    
    function pretarget(spell)
        local spell_recasts = windower.ffxi.get_spell_recasts()
        if (spell_recasts[spell.recast_id]>0 or player.mp<actual_cost(spell)) and find_degrade_table(spell) then      
            degrade_spell(spell,find_degrade_table(spell))
        end
    end
    
    function find_degrade_table(lookup_spell)
        for __,spells in pairs(degrade_tables) do
            for ___,spell in pairs(spells) do
                if spell == lookup_spell.english then
                    return spells
                end
            end
        end
        return false
    end
    
    function degrade_spell(spell,degrade_array)
        local spell_index = table.find(degrade_array,spell.english)
        if spell_index>1 then        
            local new_spell = degrade_array[spell_index - 1]
            change_spell(new_spell,spell.target.raw)
            add_to_chat(140,spell.english..' has been canceled. Using '..new_spell..' instead.')
        end
    end
     
    function change_spell(spellName,target)
        cancel_spell()
        send_command(spellName:gsub('%s','')..' '..target)
    end
     
    function actual_cost(spell)
        local cost = spell.mp_cost
        if spell.type=="WhiteMagic" then
            if buffactive["Penury"] then
                return cost*.5
            elseif buffactive["Light Arts"] or buffactive["Addendum: White"] then
                return cost*.9
            elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
                return cost*1.1
            end
        elseif spell.type=="BlackMagic" then
            if buffactive["Parsimony"] then
                return cost*.5
            elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
                return cost*.9
            elseif buffactive["Light Arts"] or buffactive["Addendum: White"] then
                return cost*1.1
            end   
        end
        return cost
    end
    
    function filtered_action(spell) 
        if find_degrade_table(spell) then degrade_spell(spell,find_degrade_table(spell))
    	else equip(sets.Idle[Idle_Set_Names[Idle_Index]])	
        end
    end


    This setup even works for Cure/Curaga and the various elemental AOEs. ^^ I never use them, but if you want to include AM, just add them to the list at the top wherever you want them in the sequential order.

    EDIT: This is for non-Mote LUAs btw. Since I don't use Mote, I'm not sure if there won't be any conflicts with existing functions. If you already have a "pretarget" function for instance, you should be able to add my code inside of your existing one and I think it should work, as long as it does not conflict with the code you already have.

    In case it helps, here's my full BLM LUA:
    Spoiler: show
    Code:
    degrade_tables = {}
    degrade_tables.Fire = {"Fire","Fire II","Fire III","Fire IV","Fire V","Fire VI","Firaga","Firaga II","Firaga III","Firaja"}
    degrade_tables.Stone = {"Stone","Stone II","Stone III","Stone IV","Stone V","Stone VI","Stonega","Stonega II","Stonega III","Stoneja"}
    degrade_tables.Aero = {"Aero","Aero II","Aero III","Aero IV","Aero V","Aero VI","Aeroga","Aeroga II","Aeroga III","Aeroja"}
    degrade_tables.Water = {"Water","Water II","Water III","Water IV","Water V","Water VI","Waterga","Waterga II","Waterga III","Waterja"}
    degrade_tables.Blizzard = {"Blizzard","Blizzard II","Blizzard III","Blizzard IV","Blizzard V","Blizzard VI","Blizzaga","Blizzaga II","Blizzaga III","Blizzaja"}
    degrade_tables.Thunder = {"Thunder","Thunder II","Thunder III","Thunder IV","Thunder V","Thunder VI","Thundaga","Thundaga II","Thundaga III","Thundaja"}
    degrade_tables.Cure = {"Cure","Cure II","Cure III","Cure IV","Cure V","Cure VI","Curaga","Curaga II","Curaga III","Curaga IV","Curaga V"}
    
    elemental_debuffs = S{'Burn', 'Frost', 'Choke', 'Rasp', 'Shock', 'Drown',}
    
    	send_command('bind != gs c toggle MBB set')
    	send_command('bind ^= gs c toggle MAcc set')
    	send_command('bind @= gs c toggle TPMode set')
    	send_command('bind !^= gs c toggle Idle set')
    	
    function get_sets()
    
    -- Sets go here --	
    	sets.FC = {}		
    	sets.FC["Base"] = {
    		ammo = "Sapience Orb",
    		head = { name="Merlinic Hood", augments={'Mag. Acc.+23 "Mag.Atk.Bns."+23','"Fast Cast"+6','VIT+7',}},
    		neck = "Orunmila's Torque",
    		ear1 = "Enchntr. Earring +1",
    		ear2 = "Loquac. Earring",
    		body = "Jhakri Robe +2",
    		hands={ name="Merlinic Dastanas", augments={'Mag. Acc.+22','"Fast Cast"+6','CHR+6','"Mag.Atk.Bns."+6',}},
    		ring1 = "Prolix Ring",
    		ring2 = "Jhakri Ring",
    		back={ name="Taranus's Cape", augments={'MP+60','Mag. Acc+20 /Mag. Dmg.+20','MP+20','"Fast Cast"+10',}},
    		waist = "Channeler's Stone",
    		legs = "Psycloth Lappas",
    		feet = { name="Merlinic Crackows", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Fast Cast"+7','Mag. Acc.+11','"Mag.Atk.Bns."+14',}}}
    		
    	sets.FC["Elemental Magic"] = set_combine(sets.FC["Base"],{ear1 = "Barkaro. Earring",})	
    	sets.FC["Healing Magic"] = set_combine(sets.FC["Base"],{ear1="Mendi. Earring",legs="Doyen Pants",feet="Vanya Clogs"})
    	sets.FC["Enhancing Magic"] = set_combine(sets.FC["Base"],{waist="Siegel Sash",legs="Doyen Pants"})
    	
    	sets.FC["Death"] = {
    		ammo = "Ghastly Tathlum +1",
    		head = { name="Merlinic Hood", augments={'Mag. Acc.+23 "Mag.Atk.Bns."+23','"Fast Cast"+6','VIT+7',}},
    		neck = "Orunmila's Torque",
    		ear1 = "Etiolation Earring",
    		ear2 = "Loquac. Earring",
    		body = "Ea Houppelande",
    		hands={ name="Merlinic Dastanas", augments={'Mag. Acc.+22','"Fast Cast"+6','CHR+6','"Mag.Atk.Bns."+6',}},
    		ring1 = "Prolix Ring",
    		ring2 = "Mephitas's Ring +1",
    		back={ name="Taranus's Cape", augments={'MP+60','Mag. Acc+20 /Mag. Dmg.+20','MP+20','"Fast Cast"+10',}},
    		waist = "Channeler's Stone",
    		legs = "Psycloth Lappas",
    		feet = { name="Merlinic Crackows", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Fast Cast"+7','Mag. Acc.+11','"Mag.Atk.Bns."+14',}}}
    
    	sets.JA = {}
    	sets.JA["Mana Wall"] = {
    		back={ name="Taranus's Cape", augments={'MP+60','Mag. Acc+20 /Mag. Dmg.+20','MP+20','"Fast Cast"+10',}}, 
    		feet="Wicce Sabots +1"}
    	sets.JA["Manafont"] = {body = "Arch. Coat"}
    	
    	sets.MA = {}
    	sets.MA["MAB"] = {
    		ammo = "Ghastly Tathlum +1",
    		head = "Ea Hat",
    		neck = "Sanctity Necklace",
    		ear1 = "Friomisi Earring",
    		ear2 = "Barkaro. Earring",
    		body = "Jhakri Robe +2",
    		hands = "Jhakri Cuffs +2",
    		ring1 = "Metamor. Ring +1",
    		ring2 = "Jhakri Ring",
    		back = { name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10',}},
    		waist = "Refoccilation Stone",
    		legs = { name="Merlinic Shalwar", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','Magic burst mdg.+6%','CHR+7','"Mag.Atk.Bns."+15',}},
    		feet = { name="Merlinic Crackows", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Fast Cast"+7','Mag. Acc.+11','"Mag.Atk.Bns."+14',}}}
    		
    	sets.MA["MBB"] = {
    		ammo = "Ghastly Tathlum +1",
    		head = "Ea Hat",
    		neck = "Mizu. Kubikazari",
    		ear1 = "Barkaro. Earring",
    		ear2 = "Friomisi Earring",
    		body = "Ea Houppelande",
    		hands = "Ea Cuffs",
    		ring1 = "Mujin Band",
    		ring2 = "Vertigo Ring",
    		back = { name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10',}},
    		waist = "Eschan Stone",
    		legs = "Ea Slops",
    		feet = { name="Merlinic Crackows", augments={'Mag. Acc.+14','Magic burst dmg.+10%','INT+7','"Mag.Atk.Bns."+14',}}}
    		
    	sets.MA["MAcc"] = {
    		ammo = "Hydrocera",
    		head = "Ea Hat",
    		neck = "Sanctity Necklace",
    		ear1 = "Barkaro. Earring",
    		ear2 = "Gwati Earring",
    		body = "Spaekona's Coat +3",
    		hands = "Ea Cuffs",
    		ring1 = "Stikini Ring",
    		ring2 = "Jhakri Ring",
    		back = { name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','INT+10','"Mag.Atk.Bns."+10',}},
    		waist = "Eschan Stone",
    		legs = { name="Merlinic Shalwar", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','Magic burst mdg.+6%','CHR+7','"Mag.Atk.Bns."+15',}},
    		feet = { name="Merlinic Crackows", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Fast Cast"+7','Mag. Acc.+11','"Mag.Atk.Bns."+14',}}}
    
    	sets.MA["Occult Acumen"] = {
    		ammo = "Seraphic Ampulla",
    		head = "Welkin Crown",
    		ear1 = "Telos Earring",
    		ring1 = "Rajas Ring",
    		ring2 = "Petrov Ring",
    		waist = "Oneiros Rope",
    		legs = "Perdition Slops",
    		feet = "Battlecast Gaiters",}
    
    	sets.MA["Dark Magic"] = {
    		ammo="Seraphic Ampulla",
    		head="Pixie Hairpin +1",
    		neck="Incanter's Torque",
    		ear1="Hermetic Earring",
    		ear2="Barkaro. Earring",
    		body="Psycloth Vest",
    		hands="Arch. Gloves",
    		ring1="Vertigo Ring",
    		ring2="Evanescence Ring",
    		back={ name="Taranus's Cape", augments={'MP+60','Mag. Acc+20 /Mag. Dmg.+20','MP+20','"Fast Cast"+10',}},
    		legs = "Jhakri Slops +1",
    		waist="Porous Rope",
    		feet="Wicce Sabots +1"}
    		
    	sets.MA["Drain"] = set_combine(sets.MA["Dark Magic"],{ear1="Hirudinea Earring",ring1="Excelsis Ring",waist="Fucho-no-Obi",
    		feet = { name="Merlinic Crackows", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Fast Cast"+7','Mag. Acc.+11','"Mag.Atk.Bns."+14',}}})
    	sets.MA["Aspir"] = sets.MA["Drain"]
    	
    	sets.MA["Death"] = {
    		ammo="Ghastly Tathlum +1",
    		head="Pixie Hairpin +1",
    		neck="Mizu. Kubikazari",
    		left_ear="Loquac. Earring",
    		right_ear="Barkaro. Earring",
    		body="Ea Houppelande",
    		hands="Ea Cuffs",
    		left_ring="Mujin Band",
    		right_ring="Mephitas's Ring +1",
    		back={ name="Taranus's Cape", augments={'MP+60','Mag. Acc+20 /Mag. Dmg.+20','MP+20','"Fast Cast"+10',}},
    		legs="Ea Slops",
    		waist="Refoccilation Stone",
    		feet={ name="Merlinic Crackows", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Fast Cast"+7','Mag. Acc.+11','"Mag.Atk.Bns."+14',}},}
    		
    	sets.MA["Healing Magic"] = {
    		ammo="Hydrocera",
    		head="Vanya Hood",
    		neck="Nodens Gorget",
    		ear1="Lifestorm Earring",
    		ear2="Mendi. Earring",
    		body="Vanya Robe",
    		hands="Psycloth Manillas",
    		ring1="Metamor. Ring +1",
    		ring2="Stikini Ring",
    		back="Solemnity Cape",
    		waist="Gishdubar Sash",
    		legs="Psycloth Lappas",
    		feet="Medium's Sabots"}
    		
    	sets.MA["Enfeebling Magic"] = set_combine(sets.MA["MAcc"],{
    		head="Jhakri Coronal +1",
    		neck="Incanter's Torque",
    		body="Spaekona's Coat +3",
    		hands="Jhakri Cuffs +2",
    		legs="Psycloth Lappas",
    		feet="Medium's Sabots",})
    		
    	sets.MA["Enhancing Magic"] = set_combine(sets.MA["Healing Magic"],{waist="Siegel Sash"})
    	sets.MA["Stoneskin"] = set_combine(sets.MA["Enhancing Magic"],{neck="Nodens Gorget",legs="Haven Hose",})
    
    	sets.DayWeather = {waist='Hachirin-no-Obi',back='Twilight Cape'}
    	sets.Zodiac = {ring2 = "Zodiac Ring"}
    	sets.Impact = {head=empty,body="Twilight Cloak"}
    	sets.THGear = {waist="Chaac Belt"}
    
    	sets.element = {}
    	sets.element["Earth"] = {neck="Quanpur Necklace"}
    --	sets.element["Wind"] = {main="Marin Staff +1"}
    
    	sets.WS = {}
    	sets.WS["Myrkr"] = {
    		ammo="Ghastly Tathlum +1",
    		head="Pixie Hairpin +1",
    		body={ name="Weather. Robe +1", augments={'MP+120',}},
    		hands={ name="Amalric Gages", augments={'MP+60','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
    		legs={ name="Psycloth Lappas", augments={'MP+80','Mag. Acc.+15','"Fast Cast"+7',}},
    		feet="Psycloth Boots",
    		neck="Orunmila's Torque",
    		waist="Shinjutsu-no-Obi +1",
    		left_ear="Etiolation Earring",
    		right_ear={ name="Moonshade Earring", augments={'"Mag.Atk.Bns."+4','TP Bonus +25',}},
    		left_ring="Persis Ring",
    		right_ring="Mephitas's Ring +1",
    		back={ name="Taranus's Cape", augments={'INT+20','Mag. Acc+20 /Mag. Dmg.+20','"Fast Cast"+10',}},}
    
    	sets.Idle = {}
    	Idle_Index = 1
    	Idle_Set_Names = {"Refresh","DT","Death"}
    	
    	sets.Idle["Death"] = sets.MA["Death"]
        sets.Idle["Refresh"] = {
    		ammo = "Ghastly Tathlum +1",
    		head = "Befouled Crown",
    		neck = "Sanctity Necklace",
    		ear1 = "Etiolation Earring",
    		ear2 = "Loquac. Earring",
    		body = "Jhakri Robe +2",
    		hands = { name="Amalric Gages", augments={'INT+10','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
    		ring1 = "Defending Ring",
    		ring2 = "Succor Ring",
    		back = "Solemnity Cape",
    		waist = "Fucho-no-Obi",
    		legs = "Assid. Pants +1",
    		feet = "Wicce Sabots +1"}
    		
    	sets.Idle["DT"] = {
    		ammo = "Ghastly Tathlum +1",
    		head = "Vanya Hood",
    		neck = "Twilight Torque",
    		ear1 = "Etiolation Earring",
    		ear2 = "Infused Earring",
    		body = "Vanya Robe",
    		hands = { name="Amalric Gages", augments={'INT+10','Mag. Acc.+15','"Mag.Atk.Bns."+15',}},
    		ring1 = "Defending Ring",
    		ring2 = "Succor Ring",
    		back = "Solemnity Cape",
    		waist = "Fucho-no-Obi",
    		legs = "Assid. Pants +1",
    		feet = "Battlecast Gaiters"}
    
    	sets.SpaeCoat= {
    		body="Spaekona's Coat +3",
    		feet={ name="Merlinic Crackows", augments={'Mag. Acc.+25 "Mag.Atk.Bns."+25','"Fast Cast"+7','Mag. Acc.+11','"Mag.Atk.Bns."+14',}},}
    
    	sets.MBBMode = {}
    	MBBMode_Index = 1
    	MBBMode_Set_Names = {"On","Off"}
    	sets.MBBMode.On = sets.MA["MBB"]
    	sets.MBBMode.Off = {}
    	
    	sets.MAccMode = {}
    	MAccMode_Index = 1
    	MAccMode_Set_Names = {"On","Off"}
    	sets.MAccMode.On = sets.MA["MAcc"]
    	sets.MAccMode.Off = {}
    	
    	sets.TPMode = {}
    	TPMode_Index = 1
    	TPMode_Set_Names = {"On","Off"}
    	sets.TPMode.On = sets.MA["Occult Acumen"]
    	sets.TPMode.Off = {}
    end
    -- Functions go here. DON'T TOUCH!!--
    
    function precast(spell) 
    	if spell.prefix == "/jobability" then
    		equip(sets.JA[spell.english] or {})
    	elseif spell.prefix == "/weaponskill" then
    		equip(sets.WS[spell.english] or {})
    	elseif spell.action_type == "Magic" then
    		if spell.english == "Death" then
    			equip(sets.FC["Death"])	 
    		elseif sets.FC[spell.skill] then
    			equip(sets.FC[spell.skill])
    		else equip(sets.FC["Base"])
    		end
    	end
    end
    
    function midcast(spell)
    	if spell.english == 'Sneak' then send_command('cancel 71;') end	
    
    	if spell.english == "Death" then
    		equip(sets.MA["Death"])
    	elseif sets.MA[spell.english] then
    		weathercheck(spell.element,sets.MA[spell.english])
    	elseif sets.MA[spell.skill] and spell.skill ~= "Elemental Magic" then
    		equip(sets.MA[spell.skill])
    	elseif spell.skill == "Elemental Magic" then
    		weathercheck(spell.element,set_combine(sets.MA["MAB"],sets.MAccMode[MAccMode_Set_Names[MAccMode_Index]],sets.TPMode[TPMode_Set_Names[TPMode_Index]],sets.MBBMode[MBBMode_Set_Names[MBBMode_Index]],sets.MA[spell.element]))
    		zodiaccheck(spell.element)
    		mpcheck(spell)
    	end
    end
    
    function aftercast(spell, action, spellMap, eventArgs)
    	if spell.english == "Death" then 
    		equip(sets.Idle["Death"])
    	elseif buffactive["Mana Wall"] then
    		equip(set_combine(sets.Idle[Idle_Set_Names[Idle_Index]],sets.JA["Mana Wall"]))
    	else equip(sets.Idle[Idle_Set_Names[Idle_Index]])
    	end
    end
    
    function weathercheck(spell_element,set)
        if not set then return end
        if spell_element == world.weather_element or spell_element == world.day_element then
            equip(set,sets.DayWeather)
        else
            equip(set)
        end
    end
    
    function zodiaccheck(spell_element)
        if spell_element == world.day_element and spell_element ~= 'Dark' and spell_element ~= 'Light' then
            equip(sets.Zodiac)
        end
    end
    
    function mpcheck(spell)
    	if spell.mppaftercast < 50 then
    		equip(sets.SpaeCoat)
    	end
    end
    
    function pretarget(spell)
        local spell_recasts = windower.ffxi.get_spell_recasts()
        if (spell_recasts[spell.recast_id]>0 or player.mp<actual_cost(spell)) and find_degrade_table(spell) then      
            degrade_spell(spell,find_degrade_table(spell))
        end
    end
    
    function find_degrade_table(lookup_spell)
        for __,spells in pairs(degrade_tables) do
            for ___,spell in pairs(spells) do
                if spell == lookup_spell.english then
                    return spells
                end
            end
        end
        return false
    end
    
    function degrade_spell(spell,degrade_array)
        local spell_index = table.find(degrade_array,spell.english)
        if spell_index>1 then        
            local new_spell = degrade_array[spell_index - 1]
            change_spell(new_spell,spell.target.raw)
            add_to_chat(140,spell.english..' has been canceled. Using '..new_spell..' instead.')
        end
    end
     
    function change_spell(spellName,target)
        cancel_spell()
        send_command(spellName:gsub('%s','')..' '..target)
    end
     
    function actual_cost(spell)
        local cost = spell.mp_cost
        if spell.type=="WhiteMagic" then
            if buffactive["Penury"] then
                return cost*.5
            elseif buffactive["Light Arts"] or buffactive["Addendum: White"] then
                return cost*.9
            elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
                return cost*1.1
            end
        elseif spell.type=="BlackMagic" then
            if buffactive["Parsimony"] then
                return cost*.5
            elseif buffactive["Dark Arts"] or buffactive["Addendum: Black"] then
                return cost*.9
            elseif buffactive["Light Arts"] or buffactive["Addendum: White"] then
                return cost*1.1
            end   
        end
        return cost
    end
    
    function filtered_action(spell) 
        if find_degrade_table(spell) then degrade_spell(spell,find_degrade_table(spell))
    	else equip(sets.Idle[Idle_Set_Names[Idle_Index]])	
        end
    end
    
    function self_command(command)
        if command == 'toggle TPMode set' then
            TPMode_Index = TPMode_Index +1
            if TPMode_Index > #TPMode_Set_Names then TPMode_Index = 1 end
            send_command('@input /echo ----- TP Set changed to '..TPMode_Set_Names[TPMode_Index]..' -----')
    	end	
        if command == 'toggle Idle set' then
            Idle_Index = Idle_Index +1
            if Idle_Index > #Idle_Set_Names then Idle_Index = 1 end
            send_command('@input /echo ----- Idle Set changed to '..Idle_Set_Names[Idle_Index]..' -----')
    		equip(sets.Idle[Idle_Set_Names[Idle_Index]])
    	end
    	if command == 'toggle MBB set' then
    		MBBMode_Index = MBBMode_Index +1
    		if MBBMode_Index > #MBBMode_Set_Names then MBBMode_Index = 1 end
    		send_command('@input /echo ----- Magic Burst Mode is now '..MBBMode_Set_Names[MBBMode_Index]..' -----')
    	end
    	if command == 'toggle MAcc set' then
    		MAccMode_Index = MAccMode_Index +1
    		if MAccMode_Index > #MAccMode_Set_Names then MAccMode_Index = 1 end
    		send_command('@input /echo ----- Magic Acc Mode is now '..MAccMode_Set_Names[MAccMode_Index]..' -----')
    	end
    end

    I'm still working on setting up my Occult Acumen / STP modes, but the related code is safe to ignore.

  14. #14
    Old Merits
    Join Date
    Nov 2015
    Posts
    1,181
    BG Level
    6
    FFXI Server
    Asura
    WoW Realm
    Cho'gall

    Quote Originally Posted by darkreign View Post
    can someone help me with my files I don't understand why my twilight cape and my hachirin-no-obi( both in my include under gear.elementa.obi or cape) do not equip while im under aurorastorm.

    Register to see the NSFW content
    Register to see the NSFW content
    Found this:
    Code:
    if spell.skill == 'Healing Magic' then
    gear.default.obi_back = "Mending Cape"
    else
    gear.default.obi_back = "Toro Cape"
    end
    end
    ..which might be over-riding what you are thinking should be happening. I normally only mess with non-Mote stuff tho, so someone who is familiar should confirm.

  15. #15

    I was gonna make a new thread but found this one.

    Premise: I'd like 3 macros on the left bar and 6 on the right. The three on the left are Tier I, Tier II and Tier III, and on the right the elements. The idea is I select a Tier on the left and then hit the element to nuke that spell. I'm already using GearSwap on RDM so I'm familiar with Lua, but I don't see how I can achieve this. Does anyone have an idea?

    I'd like to use the same logic for Enfeebles eventually, going for full MND/INT or full skill on the left and enfeeble on the right.

  16. #16
    Old Merits
    Join Date
    Nov 2015
    Posts
    1,181
    BG Level
    6
    FFXI Server
    Asura
    WoW Realm
    Cho'gall

    Quote Originally Posted by Enedin View Post
    I was gonna make a new thread but found this one.

    Premise: I'd like 3 macros on the left bar and 6 on the right. The three on the left are Tier I, Tier II and Tier III, and on the right the elements. The idea is I select a Tier on the left and then hit the element to nuke that spell. I'm already using GearSwap on RDM so I'm familiar with Lua, but I don't see how I can achieve this. Does anyone have an idea?

    I'd like to use the same logic for Enfeebles eventually, going for full MND/INT or full skill on the left and enfeeble on the right.
    I'm not that great w/ the more programming-like scripting, so here's a down/dirty method. Just copy/paste/edit to add in all the elelments I was too lazy to do for you. :3
    Code:
    function self_command(command)
    	nuke_element = "Fire"
    	if command == "change element Fire" then 
    		nuke_element = "Fire"
    	elseif command == "change element Earth" then 
    		nuke_element = "Earth"
    	elseif command == "change element Wind" then 
    		nuke_element = "Wind"
    			==   etc  ==
    	end
    	
    	if command == "nuke 1" then
    		send_command('@input /ma '..nuke_element..' I <t>'
    	elseif command == "nuke 2" then
    		send_command('@input /ma '..nuke_element..' II <t>'
    	elseif command == "nuke 3" then
    		send_command('@input /ma '..nuke_element..' III <t>'
    	end
    end
    Then you make a macro for each command along the lines of:
    Code:
    /console command change element Earth
    and
    Code:
    /console command nuke 2
    Should work I believe, but I'm positive that anyone with a more solid grasp of LUA would be able to come up w/ a far more elegant solution. ^^;; For enfeebles, I'd suggest setting up modes and use a keybind toggle instead.

  17. #17
    Melee Summoner
    Join Date
    Jun 2014
    Posts
    34
    BG Level
    1

    I imagine the enfeebling one could be handled by just defining a couple casting modes and making the sets you want to go with them.

    For the nuking, I use the code from this post: http://www.ffxiah.com/forum/topic/47...ds-for-nuking/

    That allows you to either cycle through nuke elements or choose a specific one my making a macro/keybind and then cast spells of that element using generic t1-aja macros.

  18. #18

    Thanks guys, will check it out when I get home!

    Stupid question prolly, but what are these modes you both mention?

  19. #19
    Old Merits
    Join Date
    Nov 2015
    Posts
    1,181
    BG Level
    6
    FFXI Server
    Asura
    WoW Realm
    Cho'gall

    Quote Originally Posted by Enedin View Post
    Thanks guys, will check it out when I get home!

    Stupid question prolly, but what are these modes you both mention?
    Think of modes like light switches. XD The simplest mode would be an on/off toggle, but you can get fancy and have three or more options that you cycle thru. For instance, in my BLM Lua that I posted earlier in this thread, I have keybinds for several modes set up that I can mix/match based on what I'm doing that mix/match my gear accordingly. Don't need to equip MBD+% gear when I'm freenuking after all.

    I am a non-Mote user, so the method/syntax of implementing them will be different for you. IIRC, it's easier to do with Mote than without at least.

  20. #20

    I've heard of Mote but that feels like making things more difficult than need be. I've achieved 90% of what I want through Gearswap alone so I'd like to leave it like that. But yeah basically what I'm looking for are switches and the examples posted here should work for me. Tonight I'll have time to try it out, thanks for the responses guys.

+ Reply to Thread
Page 1 of 22 1 2 3 11 ... LastLast

Quick Reply Quick Reply

  • Decrease Size
    Increase Size
  • Remove Text Formatting
  • Insert Link Insert Image Insert Video
  • Wrap [QUOTE] tags around selected text
  • Insert NSFW Tag
  • Insert Spoiler Tag

Similar Threads

  1. Gearswap Help Thread!
    By JSHidaka in forum FFXI: Everything
    Replies: 6035
    Last Post: 2018-05-06, 17:15
  2. Randomerest Question Thread III: This Time It's Random
    By isladar in forum FFXI: Everything
    Replies: 868
    Last Post: 2009-08-18, 12:03