Item Search
     
BG-Wiki Search
Page 22 of 302 FirstFirst ... 12 20 21 22 23 24 32 72 ... LastLast
Results 421 to 440 of 6036

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

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

    It seems solid, so another revision: Instead of init_user_gear_sets and user_unload functions, they should be init_gear_sets and file_unload, the same as the functions in the main job file (but still attached to the user table when defined). This simplifies things a bit, and should be less confusing to write.

    haruhigumi: you'll want to tweak the get_sets and file_unload functions of your main rng file (as well as update Mote-Utility). Only a few lines are changed.

  2. #422
    Hydra
    Join Date
    Aug 2011
    Posts
    140
    BG Level
    3
    FFXI Server
    Leviathan

    Kiting still doesn't work even with the latest changes (note 21st version of both files here)

    http://pastebin.com/u/KBeezie

    It's not showing the swaps when I toggle kiting on/off.

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

    Quote Originally Posted by haruhigumi View Post
    Kiting still doesn't work even with the latest changes (note 21st version of both files here)

    http://pastebin.com/u/KBeezie

    It's not showing the swaps when I toggle kiting on/off.
    As I just said, you need to change init_user_gear_sets to init_gear_sets, and user_unload to fiile_unload. They're now simply replacing the same functions in the main file.

  4. #424
    Hydra
    Join Date
    Oct 2009
    Posts
    109
    BG Level
    3
    FFXI Server
    Bismarck

    What would the code be for switching idle sets depending on my sub job?

    IE: for Corsair (using Motes lua) sometimes my linkshell requires me to go /whm to help out with status removals and such.

    When this happens, I would like to alter my Idle set to include some auto refresh and more MP.

    So some code that changes my Idle set to "sets.idle.mage" when my sub job is a mage job, and defaults back to the normal set on others.

  5. #425
    RIDE ARMOR
    Join Date
    Jan 2014
    Posts
    12
    BG Level
    1
    FFXI Server
    Fenrir

    Quote Originally Posted by Eastaran View Post
    What would the code be for switching idle sets depending on my sub job?

    IE: for Corsair (using Motes lua) sometimes my linkshell requires me to go /whm to help out with status removals and such.

    When this happens, I would like to alter my Idle set to include some auto refresh and more MP.

    So some code that changes my Idle set to "sets.idle.mage" when my sub job is a mage job, and defaults back to the normal set on others.
    You could set up a different Idle mode (something like options.IdleModes = {'Normal', 'Refresh'} instead of options.IdleModes = {'Normal'}) and then just have a keybind set to toggle the Idle Mode (something like windower.send_command('bind !f12 gs c cycle IdleMode')) and then then you would just need a sets.Idle and a sets.Idle.Refresh ... although that isn't automatic based on your sub changing but it would give you the flexibility if you wanted it to be on another sub for some reason.

  6. #426
    Hydra
    Join Date
    Aug 2011
    Posts
    140
    BG Level
    3
    FFXI Server
    Leviathan

    Quote Originally Posted by Motenten View Post
    As I just said, you need to change init_user_gear_sets to init_gear_sets, and user_unload to fiile_unload. They're now simply replacing the same functions in the main file.
    Out of curiosity, could something like function user.define_global_sets() be used inside of the _gear file ? or what would be the proper place to override the global gear.default.* on a per job basis, would it still work if I defined them in init_gear_sets since the sidecar is loaded after importing global?

    PS: I am aware that at the current moment the defaults (obi, etc) isn't currently working, but more of preparation for when it is.

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

    You could move the function to the sidecar file, but it wouldn't get run, so that won't work. On the other hand, you can redefine any of the vars from the global in the init_gear_sets function and it would override what was already set, so you can do it that way.

  8. #428
    Hydra
    Join Date
    Aug 2011
    Posts
    140
    BG Level
    3
    FFXI Server
    Leviathan

    Quote Originally Posted by Motenten View Post
    You could move the function to the sidecar file, but it wouldn't get run, so that won't work. On the other hand, you can redefine any of the vars from the global in the init_gear_sets function and it would override what was already set, so you can do it that way.
    Ahh ok, that's what I thought, just wanted to double check with you.

  9. #429
    Hydra
    Join Date
    Oct 2009
    Posts
    109
    BG Level
    3
    FFXI Server
    Bismarck

    Quote Originally Posted by Animetwins View Post
    You could set up a different Idle mode (something like options.IdleModes = {'Normal', 'Refresh'} instead of options.IdleModes = {'Normal'}) and then just have a keybind set to toggle the Idle Mode (something like windower.send_command('bind !f12 gs c cycle IdleMode')) and then then you would just need a sets.Idle and a sets.Idle.Refresh ... although that isn't automatic based on your sub changing but it would give you the flexibility if you wanted it to be on another sub for some reason.
    I can live with this, thanks!

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

    Can anyone check this... This code used to work before the update...

    Code:
    function buff_change(status,gain_or_loss)
        if status == "Boost" then
            if gain_or_loss == "gain" then
                if sets.aftercast.TP == sets.TP.Acc then
    				sets.precast['Victory Smite'] = sets.precast.VSImpacc
    				send_command('@input /echo Victory Smite WS Set = ImpAcc ')
    			else
    				equip(sets.TP.Impetus)
    				sets.aftercast.TP = sets.TP.Impetus			
    				sets.precast['Victory Smite'] = sets.precast.VSImpetus
    				send_command('@input /echo Victory Smite WS Set = VSImpetus ')			
    			end
            else
                if sets.aftercast.TP == sets.TP.Acc then
    				sets.precast['Victory Smite'] = sets.precast.VSACC
    				send_command('@input /echo Victory Smite WS Set = Acc ')
    			else
    				equip(sets.TP.DD)
    				sets.aftercast.TP = sets.TP.DD
    				sets.precast['Victory Smite'] = sets.precast.VSDD
    				send_command('@input /echo Victory Smite WS Set = Normal ')			
    			end
            end
        end
    end
    this is for Impetus.. but changed it to boost to test it...

    When I gain or lost boost... it go directly to this part "Victory Smite WS Set = Normal"
    So When I gain the boost GS is saying I'm loosing it ...
    But when I'm loosing it no matter if I'm on PDT or not. it will go as If I had DD set on..

    Is like if it isnt checking the conditions and go directly to the "else" parts or the conditions are false..

    http://pastebin.com/ULm7rip2 this is the lua I'm using to test it atm.. did "disable" the aftercast swaps..

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

    gain_or_loss is a bool value, not a string, now (and has been for a few weeks, so shouldn't have just changed this update). Can write as:

    Code:
    function buff_change(status,gain)
        if status == "Boost" then
            if gain then
    
    ... etc

  12. #432
    Puppetmaster
    Join Date
    Oct 2012
    Posts
    73
    BG Level
    2
    FFXI Server
    Bahamut

    Quote Originally Posted by JSHidaka View Post
    Can anyone check this... This code used to work before the update...

    Code:
    function buff_change(status,gain_or_loss)
        if status == "Boost" then
            if gain_or_loss == "gain" then
                if sets.aftercast.TP == sets.TP.Acc then
    				sets.precast['Victory Smite'] = sets.precast.VSImpacc
    				send_command('@input /echo Victory Smite WS Set = ImpAcc ')
    			else
    				equip(sets.TP.Impetus)
    				sets.aftercast.TP = sets.TP.Impetus			
    				sets.precast['Victory Smite'] = sets.precast.VSImpetus
    				send_command('@input /echo Victory Smite WS Set = VSImpetus ')			
    			end
            else
                if sets.aftercast.TP == sets.TP.Acc then
    				sets.precast['Victory Smite'] = sets.precast.VSACC
    				send_command('@input /echo Victory Smite WS Set = Acc ')
    			else
    				equip(sets.TP.DD)
    				sets.aftercast.TP = sets.TP.DD
    				sets.precast['Victory Smite'] = sets.precast.VSDD
    				send_command('@input /echo Victory Smite WS Set = Normal ')			
    			end
            end
        end
    end
    this is for Impetus.. but changed it to boost to test it...

    When I gain or lost boost... it go directly to this part "Victory Smite WS Set = Normal"
    So When I gain the boost GS is saying I'm loosing it ...
    But when I'm loosing it no matter if I'm on PDT or not. it will go as If I had DD set on..

    Is like if it isnt checking the conditions and go directly to the "else" parts or the conditions are false..

    http://pastebin.com/ULm7rip2 this is the lua I'm using to test it atm.. did "disable" the aftercast swaps..
    IIRC, gain_or_loss in that function was changed to a bool value. Try:

    Code:
    ..if 'gain_or_loss' then..
    If that's not it, then I'm not sure.

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

    Nope.. tried
    Code:
    if 'gain_or_loss' then
    if 'gain' then
    if 'loss' then
    and the same w/ " " -_-...
    Now instead going to the last condition give me the second "Victory Smite WS Set = VSImpetus" gaining or loosing it...

    found the solution...

    Code:
    function buff_change(status,gain_or_loss)
        if status == "Boost" and gain_or_loss then
                if sets.aftercast.TP == sets.TP.Acc then
    				sets.precast['Victory Smite'] = sets.precast.VSImpacc
    				send_command('@input /echo Victory Smite WS Set = ImpAcc ')
    			else
    				if sets.aftercast.TP == sets.MDT then
    					sets.precast['Victory Smite'] = sets.precast.VSImpetus
    					send_command('@input /echo Victory Smite WS Set = P/MDT - VSImpetus ')			
    				else
    					equip(sets.TP.Impetus)
    					sets.aftercast.TP = sets.TP.Impetus			
    					sets.precast['Victory Smite'] = sets.precast.VSImpetus
    					send_command('@input /echo Victory Smite WS Set = VSImpetus ')	
    				end
    			end
            else
                if sets.aftercast.TP == sets.TP.Acc then
    				sets.precast['Victory Smite'] = sets.precast.VSACC
    				send_command('@input /echo Victory Smite WS Set = Acc ')
    			else
    				if sets.aftercast.TP == sets.MDT then
    					equip(sets.MDT)
    					sets.precast['Victory Smite'] = sets.precast.VSDD
    					send_command('@input /echo Victory Smite WS Set = Normal -- MDT SET ON')	
    				else
    					equip(sets.TP.DD)
    					sets.aftercast.TP = sets.TP.DD
    					sets.precast['Victory Smite'] = sets.precast.VSDD
    					send_command('@input /echo Victory Smite WS Set = Normal ')			
    				end
    			end
        end
    end
    now another question..

    isnt this like correct

    if sets.aftercast.TP == sets.MDT or sets.aftercast.TP == sets.PDT then ?

    coz when I used it.. give me false response.. go to else

  14. #434
    The Syrup To Waffles's Waffle
    Join Date
    Jun 2007
    Posts
    5,045
    BG Level
    8
    FFXIV Character
    Cair Bear
    FFXIV Server
    Excalibur
    FFXI Server
    Fenrir

    Set comparison is by reference, it doesn't do a binary check on the contents.

    I believe there is table.equals(t1,t2) which does this sort of thing, though I'm not positive.

  15. #435
    Sea Torques
    Join Date
    Sep 2012
    Posts
    736
    BG Level
    5
    FFXI Server
    Leviathan

    If you wanna compare two sets, you can also do this:
    if (s1 ^ s2):empty() then

    It's a bit hacky, but it works.

    Explanation for the nerds:
    ^ is the symmetric set difference, so it creates a new set containing only elements that are only in one of the two sets, but not in both. If both sets are the same, the symmetric difference will be empty (because all elements are in both sets, there are no elements that are only in one of the two). Calling :empty() on a set returns true if that set is empty, hence the above will return true if the symmetric difference is empty, i.e. if the two sets only contain the same elements, i.e. if they're (by the mathematical definition) equal.

  16. #436
    Sea Torques
    Join Date
    Sep 2012
    Posts
    736
    BG Level
    5
    FFXI Server
    Leviathan

    Actually, I lie, and cair lied as well. s1 == s2 works fine.

  17. #437
    BG Content
    Join Date
    Jul 2007
    Posts
    22,370
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Yeah, they're just table references.

  18. #438
    Sea Torques
    Join Date
    Sep 2012
    Posts
    736
    BG Level
    5
    FFXI Server
    Leviathan

    Sets overload the equality operator to call set.equals, so s1 == s2 will work even if they're different tables with the same content.

    Also, as for the above:
    Code:
    if 'gain_or_loss' then
    This will always be true, since 'gain_or_loss' is a string. If anything, it should be:
    Code:
    if gain_or_loss then

  19. #439
    BG Content
    Join Date
    Jul 2007
    Posts
    22,370
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Sets is not a "set" in the library sense. It's just a table:
    Code:
            sets={naked = {main=empty,sub=empty,range=empty,ammo=empty,
                    head=empty,neck=empty,ear1=empty,ear2=empty,
                    body=empty,hands=empty,ring1=empty,ring2=empty,
                    back=empty,waist=empty,legs=empty,feet=empty}}

  20. #440
    Sea Torques
    Join Date
    Sep 2012
    Posts
    736
    BG Level
    5
    FFXI Server
    Leviathan

    Ah, those sets... I probably should have read the question, and not just the response

    @JHidaka
    How/where do you define sets.aftercast.TP and sets.MDT? If you set them by reference (i.e. sets.aftercast.TP = sets.MDT), then you can compare them by reference (==). If you define both of them explicitly then it won't work and you need to use table.equals instead. Honestly, it looks like defining a variable might be more appropriate in this case, but I'm not sure without looking at the bigger picture.

Page 22 of 302 FirstFirst ... 12 20 21 22 23 24 32 72 ... LastLast

Similar Threads

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