Item Search
     
BG-Wiki Search
Closed Thread
Page 286 of 302 FirstFirst ... 236 276 284 285 286 287 288 296 ... LastLast
Results 5701 to 5720 of 6036

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

  1. #5701
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    weakness/Refresh are a buffs not a statuses
    all the known statuses are in Windower4\res\statuses.lua
    Makes sense.

    My next guess before I just tinker around would be changing that if player.status == 'Weakness' then line to if buffactive['Weakness'] then

  2. #5702

    Quote Originally Posted by Spicyryan View Post
    Makes sense.

    My next guess before I just tinker around would be changing that if player.status == 'Weakness' then line to if buffactive['Weakness'] then
    no buffactive['weakness']

  3. #5703
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    no buffactive['weakness']
    Actually got around to testing the rule just now, and it does work as:


    Code:
    function IdleState()
        ChangeGear(sets.Idle[sets.Idle.index[Idle_ind]])
        if buffactive['Weakness'] then
    		ChangeGear({head = "Twilight Helm", body = "Twilight Mail"})
    	elseif player.sub_job:contains('WHM', 'BLM', 'RDM', 'SMN', 'BLU', 'SCH', 'GEO', 'PLD', 'DRK', 'RUN') and player.mpp < 75 then
            ChangeGear({head = "Jumalik Helm", body = "Chozoron Coselete"})
        end
    	
    end
    Happy I got it working before posting pretty much, its nice to have a basic competency in something :D.
    The only issue is if I don't have the gear for the slot, say I leave my refresh head and body in the MH from DRG, and cast a spell /mage. My precast/midcast will come on and then my idle will equip in all but those two spots. Is there something that will avoid this?

    While the weakness thing works too, there is probably a better way of handling that. It is conceivable that since nothing is locked there, I could preform an action the same time I die and lose the reraise from the set. I wonder how others handle that.

    Here is what I have worked up so far

  4. #5704
    Old Merits
    Join Date
    Sep 2010
    Posts
    1,094
    BG Level
    6
    FFXI Server
    Ragnarok

    Well, you could do an inventory check for the items in question.

    Code:
    if not player.inventory["Refresh body"] then
    --Stuff to do if your refresh body isn't in inv
    end
    Although, this only searches inventory, not wardrobe. So keep that in mind.

  5. #5705
    Old Merits
    Join Date
    Sep 2010
    Posts
    1,094
    BG Level
    6
    FFXI Server
    Ragnarok

    Looking over you lua, very briefly since I'm at work.

    It's really inefficient to have rules for every ja, when all the rule does is equip the matching set. Almost every lua I've ever seen handles ja, and a lot of spells as follows.

    Code:
    if sets.JA[spell.english] then
    		equip(sets.JA[spell.english])
    although in your case it would be ChangeGear not equip.

    The rule here checks to see if any sets matching sets.JA. then the exact English spell name. This means that if you have a sets.JA.Jump and you are using jump, it would equip that set.

    Notes on set names. For single word names just sets.JA.JAname works fine. But for anythings with a space or an apostrophe in it, you will need to do, sets.JA["JAname"]. Keep in mind that this is all case sensitive. So sets.JA.Jump would trigger, but sets.JA.jump would not.

    Much the same system is often used for WS as well.

    /mage healing breath triggers. You have;

    Code:
    if spell.action_type == 'Magic' and player.hpp <= 50 then
    		ChangeGear(sets.HB.Trigger)
    	end
    The issue with this is two fold. 1, swapping gear changes HP. so after your swap, you might not have the HP gap to HB anymore. 2, It's fairly standard practice for DRG/mage, when anyone even uses it anymore, to swap in HP+ gear on the trigger spell, to raise the threshold at which you can trigger a healing breath. Naturally, if you're only swapping in Armet when HP is already at or below 50%, this would be pretty pointless.

    EDIT2: Wait, that's at or greater than 50% HP... So are you going for a swap HP when above 50% and just armet when below? Cause the B. Trigger set only had armet in it, and i don't see an else rule to handle below 50%... that <= a typo?

    Anyway, I'll look over this some more as I have time and tell you if I notice anything else.


    EDIT:
    Code:
    	--The Freshmaker--
    	sets.HB.Mentos = {
    		head = "Pteroslaver Armet"
    	}
    This cracked me up.

  6. #5706

    Quote Originally Posted by Martel View Post
    Looking over you lua, very briefly since I'm at work.

    It's really inefficient to have rules for every ja, when all the rule does is equip the matching set. Almost every lua I've ever seen handles ja, and a lot of spells as follows.

    Code:
    if sets.JA[spell.english] then
            equip(sets.JA[spell.english])
    no this is not inefficient at all it is vary efficient
    this is because there is only one check every time this line runs
    it is infact more efficient then running
    Code:
    if spell.english == "janame" then
            equip(sets.JA.set_name)
    because it does not check the spell.name against all prior spell names in the if/elseif/else sequence
    Code:
    if sets.JA[spell.english] then
    just checks to see if the table sets.JA[spell.english] exists
    there is one issue that can arrise and that is when you create a gearset that does not have any gear in it but you want it to equip your default gear for that type but because you do not have any gear in the sets.JA[spell.english] table it will not change gear at all

  7. #5707
    Old Merits
    Join Date
    Sep 2010
    Posts
    1,094
    BG Level
    6
    FFXI Server
    Ragnarok

    My mistake then.

    Let me rephrase. It's far less a pain the ass than to have to write a rule for every action. It's time efficient from a personal perspective. This way when adding a new set for an action, all you have to do is make the set in the correct format.

  8. #5708

    Quote Originally Posted by Martel View Post
    My mistake then.

    Let me rephrase. It's far less a pain the ass than to have to write a rule for every action. It's time efficient from a personal perspective. This way when adding a new set for an action, all you have to do is make the set in the correct format.
    It is efficient in both code run time and coding time because of the fact that all you need to do is what you stated above

  9. #5709
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by Martel View Post
    EDIT2: Wait, that's at or greater than 50% HP... So are you going for a swap HP when above 50% and just armet when below? Cause the B. Trigger set only had armet in it, and i don't see an else rule to handle below 50%... that <= a typo?

    Anyway, I'll look over this some more as I have time and tell you if I notice anything else.


    EDIT:
    Code:
    	--The Freshmaker--
    	sets.HB.Mentos = {
    		head = "Pteroslaver Armet"
    	}
    This cracked me up.
    That is a <= 50% meaning if it is less than or equal to 50%. I like the idea of adding HP gear into the trigger set (I was a DRG back at 75, and then Voidwatch with OAT polearm until years away from it so I am familiar with that ), but this is by far a manual process. I just made a NQ Plackart last night so needless to say my gear isn't all gathered. I can't think of any way to have it account for the increase though aside from specifying it.

    And yes, I enjoyed being silly with it like I always do. Like with the message players see when they first load the GS.

    Quote Originally Posted by Martel View Post
    My mistake then.

    Let me rephrase. It's far less a pain the ass than to have to write a rule for every action. It's time efficient from a personal perspective. This way when adding a new set for an action, all you have to do is make the set in the correct format.
    But it's not a pain in the ass. It's not hard to type out a few sets there. Frankly it's easier to visually organize that way is why I do it. I do appreciate the interest in and help with my GS though. I know it can use more polish before I offer it out to others for their uses like my BLU one.
    If my RUN one (looks like this one but tp and tanking sets are in the same toggle...) didn't suck, I'd put it in my pastebin for others too.

  10. #5710
    Old Merits
    Join Date
    Sep 2010
    Posts
    1,094
    BG Level
    6
    FFXI Server
    Ragnarok

    Hmm, I may possibly retarded when it comes to < and > or something. Well, that's why I always test this stuff first.

    It should be entirely possible to calculate your post swap HP, but there are various factors that complicate it. HP+/- buffs, atma/atmacite,vorseals, food, etc.

    What I did was just choose a specific set of spells as trigger spells, then have those spells always swap for a healing breath. That way they can trigger, if possible even when cursed,/HP downed, etc.

    Then you just need to know how much total HP you have in your trigger set to get your threshold, so you know when you're able to trigger. That said, I don't think /mage gets much use anymore with Trusts being a thing.

    Quote Originally Posted by Spicyryan View Post
    But it's not a pain in the ass. It's not hard to type out a few sets there. Frankly it's easier to visually organize that way is why I do it.
    I'm not sure if we're talking about writing case by case rules being a pain or making sets being a pain now. I meant the former. But it's your lua, do what you want.

    You've got an Odyllic Subterfuge rule in there with your JA.

    The warcry rule references a set that doesn't exist. sets.JA.Warcry. Would throw an error on use.

    Also sets.JA.Provoke appears to just be a set_combine with a sets.Enmity. Not in and of itself a problem, but... There is no gear that directly enhances Provoke specifically(as opposed to just enmity+ gear) and there's no DRG wearable warcry gear. Why not just have the rules for voke/warcry point to directly sets.Enmity? Although you might consider a toggle for warcry depending on if you actually want to be pulling hate or not.

    Ditto Meditate. DRG can't wear anything that enhances it, and the set referenced in the rules doesn't exist.
    Code:
    function pet_midcast(spell, act)
    	if string.find(spell.english,'Healing Breath') or spell.english == 'Steady Wing' or spell.english == 'Smiting Breath' then
    		ChangeGear(sets.HB.Mentos)
    	end
    end
    Steady wing is a player used JA. The wyvern just receives the effect, much like spirit link. The steady wing portion of this rule would never be true since pet_midcast would never activate on steady wing.

    When you use smiting breath, the spell name that passes for the pet midcast, is going to be the name of the breath the wyvern uses, Flame breath, etc. Not Smiting breath.

    Healing breath, Smiting breath, and steady wing should all have different sets.

    -Healing breath uses a mix of breath+ and WHP+.
    -Smiting is all Breath+, and no WHP+, since elemental breaths are based on current wyvern HP, rather than max like HB.
    -Steady wing should be all WHP+.

    line 280 in pc_magic
    if spell.skill == 'BlueMagic' then

    I'm fairly sure you'd need a space between blue and magic for that to ever return true.

    Line 249
    if IgnoreWS:contains(spell.english) then

    The table IgnoreWS doesn't exist in this lua.

  11. #5711
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by Martel View Post
    Hmm, I may possibly retarded when it comes to < and > or something. Well, that's why I always test this stuff first.

    It should be entirely possible to calculate your post swap HP, but there are various factors that complicate it. HP+/- buffs, atma/atmacite,vorseals, food, etc.

    What I did was just choose a specific set of spells as trigger spells, then have those spells always swap for a healing breath. That way they can trigger, if possible even when cursed,/HP downed, etc.

    Then you just need to know how much total HP you have in your trigger set to get your threshold, so you know when you're able to trigger. That said, I don't think /mage gets much use anymore with Trusts being a thing.


    I'm not sure if we're talking about writing case by case rules being a pain or making sets being a pain now. I meant the former. But it's your lua, do what you want.

    You've got an Odyllic Subterfuge rule in there with your JA.

    The warcry rule references a set that doesn't exist. sets.JA.Warcry. Would throw an error on use.

    Also sets.JA.Provoke appears to just be a set_combine with a sets.Enmity. Not in and of itself a problem, but... There is no gear that directly enhances Provoke specifically(as opposed to just enmity+ gear) and there's no DRG wearable warcry gear. Why not just have the rules for voke/warcry point to directly sets.Enmity? Although you might consider a toggle for warcry depending on if you actually want to be pulling hate or not.

    Ditto Meditate. DRG can't wear anything that enhances it, and the set referenced in the rules doesn't exist.
    Code:
    function pet_midcast(spell, act)
    	if string.find(spell.english,'Healing Breath') or spell.english == 'Steady Wing' or spell.english == 'Smiting Breath' then
    		ChangeGear(sets.HB.Mentos)
    	end
    end
    Steady wing is a player used JA. The wyvern just receives the effect, much like spirit link. The steady wing portion of this rule would never be true since pet_midcast would never activate on steady wing.

    When you use smiting breath, the spell name that passes for the pet midcast, is going to be the name of the breath the wyvern uses, Flame breath, etc. Not Smiting breath.

    Healing breath, Smiting breath, and steady wing should all have different sets.

    -Healing breath uses a mix of breath+ and WHP+.
    -Smiting is all Breath+, and no WHP+, since elemental breaths are based on current wyvern HP, rather than max like HB.
    -Steady wing should be all WHP+.

    line 280 in pc_magic
    if spell.skill == 'BlueMagic' then

    I'm fairly sure you'd need a space between blue and magic for that to ever return true.

    Line 249
    if IgnoreWS:contains(spell.english) then

    The table IgnoreWS doesn't exist in this lua.
    -Added the ignoreWS table, will add stuff to it if i need to, but I don't think theres anything I need to as that is a magical WS sort of rule. Previously in my BLU LUA this housed magical WS and things I didn't want Ishvara on like sanguine blade. I tend to keep these things innocuously around in case they are of a future use.

    -Fixed Steady Wing

    -Fixed that Blue Magic thing, but it was actually a nonissue. FC triggered because it was a spell, but the original purpose of that set was for equipping the empyrean BLU body for BLU only spells on BLU. I never need that body, but left the rule in there for others, but never tested it probably. So it was a non issue for me, but fixed none the less, that was a really good catch though.

    -Removed the Odyllic rule, it was just a remnant of the RUN GS. As was the case for the RUN GS from my BLU. I just copy pasted and started ripping stuff out, adding stuff, etc.

    - Meditate rule is there to equip enmity gear while using meditate same for warcry, was specially for RUN, but I will remove that too. I was really tired while working on that part of the GS so I forgot to remove that other part of the rule. Fixed this now though.

    -As for HB, yeah that isn't such a big thing for anyone anymore, but much like how I don't even have Deep Breathing merited, I wanted it accounted for.

    Fixed, but untested:
    - Elemental Breaths, while I don't plan on carrying around different gear since wyvern breaths are so shitty for DDing, I did want to make this work right obviously. So I made a table for it and added an elseif to the healing breath rule. It should work, but I never know until I test it.


    Here is the updated lua after all that


    EDIT: For some reason when I am in the MH I get a spam every 3 seconds of "You cannot use that command here." While I am just sitting on the MH/Garden.

    I went and zoned out to the field and it hasn't said anything about it.

    Show swaps was on and it wasn't trying to change anything so I don't get why that keeps happening.

  12. #5712
    Old Merits
    Join Date
    Sep 2010
    Posts
    1,094
    BG Level
    6
    FFXI Server
    Ragnarok

    I would have thought Ishvara would have been very good for sanguine. <,<

    For your error, maybe put some echos in various functions, like in self command put one that reports the current command, in status change one that says the new status, etc. Spell.english for pre/mid/etc. If any of those are outputting something it might tell you what's doing it.

    Edit: Oh, or just turn on debug mode. WOuld show what ever function is being called, pre/mid/status etc.

    //gs debugmode

  13. #5713
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    Quote Originally Posted by Martel View Post
    I would have thought Ishvara would have been very good for sanguine. <,<

    For your error, maybe put some echos in various functions, like in self command put one that reports the current command, in status change one that says the new status, etc. Spell.english for pre/mid/etc. If any of those are outputting something it might tell you what's doing it.

    Edit: Oh, or just turn on debug mode. WOuld show what ever function is being called, pre/mid/status etc.

    //gs debugmode
    It is a bug with my refresh line, at least in kamihr drifts atm. Keeps saying it every 3 seconds Entering buff_refresh in the debug. My rule must be poorly written.

    Regardless of threshold it is trying to put it on, even when it is already on.

    It works too though, puts on that gear correctly when idle after mp goes below the threshold.

    It probably does this for weakened with twilight too I'd assume.

    However that doesnt explain why it keeps saying i cant do that in the MH, because you can change gear there.

    EDIT: The idle refresh rule is faulty anyway, only works with the first listed SJ there. Anything after WHM in that list won't change gear. I replaced 'BLU' , as the first term instead of WHM and it stopped working for sub 'WHM'.

  14. #5714
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    What about something like this. Make a table then refer to it in the code with the second line.

    Code:
    mp_jobs = S{"WHM","BLM","RDM","SMN","BLU","SCH","GEO","PLD","DRK","RUN"}
    
    elseif mp_jobs[player.sub_job] and player.mpp < 75 then

  15. #5715

    Quote Originally Posted by Trumpy View Post
    What about something like this. Make a table then refer to it in the code with the second line.

    Code:
    mp_jobs = S{"WHM","BLM","RDM","SMN","BLU","SCH","GEO","PLD","DRK","RUN"}
    
    elseif mp_jobs[player.sub_job] and player.mpp < 75 then
    that wont work because there are no sub tables in mp_jobs
    you would need to do this
    Code:
    elseif mp_jobs:contains(player.sub_job) and player.mpp < 75 then

  16. #5716
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    that wont work because there are no sub tables in mp_jobs
    you would need to do this
    Code:
    mp_jobs = S{"WHM","BLM","RDM","SMN","BLU","SCH","GEO","PLD","DRK","RUN"}
    
    if command == 'mpjobcheck' then
    	if mp_jobs[player.sub_job] then
    		windower.add_to_chat(50, '======= '..('[  MP  JOB  ]'):color(5)..''..(' ======='):color(50))
    	else
    		windower.add_to_chat(50, '======= '..('[ NO MP JOB ]'):color(20)..''..(' ======='):color(50))
    	end
    end
    This code works for me. not sure what you mean by sub tables. I use this kind of code alot in my luas.

  17. #5717
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    If you use a set, you should generally use the contains method. It won't cause any problems here, but looking up a key in a set can have unexpected results.
    e.g. mp_jobs.flat (mp_jobs.add, mp_jobs.equals, etc.) is not nil.
    Additionally, any lookup that fails goes through two or three tables: First the table (mp_jobs in this case) is searched. If the key is not found, Lua searches for a metatable, finds the _meta.S table and uses its __index key to then search the sets and table tables.

  18. #5718
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    what are mp_jobs.flat mp_jobs.add mp_jobs.equals though? Where do these come from?

  19. #5719
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    They're the methods from the sets/table libraries. It's a quirk of Lua-- it's not object-oriented, but you can create the same behavior with metatables (or closures, but windower uses metatables).

    When you create a set (mp_jobs = S{}) the S function takes the table, performs some intermediate steps, and returns a table with the structure {stuff = true}. One of the steps is to add a metatable, which is a table that Lua looks to for instructions when certain events pertaining to the original table occur. Two common events are the __index and __newindex metamethods, which occur, respectively, when you try to lookup a key in a table where there is no associated value, and when you add a new key to a table.

    The S function assigns a metatable to your table with a function as the __index metamethod.
    Code:
    _meta.S.__index = function(s, k) return rawget(set, k) or rawget(table, k) end
    When you lookup the key "flat" in mp_jobs, for example, Lua can't find anything: this is the __index metamethod event. Lua looks to see if the table has a metatable and finds the table assigned by S. It checks for an __index key and finds the function defined above, which instructs it to check the sets table. There, it finds the sets.flat function, and so mp_jobs.flat is not nil.

    You see the same behavior when you write
    Code:
    mp_jobs:contains('blah')
    mp_jobs does not have a "contains" key, so Lua checks the metatable and finds the sets.contains function. (The semicolon operator works as a syntactic short-cut in Lua which passes what precedes the operator as the first argument to the method which follows it. That is, it saves you from typing sets.contains(mp_table, 'blah')).

    It's quirky, and it has disadvantages (S{'contains'}:contains() will error out because you blocked the __index event from occurring, etc.). You get used to it, though.

  20. #5720
    i should really shut up
    You can safely ignore me I am a troll

    Join Date
    Sep 2011
    Posts
    6,750
    BG Level
    8
    FFXI Server
    Asura

    Okay, got around to making a new DRG cape, playing on it, messing around.

    The /mage thing works now. Thanks for the code.

    Here is the updated lua. Think it is about ready to be done with (unless Martel has any suggestions for DRG).

    However, I noticed my doom rule today, while working (says in pt "doomed ", puts the set on for doom, but) doesn't lock the slots in it should lock in while doomed until it wears. After doing something while doomed it changed out the cursna potency received stuff. Which I didn't expect and lived with one second left. It isn't an easy thing to check too since I have to go get doomed.

    Is there also a way to have a set equip while using an item? That would be something I haven't done before.

Similar Threads

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