Item Search
     
BG-Wiki Search
Page 235 of 302 FirstFirst ... 185 225 233 234 235 236 237 245 285 ... LastLast
Results 4681 to 4700 of 6036

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

  1. #4681
    Nidhogg
    Join Date
    Aug 2007
    Posts
    3,754
    BG Level
    7
    FFXI Server
    Bahamut

    Trying to add a variable to my healing set for self cures but I'm in the dark on how to add it correctly. Essentially I'm wanting to add something like:

    if target = self
    then sets.midcast.Cure = set_combine(sets.midcast.Cure, {stuff}),

    But I'm not having any luck. Any guidance is much appreciated.

    One more question too. Just realized Solstice has Indi Duration +15 on it. Is there a way to equip Solstice for the next Indi spell after using Entrust? Obviously still want to use Idris during non-Entrusted Indi spells, but anytime I use Entrust, it'd be great if I could lock Solstice in for the next Indi.

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

    Quote Originally Posted by Malithar View Post
    Trying to add a variable to my healing set for self cures but I'm in the dark on how to add it correctly. Essentially I'm wanting to add something like:

    if target = self
    then sets.midcast.Cure = set_combine(sets.midcast.Cure, {stuff}),

    But I'm not having any luck. Any guidance is much appreciated.

    One more question too. Just realized Solstice has Indi Duration +15 on it. Is there a way to equip Solstice for the next Indi spell after using Entrust? Obviously still want to use Idris during non-Entrusted Indi spells, but anytime I use Entrust, it'd be great if I could lock Solstice in for the next Indi.
    Code:
    if S{"Cure","Cure II","Cure III","Cure IV","Cure V","Cure VI"}:contains(spell.en) then--or however you want to tell if its a cure spell
        local cure_gear
        if spell.target.type == "SELF" then
            cure_gear = set_combine(sets.midcast.Cure, {stuff})
        else
            cure_gear = sets.midcast.Cure
        end
        equip(cure_gear)
    end
    if buffactive.Entrust and spell.name.contains("Indi") then
        equip(main="Solstice")
    end
    this is untested for basic gearswap coding

  3. #4683
    Nidhogg
    Join Date
    Aug 2007
    Posts
    3,754
    BG Level
    7
    FFXI Server
    Bahamut

    Quote Originally Posted by dlsmd View Post
    Code:
    if S{"Cure","Cure II","Cure III","Cure IV","Cure V","Cure VI"}:contains(spell.en) then--or however you want to tell if its a cure spell
        local cure_gear
        if spell.target.type == "SELF" then
            cure_gear = set_combine(sets.midcast.Cure, {stuff})
        else
            cure_gear = sets.midcast.Cure
        end
        equip(cure_gear)
    end
    if buffactive.Entrust and spell.name.contains("Indi") then
        equip(main="Solstice")
    end
    this is untested for basic gearswap coding
    Thanks much dlsmd, got me on the right track. Was able to get the Indi Solstice bit working with some poking and proding, eventually producing:

    Code:
    sets.buff['Entrust'] = set_combine(sets.midcast.Geomancy, {main="Solstice",legs="Bagua Pants +1"})
    
    function job_midcast(spell, action, spellMap, eventArgs)
    	if string.find(spell.english,'Indi') and buffactive['Entrust'] then
    		equip(sets.buff['Entrust'])
    		eventArgs.handled = true
    	end
    end
    Still on Mote's old setup, but your help got me going in the right direction. :D Still at a loss for the cure swapping bit, I've tried replacing the specific spells with just a lookup for healing magic but it's erroring out each time. I'll mess with it some more and figure something out. Thanks again!

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

    Quote Originally Posted by Malithar View Post
    Thanks much dlsmd, got me on the right track. Was able to get the Indi Solstice bit working with some poking and proding, eventually producing:

    Code:
    sets.buff['Entrust'] = set_combine(sets.midcast.Geomancy, {main="Solstice",legs="Bagua Pants +1"})
    
    function job_midcast(spell, action, spellMap, eventArgs)
        if string.find(spell.english,'Indi') and buffactive['Entrust'] then
            equip(sets.buff['Entrust'])
            eventArgs.handled = true
        end
    end
    Still on Mote's old setup, but your help got me going in the right direction. :D Still at a loss for the cure swapping bit, I've tried replacing the specific spells with just a lookup for healing magic but it's erroring out each time. I'll mess with it some more and figure something out. Thanks again!
    i will recomend you use this: spell.english.startswith("Indi-")
    instead of string.find(spell.english,'Indi')
    its faster

    also i think in motes code
    if spellMap == 'Cure' and spell.target.type == "SELF" then --is what you need but not sure

  5. #4685
    Nidhogg
    Join Date
    Aug 2007
    Posts
    3,754
    BG Level
    7
    FFXI Server
    Bahamut

    Quote Originally Posted by dlsmd View Post
    i will recomend you use this: spell.english.startswith("Indi-")
    instead of string.find(spell.english,'Indi')
    its faster

    also i think in motes code
    if spellMap == 'Cure' and spell.target.type == "SELF" then --is what you need but not sure
    Tried swapping that in but I'm getting "attempt to get length of local 'substr' (a nil value)" and it skips the midcast set entirely. I'll leave it as is for now. Out of curiosity, when you say it's faster, is that on a code level, or a practical "it just might fuck you one day" level?

    Was able to get the cure bit setup correctly thanks to your help as well. Ended up with:

    Code:
    function job_midcast(spell, action, spellMap, eventArgs)
    	if spell.skill == 'Healing Magic' then
    		if spell.target and spell.target.type == 'SELF' then
    		equip(sets.midcast.Cure.Self)
    		eventArgs.handled = true
    		end
    	end
    end
    I have no idea what the whole eventArgs.handled = true is, but I'm finding it's needed on most of the custom rules I've been putting in. The joy of being a pretend programmer! :3 Thanks again for the direction!

  6. #4686
    Cerberus
    Join Date
    Jun 2007
    Posts
    411
    BG Level
    4
    FFXIV Character
    Ninita Nita
    FFXIV Server
    Excalibur
    FFXI Server
    Shiva
    WoW Realm
    Gnomeregan

    using spell.skill = healing magic will trigger on -na spells and raise as well

    better off targetting cures, either by doing what he listed above and making a table of them, or doing
    Code:
    function job_midcast(spell, action, spellMap, eventArgs)
    	if (spell.english.startswith("Cure") or spell.english.startswith("Cura")) then
    		if spell.target and spell.target.type == 'SELF' then
    		equip(sets.midcast.Cure.Self)
    		eventArgs.handled = true
    		end
    	end
    end

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

    Quote Originally Posted by Malithar View Post
    Tried swapping that in but I'm getting "attempt to get length of local 'substr' (a nil value)" and it skips the midcast set entirely. I'll leave it as is for now. Out of curiosity, when you say it's faster, is that on a code level, or a practical "it just might fuck you one day" level?
    its faster on a code level
    the reason being string.find looks at the entire string
    example:
    "askt109nthskedtesmodt" your looking for "dtes" it will process like this till it finds the str or reaches the end of the str
    pass1:"askt" false
    pass2:"skt1" false
    ...
    pass14:"dtes" true
    while starts with only checks the first chars that the str contains
    example:
    "ABCDEFGH" looking for "CDEF"
    pass1:"ABCD" false
    "CDEFGHIJK" looking for "CDEF"
    pass1:"CDEF" true

    it should not happen but this would be exactly the same thing you can try this
    string.startswith(spell.english, "Indi-")
    if not that change spell.english to spell.en


    Quote Originally Posted by Malithar View Post
    Was able to get the cure bit setup correctly thanks to your help as well. Ended up with:

    Code:
    function job_midcast(spell, action, spellMap, eventArgs)
        if spell.skill == 'Healing Magic' then
            if spell.target and spell.target.type == 'SELF' then
            equip(sets.midcast.Cure.Self)
            eventArgs.handled = true
            end
        end
    end
    I have no idea what the whole eventArgs.handled = true is, but I'm finding it's needed on most of the custom rules I've been putting in. The joy of being a pretend programmer! :3 Thanks again for the direction!
    and as Nitrous24 said this spell.skill == 'Healing Magic' will process on na/raise/etc. spells not just cure spells
    i still recommend S{"Cure","Cure II","Cure III","Cure IV","Cure V","Cure VI"}:contains(spell.en)--you can add any spells you want to this if any are missing

  8. #4688
    Nidhogg
    Join Date
    Aug 2007
    Posts
    3,754
    BG Level
    7
    FFXI Server
    Bahamut

    Eh, won't be casting Raise on myself anytime soon, and /Whm is pretty much dead to me atm, but I made the changes anyways. So with the above functions, my dumbass didn't realize you can't have multiple, they all have to be within the same function job_midcast. After messing with it for a few hours, I got it all working, except for one very annoying hickup. I have:

    Code:
    function job_post_midcast(spell, action, spellMap, eventArgs)
        if spell.skill == 'Elemental Magic' then
            if spell.element == world.day_element or spell.element == world.weather_element then
                equip(sets.midcast['Elemental Magic'], {waist="Hachirin-no-Obi"})
            end
        elseif spell.skill == 'Healing Magic' then
            if spell.english:startswith('Cure') and world.day_element == 'Light' or world.weather_element == 'Light' then
                equip(sets.midcast.Cure, {waist="Hachirin-no-Obi"})
    		end
        elseif spell.english:startswith('Cure') then
    		if spell.target and spell.target.type == 'SELF' then
    			equip(sets.midcast.Cure.Self)
    		end
    	elseif spell.english:startswith('Indi') then
    		if buffactive['Entrust'] then
    			equip(sets.buff['Entrust'])
    		end
    	end
    end
    Works nearly flawlessly for what I was wanting, while still having my obi work. Problem being, light day/weather takes precedence over the self function. Is there an easy way for it to check for both, or do I just need to include another function that is essentially
    Code:
    elseif spell.skill == 'Healing Magic' then
            if spell.english:startswith('Cure') and spell.target and spell.target.type == 'SELF' and world.day_element == 'Light' or world.weather_element == 'Light' then
                equip(sets.midcast.Cure.Self, {waist="Hachirin-no-Obi"})
    		end
    I say essentially because that bit doesn't seem to work as I was hoping. Want to say thanks for the help again, helps a ton with motivation and confidence with GS knowing you guys are ready to give direction.

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

    replace
    Code:
        elseif spell.skill == 'Healing Magic' then
            if spell.english:startswith('Cure') and world.day_element == 'Light' or world.weather_element == 'Light' then
                equip(sets.midcast.Cure, {waist="Hachirin-no-Obi"})
            end
        elseif spell.english:startswith('Cure') then
            if spell.target and spell.target.type == 'SELF' then
                equip(sets.midcast.Cure.Self)
            end
    with
    Code:
        elseif spell.skill == 'Healing Magic' then
            if spell.english:startswith('Cure') then
                local cure_gear = set_combine(sets.midcast.Cure)
                if world.day_element == 'Light' or world.weather_element == 'Light' then
                    cure_gear = set_combine(cure_gear, {waist="Hachirin-no-Obi"})
                end
                if spell.target and spell.target.type == 'SELF' then
                    cure_gear = set_combine(cure_gear, sets.midcast.Cure.Self)
                end
                equip(cure_gear)
            end

  10. #4690
    Nidhogg
    Join Date
    Aug 2007
    Posts
    3,754
    BG Level
    7
    FFXI Server
    Bahamut

    http://cdn.meme.am/instances/61460782.jpg

    On a side note, how does that local command work? Is it local to that specific function so you can combine sets within multiple different functions?

  11. #4691
    Cerberus
    Join Date
    Jun 2007
    Posts
    411
    BG Level
    4
    FFXIV Character
    Ninita Nita
    FFXIV Server
    Excalibur
    FFXI Server
    Shiva
    WoW Realm
    Gnomeregan

    local limits it to the function that is currently executing, once it finishes the variable is destroyed so you can't access it anywhere else

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

    Quote Originally Posted by Malithar View Post

    On a side note, how does that local command work? Is it local to that specific function so you can combine sets within multiple different functions?
    local is local to the block in do/then/etc. once you leave the block it gets destroyed
    here: http://www.lua.org/pil/4.2.html

    Quote Originally Posted by Nitrous24 View Post
    local limits it to the function that is currently executing, once it finishes the variable is destroyed so you can't access it anywhere else
    this is how it works

    Code:
    function a()
        local b = "any" -- local b is created
        if true then
            local c = "none" -- local c is created
            -- do something
            -- local c is destroyed
        elseif true then
            local d = "hello" -- local d is created
            -- do something
             -- local d is destroyed
        end
        -- local b is destroyed
    end

  13. #4693
    Cerberus
    Join Date
    Jun 2007
    Posts
    411
    BG Level
    4
    FFXIV Character
    Ninita Nita
    FFXIV Server
    Excalibur
    FFXI Server
    Shiva
    WoW Realm
    Gnomeregan

    yea, i thought it would be local to if/else statements and do statements as well, but i didn't want to give improper information because i wasn't sure. Thanks for the info

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

    Quote Originally Posted by Nitrous24 View Post
    yea, i thought it would be local to if/else statements and do statements as well, but i didn't want to give improper information because i wasn't sure. Thanks for the info
    no problem knowledge is power and learning is the only way to knowledge and power
    also i updated my post with elseif just for the sake of arguments

  15. #4695
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Just came back somewhat recently after taking off the summer, and noticed a few oddities in my luas.

    Has anyone else noted player.equipment.main string comparisons being unreliable, or flat out not working in some functions? Specifically, I'm checking my main weapon in status_change(), which I never had issue with before. I'll try throwing together a test case, but mostly curious if this is a known issue, etc.

    Also, kinda random, but the following used to work in buff_change, but now fails. I can do this another way, but I'm just curious... did the Set lib change?
    Code:
    -- used to work, but now fails
    if S{'Aftermath'}:contains(buff) then
     -- works
    if string.startswith(buff, "Aftermath") then
    Thanks

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

    Quote Originally Posted by Orestes View Post
    Just came back somewhat recently after taking off the summer, and noticed a few oddities in my luas.

    Has anyone else noted player.equipment.main string comparisons being unreliable, or flat out not working in some functions? Specifically, I'm checking my main weapon in status_change(), which I never had issue with before. I'll try throwing together a test case, but mostly curious if this is a known issue, etc.

    Also, kinda random, but the following used to work in buff_change, but now fails. I can do this another way, but I'm just curious... did the Set lib change?
    Code:
    -- used to work, but now fails
    if S{'Aftermath'}:contains(buff) then
     -- works
    if string.startswith(buff, "Aftermath") then
    Thanks
    it should be
    buffactive['Aftermath'] --use this if the buff name has a space in it
    or
    buffactive.Aftermath

    but there are buffs
    Aftermath: Lv.1
    Aftermath: Lv.2
    Aftermath: Lv.3
    Aftermath

    unless your doing it in the buff_change function
    then its
    string.startswith(buff, "Aftermath")

  17. #4697
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by dlsmd View Post
    it should be
    buffactive['Aftermath'] --use this if the buff name has a space in it
    or
    buffactive.Aftermath

    unless your doing it in the buff_change function
    then its
    string.startswith(buff, "Aftermath")
    Yes, it's in buff_change as noted. That is how I'm doing it now. Perhaps it was a stupid way to do it before.

    Mostly curious about player.equipment not working as expected.

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

    Quote Originally Posted by Orestes View Post
    Yes, it's in buff_change as noted. That is how I'm doing it now. Perhaps it was a stupid way to do it before.

    Mostly curious about player.equipment not working as expected.
    if you change gear out side of gearswap it can lose what gear you have on

  19. #4699
    Hydra
    Join Date
    Feb 2014
    Posts
    131
    BG Level
    3
    FFXI Server
    Quetzalcoatl

    Quote Originally Posted by dlsmd View Post
    if you change gear out side of gearswap it can lose what gear you have on
    I have the same function that I call in status_change() also in job_update(), which I just manually hit F12 to trigger when I switch weapons. I'll do some more testing though.

  20. #4700
    Smells like Onions
    Join Date
    Feb 2013
    Posts
    1
    BG Level
    0

    i'm a gs nub

    wondering if there's a way to lock my aptitude mantle with a shortcut/keybind so i can keep it on during cp parties

Page 235 of 302 FirstFirst ... 185 225 233 234 235 236 237 245 285 ... LastLast

Similar Threads

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