Item Search
     
BG-Wiki Search
+ Reply to Thread
Page 15 of 22 FirstFirst ... 5 13 14 15 16 17 ... LastLast
Results 281 to 300 of 421
  1. #281
    Smells like Onions
    Join Date
    Feb 2016
    Posts
    2
    BG Level
    0

    Off topic a bit... but this reminded me of every time I work on a gearswap lua (or programming in general).

    youtube.com/watch?v=8fnfeuoh4s8

  2. #282
    Relic Weapons
    Join Date
    Jul 2008
    Posts
    384
    BG Level
    4
    FFXI Server
    Asura

    Where might I find a snippet of code that won't let me RA weaponskill if I am out of range? Thanks

  3. #283

    Quote Originally Posted by Aja View Post
    Where might I find a snippet of code that won't let me RA weaponskill if I am out of range? Thanks
    there is not one

  4. #284
    Relic Weapons
    Join Date
    Jul 2008
    Posts
    384
    BG Level
    4
    FFXI Server
    Asura

    Damn ; ; ok thanks!

  5. #285
    Radsourceful

    Join Date
    Jul 2007
    Posts
    1,964
    BG Level
    6
    FFXI Server
    Bismarck

    Quote Originally Posted by Aja View Post
    Damn ; ; ok thanks!
    This is adapted from a different block, but will probably do the trick - may need a few tweaks.

    Code:
    function job_precast(spell, action, spellMap, eventArgs)
    require('Vectors') --This might not be needed, there was an angle/facing component to the source that's not present below
    local Pos = require 'position'
    ...
    local t = windower.ffxi.get_mob_by_target('t') or windower.ffxi.get_mob_by_target('st')
    local s = windower.ffxi.get_mob_by_target('me')
    local distance = windower.ffxi.get_mob_by_index(target)['distance']
    
    if 3+t.model_size+s.model_size < math.sqrt(distance) then
    	eventArgs.cancel = true
    end
    ...
    end
    If you're not using a mote-based file, just stick it in precast, and change the eventargs.cancel line to be whatever the default command to cancel is.

    Edit: This is for melee-WS, ranged stuff is I believe 20+model sizes

  6. #286
    Relic Weapons
    Join Date
    Jul 2008
    Posts
    384
    BG Level
    4
    FFXI Server
    Asura

    Thank you as well. I will mess around with this later tonight. My COR lua is a Mote based one so I will see if I have enough knowledge to get it working^^

    Essentially, I would be fine with it not even factoring in the mob size. Just if I was over 20 distance away, it would stop me from trying to RA weaponskill. I forget too often that even though I can shoot from over 20, I cannot WS from over 20.

  7. #287
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    Gun-it

    Did you solve your meditate issue? First does the gear just need to be on when the ability is activated, or does it need to be worn the duration of the meditation buff? One thing i noticed is when you first gave your equipment you put:

    sets.JA['Meditate']

    you only need the ['Words Words'] when there are two words. but as i scrolled down i noticed in the actual file it had:

    sets.JA.Meditate

    so I am not sure if these are conflicting or not. Both sets seem to have the same gear in them. I dont really understands Motes stuff, I try to write my simpler own files, but I dont see a:

    state.Buff.Hasso = buffactive.Hasso or false

    type line for Meditate. Im not currently subbed and cant remember if Meditate gives you a buff while active or not. If it does maybe thats why it isnt working? I dont really know how his files even register a JA went off.

  8. #288
    Sea Torques
    Join Date
    May 2010
    Posts
    719
    BG Level
    5
    FFXI Server
    Ragnarok

    Quote Originally Posted by Trumpy View Post
    Gun-it

    Did you solve your meditate issue? First does the gear just need to be on when the ability is activated, or does it need to be worn the duration of the meditation buff? One thing i noticed is when you first gave your equipment you put:

    sets.JA['Meditate']

    you only need the ['Words Words'] when there are two words. but as i scrolled down i noticed in the actual file it had:

    sets.JA.Meditate

    so I am not sure if these are conflicting or not. Both sets seem to have the same gear in them. I dont really understands Motes stuff, I try to write my simpler own files, but I dont see a:

    state.Buff.Hasso = buffactive.Hasso or false

    type line for Meditate. Im not currently subbed and cant remember if Meditate gives you a buff while active or not. If it does maybe thats why it isnt working? I dont really know how his files even register a JA went off.
    Never got it working. I swapped between sets.JA.Meditate and sets.JA['Meditate'] trying to get it to work. The gear only needs to equipped when meditate is used and you do not get a status buff.

    At this point I am trying to find a new SAM Lua to use (Hoping this fixes the problem0, but I have not found one detailed enough yet.

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

    Is using the format ==> {main={name="itemname",priority=X} <== still the only way to avoid two items not equipping?

    I have an issue with 2x Stikini Ring +1. When I launch my sets that have both rings equipped in left and right fingers, sometimes (often!) I get only one ring equipping.
    If you have any other solution to solve this I'd be very thankful, I find the priority thing very annoying and I'd like to avoid going back to that if possible Q_Q

  10. #290

    Quote Originally Posted by Sechs View Post
    Is using the format ==> {main={name="itemname",priority=X} <== still the only way to avoid two items not equipping?

    I have an issue with 2x Stikini Ring +1. When I launch my sets that have both rings equipped in left and right fingers, sometimes (often!) I get only one ring equipping.
    If you have any other solution to solve this I'd be very thankful, I find the priority thing very annoying and I'd like to avoid going back to that if possible Q_Q
    put each item in a different bag
    example: sets.wardrobe_feet = {feet={name="Bokwus Boots",bag="wardrobe"}}
    i think you can onlt equip from these bags
    inventory
    wardrobe
    wardrobe2
    wardrobe3
    wardrobe4

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

    Ooooh, so if they're in different bags the problem is solved without the use of priority?
    Hmmm NEAT.

    I'm gonna try that when I get back home. Thanks for getting my hopes up! ^-^

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

    Works perfectly, thanks dlsmd! ^_^

  13. #293

    0_0 im glad -_-

  14. #294
    RIDE ARMOR
    Join Date
    Feb 2017
    Posts
    19
    BG Level
    1
    FFXI Server
    Bismarck

    Seeing the error of my ways, I've cast aside my hybrid lua attempts, and have been spending the past few days writing a COR lua for myself. I can't seem to get it to swap to my elemental obi when using the appropriate shot though, and for some reason my job abilities aren't switching either. Paste below. Can anyone tell me what I've done wrong?

    https://pastebin.com/bQVvW9jD


    Edit: I've done some further reading on here and it seems that making my JA sets read something like sets.ja['Phantom Roll'] should get the job abilities that have multiple names working. I'm at work now so I can't test it, but even my fold set doesn't switch, and from what I understand, the way I've written the precast sets.ja.Fold should be working, but isn't. Do I need to just use it as sets.ja['Fold'] as well?

    Edit 2: I've fixed the elemental obi switching. There was just some minor formatting issues, however I still can't get my job abilities to switch gear.

  15. #295
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,366
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    So, I'm going through and rebuilding my LUAs and this is something that's been bugging me. The function you guys helped me build to automatically upgrade spells works most of the time, but the part that checks to see if my current job is capable of casting the output seems to fail. At 99, this is just a matter of puttin in some blacklisted spells, but when sub-99 this can be awkward.

    Code:
    if spell.action_type == 'Magic' then 
            if spell.english:startswith("Protect") or 
            spell.english:startswith("Shell") or 
            spell.english:startswith("Dia") or 
            spell.english:startswith("Fire") or 
            spell.english:startswith("Stone") or 
            spell.english:startswith("Thunder") or 
            spell.english:startswith("Water") or 
            spell.english:startswith("Blizzard") or 
            spell.english:startswith("Aero") or 
            spell.english:startswith("Bio") or 
            spell.english:startswith("Poison") or 
            spell.english:startswith("Sleep") or 
            spell.english:startswith("Raise") or 
            spell.english:startswith("Holy") or 
            spell.english:startswith("Banish") or 
            spell.english:startswith("Enlight") or 
            spell.english:startswith("Endark") or
            spell.english:startswith("Drain") or 
            spell.english:startswith("Aspir") or
            spell.english:startswith("Reraise") or
            spell.english:startswith("Regen") then 
            for _,lvl in pairs({" VI"," V"," IV"," III"," II",""}) do 
            --print("current spell checking = "..string.mgsub(spell.english, "%s.+", "")..""..lvl) 
                local spellR = gearswap.res.spells:with("name", string.mgsub(spell.english, "%s.+", "")..""..lvl) 
                if spellR then
                    local reject = S{"Banishga III","Banish IV","Diaga II"}
                    if not reject:contains(spellR.en) then
                        --print("spellR is good") 
                        if spell.english == spellR.en and 
                        windower.ffxi.get_spell_recasts()[spellR.recast_id] == 0 and 
                        spellR.mp_cost <= player.mp then 
                            --print("spell confirmed as casted spell and is good to cast") 
                            --print("casted spell = "..spell.english) 
                            break 
                        elseif spell.english ~= spellR.en and 
                        ((spellR.levels[player.main_job_id] and 
                        spellR.levels[player.main_job_id] <=  player.main_job_level) or 
                        (spellR.levels[player.sub_job_id] and 
                        spellR.levels[player.sub_job_id] <=  player.sub_job_level)) and 
                        windower.ffxi.get_spell_recasts()[spellR.recast_id] == 0 and 
                        spellR.mp_cost <= player.mp then 
                        --print("spell confirmed as new spell and is good to cast = "..spellR.en) 
                            eventArgs.cancel = true 
                            send_command('input /ma "'..spellR.en..'"'..spell.target.raw) 
                            break 
                        end  
                    end
                end
            end
            --print("spell test end")
            end
        end
    I can't figure out what's wrong with the checks. It looks like it should work.

  16. #296

    Quote Originally Posted by BaneTheBrawler View Post
    So, I'm going through and rebuilding my LUAs and this is something that's been bugging me. The function you guys helped me build to automatically upgrade spells works most of the time, but the part that checks to see if my current job is capable of casting the output seems to fail. At 99, this is just a matter of puttin in some blacklisted spells, but when sub-99 this can be awkward.

    Code:
    if spell.action_type == 'Magic' then 
            if spell.english:startswith("Protect") or 
            spell.english:startswith("Shell") or 
            spell.english:startswith("Dia") or 
            spell.english:startswith("Fire") or 
            spell.english:startswith("Stone") or 
            spell.english:startswith("Thunder") or 
            spell.english:startswith("Water") or 
            spell.english:startswith("Blizzard") or 
            spell.english:startswith("Aero") or 
            spell.english:startswith("Bio") or 
            spell.english:startswith("Poison") or 
            spell.english:startswith("Sleep") or 
            spell.english:startswith("Raise") or 
            spell.english:startswith("Holy") or 
            spell.english:startswith("Banish") or 
            spell.english:startswith("Enlight") or 
            spell.english:startswith("Endark") or
            spell.english:startswith("Drain") or 
            spell.english:startswith("Aspir") or
            spell.english:startswith("Reraise") or
            spell.english:startswith("Regen") then 
            for _,lvl in pairs({" VI"," V"," IV"," III"," II",""}) do 
            --print("current spell checking = "..string.mgsub(spell.english, "%s.+", "")..""..lvl) 
                local spellR = gearswap.res.spells:with("name", string.mgsub(spell.english, "%s.+", "")..""..lvl) 
                if spellR then
                    local reject = S{"Banishga III","Banish IV","Diaga II"}
                    if not reject:contains(spellR.en) then
                        --print("spellR is good") 
                        if spell.english == spellR.en and 
                        windower.ffxi.get_spell_recasts()[spellR.recast_id] == 0 and 
                        spellR.mp_cost <= player.mp then 
                            --print("spell confirmed as casted spell and is good to cast") 
                            --print("casted spell = "..spell.english) 
                            break 
                        elseif spell.english ~= spellR.en and 
                        ((spellR.levels[player.main_job_id] and 
                        spellR.levels[player.main_job_id] <=  player.main_job_level) or 
                        (spellR.levels[player.sub_job_id] and 
                        spellR.levels[player.sub_job_id] <=  player.sub_job_level)) and 
                        windower.ffxi.get_spell_recasts()[spellR.recast_id] == 0 and 
                        spellR.mp_cost <= player.mp then 
                        --print("spell confirmed as new spell and is good to cast = "..spellR.en) 
                            eventArgs.cancel = true 
                            send_command('input /ma "'..spellR.en..'"'..spell.target.raw) 
                            break 
                        end  
                    end
                end
            end
            --print("spell test end")
            end
        end
    I can't figure out what's wrong with the checks. It looks like it should work.
    it it thar it cant tell that you have the spell or is it that it tries to cast a spell you do not have?

  17. #297
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,366
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    It tries to cast a spell I don't have. Like Fire 4 when I only have Fire 1. It seems to just be casting the highest spell that exists, not the highest spell I know.

  18. #298

    Quote Originally Posted by BaneTheBrawler View Post
    It tries to cast a spell I don't have. Like Fire 4 when I only have Fire 1. It seems to just be casting the highest spell that exists, not the highest spell I know.
    you need to check if you have the spell then
    Code:
    if spell.action_type == 'Magic' then 
            if spell.english:startswith("Protect") or 
            spell.english:startswith("Shell") or 
            spell.english:startswith("Dia") or 
            spell.english:startswith("Fire") or 
            spell.english:startswith("Stone") or 
            spell.english:startswith("Thunder") or 
            spell.english:startswith("Water") or 
            spell.english:startswith("Blizzard") or 
            spell.english:startswith("Aero") or 
            spell.english:startswith("Bio") or 
            spell.english:startswith("Poison") or 
            spell.english:startswith("Sleep") or 
            spell.english:startswith("Raise") or 
            spell.english:startswith("Holy") or 
            spell.english:startswith("Banish") or 
            spell.english:startswith("Enlight") or 
            spell.english:startswith("Endark") or
            spell.english:startswith("Drain") or 
            spell.english:startswith("Aspir") or
            spell.english:startswith("Reraise") or
            spell.english:startswith("Regen") then 
                for _,lvl in pairs({" VI"," V"," IV"," III"," II",""}) do 
                --print("current spell checking = "..string.mgsub(spell.english, "%s.+", "")..""..lvl) 
                    local spellR = gearswap.res.spells:with("name", string.mgsub(spell.english, "%s.+", "")..""..lvl) 
                    if spellR then
                        local reject = S{"Banishga III","Banish IV","Diaga II"}
                        if not reject:contains(spellR.en) then
                            --print("spellR is good") 
                            if spell.english == spellR.en and 
                            windower.ffxi.get_spell_recasts()[spellR.recast_id] == 0 and 
                            spellR.mp_cost <= player.mp then 
                                --print("spell confirmed as casted spell and is good to cast") 
                                --print("casted spell = "..spell.english) 
                                break 
                            elseif spell.english ~= spellR.en and 
                            ((spellR.levels[player.main_job_id] and 
                            spellR.levels[player.main_job_id] <=  player.main_job_level) or 
                            (spellR.levels[player.sub_job_id] and 
                            spellR.levels[player.sub_job_id] <=  player.sub_job_level)) and 
                            windower.ffxi.get_spell_recasts()[spellR.recast_id] == 0 and 
                            spellR.mp_cost <= player.mp and
                            windower.ffxi.get_spells()[spellR.id] then  
                            --print("spell confirmed as new spell and is good to cast = "..spellR.en) 
                                eventArgs.cancel = true 
                                send_command('input /ma "'..spellR.en..'"'..spell.target.raw) 
                                break 
                            end  
                        end
                    end
                end
            --print("spell test end")
            end
        end

  19. #299
    The Shitlord
    Join Date
    Feb 2008
    Posts
    11,366
    BG Level
    9
    FFXIV Character
    Kharo Hadakkus
    FFXIV Server
    Hyperion
    FFXI Server
    Sylph
    WoW Realm
    Rivendare

    That did it, thank you!

  20. #300

    Quote Originally Posted by BaneTheBrawler View Post
    That did it, thank you!
    just remember that any spell that is in the dats that does not exist in ffxi will need to be added to the reject table

Similar Threads

  1. Gearswap Help Thread!
    By JSHidaka in forum FFXI: Everything
    Replies: 6035
    Last Post: 2018-05-06, 17:15
  2. Randomerest Question Thread III: This Time It's Random
    By isladar in forum FFXI: Everything
    Replies: 868
    Last Post: 2009-08-18, 12:03