Item Search
     
BG-Wiki Search
Closed Thread
Page 302 of 302 FirstFirst ... 252 292 300 301 302
Results 6021 to 6036 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter submit to tumblr

  1. #6021
    Radsourceful

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

    Quote Originally Posted by Modoru View Post
    read code above
    No, that's not it at all - I can't speak to what's inside the function, but the problem here is the expected variables coming in. They need to be separated by commas.

    Code:
    windower.register_event('chat message', function(chat message)
    	print('asdf')
    end)
    --Error - "attempt to call a string value"
    --While your error is different, you likely have code above/below affecting it
    Code:
    windower.register_event('chat message', function(chat, message)
    	print('asdf')
    end)
    --This loads correctly
    Code:
    windower.register_event('chat message', function(message,sender,mode,gm)
    	print('asdf')
    end)
    --These are the actual arguments passed on the chat message event.
    See: http://dev.windower.net/doku.php?id=...i:events:start
    Quick reply to this message Reply  

  2. #6022
    Relic Shield
    Join Date
    Mar 2007
    Posts
    1,738
    BG Level
    6
    FFXIV Character
    Rehn Valor
    FFXIV Server
    Sargatanas
    FFXI Server
    Ragnarok

    Yea I found chat message thing from the page radec linked, which was how I started to make that. I do want to know when dia/slow/para wears off, so I wanted to try doing it for dia, but never got it to work.

    I'll try your code.
    Quick reply to this message Reply  

  3. #6023
    I Am, Who I Am.
    Join Date
    Nov 2005
    Posts
    15,862
    BG Level
    9
    FFXIV Character
    Trixi Sephyuyx
    FFXIV Server
    Excalibur
    FFXI Server
    Ragnarok

    Quote Originally Posted by Rehn View Post
    You could try this:

    Code:
    sets.midcast['Elemental Magic'] = {
    lring={name="Shiva Ring +1",priority=1},
    main="Lathi",sub="Niobid Strap",
    ranged="",ammo="Pemphredo Tathlum",
    head="Merlinic Hood",
    neck="Mizukage-no-Kubikazari",
    ear1="Friomisi Earring",
    ear2="Barkarole Earring",
    body="Count's Garb",
    hands="Amalric Gages",
    rring={name="Shiva Ring +1",priority=12},
    back="Toro Cape",
    waist="Yamabuki-no-Obi",
    legs="Merlinic Shalwar",
    feet="Merlinic Crackows"}
    Mine equips fine despite using no priority
    Still not working the majority of the time :/ I have a weatherspoon ring in for fastcast right before, and for the most part it stays equipped. Another ring in lring too, but that has no issues equiping the correct one afterwords.

    Code:
        
    
        sets.precast.FastCast.Default = {main="Lathi",sub="Vivid Strap",ranged="",ammo="Impatiens",
            head="Nahtirah Hat",neck="Stoicheion Medal",ear1="Loquacious Earring",ear2="Barkarole Earring",
    	body="Royal Redingote",hands="Magavan Mitts",lring="Prolix Ring",rring="Weatherspoon Ring",
            back="Bane Cape",waist="Witful Belt",legs="Orvail Pants +1",feet="Merlinic Crackows"}
        
        sets.precast.FastCast['Elemental Magic'] = set_combine(sets.precast.FastCast.Default,{head="Wicce Petasos +1"})
    Quick reply to this message Reply  

  4. #6024
    Relic Shield
    Join Date
    Mar 2007
    Posts
    1,738
    BG Level
    6
    FFXIV Character
    Rehn Valor
    FFXIV Server
    Sargatanas
    FFXI Server
    Ragnarok

    The only difference between yours and mines are how I name my rings:

    Code:
    sets.precast.FC = {
    main=Grioavolr_FC,
    sub="Oneiros Grip",
    head=Merlinic_Hood_FC,
    body=Merlinic_Jubbah_FC,
    hands=Merlinic_Dastanas_FC,
    legs="Psycloth Lappas",
    feet=Merlinic_Crackows_FC,
    neck="Voltsurge Torque",
    waist="Witful Belt",
    left_ear="Moonshade Earring",
    right_ear={name="Etiolation Earring", priority=2},
    left_ring={name="Mephitas's Ring +1", priority=1},
    right_ring="Lebeche Ring",
    back=Taranus_FC}
    
    sets.midcast.MAB = {
    main=Grioavolr_Magic_Burst,
    sub="Elan Strap +1",
    ammo="Pemphredo Tathlum",
    head=Merlinic_Hood,
    body="Amalric Doublet +1",
    hands="Amalric Gages +1",
    legs="Amalric Slops +1",
    feet="Amalric Nails +1",
    neck="Saevus Pendant +1",
    waist="Refoccilation Stone",
    left_ear="Barkarole Earring",
    right_ear="Regal Earring",
    left_ring="Shiva Ring +1",
    right_ring="Shiva Ring +1",
    back=Taranus_MAB}
    Spoiler: show


    Both of my rings are in the same bag as well (wardrobe 4)
    Quick reply to this message Reply  

  5. #6025

    Hello again!

    I've been working on trying to get something going in terms of getting gearswap to figure out if I am facing the mob or not within about 60 degrees. I've done some research on the topic and the only information that I could get was a post by an admin as follows:
    Code:
    require('vectors')
     
    check_mob_facing = function(mob)
        local facing = vector.from_radian(mob.facing)
        local direction = V{player.x, player.y} - V{mob.x, mob.y}
        local angle = vector.angle(direction, facing):degree():abs()
        return angle > 90
    end
    I cannot seem to find any file called vector that I can reference to unless it was deprecated.

    Any help on the topic would be greatly appreciated ^^


    Edit:

    Quote Originally Posted by dlsmd View Post
    i was thinking about this issue while sitting around
    you could try this if you want

    just create a new file call test.lua then paste this in and save it in your gearswap file folder with all your other gearswap job files


    if it counts past 6 and is accurate let me know
    I am so sowwi x.x I didn't know! I'mma test it right now!


    Edit2: I was able to get it up and running! :> I followed your instructions and it gave me a error. I think you forgot a "then" after the buffactive'presto'. I put that in and then it gave me a new error. It said that it was looking for a table for presto so I added the includes to the file and it loads without error now but it does nothing :<
    Quick reply to this message Reply  

  6. #6026
    Sea Torques
    Join Date
    Sep 2011
    Posts
    666
    BG Level
    5
    FFXIV Character
    Modoru D'kkoru
    FFXIV Server
    Hyperion
    FFXI Server
    Siren

    Ah, my mistake - I was interpreting the code in totally the wrong way.

    /shrug
    Quick reply to this message Reply  

  7. #6027

    Quote Originally Posted by Rikimarueye View Post
    I am so sowwi x.x I didn't know! I'mma test it right now!


    Edit2: I was able to get it up and running! :> I followed your instructions and it gave me a error. I think you forgot a "then" after the buffactive'presto'. I put that in and then it gave me a new error. It said that it was looking for a table for presto so I added the includes to the file and it loads without error now but it does nothing :<
    no problem
    i just looked over my code and i borked it up prity good
    here is the fixed code
    Code:
    fm_test = 0
    function buff_change(name,gain,buff_table)
        if name:startswith('Finishing Move') then
            if gain then
                if buffactive['Presto'] then
                    fm_test = fm_test+2
                else
                    fm_test= fm_test+1
                end
                add_to_chat(7,'current FM count = '..fm_test)
            end
        end
    end
    function aftercast(spell)
        if spell.interrupted then
            return
        end
        if spell.type:startswith('Flourish') then
            local fm_for_flourishes = {['Animated Flourish']={m=2},
                                       ['Desperate Flourish']=1,
                                       ['Violent Flourish']=1,
                                       ['Reverse Flourish']={m=5},
                                       ['Building Flourish']={m=3},
                                       ['Wild Flourish']=2,
                                       ['Climactic Flourish']={m=5},
                                       ['Striking Flourish']=2,
                                       ['Ternary Flourish']=3,}
            if type(fm_for_flourishes[spell.name]) == 'number' then
                fm_test = fm_test-fm_for_flourishes[spell.name]
            else
                if fm_for_flourishes[spell.name].m >= fm_test then
                    fm_test = 0
                else
                    fm_test = fm_test-fm_for_flourishes[spell.name].m
                end
            end
            add_to_chat(7,'current FM count = '..fm_test)
        end
    end
    Quick reply to this message Reply  

  8. #6028

    Quote Originally Posted by dlsmd View Post
    no problem
    i just looked over my code and i borked it up prity good
    here is the fixed code
    Code:
    fm_test = 0
    function buff_change(name,gain,buff_table)
        if name:startswith('Finishing Move') then
            if gain then
                if buffactive['Presto'] then
                    fm_test = fm_test+2
                else
                    fm_test= fm_test+1
                end
                add_to_chat(7,'current FM count = '..fm_test)
            end
        end
    end
    function aftercast(spell)
        if spell.interrupted then
            return
        end
        if spell.type:startswith('Flourish') then
            local fm_for_flourishes = {['Animated Flourish']={m=2},
                                       ['Desperate Flourish']=1,
                                       ['Violent Flourish']=1,
                                       ['Reverse Flourish']={m=5},
                                       ['Building Flourish']={m=3},
                                       ['Wild Flourish']=2,
                                       ['Climactic Flourish']={m=5},
                                       ['Striking Flourish']=2,
                                       ['Ternary Flourish']=3,}
            if type(fm_for_flourishes[spell.name]) == 'number' then
                fm_test = fm_test-fm_for_flourishes[spell.name]
            else
                if fm_for_flourishes[spell.name].m >= fm_test then
                    fm_test = 0
                else
                    fm_test = fm_test-fm_for_flourishes[spell.name].m
                end
            end
            add_to_chat(7,'current FM count = '..fm_test)
        end
    end
    I tried it! Unfortunately, it does not count past two, and even with presto it counts as 1 FM. On the positive side, it does deduct FMs from the count of two FMs.
    Also, this is what happens when I use JAs:

    Counter(Actual value)

    No Foot Rise: Gains 1 FM (Gives 5 FMs)
    Steps : Gain 1 FM (Gives 3 FMs since I have terpaderp on)
    Presto + Step: Gain 1 FM (Gives 4 FMs)
    Climactic Flourish: Resets to zero then adds +1 (if I have any remaining FMs) or Resets to zero (No FMs)
    Building Flourish: Resets to zero from a count of 1 (No FMs)


    I can do a more thorough investigation if this information is not suffice ^^
    Quick reply to this message Reply  

  9. #6029

    Quote Originally Posted by Rikimarueye View Post
    I tried it! Unfortunately, it does not count past two, and even with presto it counts as 1 FM. On the positive side, it does deduct FMs from the count of two FMs.
    Also, this is what happens when I use JAs:

    Counter(Actual value)

    No Foot Rise: Gains 1 FM (Gives 5 FMs)
    Steps : Gain 1 FM (Gives 3 FMs since I have terpaderp on)
    Presto + Step: Gain 1 FM (Gives 4 FMs)
    Climactic Flourish: Resets to zero then adds +1 (if I have any remaining FMs) or Resets to zero (No FMs)
    Building Flourish: Resets to zero from a count of 1 (No FMs)


    I can do a more thorough investigation if this information is not suffice ^^
    you see the issue with trying this now
    that's why this is the only way i could find to do it
    Code:
            local fm_count = 0
            for i, v in pairs(buffactive) do
                if tostring(i):startswith('finishing move') or tostring(i):startswith('フィニシングムーブ') then
                    if i:endswith("+)") then
                        fm_count = 6
                    else
                        fm_count = tonumber(string.match(i, '%d+')) or 1
                    end
                end
            end
    this is accurate to 6 but that is it
    Quick reply to this message Reply  

  10. #6030

    Quote Originally Posted by dlsmd View Post
    you see the issue with trying this now
    that's why this is the only way i could find to do it
    Code:
            local fm_count = 0
            for i, v in pairs(buffactive) do
                if tostring(i):startswith('finishing move') or tostring(i):startswith('フィニシングムーブ') then
                    if i:endswith("+)") then
                        fm_count = 6
                    else
                        fm_count = tonumber(string.match(i, '%d+')) or 1
                    end
                end
            end
    this is accurate to 6 but that is it
    Thank you for trying tho ^^ I see the issue with more clarity now.

    Do you know if gearswap is able to detect when the mob is facing you?
    Quick reply to this message Reply  

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

    I'm looking to make a rule in my Gear swap to equip the inspirited boots while someone else is casting refresh on me. Can someone help me with this and where should i put it in my gear swap?

    Register to see the NSFW content
    Quick reply to this message Reply  

  12. #6032

    Quote Originally Posted by darkreign View Post
    I'm looking to make a rule in my Gear swap to equip the inspirited boots while someone else is casting refresh on me. Can someone help me with this and where should i put it in my gear swap?

    ...
    you can only do that by watching packets or chat but its not easy to do
    Quick reply to this message Reply  

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

    Quote Originally Posted by KaraeLimier View Post
    Hi, I'm currently trying to create a mode in Gearswap that lets me switch between which Runes to use, but when I activate it it always casts Ignis instead of the current mode state. How would I go about fixing this?

    Code:
    function get_sets()
    	mote_include_version = 2
        include('Mote-Include.lua')
    end
    function user_setup()
    	state.RuneMode = M{['description']='RuneMode', 'Ignis', 'Gelus', 'Flabra', 'Tellus', 'Sulpor', 'Unda', 'Lux', 'Tenebrae'}
    	send_command('bind ^f8 gs c cycle RuneMode')
    	send_command('bind ^q @input /ja "'..state.RuneMode.value..'" <me>')
    end
    function init_gear_sets()
    end
    function file_unload()
    	send_command('unbind ^f8')
    	send_command('unbind ^q')
    end
    I asked about something similar and this was what I ended up with
    Quote Originally Posted by dlsmd View Post
    this should be more efficient coding (i used the code you posted above)
    Code:
    function job_self_command(cmdParams, eventArgs)
        if cmdParams[2] then
            local Chat_add = {
                --a is the rune name / b is the resistance type / c is the damage type
                Ignis={a="Gelus",b="Wind",c="Ice"},Gelus={a="Flabra",b="Earth",c="Wind"},
                Flabra={a="Tellus",b="Lightning",c="Earth"},Tellus={a="Sulpor",b="Water",c="Lightning"},
                Sulpor={a="Unda",b="Fire",c="Water"},Unda={a="LUX",b="Dark",c="Light"},
                Lux={a="Tenebrae",b="Light",c="Dark"},Tenebrae={a="Ignis",b="Ice",c="Fire"},
            local temp = Chat_add[state.Runes.value]
            add_to_chat(7,"Runes is now ".. temp.a .." - "..temp.b.." Resistance and "..temp.c.." Damage")
        end
        
        if cmdParams[1]:lower() == 'rune' then
            send_command('@input /ja '..state.Runes.value..' <me>')
        end
    end
    i just dont understand why you have the chat lines like this
    Ignis= "Runes is now Gelus - Wind Resistance and Ice Damage",
    when state.Runes.value == "Ignis" you want the chat to say "Runes is now Gelus - Wind Resistance and Ice Damage" when Ignis gives Ice Resistance and Fire Damage
    Quick reply to this message Reply  

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

    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.
    Quick reply to this message Reply  

  15. #6035
    Special at 11:30 or w/e
    Sweaty Dick Punching Enthusiast

    Join Date
    Feb 2012
    Posts
    8,136
    BG Level
    8
    FFXIV Character
    Kalmado Espiritu
    FFXIV Server
    Gilgamesh
    FFXI Server
    Odin
    Blog Entries
    3

    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.
    Opening new thread due to size of this thread. Your post will be at the top.
    Quick reply to this message Reply  

  16. #6036
    i should really shut up
    Join Date
    Sep 2011
    Posts
    2,612
    BG Level
    7
    FFXI Server
    Asura

    I'm an idiot, posted in the closed thread...
    Quick reply to this message Reply  


This thread is HUEG! You might want to consider creating a new thread.


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. Replies: 6547
    Last Post: 2014-07-08, 22:45