Item Search
     
BG-Wiki Search
Page 64 of 302 FirstFirst ... 14 54 62 63 64 65 66 74 114 ... LastLast
Results 1261 to 1280 of 6036

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

  1. #1261
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    it needs to be
    sets.precast.FC["Blue Magic"]

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

    Quote Originally Posted by dlsmd View Post
    Quote Originally Posted by Motenten
    Not quite. You don't want Stop.spells[spell.english], you want Stop.spells:contains(spell.english).
    why not it works for me on all the ones i use it on
    like
    Waltz.spells[spell.name]
    From page 17 of this thread:

    Quote Originally Posted by Arcon View Post
    You can do it, but like I said, it will backfire in some cases, because [] looks up values in the metatable first, which searches through the "set" and the "table" table for the right keys. Meaning, S{'name', 'id', 'count'}['count'] would be true, as you expect it to. However, S{'name', 'id'}['count'] would also be true, which you wouldn't expect. That's because "count" is a key in the "table" table. Everything that's used as a key in the "set" or "table" table would be invalid as a parameter, which could fuck up a few things. Also, despite what it looks like, this is slower than set.contains. You would think it's just a look-up, but thanks to the metamethod definition it's actually a function call that looks for the key in three tables.

  3. #1263
    RIDE ARMOR
    Join Date
    Jun 2011
    Posts
    11
    BG Level
    1
    FFXI Server
    Sylph

    thanks

    dlsmd and moten thanks for the help it works like a charm i would have liked to have it do like a counter thing were if i was paralyzed but i really had to use that ja to win the fight i could try it and on the third time it would unlock and do it but that seams like alot of work so i wont bother >.> thanks again

  4. #1264
    RIDE ARMOR
    Join Date
    Jun 2011
    Posts
    11
    BG Level
    1
    FFXI Server
    Sylph

    then would
    if spell.name == "Ranged"

    then be better off

    if spell:contains(spell.english, 'Ranged') then

    ?

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

    Quote Originally Posted by theblackdeath View Post
    then would
    if spell.name == "Ranged"

    then be better off

    if spell:contains(spell.english, 'Ranged') then

    ?
    No. What you wrote -- spell:contains(spell.english, 'Ranged') -- will never work. It's not looking at the right thing in remotely the right way.

    spell.name == "Ranged" is... 'adequate', but well down the list of the way I would do it.

    In order of preference, I'd use one of:

    if spell.action_type == "Ranged Attack" then
    if spell.english == "Ranged" then
    if spell.name == "Ranged" then

  6. #1266
    RIDE ARMOR
    Join Date
    Jun 2011
    Posts
    11
    BG Level
    1
    FFXI Server
    Sylph

    replace

    so would there be a faster way of doing

    if spell.type == 'WeaponSkill' then

  7. #1267
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Motenten so you saying that i have to do this

    Code:
    	Waltz.debuff = S{'Max HP Down','Max MP Down','Magic Evasion Down','Max TP Down','Magic Atk. Down','Magic Acc. Down','Magic Def. Down','Defense Down','Evasion Down','Attack Down','Accuracy Down','CHR Down','AGI Down','DEX Down','VIT Down','MND Down','INT Down','STR Down','Bane','Bio','Blind','Curse','Dia','Disease','Shock','Rasp','Choke','Frost','Burn','Drown','Flash','Paralyze','Plague','Poison','Silence','Slow','Weight'}
    	Waltz.debuff[buffactive]
    like this
    Code:
    (buffactive['Max HP Down'] or buffactive['Max MP Down'] or buffactive['Magic Evasion Down'] or buffactive['Max TP Down'] or buffactive['Magic Atk. Down'] or buffactive['Magic Acc. Down'] or buffactive['Magic Def. Down'] or buffactive['Defense Down'] or buffactive['Evasion Down'] or buffactive['Attack Down'] or buffactive['Accuracy Down'] or buffactive['CHR Down'] or buffactive['AGI Down'] or buffactive['DEX Down'] or buffactive['VIT Down'] or buffactive['MND Down'] or buffactive['INT Down'] or buffactive['STR Down'] or buffactive.bane or buffactive.Bio or buffactive.blindness or buffactive.curse or buffactive.Dia or buffactive.disease or buffactive.Shock or buffactive.Rasp or buffactive.Choke or buffactive.Frost or buffactive.Burn or buffactive.Drown or buffactive.Flash or buffactive.paralysis or buffactive.plague or buffactive.poison or buffactive.silence or buffactive.slow or buffactive.weight)

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

    @dlsmd: That would be the long way of doing it, yes. And yes, the second would be correct, while the first would not work.

    However a better way to do it would be to use certain functions:

    Code:
    buffs_to_check = S{'Max HP Down','Max MP Down','Magic Evasion Down','Max TP Down','Magic Atk. Down','etc...'}
    
    ~
    
    function precast(spell)
        if has_any_buff_of(buffs_to_check) then
            -- do whatever
        end
    end
    
    
    -- utility functions to make using this call as simple as possible:
    
    -- buff_set is a set of buffs in a library table (any of S{}, T{} or L{}).
    -- This function checks if any of those buffs are present on the player.
    function has_any_buff_of(buff_set)
        return buff_set:any(has_buff())
    end
    
    -- Helper function to return the evaluation function used by has_any_buff_of.
    function has_buff()
        return function (b) return buffactive[b] end
    end

  9. #1269
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Motenten View Post
    @dlsmd: That would be the long way of doing it, yes. And yes, the second would be correct, while the first would not work.

    However a better way to do it would be to use certain functions:

    Code:
    buffs_to_check = S{'Max HP Down','Max MP Down','Magic Evasion Down','Max TP Down','Magic Atk. Down','etc...'}
    
    ~
    
    function precast(spell)
        if has_any_buff_of(buffs_to_check) then
            -- do whatever
        end
    end
    
    
    -- utility functions to make using this call as simple as possible:
    
    -- buff_set is a set of buffs in a library table (any of S{}, T{} or L{}).
    -- This function checks if any of those buffs are present on the player.
    function has_any_buff_of(buff_set)
        return buff_set:any(has_buff())
    end
    
    -- Helper function to return the evaluation function used by has_any_buff_of.
    function has_buff()
        return function (b) return buffactive[b] end
    end
    i dont see how that works can you explain it to me??

    i think that
    has_any_buff_of(buffs_to_check)
    sends the buffs i want to check to
    function has_any_buff_of

    if im thinking correctly
    Code:
    function has_buff()
        return function (b) return buffactive[b] end
    end
    creates a table with all of my current buffs in it
    and
    Code:
    function has_any_buff_of(buff_set)
        return buff_set:any(has_buff())
    end
    checks to see if any of my buffs to check are in the table of the buffs i have
    im not sure if this is correct

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

    May I ask what you wanna do? Coz IMO would be easier just to list the debuff healing waltz can't remove...

  11. #1271
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by JSHidaka View Post
    May I ask what you wanna do? Coz IMO would be easier just to list the debuff healing waltz can't remove...
    no because there are hundreds that it cant

    and im only checking for the ones that would not stop you from using it

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

    Quote Originally Posted by dlsmd View Post
    i think that
    has_any_buff_of(buffs_to_check)
    sends the buffs i want to check to
    function has_any_buff_of
    Correct.

    Quote Originally Posted by dlsmd View Post
    if im thinking correctly
    Code:
    function has_buff()
        return function (b) return buffactive[b] end
    end
    creates a table with all of my current buffs in it
    Not correct.

    Quote Originally Posted by dlsmd View Post
    and
    Code:
    function has_any_buff_of(buff_set)
        return buff_set:any(has_buff())
    end
    checks to see if any of my buffs to check are in the table of the buffs i have
    Sort of correct, but not entirely.


    Quote Originally Posted by dlsmd View Post
    i dont see how that works can you explain it to me??
    This just lists the buffs you're checking for:
    Code:
    buffs_to_check = S{'Max HP Down','Max MP Down','Magic Evasion Down','Max TP Down','Magic Atk. Down','etc...'}

    This calls the utility function, passing it the above list as the parameter to check.
    Code:
    function precast(spell)
        if has_any_buff_of(buffs_to_check) then
            -- do whatever
        end
    end
    This uses the :any() function that's defined for all library tables (S/L/T). The :any() function iterates over the list and calls the function you pass as the parameter on each one. If at any time the result of using the function on one of the values of the list is true, :any() returns true. Otherwise, once it goes through the entire list, it returns false.
    Code:
    function has_any_buff_of(buff_set)
        return buff_set:any(has_buff())
    end

    This provides the function that's being passed as a parameter to :any(). I set it as a separate function to make things a little bit less of a garbled mess.
    The function that gets passed to :any() takes a single parameter (the value of the list to be checked) and tests to see whether a buff of that name is active on the player. If so, it returns true; otherwise false.
    Code:
    function has_buff()
        return function (b) return buffactive[b] end
    end

    So the overall logic, if written entirely in the precast() function, expands out so that:
    Code:
    function precast(spell)
        if has_any_buff_of(buffs_to_check) then
            -- do whatever
        end
    end
    becomes:
    Code:
    function precast(spell)
        local has_buff = false
        
        for val in buffs_to_check do
            if buffactive[val] then
                has_buff = true
                break
            end
        end
        
        if has_buff then
            -- do whatever
        end
    end
    Though there's some extra stuff in :any() that handles the differences between the different types of library tables as well.

  13. #1273
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    thx mote that explains it for me

  14. #1274
    Smells like Onions
    Join Date
    May 2014
    Posts
    3
    BG Level
    0

    I seem to have trouble with the Black Mage lua that is in the shop thread, the one by Kinematics.

    It doesn't seem to actually swap between the low tier nuking (default nuking set in it's case) and high tier nuking at all. It only uses the default set no matter what nuke I cast.
    Everything else seems to work fine, curing, enfeebles, etc, it's only the high tier gear swap that it's not doing. Even with no edits to the lua, it's still not swapping to high tier.

    I have all the motes if that's relevant.

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

    If you have not updated from the github repository recently, make sure that all sets that have skills in their name are changed from .ElementalMagic to ['Elemental Magic'], etc.

  16. #1276
    Smells like Onions
    Join Date
    May 2014
    Posts
    3
    BG Level
    0

    I used the exact one that's on github right now (the one that your signature links point to.) I tried it not even a few hours ago. So it's as recent as it can be. Which is why I'm wondering if it's a fault in the script.

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

    Ok, I'd missed some additional instances that needed to be fixed. Updated and pushed to master branch on github.

  18. #1278
    Smells like Onions
    Join Date
    May 2014
    Posts
    3
    BG Level
    0

    Awesome. Works perfectly now. Thanks a bunch. What was it that you fixed?

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

    Can I use a variable in place of an equipment name inside of a set?
    Example:

    set.Test = {head=Var}

    Somewhere else, presumably before I define that set, I'd define Var = 'Equip Name'.

  20. #1280
    BG Content
    Join Date
    Jul 2007
    Posts
    22,361
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Yes, but only if you use Var = {name="Equip Name"}

    If Var is a string, it will undergo static assignment when set.Test is first defined. If it is a table, the table ID will be assigned to set.Test.head, and then you're free to change set.Test.head.name to be whatever you want.

Page 64 of 302 FirstFirst ... 14 54 62 63 64 65 66 74 114 ... LastLast

Similar Threads

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