Item Search
     
BG-Wiki Search
Page 137 of 302 FirstFirst ... 87 127 135 136 137 138 139 147 187 ... LastLast
Results 2721 to 2740 of 6036

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

  1. #2721
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    My own solution to this issue: http://pastebin.com/uFtapgQs

    It tracks runes by name, including the number of each type of rune.
    It expires them appropriately, including something like using Ignis while 3 Ignis runes are up (the oldest is dropped, the newest added, and the numbering is all adjusted).
    It handles Swipe/Lunge/Gambit, though it doesn't account for keeping runes if you kill the mob prematurely.
    It does not remove timers when a rune is lost on buff_change since runes are no longer dispellable. If the rune wears off on its own, the timer should be expiring at the same time, so trying to preemptively remove it will just cause problems.

    I had to push all the timer creation/deletion into a single queued command per event. If I issued the commands individually, they wouldn't always take effect.

    The code for keeping the timers updated is a bit more complicated than I'd like, due to needing to queue the commands, and making sure deleting from a table doesn't screw things up. However all the code is isolated into what should be very easily-understandable function units.

  2. #2722
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by Motenten View Post
    It handles Swipe/Lunge/Gambit, though it doesn't account for keeping runes if you kill the mob prematurely.
    That only applies to Lunge afaik, and duh, completely forgot about that, but meh, it happens rarely, can afford to have timers reset for such a rare situation.
    Gonna try your code when I get a chance Mote, thanks for sharing


    Tested JSH's code and works like a charm.
    Noticed a bit of an issue with the reset but I'm pretty confident that only happened because I was testing in a fake lua instead than in my real one.

  3. #2723
    Hydra
    Join Date
    Sep 2012
    Posts
    118
    BG Level
    3

    I was talking to you. You had code in the precast and aftercast functions that was changing the runecount variable with no checks of actual runecount. That is really bad code and should be avoided. When you are dealing with variables, you don't want to be able to change them anywhere. Usually, you only want to change them within a function specifically for that purpose. It makes it easier for troubleshooting (fewer places to look for the problem) and makes for a more stable program.

    Mote, I have a question about T tables. I was trying to implement a solution similar to yours. If you remove index 1 from a T table does whatever was at index 2 become index 1 or is it still index 2. If so, you should always have the oldest timer at index 1, like a FIFO queue.

  4. #2724
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Mote, I have a question about T tables. I was trying to implement a solution similar to yours. If you remove index 1 from a T table does whatever was at index 2 become index 1 or is it still index 2. If so, you should always have the oldest timer at index 1, like a FIFO queue.
    No, it doesn't work like that unfortunately. If you remove index 1, index 1 is just nil, and index 2 and 3 stay where they are. Any additional entries added are not guaranteed to be in any particular order, either.

    A List would help in some respects, but is incomplete in other respects, so it probably wouldn't be useful in collapsing the code unless you were to get rid of the rune name tracking entirely (ie: just Rune 1, Rune 2, etc, and not Lux-1, Ignis-1, etc).

  5. #2725
    Melee Summoner
    Join Date
    May 2014
    Posts
    38
    BG Level
    1
    FFXI Server
    Bismarck

    Hi everyone,
    Any help is always appreciated.
    Trying to add a rule in Motenten's SAM file to cancel Meditate if TP is greater than 2900TP or if buffactive Sekkanoki.
    Also, if ws is Fudo or Shoha and TP is 3000, equip Vulcan's Pearl

    In my original lua, it read as follows.
    Spoiler: show
    Code:
    if (spell.english == "Tachi: Fudo" or spell.english == "Tachi: Shoha") and (player.tp > 2990 or buffactive.Sekkanoki or (player.tp > 1990 and buffactive.Hagakure)) then -- Equip Vulcan's Pearl When You Have 300 TP or Sekkanoki On or 200+ TP For Hagakure --
    				equipSet = set_combine(equipSet,{ear1="Vulcan's Pearl"})
    			end


    Thank you.

  6. #2726
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Where are you putting that? Anything trying to modify equipSet is pretty much guaranteed to be wrong, since there's absolutely nothing in the user-modifiable areas that passes that in as a parameter. Plus, somehow you're trying to combine equipping gear and cancelling actions in the same rule. That code is just complete nonsense.

    Sekkanoki is already automatically tracked in the state.Buff table, so using that.

    Modifying the weaponskill set is something to be done in post_precast, since you're -modifying- the default action, not replacing or preempting it.

    Code:
    function job_precast(spell, action, spellMap, eventArgs)
        if spell.english == 'Meditate' and (player.tp > 2900 or state.Buff.Sekkanoki) then
            eventArgs.cancel = true
            return
        end
    end
    
    function job_post_precast(spell, action, spellMap, eventArgs)
        if spell.english == 'Tachi: Shoha' or spell.english == 'Tachi: Fudo' then
            if player.tp == 3000 then
                equip({ear1="Vulcan's Pearl"})
            end
        end
    end

  7. #2727
    Melee Summoner
    Join Date
    May 2014
    Posts
    38
    BG Level
    1
    FFXI Server
    Bismarck

    Awesome, thank you. I didn't put that piece of code anywhere as I knew it wouldn't work and is quite nonsensical. I simply wanted to give an example of what I wanted so it's clear.

    I'm really enjoying all your lua files. Thanks for the effort you put into them and for your help!

  8. #2728
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Mote I wanted to try the RUN thing you developed but I'm a bit confused, in spite of the wonderful comments you put in there.
    Which functions do I have to call and from where?

    "update_timers" => in midcast, or maybe aftercast, if spell.type == 'Rune'?

    Not sure I'm getting where I should use reset_timers (is it just for dead, zone and logout?) and where I should use prune

  9. #2729
    Sea Torques
    Join Date
    Jun 2012
    Posts
    570
    BG Level
    5
    FFXI Server
    Asura
    WoW Realm
    The Scryers

    Quote Originally Posted by Sechs View Post
    Mote I wanted to try the RUN thing you developed but I'm a bit confused, in spite of the wonderful comments you put in there.
    Which functions do I have to call and from where?

    "update_timers" => in midcast, or maybe aftercast, if spell.type == 'Rune'?

    Not sure I'm getting where I should use reset_timers (is it just for dead, zone and logout?) and where I should use prune
    Update_timers in aftercast i assume Would be the best place, if rune and if not interrupted.


    Prune is used /called by update_timers or a function inside it...

    About reset, he did mention in his post that it would work using the JA.... But I see no code for it, or anything that check if you lost a rune, so no idea if it's on any of his includes.... Probably best way is to test and check lol

    EDIT:...
    http://pastebin.com/ydTnrTAb

    a working file w/ mote's solution, yea by it self doesnt reset timers on JA, either way interesting the way update timers works.

  10. #2730
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Woops. One of my edits deleted the aftercast function from the pastebin file. Put that back in there.

    Aside from the resets (death/zone/logout), everything is called from the aftercast function.

  11. #2731
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Yes I see it now. You kinda used the approach I thought of but couldn't manage to think how to implement.
    It's very deep and complete, typical Motenten™ style
    Personally I don't like the tracking of the type of rune, imho it's an useless information and I prefer Rune1, 2 and 3 in that list, but regardless I'm sure someone will be happy about that, like JSH maybe?


    Oh, don't forget to add Rayke too in the list where you're adding Gambit and Lunge. It's a merit ability but works exactley like Gambit, expends all current runes.

  12. #2732
    RIDE ARMOR
    Join Date
    Feb 2010
    Posts
    14
    BG Level
    1
    FFXI Server
    Bismarck

    Hi, I have been trying to learn the basics of GS lately and seem to be stuck on the issue of weapon-specific gear sets.

    When I use Mote's BRD gearswap file, for example, when my character is engaged, it will *only* use the sets.engaged, not the sets.engaged.Dagger

    I have tried changing the code to get it to work, and even a simplified script doesnt work. this is what i have so far:

    Doesn't work:
    function pick_tp_weapon()
    if player.equipment.main == "Atoyac" then
    state.CombatWeapon = 'Dagger'
    else state.CombatWeapon = nil
    end
    end
    Works:
    function pick_tp_weapon()
    state.CombatWeapon = 'Dagger'
    end
    Advice is greatly appreciated! Thanks so much~

  13. #2733
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Turn on debugmode and look at what default sets it's trying to equip.

    The brd file is working fine for me right now, so more detailed info may be needed.

  14. #2734
    Puppetmaster
    Join Date
    Apr 2013
    Posts
    63
    BG Level
    2
    FFXI Server
    Asura

    Having an issue with Motes Cor.lua, it keeps using Ma.bullet for Last Stand ws instead of WS.bullet, might be treating it as magical ws and overwring the equip ws.bullet line? any tips how to fix this? any help apreciated.
    using this luahttps://github.com/Kinematics/GearSw...master/COR.lua

  15. #2735
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Hmm. Something changed, and a ton of the physical weaponskills now have elements attached to them. It should be 'None' or 'Physical' for physical weaponskills, and the appropriate element for magical ones. Will have to look into that.

    However, the bullets should be explicitly assigned to the weaponskill sets, so that shouldn't be screwing up which one gets used, only which one it looks for when checking bullet count. Can you verify?

  16. #2736
    Sea Torques
    Join Date
    Nov 2007
    Posts
    694
    BG Level
    5
    FFXI Server
    Asura

    My COR.lua is like 90% that one and Last Stand uses the proper bullet.

  17. #2737
    RIDE ARMOR
    Join Date
    Feb 2010
    Posts
    14
    BG Level
    1
    FFXI Server
    Bismarck

    Quote Originally Posted by Motenten View Post
    Turn on debugmode and look at what default sets it's trying to equip.

    The brd file is working fine for me right now, so more detailed info may be needed.
    So, I went back to the original BRD script, since I definitely screwed up some things during my "learning curve"... here are issues that persist

    1. Equipping engaged.Dagger set:
    If I simply equip my Atoyac, this will not trigger the Dagger mode. I have to equip my Atoyac and then toggle some state (ie. offensemode from Normal to None, etc), before the combat mode will update to dagger. Can you advise how to make a function that performs pick_tp_weapon() whenever I equip a weapon from the brd_daggers list?


    2. Issue equipping SongDebuff set:
    in debugmode, i get
    Default midcast set selection for carnage elegy : None
    all the code looks fine, so im totally confused by this. I was thinking I want to use a fastcast precast set, and then a duration/effect/accuracy midcast set. So far, those midcast sets are not activating.

    3. Terpander users and clarion call:
    When a Terpander user uses clarion call, maxsongs goes up from 3 to 4, so the function duar_song_gap() should ideally account for this... how does this script look?
    function daur_song_gap()
    if player.inventory[info.DaurdablaInstrument] or player.wardrobe[info.DaurdablaInstrument] then

    local maxsongs = 2 + info.DaurdablaSongs
    if buffactive['Clarion Call'] then
    if info.DaudablaSongs == 1 then maxsongs = maxsongs+1
    end
    end

    local activesongs = table.length(custom_timers)

    if activesongs == (maxsongs - info.DaurdablaSongs) then
    return true
    end
    end

    return false
    end

  18. #2738
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    1. Equipping engaged.Dagger set:
    If I simply equip my Atoyac, this will not trigger the Dagger mode. I have to equip my Atoyac and then toggle some state (ie. offensemode from Normal to None, etc), before the combat mode will update to dagger. Can you advise how to make a function that performs pick_tp_weapon() whenever I equip a weapon from the brd_daggers list?
    Not possible without packet-level analysis, which is beyond the complexity of what I want to deal with in my job files for anything that doesn't -really- need it.

    2. Issue equipping SongDebuff set:
    in debugmode, i get
    Code:
    Default midcast set selection for carnage elegy : None
    all the code looks fine, so im totally confused by this. I was thinking I want to use a fastcast precast set, and then a duration/effect/accuracy midcast set. So far, those midcast sets are not activating.
    I'll need to look into this more. That's not expected behavior.

    3. Terpander users and clarion call:
    When a Terpander user uses clarion call, maxsongs goes up from 3 to 4, so the function duar_song_gap() should ideally account for this... how does this script look?
    daur_song_gap() is used as part of the old auto-daurdabla code. I disabled that by default a while back because of problems it had, and have removed it entirely in recent (dev) versions. Fixing it is not relevant anymore.

    Also, for your above code, max songs should increase by 1 regardless of what info.DaurdablaSongs is (which is also misspelled). Also, your activesongs conditional wouldn't work at all.

  19. #2739
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    @Suteru: Just noticed that the post_* processing of commands were not being called at the user_ level, which is why your stuff wasn't working. user_post_precast/midcast/etc (ie: global versions for these events) should now be working on dev.

    Sorry about the confusion.

  20. #2740
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    General notice: Dev branch, with the new mode var usage, is going to be merged to live soon. Please be ready to update your files for jobs based on my libraries.

    Note that your job files will still work fine without updating them; they'll use the last library update from the older version. You'll just get the notice when you first load a non-updated file as a reminder.

Page 137 of 302 FirstFirst ... 87 127 135 136 137 138 139 147 187 ... LastLast

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45