Item Search
     
BG-Wiki Search
+ Reply to Thread
Page 6 of 20 FirstFirst ... 4 5 6 7 8 16 ... LastLast
Results 101 to 120 of 395
  1. #101
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    hmm. Still getting the same thing.

  2. #102

    Quote Originally Posted by BaneTheBrawler View Post
    hmm. Still getting the same thing.
    try this
    Code:
    function get_weapon_type(slot)
        local item_data = gearswap.res.items:with('name', player.equipment[slot])
        if item_data.category == "Weapon" then
            return gearswap.res.skills:with('id', item_data.skill).en
        else
            return "NOT WEAPON"
        end
    end

  3. #103
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    nope same thing. "attempt to index local 'item_data' (a nil value)" centered on this part


    Code:
    if item_data.category == "Weapon" then
            return gearswap.res.skills:with('id', item_data.skill).en
        else
            return "NOT WEAPON"
        end

  4. #104

    Quote Originally Posted by BaneTheBrawler View Post
    nope same thing. "attempt to index local 'item_data' (a nil value)" centered on this part


    Code:
    if item_data.category == "Weapon" then
            return gearswap.res.skills:with('id', item_data.skill).en
        else
            return "NOT WEAPON"
        end
    what weapon are your checking? it might not be in the dats yet
    are you useing the correct slot name? (with the "")

    "main"
    "sub"
    "range"
    "ammo"

  5. #105
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    the portion of code running the check that fails is thus:

    Code:
            if state.RangedMode.value == 'Ranged' then 
                if    get_weapon_type("range") == "Archery" then
                    set_macro_page(3, 19)
                elseif get_weapon_type("range") == "Marksmanship" then
                    set_macro_page(4, 19)
                else send_command('gs c set RangedMode Melee', 'gs c WS_macro_set')
                end
    dunno if that last bit is how i'm going to actually make it do that; the function fails as soon as it gets the nil value from the first part. it continues on for a bit after that. the complete function is here:

    Code:
    function job_self_command(cmdParams, eventArgs)
        if cmdParams[1] == 'default_macro_set' then
            select_default_macro_book()
        elseif cmdParams[1] == 'WS_macro_set' then
            if state.RangedMode.value == 'Ranged' then 
                if    get_weapon_type("range") == "Archery" then
                    set_macro_page(3, 19)
                elseif get_weapon_type("range") == "Marksmanship" then
                    set_macro_page(4, 19)
                else send_command('gs c set RangedMode Melee', 'gs c WS_macro_set')
                end
            elseif get_weapon_type("main") == "Great Katana" then
                set_macro_page(2, 20)
            elseif get_weapon_type("main") == "Polearm" then
                set_macro_page(3, 20)
            elseif get_weapon_type("main") == "Sword" then
                set_macro_page(4, 20)
            elseif get_weapon_type("main") == "Dagger" then
                set_macro_page(5, 20)
            elseif get_weapon_type("main") == "Club" then
                set_macro_page(6, 20)
            elseif get_weapon_type("main") == "Staff" then
                set_macro_page(7, 20)
            elseif get_weapon_type("main") == "Hand-to-Hand" then
                set_macro_page(8, 20)
            elseif get_weapon_type("main") == "Great Sword" then
                set_macro_page(9, 20)
            elseif get_weapon_type("main") == "Axe" then
                set_macro_page(0, 20)
            elseif get_weapon_type("main") == "Great Axe" then
                set_macro_page(1, 20)
            elseif get_weapon_type("main") == "Scythe" then
                set_macro_page(1, 19)
            elseif get_weapon_type("main") == "Katana" then
                set_macro_page(2, 19)
            else
                select_default_macro_book()
            end
        elseif cmdParams[1] == 'subjob_macro_set' then
            if player.sub_job == 'WAR' then
                set_macro_page(2, 18)
            elseif player.sub_job == 'DNC' then
                set_macro_page(5, 18)
            elseif player.sub_job == 'THF' then
                set_macro_page(7, 18)
            elseif player.sub_job == 'NIN' then
                set_macro_page(4, 18)
            elseif player.sub_job == 'RNG' then
                set_macro_page(6, 18)
            elseif player.sub_job == 'MNK' then
                set_macro_page(8, 18)
            else
                select_default_macro_book()
            end
        elseif cmdParams[1] == 'spell_macro_set' then
            if player.main_job == 'PLD' or
                player.main_job == 'RDM' or
                player.main_job == 'BLM' or
                player.main_job == 'DRK' or
                player.main_job == 'RUN' or
                player.sub_job == 'PLD' or
                player.sub_job == 'RDM' or
                player.sub_job == 'WHM' or
                player.sub_job == 'BLM' or
                player.sub_job == 'DRK' or
                player.sub_job == 'SCH' or
                player.sub_job == 'RUN' then
                set_macro_page(1, 16)
            else
                select_default_macro_book()
            end
        end
    end

  6. #106

    Quote Originally Posted by BaneTheBrawler View Post
    the portion of code running the check that fails is thus:

    Code:
            if state.RangedMode.value == 'Ranged' then 
                if    get_weapon_type("range") == "Archery" then
                    set_macro_page(3, 19)
                elseif get_weapon_type("range") == "Marksmanship" then
                    set_macro_page(4, 19)
                else send_command('gs c set RangedMode Melee', 'gs c WS_macro_set')
                end
    dunno if that last bit is how i'm going to actually make it do that; the function fails as soon as it gets the nil value from the first part. it continues on for a bit after that. the complete function is here:

    Code:
    function job_self_command(cmdParams, eventArgs)
        if cmdParams[1] == 'default_macro_set' then
            select_default_macro_book()
        elseif cmdParams[1] == 'WS_macro_set' then
            if state.RangedMode.value == 'Ranged' then 
                if    get_weapon_type("range") == "Archery" then
                    set_macro_page(3, 19)
                elseif get_weapon_type("range") == "Marksmanship" then
                    set_macro_page(4, 19)
                else send_command('gs c set RangedMode Melee', 'gs c WS_macro_set')
                end
            elseif get_weapon_type("main") == "Great Katana" then
                set_macro_page(2, 20)
            elseif get_weapon_type("main") == "Polearm" then
                set_macro_page(3, 20)
            elseif get_weapon_type("main") == "Sword" then
                set_macro_page(4, 20)
            elseif get_weapon_type("main") == "Dagger" then
                set_macro_page(5, 20)
            elseif get_weapon_type("main") == "Club" then
                set_macro_page(6, 20)
            elseif get_weapon_type("main") == "Staff" then
                set_macro_page(7, 20)
            elseif get_weapon_type("main") == "Hand-to-Hand" then
                set_macro_page(8, 20)
            elseif get_weapon_type("main") == "Great Sword" then
                set_macro_page(9, 20)
            elseif get_weapon_type("main") == "Axe" then
                set_macro_page(0, 20)
            elseif get_weapon_type("main") == "Great Axe" then
                set_macro_page(1, 20)
            elseif get_weapon_type("main") == "Scythe" then
                set_macro_page(1, 19)
            elseif get_weapon_type("main") == "Katana" then
                set_macro_page(2, 19)
            else
                select_default_macro_book()
            end
        elseif cmdParams[1] == 'subjob_macro_set' then
            if player.sub_job == 'WAR' then
                set_macro_page(2, 18)
            elseif player.sub_job == 'DNC' then
                set_macro_page(5, 18)
            elseif player.sub_job == 'THF' then
                set_macro_page(7, 18)
            elseif player.sub_job == 'NIN' then
                set_macro_page(4, 18)
            elseif player.sub_job == 'RNG' then
                set_macro_page(6, 18)
            elseif player.sub_job == 'MNK' then
                set_macro_page(8, 18)
            else
                select_default_macro_book()
            end
        elseif cmdParams[1] == 'spell_macro_set' then
            if player.main_job == 'PLD' or
                player.main_job == 'RDM' or
                player.main_job == 'BLM' or
                player.main_job == 'DRK' or
                player.main_job == 'RUN' or
                player.sub_job == 'PLD' or
                player.sub_job == 'RDM' or
                player.sub_job == 'WHM' or
                player.sub_job == 'BLM' or
                player.sub_job == 'DRK' or
                player.sub_job == 'SCH' or
                player.sub_job == 'RUN' then
                set_macro_page(1, 16)
            else
                select_default_macro_book()
            end
        end
    end
    i think you range gear is not in dats but here is a way to fix it
    Code:
    function get_weapon_type(slot)
        local item_data = gearswap.res.items:with('name', player.equipment[slot])
        if item_data and item_data.category == "Weapon" then
            return gearswap.res.skills:with('id', item_data.skill).en
        else
            return "NOT WEAPON OR NOT IN DATS"
        end
    end

  7. #107
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    Excellent, thank you! Now I just need to figure out how to get windower to recognize f13-24, and how to have a function start itself over

  8. #108
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    okay, another day another question. I'm trying to get it so that if I have a bow equipped, none of my gearsets will change anything about my ranged/ammo slot. I thought this might be straightforward, but since it doesnt seem to want to work, maybe it's not.

    Code:
        if get_weapon_type("range") == "Marksmanship" then
            disable('range')
            disable('ammo')
        elseif get_weapon_type("range") == "Archery" then
            disable('range')
            disable('ammo')
        else
           enable('range')
           enable('ammo')
         end
    I've placed this in both my global user_setup function and in my job-specific user_setup function but neither worked. so either i goofed, or i'm putting it in the wrong function.




    edit: oh i think i just realized the problem. user_setup is only called on load, so its disabling/enabling based on what i have equipped at that time.. hmm.... got an idea, will report back

  9. #109

    in all gearswap files the get_sets function is only parsed at load
    in motes include the job-specific user_setup function is only parsed at load or you change sub jobs

  10. #110
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    yeah, i realized that shortly after posting. well i know that snippet works because when i stick it in my global with no function it disables the range/ammo slots. so i just need to figure out which function to use that would get called any time my gear is being touched. i thought that would be get_gearsets but that didnt work

  11. #111
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    aight so
    Code:
    function update_combat_form()
        if get_weapon_type("range") == "Marksmanship" then
            disable('range')
            disable('ammo')
        elseif get_weapon_type("range") == "Archery" then
            disable('range')
            disable('ammo')
        else
           enable('range')
           enable('ammo')
        end
    end


    seems to have fixed that.

  12. #112
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    okay so coming back to the WS snippet; it's mostly working now, but it doesn't identify non-weapon in the main slot as being hand-to-hand. so i tried



    Code:
            if state.RangedMode.value == 'Ranged' then 
                if    get_weapon_type("range") == "Archery" then
                    set_macro_page(3, 19)
                elseif get_weapon_type("range") == "Marksmanship" then
                    set_macro_page(4, 19)
                else send_command('gs c set RangedMode Melee')
                end
            elseif get_weapon_type("main") == "Great Katana" then
                set_macro_page(2, 20)
            elseif get_weapon_type("main") == "Polearm" then
                set_macro_page(3, 20)
            elseif get_weapon_type("main") == "Sword" then
                set_macro_page(4, 20)
            elseif get_weapon_type("main") == "Dagger" then
                set_macro_page(5, 20)
            elseif get_weapon_type("main") == "Club" then
                set_macro_page(6, 20)
            elseif get_weapon_type("main") == "Staff" then
                set_macro_page(7, 20)
            elseif get_weapon_type("main") == "Hand-to-Hand" then
                set_macro_page(8, 20)
            elseif get_weapon_type("main") == "Great Sword" then
                set_macro_page(9, 20)
            elseif get_weapon_type("main") == "Axe" then
                set_macro_page(0, 20)
            elseif get_weapon_type("main") == "Great Axe" then
                set_macro_page(1, 20)
            elseif get_weapon_type("main") == "Scythe" then
                set_macro_page(1, 19)
            elseif get_weapon_type("main") == "Katana" then
                set_macro_page(2, 19)
            else
                set_macro_page(8, 20) -- h2h
            end
    which i was sure would work, but it doesn't. just fails to change macro sets without a weapon equipped.

  13. #113

    Quote Originally Posted by BaneTheBrawler View Post
    okay so coming back to the WS snippet; it's mostly working now, but it doesn't identify non-weapon in the main slot as being hand-to-hand. so i tried



    Code:
            if state.RangedMode.value == 'Ranged' then 
                if    get_weapon_type("range") == "Archery" then
                    set_macro_page(3, 19)
                elseif get_weapon_type("range") == "Marksmanship" then
                    set_macro_page(4, 19)
                else send_command('gs c set RangedMode Melee')
                end
            elseif get_weapon_type("main") == "Great Katana" then
                set_macro_page(2, 20)
            elseif get_weapon_type("main") == "Polearm" then
                set_macro_page(3, 20)
            elseif get_weapon_type("main") == "Sword" then
                set_macro_page(4, 20)
            elseif get_weapon_type("main") == "Dagger" then
                set_macro_page(5, 20)
            elseif get_weapon_type("main") == "Club" then
                set_macro_page(6, 20)
            elseif get_weapon_type("main") == "Staff" then
                set_macro_page(7, 20)
            elseif get_weapon_type("main") == "Hand-to-Hand" then
                set_macro_page(8, 20)
            elseif get_weapon_type("main") == "Great Sword" then
                set_macro_page(9, 20)
            elseif get_weapon_type("main") == "Axe" then
                set_macro_page(0, 20)
            elseif get_weapon_type("main") == "Great Axe" then
                set_macro_page(1, 20)
            elseif get_weapon_type("main") == "Scythe" then
                set_macro_page(1, 19)
            elseif get_weapon_type("main") == "Katana" then
                set_macro_page(2, 19)
            else
                set_macro_page(8, 20) -- h2h
            end
    which i was sure would work, but it doesn't. just fails to change macro sets without a weapon equipped.
    im betting it because you are in Ranged mode not Melee mode

  14. #114
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    ahem, well, i was doing some coding that had rather more testable effects today and figured out why....




    i'd been editing my backups, not the actual script files. whoops. so it does totally work, exactly as expected. once i... yknow... actually load it in. derp.

    However, I do have another question! I'm trying to intercept whenever I cast "Protect" and replace that with the highest tier Protect spell currently available to me, targeting the same person. I thought maybe I could adapt the polearm WS insert function from the samurai file, but my ham-fisted attempt seems to have failed.

    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
            send_command('input /ma "Protect V"'..spell.target.raw)
            send_command('input /ma "Protect IV"'..spell.target.raw)
            send_command('input /ma "Protect III"'..spell.target.raw)
            send_command('input /ma "Protect II"'..spell.target.raw)
            send_command('input /ma "Protect"'..spell.target.raw)
            eventArgs.cancel = true
            end
        end
    end
    Am I even in the ballpark on this one? How do I do that? Also, what argument could I make instead of "startswith"? that would trigger on protectra, as well, which i'd like to avoid.

  15. #115

    Quote Originally Posted by BaneTheBrawler View Post
    ahem, well, i was doing some coding that had rather more testable effects today and figured out why....

    i'd been editing my backups, not the actual script files. whoops. so it does totally work, exactly as expected. once i... yknow... actually load it in. derp.
    oh ok
    Quote Originally Posted by BaneTheBrawler View Post
    However, I do have another question! I'm trying to intercept whenever I cast "Protect" and replace that with the highest tier Protect spell currently available to me, targeting the same person. I thought maybe I could adapt the polearm WS insert function from the samurai file, but my ham-fisted attempt seems to have failed.

    ...


    Am I even in the ballpark on this one? How do I do that? Also, what argument could I make instead of "startswith"? that would trigger on protectra, as well, which i'd like to avoid.
    this is all i can think of
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in ipairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spellRs:with('name', spell.english..""..lvl)
                    if spellR and spell.english != spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or spellR.levels[player.sub_job_id] <= player.sub_job_level) and
                     windower.ffxi.get_spellR_recasts()[spellR.recast_id] == 0 and spellR.mp_cost <= player.mp then
                        send_command('input /ma "'..spellR.english..''..lvl..'"'..spellR.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end
    only cast Protect or Protectra and it should auto adjust to the highest you can cast on your main/sub job based on you current lvl, recast timer, and mp


    here is some lua help for you:https://www.lua.org/pil/contents.html#P1

  16. #116
    Cerberus
    Join Date
    Jan 2007
    Posts
    464
    BG Level
    4
    WoW Realm
    Frostmane

    Is there a way to make a send_command('bind') keyboard depending on which weapon you have equiped?

  17. #117

    Quote Originally Posted by seph32 View Post
    Is there a way to make a send_command('bind') keyboard depending on which weapon you have equiped?
    i dont use bind so im not sure
    but there probably is

  18. #118
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    sure. you just use the script dlsmd helped me with a few posts ago, replace all my macro switching with your send_commands, then stick the whole shebang in whatever function you want to trigger it.

  19. #119
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,365
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    Quote Originally Posted by dlsmd View Post
    oh ok

    this is all i can think of
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in ipairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spellRs:with('name', spell.english..""..lvl)
                    if spellR and spell.english != spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or spellR.levels[player.sub_job_id] <= player.sub_job_level) and
                     windower.ffxi.get_spellR_recasts()[spellR.recast_id] == 0 and spellR.mp_cost <= player.mp then
                        send_command('input /ma "'..spellR.english..''..lvl..'"'..spellR.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end
    only cast Protect or Protectra and it should auto adjust to the highest you can cast on your main/sub job based on you current lvl, recast timer, and mp


    here is some lua help for you:https://www.lua.org/pil/contents.html#P1

    okay so i'm still digesting that resource (that's gonna take a while) but i finally got a chance to try out this script. at first it wouldn't load in, but i replaced the ! with a ~ and that fixed that. however, .spellRs keeps returning nil.

  20. #120

    Quote Originally Posted by BaneTheBrawler View Post
    okay so i'm still digesting that resource (that's gonna take a while) but i finally got a chance to try out this script. at first it wouldn't load in, but i replaced the ! with a ~ and that fixed that. however, .spellRs keeps returning nil.
    i goofed up here is the fix (i used ipairs not pairs)
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spellRs:with('name', spell.english..""..lvl)
                    if spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or spellR.levels[player.sub_job_id] <= player.sub_job_level) and
                     windower.ffxi.get_spellR_recasts()[spellR.recast_id] == 0 and spellR.mp_cost <= player.mp then
                        send_command('input /ma "'..spellR.english..''..lvl..'"'..spellR.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end

+ Reply to Thread
Page 6 of 20 FirstFirst ... 4 5 6 7 8 16 ... 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