Item Search
     
BG-Wiki Search
+ Reply to Thread
Page 5 of 18 FirstFirst ... 3 4 5 6 7 15 ... LastLast
Results 81 to 100 of 342
  1. #81

    Quote Originally Posted by BaneTheBrawler View Post
    i decided to abandon that particular project for the moment.

    however, i'm trying to trigger a function from an in-game macro, or a keybind. Either would work for what i want to do. The best I can come up with is to put my string in a user_setup function and then use a macro to re-load Gearswap, which seems rather.... inelegant. Surely there's a way to have a particular function trigger on keybind?

    Edit: An alernative would be to do it on a precast for some ability that can never be cast, but I don't know what that would be.
    use geaswaps self_command(command) function

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

    that seems promising. i'm learning lua on the fly as i go, so i feel like there's a lot of basic syntax stuff that i haven't picked up on but isn't explicitly covered in the resources i'm finding. or if it is, it's not clicking for me. There's not much documentation on self_command that I can find; how does the syntax work? I tried:

    Code:
    function self_command(command)
        if command == 'macro_reset' then
            -- Default macro set/book
            if player.sub_job == 'WAR' then
                set_macro_page(2, 1)
            elseif player.sub_job == 'DNC' then
                set_macro_page(5, 1)
            elseif player.sub_job == 'THF' then
                set_macro_page(7, 1)
            elseif player.sub_job == 'NIN' then
                set_macro_page(4, 1)
            elseif player.sub_job == 'RNG' then
                set_macro_page(6, 1)
            elseif player.sub_job == 'MNK' then
                set_macro_page(8, 1)
            else
                set_macro_page(2, 1)
            end
        end
     end

    with an in-game macro for "/console gs c macro_reset" but that didn't work.

  3. #83

    Quote Originally Posted by BaneTheBrawler View Post
    that seems promising. i'm learning lua on the fly as i go, so i feel like there's a lot of basic syntax stuff that i haven't picked up on but isn't explicitly covered in the resources i'm finding. or if it is, it's not clicking for me. There's not much documentation on self_command that I can find; how does the syntax work? I tried:

    Code:
    function self_command(command)
        if command == 'macro_reset' then
            -- Default macro set/book
            if player.sub_job == 'WAR' then
                set_macro_page(2, 1)
            elseif player.sub_job == 'DNC' then
                set_macro_page(5, 1)
            elseif player.sub_job == 'THF' then
                set_macro_page(7, 1)
            elseif player.sub_job == 'NIN' then
                set_macro_page(4, 1)
            elseif player.sub_job == 'RNG' then
                set_macro_page(6, 1)
            elseif player.sub_job == 'MNK' then
                set_macro_page(8, 1)
            else
                set_macro_page(2, 1)
            end
        end
     end

    with an in-game macro for "/console gs c macro_reset" but that didn't work.
    are you using motes include??
    if so you should use this not self_command
    select_default_macro_book function in motes include was built for the purpose of changing your macro books

    Code:
    function select_default_macro_book()
        -- Default macro set/book
        if player.sub_job == 'WAR' then
            set_macro_page(2, 1)
        elseif player.sub_job == 'DNC' then
            set_macro_page(5, 1)
        elseif player.sub_job == 'THF' then
            set_macro_page(7, 1)
        elseif player.sub_job == 'NIN' then
            set_macro_page(4, 1)
        elseif player.sub_job == 'RNG' then
            set_macro_page(6, 1)
        elseif player.sub_job == 'MNK' then
            set_macro_page(8, 1)
        else
            set_macro_page(2, 1)
        end
    end

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

    i am, but i want this function to fire on a keypress. select_default_macro_book only fires when you change jobs using the includes and the job files from motenten.




    so i need a way to fire select_default_macro_book on keypress/console command, or a function that can be made to fire on keypress/console command, or a console command that fires select_default_macro_book.

  5. #85

    then use the best of both worlds
    Code:
    function select_default_macro_book()
        -- Default macro set/book
        if player.sub_job == 'WAR' then
            set_macro_page(2, 1)
        elseif player.sub_job == 'DNC' then
            set_macro_page(5, 1)
        elseif player.sub_job == 'THF' then
            set_macro_page(7, 1)
        elseif player.sub_job == 'NIN' then
            set_macro_page(4, 1)
        elseif player.sub_job == 'RNG' then
            set_macro_page(6, 1)
        elseif player.sub_job == 'MNK' then
            set_macro_page(8, 1)
        else
            set_macro_page(2, 1)
        end
    end
    function job_self_command(cmdParams, eventArgs)
        if cmdParams[1] == 'macro_reset' then
            select_default_macro_book()
        end
    end
    the reason for cmdParams[1] is because motes include breaks the sent command in to separate strings and creates a table

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

    ah, i remember reading that, but i don't know enough about lua yet to really follow the consequences. that did the trick, thank you! And that taught me a bit more about how functions can be used; should save me some effort later on. very interesting.

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

    that leads me to my next questions: what's the string to check for a gear type? like player.equipment.???? = ('Club') or something. basically, i want to be able to have the script check the true/falseness of a particular weapon type. i know how to have it check for a particular named weapon, like, say, Kraken Club, but I'd like it to identify "yep, that's a club." or "nope that's not a club." without needing to get more specific than that.

    and: how would i set up a second select_default_macro_book function? i want it to be different books than the actual default, so i can't just call select_default_macro_book(), right?

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

    Does anyone else macro disappear? I think I've linked it back to Motenn's auto swap. Its always page 1 that does missing. I am going to change all mine to

    if player.sub_job == 'WAR' then
    set_macro_page(6, 1)

    Right now they are all and its page one that goes blank which is incredibly frustrating.

    if player.sub_job == 'WAR' then
    set_macro_page(1, 1)

    I'll see if page 6 starts disappearing.

    Anyone else have this issue? Is my assumption wrong?

  9. #89

    Quote Originally Posted by BaneTheBrawler View Post
    that leads me to my next questions: what's the string to check for a gear type? like player.equipment.???? = ('Club') or something. basically, i want to be able to have the script check the true/falseness of a particular weapon type. i know how to have it check for a particular named weapon, like, say, Kraken Club, but I'd like it to identify "yep, that's a club." or "nope that's not a club." without needing to get more specific than that.

    and: how would i set up a second select_default_macro_book function? i want it to be different books than the actual default, so i can't just call select_default_macro_book(), right?
    1.
    Code:
    function get_weapon_type(slot)
        local item_data = gearswap.res.items:with('name', player.equipment[slot])
        if item_data.category ~= "Weapon" then
            return nil
        end
        return  gearswap.res.skills:with('name', item_data.skill).en
    end
    check it in your code with
    get_weapon_type(slotname) == "Weapontype"


    2. if you want 2 different setups i would do something like this
    Code:
    function select_default_macro_book()
         -- Default macro set/book
        if player.sub_job == 'WAR' then
            set_macro_page(2, 1)
        elseif player.sub_job == 'DNC' then
            set_macro_page(5, 1)
        elseif player.sub_job == 'THF' then
            set_macro_page(7, 1)
        elseif player.sub_job == 'NIN' then
            set_macro_page(4, 1)
        elseif player.sub_job == 'RNG' then
            set_macro_page(6, 1)
        elseif player.sub_job == 'MNK' then
            set_macro_page(8, 1)
        else
            set_macro_page(2, 1)
        end
    end
        function job_self_command(cmdParams, eventArgs)
        if cmdParams[1] == 'macro_set_1' then
            select_default_macro_book()\
        elseif cmdParams[1] == 'macro_set_2' then
            if player.sub_job == 'WAR' then
                set_macro_page(2, 1)
            elseif player.sub_job == 'DNC' then
                set_macro_page(5, 1)
            elseif player.sub_job == 'THF' then
                set_macro_page(7, 1)
            elseif player.sub_job == 'NIN' then
                set_macro_page(4, 1)
            elseif player.sub_job == 'RNG' then
                set_macro_page(6, 1)
            elseif player.sub_job == 'MNK' then
                set_macro_page(8, 1)
            else
                set_macro_page(2, 1)
            end
        end
    end
    -i only used the same as you for both macro sets

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

    okay, so combining those, i have



    Code:
    function get_weapon_type(slot)
        local item_data = gearswap.res.items:with('name', player.equipment[slot])
        if item_data.category ~= "Weapon" then
            return nil
        end
        return  gearswap.res.skills:with('name', item_data.skill).en
    end
    
    
    
    
    
     function job_self_command(cmdParams, eventArgs)
        if cmdParams[1] == 'macro_set_1' then
            select_default_macro_book()
        elseif cmdParams[1] == 'macro_set_2' then
            if 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
        end
    did i combine it wrong? I also tried replacing 'name' with 'Great Katana' and 'slot' with 'main' but it's not working. Sorry, I know it's probably something basic I'm just not putting together properly.

  11. #91

    for get_weapon_type(slotname) == "Weapontype"


    slotname use one of these
    "main"
    "sub"
    "range"
    "ammo"


    for "Weapontype" use one of these
    "Hand-to-Hand"
    "Dagger"
    "Sword"
    "Great Sword"
    "Axe"
    "Great Axe"
    "Scythe"
    "Polearm"
    "Katana"
    "Great Katana"
    "Club"
    "Staff"
    "Archery"
    "Marksmanship"
    "Throwing"


    make sure to include the ""
    example:
    get_weapon_type("main") == "Great Katana"


    also change
    return gearswap.res.skills:with('name', item_data.skill).en
    to
    return gearswap.res.skills:with('id', item_data.skill).en
    -i messed up sorry

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

    okay, so we have two parts:

    Code:
    function get_weapon_type(slot)
        local item_data = gearswap.res.items:with('name', player.equipment[slot])
        if item_data.category ~= "Weapon" then
            return nil
        end
        return gearswap.res.skills:with('id', item_data.skill).en
    end
    and

    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 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
        end
    end
    i THINK i have part 2 ready, but i'm not sure if i did part 1 correctly, and i know that's the part that lets the second part fire

  13. #93

    Quote Originally Posted by BaneTheBrawler View Post
    okay, so we have two parts:

    Code:
    function get_weapon_type(slot)
        local item_data = gearswap.res.items:with('name', player.equipment[slot])
        if item_data.category ~= "Weapon" then
            return nil
        end
        return gearswap.res.skills:with('id', item_data.skill).en
    end
    and

    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 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
        end
    end
    i THINK i have part 2 ready, but i'm not sure if i did part 1 correctly, and i know that's the part that lets the second part fire
    it looks correct to me

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

    ermergerd! That's because it is; it was a typo in my in-game macro. case matters! it's working now. fantastic! one button gets me all my weaponskills on my macro bar... muahahaha! thanks dude, this is fantastic. DO ALL THE SKILLCHAINS

  15. #95
    E before O except before E-I-E-I-O.
    Join Date
    May 2008
    Posts
    129
    BG Level
    3
    FFXIV Character
    Kyleen Garaka
    FFXIV Server
    Sargatanas
    FFXI Server
    Phoenix

    So I'm having a couple of issues and I'm hoping I can find help here.
    1). When I change jobs, my COR lua loses the ability to toggle gearsets (F9) unless I restart windower.
    2). Line 280 in rolltracker keeps bringing up errors when I use Tacticians or Allies' rolls.

    If you can help, lemme know what I need to post. >_>;;

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

    Related to my post in Windower thread, how do I bind Gearswap to f13-24?

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

    Also, trying to get modes up and running. I'm using the previous script to scan what type of weapon i'm using, but i'm running into a problem: if my range slot is empty, the scan returns nil and the script fails to proceed. how do i make it so that the script continues?

  18. #98

    Quote Originally Posted by BaneTheBrawler View Post
    Also, trying to get modes up and running. I'm using the previous script to scan what type of weapon i'm using, but i'm running into a problem: if my range slot is empty, the scan returns nil and the script fails to proceed. how do i make it so that the script continues?
    i need to see where it fails so i need the code your working on

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

    Code:
    function get_weapon_type(slot)
        local item_data = gearswap.res.items:with('name', player.equipment[slot])
        if item_data.category ~= "Weapon" then
            return nil
        end
        return gearswap.res.skills:with('id', item_data.skill).en
    end
    According to the console, the nil value is being returned from this part



    Code:
        if item_data.category ~= "Weapon" then
            return nil
        end

    but when i tried replacing "return nil" with "return other stuff" it just kept doing the same thing, so i dont think i was approaching that correctly.

  20. #100

    Quote Originally Posted by BaneTheBrawler View Post
    Code:
    function get_weapon_type(slot)
        local item_data = gearswap.res.items:with('name', player.equipment[slot])
        if item_data.category ~= "Weapon" then
            return nil
        end
        return gearswap.res.skills:with('id', item_data.skill).en
    end
    According to the console, the nil value is being returned from this part



    Code:
        if item_data.category ~= "Weapon" then
            return nil
        end

    but when i tried replacing "return nil" with "return other stuff" it just kept doing the same thing, so i dont think i was approaching that correctly.
    replace
    return nil
    with
    return "other"

+ Reply to Thread
Page 5 of 18 FirstFirst ... 3 4 5 6 7 15 ... 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