Item Search
     
BG-Wiki Search
+ Reply to Thread
Page 7 of 22 FirstFirst ... 5 6 7 8 9 17 ... LastLast
Results 121 to 140 of 421
  1. #121
    Radsourceful

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

    Not ingame right now, but I suspect you also need to change "gearswap.res.spellRs" to "gearswap.res.spells". Find and replace gone wild?

  2. #122

    Quote Originally Posted by Radec View Post
    Not ingame right now, but I suspect you also need to change "gearswap.res.spellRs" to "gearswap.res.spells". Find and replace gone wild?
    i missed that as well
    good your learning
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spells:with('name', spell.english..""..lvl)
                    if spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or spellR.levels[player.sub_job_id] <= player.sub_job_level) and
                     windower.ffxi.get_spellR_recasts()[spellR.recast_id] == 0 and spellR.mp_cost <= player.mp then
                        send_command('input /ma "'..spellR.english..''..lvl..'"'..spellR.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end

  3. #123
    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

    progress. with the replace-gone-wild in mind, ive fixed a few other things so that it's almost working- but it's trying to cast "Protect V V"


    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spells:with('name', spell.english..""..lvl)
                    if spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or 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
                        send_command('input /ma "'..spellR.english..''..lvl..'"'..spell.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end

  4. #124
    Radsourceful

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

    Quote Originally Posted by BaneTheBrawler View Post
    progress. with the replace-gone-wild in mind, ive fixed a few other things so that it's almost working- but it's trying to cast "Protect V V"


    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spells:with('name', spell.english..""..lvl)
                    if spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or 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
                        send_command('input /ma "'..spellR.english..''..lvl..'"'..spell.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end
    Remove '..lvl..' from the send line. It's already added in the renamed spellR.english

  5. #125

    Quote Originally Posted by BaneTheBrawler View Post
    progress. with the replace-gone-wild in mind, ive fixed a few other things so that it's almost working- but it's trying to cast "Protect V V"


    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spells:with('name', spell.english..""..lvl)
                    if spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or 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
                        send_command('input /ma "'..spellR.english..''..lvl..'"'..spell.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end
    i said to only cast /ma "Protect" or /ma "Protectra" do not cast any other like Protect/Protectra II/III/IV/V
    the code gets the highest you can cast based on job lvl/MP/recast and auto adjusts
    i found a minor bug fixed
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spells:with('name', spell.english..""..lvl)
                    if spellR and spell.english == spellR.en then
                        break
                    elseif spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or spellR.levels[player.sub_job_id] <= player.sub_job_level) and
                     windower.ffxi.get_spellR_recasts()[spellR.recast_id] == 0 and spellR.mp_cost <= player.mp then
                        send_command('input /ma "'..spellR.en..''..lvl..'"'..spellR.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end

  6. #126
    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

    yep, only casting the lowest tier. actually noticed the ..lvl..thing on my own, but good to know i'm starting to catch on.

    final product, fully functional:
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") or spell.english:startswith("Shell") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spells:with('name', spell.english..""..lvl)
                    if spellR and spell.english == spellR.en then
                        break
                    elseif spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or 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
                        send_command('input /ma "'..spellR.english..'"'..spell.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end

  7. #127

    Quote Originally Posted by BaneTheBrawler View Post
    yep, only casting the lowest tier. actually noticed the ..lvl..thing on my own, but good to know i'm starting to catch on.

    final product, fully functional:
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") or spell.english:startswith("Shell") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spells:with('name', spell.english..""..lvl)
                    if spellR and spell.english == spellR.en then
                        break
                    elseif spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or 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
                        send_command('input /ma "'..spellR.english..'"'..spell.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end

    oops dang
    well i have been doing some work on my end
    and this should work with any of the protect spells when you cast them (and it has a full break down of what every thing does)
    ...

  8. #128

    Quote Originally Posted by BaneTheBrawler View Post
    yep, only casting the lowest tier. actually noticed the ..lvl..thing on my own, but good to know i'm starting to catch on.

    final product, fully functional:
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") or spell.english:startswith("Shell") then
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    local spellR = gearswap.res.spells:with('name', spell.english..""..lvl)
                    if spellR and spell.english == spellR.en then
                        break
                    elseif spellR and spell.english ~= spellR.en and (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <= player.main_job_level or 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
                        send_command('input /ma "'..spellR.english..'"'..spell.target.raw)
                        eventArgs.cancel = true
                        break
                    end
                end
            end
        end
    end
    i for got to include the most important part in my last post
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            --checks to see if the spell used starts with Protect
            if spell.english:startswith("Protect") then
                --processes from highest to lowest level of spell
                for _,lvl in pairs({" V"," IV"," III"," II",""}) do
                    --grabs spell data from resorces
                    local spellR = gearswap.res.spells:with('name', string.mgsub(spell.en, "%s.+", "")..'"'..lvl)
                    --checks to see if spellR is nil
                    if spellR then
                        --verifies that the player can cast the spell
                         --checks to see if the spellR is the same as currently trying to cast
                        if spell.english == spellR.en and
                         --checks to see if current spell is on recast
                         windower.ffxi.get_spellR_recasts()[spellR.recast_id] == 0 and
                         --checks to see if player has enuf MP to cast spell
                         spellR.mp_cost <= player.mp then
                            --breaks out of the for loop
                            break
                         --checks to see if the spellR is not the same as currently trying to cast
                         elseif spell.english ~= spellR.en and
                         --verifies the current player job setup can cast the spell
                         (spellR.levels[player.main_job_id] or spellR.levels[player.sub_job_id]) and
                         --verifies that current Main or Sub job can cast the spell at it correct level
                         (spellR.levels[player.main_job_id] <=  player.main_job_level or spellR.levels[player.sub_job_id] <=  player.sub_job_level) and
                         --checks to see if current spell is on recast
                         windower.ffxi.get_spellR_recasts()[spellR.recast_id] == 0 and
                         --checks to see if player has enuf MP to cast spell
                         spellR.mp_cost <= player.mp then
                             --cancels the current spell
                             eventArgs.cancel = true
                             --changes the current spell to the new one
                             send_command('input /ma "'..spellR.en..'"'..spellR.target.raw)
                             --breaks out of the for loop
                             break
                        end
                    end
                end
            end
        end
      end

    sorry my mind works in mysterious ways

  9. #129
    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 doesn't seem to want to work. Just yields the base spell. I noticed a few places where 'get_spell_recasts' got replaced with get_spellR_recasts, and corrected that, but that still didn't fix it.

  10. #130

    with this you will get some things in the console related to what it is doing
    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        if spell.type == 'WhiteMagic' then
            if spell.english:startswith("Protect") then
                for _,lvl in pairs({" 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
                        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] or spellR.levels[player.sub_job_id]) and
                         (spellR.levels[player.main_job_id] <=  player.main_job_level or 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..'"'..spellR.target.raw)
                             break
                        end
                    end
                end
                print("spell test end")
            end
        end
     end
    i really dont like using ' instead of " for strings because of the strings with ' unless it is absolutely necessary
    for things like: send_command('input /ma "'..spellR.en..'"'..spellR.target.raw)

  11. #131
    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

    okay finally got a chance to test it. fixed it trying to call spellR.target.raw and it works. thanks dude

  12. #132
    E before O except before E-I-E-I-O.
    Join Date
    May 2008
    Posts
    138
    BG Level
    3
    FFXIV Character
    Kyleen Garaka
    FFXIV Server
    Sargatanas
    FFXI Server
    Phoenix

    So I started working on my DRK .lua and I'm having the same problem my COR lua was having on the last page. If I change jobs, I have to restart windower or my F9 toggles don't work. (reloading gearswap doesn't work) Is there a workaround for this, or do I just need to keep restarting? =/

  13. #133
    Radsourceful

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

    Quote Originally Posted by Garaku View Post
    So I started working on my DRK .lua and I'm having the same problem my COR lua was having on the last page. If I change jobs, I have to restart windower or my F9 toggles don't work. (reloading gearswap doesn't work) Is there a workaround for this, or do I just need to keep restarting? =/
    99.99% chance, something in your file is sending either a bind or unbind command to f9. Post the file via pastebin, or just search for any line with "bind" in it and see if it's needed.

  14. #134
    E before O except before E-I-E-I-O.
    Join Date
    May 2008
    Posts
    138
    BG Level
    3
    FFXIV Character
    Kyleen Garaka
    FFXIV Server
    Sargatanas
    FFXI Server
    Phoenix

    https://pastebin.com/UH9E4xzY - COR

    https://pastebin.com/9arx29xY - DRK

    There are some bind commands in there, but I don't quite understand them. Q_Q

  15. #135
    Radsourceful

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

    For comparison's sake, do you have a link to one where the binds work?

  16. #136
    E before O except before E-I-E-I-O.
    Join Date
    May 2008
    Posts
    138
    BG Level
    3
    FFXIV Character
    Kyleen Garaka
    FFXIV Server
    Sargatanas
    FFXI Server
    Phoenix

    Those same ones work when I log in. But if I change jobs at all, they stop working when I change back to them. (There are no other .lua)

  17. #137
    Radsourceful

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

    I can't see what's doing it, but we can fix this - next time you log in, make sure it's working and first thing do '//listbinds' and look for what f9 is.

    Add a line, send_command('bind f9 YOUR_TEXT_HERE') right after get_sets() at the top of each file, where YOUR_TEXT_HERE is whatever the initial bind is - probably something like "gs c C1". This should rebind that key every time you change to that job.

    Something in your scripts or macros is doing the bind to begin with, but I don't see it here.

  18. #138
    E before O except before E-I-E-I-O.
    Join Date
    May 2008
    Posts
    138
    BG Level
    3
    FFXIV Character
    Kyleen Garaka
    FFXIV Server
    Sargatanas
    FFXI Server
    Phoenix

    I think something in my GEO lua kills my binds. When I load and bounce between DRK and COR, the keybinds stay the same, but when I swap to GEO it messes them all up and changing back to the jobs doesn't repair it.

    https://pastebin.com/jiv13V1T - GEO


    EDIT: Your fix did help my problem though! My hero. lol

  19. #139
    Radsourceful

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

    Quote Originally Posted by Garaku View Post
    I think something in my GEO lua kills my binds. When I load and bounce between DRK and COR, the keybinds stay the same, but when I swap to GEO it messes them all up and changing back to the jobs doesn't repair it.

    https://pastebin.com/jiv13V1T - GEO


    EDIT: Your fix did help my problem though! My hero. lol
    Good to hear!

    GEO.lua explains it! The line "include('Mote-Include.lua')" ends up running a whole bunch of other commands, including this set - which binds all of the f9-f12 key combos with other things. Once you change off GEO, they're all set to unbind at the end.

    Code:
    function global_on_load()
    	send_command('bind f9 gs c cycle OffenseMode')
    	send_command('bind ^f9 gs c cycle HybridMode')
    	send_command('bind !f9 gs c cycle RangedMode')
    	send_command('bind @f9 gs c cycle WeaponskillMode')
    	send_command('bind f10 gs c set DefenseMode Physical')
    	send_command('bind ^f10 gs c cycle PhysicalDefenseMode')
    	send_command('bind !f10 gs c toggle Kiting')
    	send_command('bind f11 gs c set DefenseMode Magical')
    	send_command('bind ^f11 gs c cycle CastingMode')
    	send_command('bind f12 gs c update user')
    	send_command('bind ^f12 gs c cycle IdleMode')
    	send_command('bind !f12 gs c reset DefenseMode')
    
    	send_command('bind ^- gs c toggle selectnpctargets')
    	send_command('bind ^= gs c cycle pctargetmode')
    end
    
    -- Function to revert binds when unloading.
    function global_on_unload()
    	send_command('unbind f9')
    	send_command('unbind ^f9')
    	send_command('unbind !f9')
    	send_command('unbind @f9')
    	send_command('unbind f10')
    	send_command('unbind ^f10')
    	send_command('unbind !f10')
    	send_command('unbind f11')
    	send_command('unbind ^f11')
    	send_command('unbind !f11')
    	send_command('unbind f12')
    	send_command('unbind ^f12')
    	send_command('unbind !f12')
    
    	send_command('unbind ^-')
    	send_command('unbind ^=')
    end

  20. #140
    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

    Quote Originally Posted by BaneTheBrawler View Post
    okay finally got a chance to test it. fixed it trying to call spellR.target.raw and it works. thanks dude



    welp, it worked as pld on protect/shell, but going war/rdm it yields an error. "Attempt to compare nil with number"


    Code:
    function job_pretarget(spell, action, spellMap, eventArgs)
        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("Bio") or 
            spell.english:startswith("Poison") or
            spell.english:startswith("Sleep") or 
            spell.english:startswith("Raise") then
            for _,lvl in pairs({" 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
                    --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] or spellR.levels[player.sub_job_id]) and
                     (spellR.levels[player.main_job_id] <=  player.main_job_level or 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
            --print("spell test end")
        end
     end
    that's what I've got right now; windower says the error is from the bolded line.




    edit: okay, after breaking each condition out into a line, the error is with



    Code:
    (spellR.levels[player.main_job_id] <=  player.main_job_level or
    so i think it's malfunctioning when it tries to check the spell level for my main job (nil, because warrior can't cast natively) against my actual level.




    edit2: okay this is bizarre. i tried some stuff, none of it worked, then reverted... the protect part works, but none of the other spells. it's also not handling my pre/midcasts for any of the spells i punch in except protect

+ Reply to Thread
Page 7 of 22 FirstFirst ... 5 6 7 8 9 17 ... LastLast

Quick Reply Quick Reply

  • Decrease Size
    Increase Size
  • Remove Text Formatting
  • Insert Link Insert Image Insert Video
  • Wrap [QUOTE] tags around selected text
  • Insert NSFW Tag
  • Insert Spoiler Tag

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