Item Search
     
BG-Wiki Search
Page 195 of 302 FirstFirst ... 145 185 193 194 195 196 197 205 245 ... LastLast
Results 3881 to 3900 of 6036

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

  1. #3881
    Sea Torques
    Join Date
    Jul 2009
    Posts
    608
    BG Level
    5

    Alright, that works. Thanks so much.

    Now I need to get my elemental put into there, and it should be all set!

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

    also you need to add in the set sets.midcast.fastcast

  3. #3883
    Sea Torques
    Join Date
    Jul 2009
    Posts
    608
    BG Level
    5

    Yup. Did that.

    Spoiler: show
    Code:
    function get_sets()
        --Tables
        enfeeb = {Mnd=S{"Silence","Silencega","Dia","Dia II","Dia III","Dia IV","Dia V","Diaga","Diaga II","Diaga III","Diaga IV","Diaga V"},Dark=S{"Sleep","Sleep II",
                "Sleepga","Sleepga II","Blind","Blind II","Blindga","Bind","Bindga","Poison","Poison II","Poison III","Poison IV","Poison V","Poisonga","Poisonga II",
                "Poisonga III","Poisonga IV","Poisonga V"},other=S{"Paralyze","Paralyze II","Slow","Slow II"},}
        Cure_spells = S{'Cura','Cura II','Cura III','Curaga','Curaga II','Curaga III','Curaga IV','Curaga V','Cure','Cure II','Cure III','Cure IV','Cure V','Cure VI'}
        Enhance_spells = S{"Refresh","Refresh II","Haste","Haste II","Hastega"}
        enfeeb_set_type = {"potency","accuracy"}
        enfeeb_set_type_count = 1
       
        ----GEAR SETS----
       
        --Idle Sets
        sets.idle = {main="Terra's Staff", sub="Vivid Strap +1", ammo="Hedgehog Bomb",
                            neck="Orocho Nodowa +1", ear1="Merman's Earring", ear2="Merman's Earring",
                            body="Ixion Cloak", hands="Dst. Mittens +1", ring1="Merman's Ring", ring2="Merman's Ring",
                            back="Umbra Cape", waist="Ocean Rope", legs="Blood Cuisses", feet="Dst. Leggings +1"}
           
        sets.idle.standard = {main="Terra's Staff", sub="Vivid Strap +1", ammo="Hedgehog Bomb",
                            neck="Orocho Nodowa +1", ear1="Merman's Earring", ear2="Merman's Earring",
                            body="Ixion Cloak", hands="Dst. Mittens +1", ring1="Merman's Ring", ring2="Merman's Ring",
                            back="Umbra Cape", waist="Ocean Rope", legs="Blood Cuisses", feet="Dst. Leggings +1"}
           
        sets.idle.PDT = {main="Terra's Staff", sub="Vivid Strap +1", ammo="Hedgehog Bomb",
                            neck="Orocho Nodowa +1", ear1="Merman's Earring", ear2="Merman's Earring",
                            body="Ixion Cloak", hands="Dst. Mittens +1", ring1="Merman's Ring", ring2="Merman's Ring",
                            back="Umbra Cape", waist="Ocean Rope", legs="Blood Cuisses", feet="Dst. Leggings +1"}
           
        --Precast Sets
        sets.precast = {head="Warlock's Chapeau", body="Goliard Saio", sub="Vivid Strap +1"}
           
        --Midcast sets
        sets.midcast = {head="Warlock's Chapeau", body="Goliard Saio", hands="Dusk Gloves +1", waist="Speed Belt", feet="Dusk Ledelsens +1"}
    	sets.midcast.fastcast = {head="Warlock's Chapeau", body="Goliard Saio", hands="Dusk Gloves +1", waist="Speed Belt", feet="Dusk Ledelsens +1"}
        sets.midcast.Cure = {main="Chatoyant Staff", sub="Staff Grip", head="Warlock's Chapeau", neck="Fylgja Torque +1", ear1="Roundel Earring",
                            ear2="Celestial Earring", body="Goliard Saio", hands="Dusk Goves +1", ring1="Celestal Ring", ring2="Celestial Ring", back="Mahatma Cape",
                            waist="Pythia Sash +1", legs="Mahatma Slops", feet="Dusk Ledelsens +1"}        
        sets.midcast.DarkEnfeeble = {main="Chatoyant Staff", sub="Vivid Strap +1",
                    head="blood Mask", neck="Enfeebling Torque", ear1="Incubus Earring +1",
                    ear2="Incubus Earring +1", body="Warlock's Tabard", hands="Mahatma Cuffs",
                    ring1="Omn. Ring +1", ring2="Omn. Ring +1", back="Hecate's Cape",
                    waist="Witch Sash", legs="Mahatma Slops", feet="Wise Pigaches +1"}
                   
        sets.midcast.MndEnfeeble = {main="Chatoyant Staff", sub="raptor strap +1",
                    head="blood Mask", neck="Enfeebling Torque", ear1="Incubus Earring +1",
                    ear2="Incubus Earring +1", body="Warlock's Tabard", hands="Devotee's Mitts +1",
                    ring1="Celestial Ring", ring2="Celestial Ring", back="Hecate's Cape",
                    waist="Witch Sash", legs="Mahatma Slops", feet="Mahatma Pigaches"}
        sets.midcast.accuracy = {main="Chatoyant Staff", sub="raptor strap +1",
                    head="blood Mask", neck="Enfeebling Torque", ear1="Incubus Earring +1",
                    ear2="Incubus Earring +1", body="Warlock's Tabard", hands="Devotee's Mitts +1",
                    ring1="Celestial Ring", ring2="Celestial Ring", back="Hecate's Cape",
                    waist="Witch Sash", legs="Mahatma Slops", feet="Mahatma Pigaches"}
        sets.midcast.potency = {main="Mistilteinn", sub="Nms. Shield +1",
                    head="blood Mask", neck="Promis Badge", ear1="Celestial Earring",
                    ear2="Celestial Earring", body="Mahatma Houppelande", hands="Devotee's Mitts +1",
                    ring1="Celestial Ring", ring2="Celestial Ring", back="Prism Cape",
                    waist="Witch Sash", legs="Mahatma Slops", feet="Mahatma Pigaches"}
     
        sets.midcast.Curaga = sets.midcast.Cure
        sets.midcast.CureSelf = {main="Chatoyant Staff", sub="Staff Grip", head="Warlock's Chapeau", neck="Fylgja Torque +1", ear1="Roundel Earring",
                            ear2="Celestial Earring", body="Goliard Saio", hands="Dusk Goves +1", ring1="Celestal Ring", ring2="Celestial Ring", back="Mahatma Cape",
                            waist="Pythia Sash +1", legs="Mahatma Slops", feet="Dusk Ledelsens +1"}
     
        sets.midcast['Enhancing Magic'] = {head="Warlock's Chapeau", body="Goliard Saio", neck="Enhancing Torque", ear1="Augment. Earring", legs="Warlock's Tights",
                            hands="Duelist's Gloves", feet="Dusk Ledelsens +1", waist="Speed Belt"}
                   
        sets.midcast.Buffs = {head="Warlock's Chapeau", body="Goliard Saio", legs="Warlock's Tights",
                            hands="Dusk Gloves +1", feet="Dusk Ledelsens +1", waist="Speed Belt"}
     
        sets.midcast.Stoneskin = {head="Warlock's Chapeau", body="Goliard Saio", neck="Enhancing Torque", ear1="Augment. Earring", ear2="Celestial Earring",
                            legs="Warlock's Tights", hands="Dusk gloves +1", feet="Dusk Ledelsens +1", waist="Speed Belt", back="Prism Cape", ring1="celestial Ring",
                            ring2="Celestial Ring"}
           
    	sets.midcast.Nuke = {main="Chatoyant Staff", sub="Vivid Strap +1", ammo="Phtm. Tathlum",
    		head="warlock's Chapeau", neck="Lmg. Medallion +1", ear1="Moldavite Earring", ear2="Elemental Earring",
    		body="Mahatma Hpl.", hands="Zenith Mitts +1", ring1="Omn. Ring +1", ring2="Omn. Ring +1", 
    		back="Hecate's Cape", waist="Witch Sash", legs="Mahatma Slops", feet="Duelist's Boots"}
    
        sets.midcast.Blizzard = {main="Aquilo's Staff", sub="Vivid Strap +1", ammo="Phtm. Tathlum",
    		head="warlock's Chapeau", neck="Lmg. Medallion +1", ear1="Moldavite Earring", ear2="Crapaud Earring",
    		body="Mahatma Hpl.", hands="Zenith Mitts +1", ring1="Omn. Ring +1", ring2="Omn. Ring +1", 
    		back="Hecate's Cape", waist="Witch Sash", legs="Mahatma Slops", feet="Duelist's Boots"}
    end
    function precast(spell)
            if spell.action_type == 'Magic' then
                    equip(sets.precast)
            end
    end
    function midcast(spell)
        if spell.action_type == 'Magic' then
            if spell.skill == "Enfeebling Magic" then
                if enfeeb.Mnd:contains(spell.en) then
                    equip(sets.midcast.MndEnfeeble)
                elseif enfeeb.Dark:contains(spell.en) then
                    equip(sets.midcast.DarkEnfeeble)
                elseif enfeeb.other:contains(spell.en) then
                    equip(sets.midcast[enfeeb_set_type[enfeeb_set_type_count]])
                end
            elseif spell.skill == 'Healing Magic' then
                if Cure_spells:contains(spell.en) then
                    equip(sets.midcast.Cure)
                else
                    equip(sets.midcast.fastcast)
                end
            elseif spell.skill == 'Enhancing Magic' then
                if spell.en == 'Stoneskin' then
                    equip(sets.midcast.Stoneskin)
                elseif Enhance_spells:contains(spell.en) then
                    equip(sets.midcast.Buffs)
                else
                    equip(sets.midcast.fastcast)
                end
    		elseif spell.skill == 'Elemental Magic' then
    			if spell.en == 'Blizzard*' then
    				equip(sets.midcast.Blizzard)
    			else
    				equip(sets.midcast.Nuke)
    			end
    		end
        end
    end
    function aftercast(spell)
            equip(sets.idle)
    end
    function self_command(command)
        if command == 'enfeebsettype' then
            enfeeb_set_type_count = (enfeeb_set_type_count % #enfeeb_set_type) + 1
            add_to_chat(7,'Enfeeb Set Type = ' .. tostring(enfeeb_set_type[enfeeb_set_type_count]))
        end
    end


    And one last thing <_< When I nuke, it doesn't go back to regular equip. All I did was added lines to midcast sets (for elemental/blizzard), and sets.midcast.fastcast. Blizzard set isn't equipping Aquilo's like it should. Some nukes go back to normal (water), but blizzard/thunder do not.

  4. #3884
    Smells like Onions
    Join Date
    Mar 2015
    Posts
    7
    BG Level
    0

    Hello. Trying to get dusk to dawn earring to work with weaponskills and having issues. I do not use Mote's includes.

    sets.Night = {ear2="Lugra Earring"}

    elseif spell.type == "WeaponSkill" then
    if player.status ~= 'Engaged' then
    cancel_spell()
    add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
    return
    else
    equipSet = sets.WS
    if equipSet[spell.english] then
    equipSet = equipSet[spell.english]
    end
    if spell.type == 'WeaponSkill' then
    if world.time <= (7*60) or world.time >= (17*60) then
    equip(sets.Night)
    end
    end

    Any help on what I'm doing wrong would be appreciated!

  5. #3885
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Clerix View Post
    Yup. Did that.

    Spoiler: show
    Code:
    function get_sets()
        --Tables
        enfeeb = {Mnd=S{"Silence","Silencega","Dia","Dia II","Dia III","Dia IV","Dia V","Diaga","Diaga II","Diaga III","Diaga IV","Diaga V"},Dark=S{"Sleep","Sleep II",
                "Sleepga","Sleepga II","Blind","Blind II","Blindga","Bind","Bindga","Poison","Poison II","Poison III","Poison IV","Poison V","Poisonga","Poisonga II",
                "Poisonga III","Poisonga IV","Poisonga V"},other=S{"Paralyze","Paralyze II","Slow","Slow II"},}
        Cure_spells = S{'Cura','Cura II','Cura III','Curaga','Curaga II','Curaga III','Curaga IV','Curaga V','Cure','Cure II','Cure III','Cure IV','Cure V','Cure VI'}
        Enhance_spells = S{"Refresh","Refresh II","Haste","Haste II","Hastega"}
        enfeeb_set_type = {"potency","accuracy"}
        enfeeb_set_type_count = 1
       
        ----GEAR SETS----
       
        --Idle Sets
        sets.idle = {main="Terra's Staff", sub="Vivid Strap +1", ammo="Hedgehog Bomb",
                            neck="Orocho Nodowa +1", ear1="Merman's Earring", ear2="Merman's Earring",
                            body="Ixion Cloak", hands="Dst. Mittens +1", ring1="Merman's Ring", ring2="Merman's Ring",
                            back="Umbra Cape", waist="Ocean Rope", legs="Blood Cuisses", feet="Dst. Leggings +1"}
           
        sets.idle.standard = {main="Terra's Staff", sub="Vivid Strap +1", ammo="Hedgehog Bomb",
                            neck="Orocho Nodowa +1", ear1="Merman's Earring", ear2="Merman's Earring",
                            body="Ixion Cloak", hands="Dst. Mittens +1", ring1="Merman's Ring", ring2="Merman's Ring",
                            back="Umbra Cape", waist="Ocean Rope", legs="Blood Cuisses", feet="Dst. Leggings +1"}
           
        sets.idle.PDT = {main="Terra's Staff", sub="Vivid Strap +1", ammo="Hedgehog Bomb",
                            neck="Orocho Nodowa +1", ear1="Merman's Earring", ear2="Merman's Earring",
                            body="Ixion Cloak", hands="Dst. Mittens +1", ring1="Merman's Ring", ring2="Merman's Ring",
                            back="Umbra Cape", waist="Ocean Rope", legs="Blood Cuisses", feet="Dst. Leggings +1"}
           
        --Precast Sets
        sets.precast = {head="Warlock's Chapeau", body="Goliard Saio", sub="Vivid Strap +1"}
           
        --Midcast sets
        sets.midcast = {head="Warlock's Chapeau", body="Goliard Saio", hands="Dusk Gloves +1", waist="Speed Belt", feet="Dusk Ledelsens +1"}
        sets.midcast.fastcast = {head="Warlock's Chapeau", body="Goliard Saio", hands="Dusk Gloves +1", waist="Speed Belt", feet="Dusk Ledelsens +1"}
        sets.midcast.Cure = {main="Chatoyant Staff", sub="Staff Grip", head="Warlock's Chapeau", neck="Fylgja Torque +1", ear1="Roundel Earring",
                            ear2="Celestial Earring", body="Goliard Saio", hands="Dusk Goves +1", ring1="Celestal Ring", ring2="Celestial Ring", back="Mahatma Cape",
                            waist="Pythia Sash +1", legs="Mahatma Slops", feet="Dusk Ledelsens +1"}        
        sets.midcast.DarkEnfeeble = {main="Chatoyant Staff", sub="Vivid Strap +1",
                    head="blood Mask", neck="Enfeebling Torque", ear1="Incubus Earring +1",
                    ear2="Incubus Earring +1", body="Warlock's Tabard", hands="Mahatma Cuffs",
                    ring1="Omn. Ring +1", ring2="Omn. Ring +1", back="Hecate's Cape",
                    waist="Witch Sash", legs="Mahatma Slops", feet="Wise Pigaches +1"}
                   
        sets.midcast.MndEnfeeble = {main="Chatoyant Staff", sub="raptor strap +1",
                    head="blood Mask", neck="Enfeebling Torque", ear1="Incubus Earring +1",
                    ear2="Incubus Earring +1", body="Warlock's Tabard", hands="Devotee's Mitts +1",
                    ring1="Celestial Ring", ring2="Celestial Ring", back="Hecate's Cape",
                    waist="Witch Sash", legs="Mahatma Slops", feet="Mahatma Pigaches"}
        sets.midcast.accuracy = {main="Chatoyant Staff", sub="raptor strap +1",
                    head="blood Mask", neck="Enfeebling Torque", ear1="Incubus Earring +1",
                    ear2="Incubus Earring +1", body="Warlock's Tabard", hands="Devotee's Mitts +1",
                    ring1="Celestial Ring", ring2="Celestial Ring", back="Hecate's Cape",
                    waist="Witch Sash", legs="Mahatma Slops", feet="Mahatma Pigaches"}
        sets.midcast.potency = {main="Mistilteinn", sub="Nms. Shield +1",
                    head="blood Mask", neck="Promis Badge", ear1="Celestial Earring",
                    ear2="Celestial Earring", body="Mahatma Houppelande", hands="Devotee's Mitts +1",
                    ring1="Celestial Ring", ring2="Celestial Ring", back="Prism Cape",
                    waist="Witch Sash", legs="Mahatma Slops", feet="Mahatma Pigaches"}
     
        sets.midcast.Curaga = sets.midcast.Cure
        sets.midcast.CureSelf = {main="Chatoyant Staff", sub="Staff Grip", head="Warlock's Chapeau", neck="Fylgja Torque +1", ear1="Roundel Earring",
                            ear2="Celestial Earring", body="Goliard Saio", hands="Dusk Goves +1", ring1="Celestal Ring", ring2="Celestial Ring", back="Mahatma Cape",
                            waist="Pythia Sash +1", legs="Mahatma Slops", feet="Dusk Ledelsens +1"}
     
        sets.midcast['Enhancing Magic'] = {head="Warlock's Chapeau", body="Goliard Saio", neck="Enhancing Torque", ear1="Augment. Earring", legs="Warlock's Tights",
                            hands="Duelist's Gloves", feet="Dusk Ledelsens +1", waist="Speed Belt"}
                   
        sets.midcast.Buffs = {head="Warlock's Chapeau", body="Goliard Saio", legs="Warlock's Tights",
                            hands="Dusk Gloves +1", feet="Dusk Ledelsens +1", waist="Speed Belt"}
     
        sets.midcast.Stoneskin = {head="Warlock's Chapeau", body="Goliard Saio", neck="Enhancing Torque", ear1="Augment. Earring", ear2="Celestial Earring",
                            legs="Warlock's Tights", hands="Dusk gloves +1", feet="Dusk Ledelsens +1", waist="Speed Belt", back="Prism Cape", ring1="celestial Ring",
                            ring2="Celestial Ring"}
           
        sets.midcast.Nuke = {main="Chatoyant Staff", sub="Vivid Strap +1", ammo="Phtm. Tathlum",
            head="warlock's Chapeau", neck="Lmg. Medallion +1", ear1="Moldavite Earring", ear2="Elemental Earring",
            body="Mahatma Hpl.", hands="Zenith Mitts +1", ring1="Omn. Ring +1", ring2="Omn. Ring +1", 
            back="Hecate's Cape", waist="Witch Sash", legs="Mahatma Slops", feet="Duelist's Boots"}
    
        sets.midcast.Blizzard = {main="Aquilo's Staff", sub="Vivid Strap +1", ammo="Phtm. Tathlum",
            head="warlock's Chapeau", neck="Lmg. Medallion +1", ear1="Moldavite Earring", ear2="Crapaud Earring",
            body="Mahatma Hpl.", hands="Zenith Mitts +1", ring1="Omn. Ring +1", ring2="Omn. Ring +1", 
            back="Hecate's Cape", waist="Witch Sash", legs="Mahatma Slops", feet="Duelist's Boots"}
    end
    function precast(spell)
            if spell.action_type == 'Magic' then
                    equip(sets.precast)
            end
    end
    function midcast(spell)
        if spell.action_type == 'Magic' then
            if spell.skill == "Enfeebling Magic" then
                if enfeeb.Mnd:contains(spell.en) then
                    equip(sets.midcast.MndEnfeeble)
                elseif enfeeb.Dark:contains(spell.en) then
                    equip(sets.midcast.DarkEnfeeble)
                elseif enfeeb.other:contains(spell.en) then
                    equip(sets.midcast[enfeeb_set_type[enfeeb_set_type_count]])
                end
            elseif spell.skill == 'Healing Magic' then
                if Cure_spells:contains(spell.en) then
                    equip(sets.midcast.Cure)
                else
                    equip(sets.midcast.fastcast)
                end
            elseif spell.skill == 'Enhancing Magic' then
                if spell.en == 'Stoneskin' then
                    equip(sets.midcast.Stoneskin)
                elseif Enhance_spells:contains(spell.en) then
                    equip(sets.midcast.Buffs)
                else
                    equip(sets.midcast.fastcast)
                end
            elseif spell.skill == 'Elemental Magic' then
                if spell.en == 'Blizzard*' then
                    equip(sets.midcast.Blizzard)
                else
                    equip(sets.midcast.Nuke)
                end
            end
        end
    end
    function aftercast(spell)
            equip(sets.idle)
    end
    function self_command(command)
        if command == 'enfeebsettype' then
            enfeeb_set_type_count = (enfeeb_set_type_count % #enfeeb_set_type) + 1
            add_to_chat(7,'Enfeeb Set Type = ' .. tostring(enfeeb_set_type[enfeeb_set_type_count]))
        end
    end


    And one last thing <_< When I nuke, it doesn't go back to regular equip. All I did was added lines to midcast sets (for elemental/blizzard), and sets.midcast.fastcast. Blizzard set isn't equipping Aquilo's like it should. Some nukes go back to normal (water), but blizzard/thunder do not.
    because spell.en == 'Blizzard*' wont work
    create a table like i did for each of the other ones

  6. #3886
    Puppetmaster
    Join Date
    Jan 2014
    Posts
    59
    BG Level
    2

    Quote Originally Posted by drip View Post
    Hello. Trying to get dusk to dawn earring to work with weaponskills and having issues. I do not use Mote's includes.

    sets.Night = {ear2="Lugra Earring"}

    elseif spell.type == "WeaponSkill" then
    if player.status ~= 'Engaged' then
    cancel_spell()
    add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
    return
    else
    equipSet = sets.WS
    if equipSet[spell.english] then
    equipSet = equipSet[spell.english]
    end
    if spell.type == 'WeaponSkill' then
    if world.time <= (7*60) or world.time >= (17*60) then
    equip(sets.Night)
    end
    end

    Any help on what I'm doing wrong would be appreciated!
    You're missing a closing, 'end'. So the syntax error won't allow GS to load your JOB.lua.

    Try this instead.
    Code:
    elseif spell.type == "WeaponSkill" then
        if buffactive.amnesia or spell.target.distance > 5 or player.tp < 1000 then
            add_to_chat(8, spell.english .. ' Canceled: ' .. player.tp)
            cancel_spell()
            return
        else
            equipSet = sets.WS
            if equipSet[spell.english] then
                equipSet = set_combine(equipSet, equipSet[spell.english])
            end
            if world.time <= (7*60) or world.time >= (17*60) then
                equipSet = set_combine(equipSet, sets.Night)
            end
            return equipSet
        end
    end

  7. #3887
    Smells like Onions
    Join Date
    Mar 2015
    Posts
    7
    BG Level
    0

    Quote Originally Posted by Quixacotl View Post
    You're missing a closing, 'end'. So the syntax error won't allow GS to load your JOB.lua.

    Try this instead.
    Code:
    elseif spell.type == "WeaponSkill" then
        if buffactive.amnesia or spell.target.distance > 5 or player.tp < 1000 then
            add_to_chat(8, spell.english .. ' Canceled: ' .. player.tp)
            cancel_spell()
            return
        else
            equipSet = sets.WS
            if equipSet[spell.english] then
                equipSet = set_combine(equipSet, equipSet[spell.english])
            end
            if world.time <= (7*60) or world.time >= (17*60) then
                equipSet = set_combine(equipSet, sets.Night)
            end
            return equipSet
        end
    end
    Thanks for reply Quixacotl! When I use this I don't seem to get an error but the earring does not equip during proper conditions... When I use your suggestion I do get a error, so I'm not sure what's up. Maybe it would be best if I pasted my entire Precast function to suggest what I'm doing wrong. Thanks again!

    Code:
    function precast(spell,action)
    	local check_ammo
    	local check_ammo_count = 1
    	if spell.action_type == 'Ranged Attack' then
    		check_ammo = player.equipment.ammo
    		if player.equipment.ammo == 'empty' or player.inventory[check_ammo].count <= check_ammo_count then
    			add_to_chat(123, spell.name..' Canceled: [Out of Ammo]')
    			cancel_spell()
    			return
    		else
    			equip(sets.Preshot)
    			if player.inventory[check_ammo].count <= ammo_warning_limit and player.inventory[check_ammo].count > 1 and not warning then
    				add_to_chat(8, '***** [Low Ammo Warning!] *****')
    				warning = true
    			elseif player.inventory[check_ammo].count > ammo_warning_limit and warning then
    				warning = false
    			end
    		end
    elseif spell.type == "WeaponSkill" then
        if buffactive.amnesia or spell.target.distance > 5 or player.tp < 1000 then
            add_to_chat(8, spell.english .. ' Canceled: ' .. player.tp)
            cancel_spell()
            return
        else
            equipSet = sets.WS
            if equipSet[spell.english] then
                equipSet = set_combine(equipSet, equipSet[spell.english])
            end
            if world.time <= (7*60) or world.time >= (17*60) then
                equipSet = set_combine(equipSet, sets.Night)
            end
            return equipSet
        end
    end
    			if Attack == 'ON' then
    				equipSet = equipSet["ATT"]
    			end
    			if equipSet[AccArray[AccIndex]] then
    				equipSet = equipSet[AccArray[AccIndex]]
    			end
    			if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
    				equipSet = equipSet["STP"]
    			end
    			if buffactive.Sekkanoki then -- Equip Unkai Kote +2 When Sekkanoki Is On --
    				equipSet = set_combine(equipSet,{hands="Unkai Kote +2"})
    			end
    			if buffactive.Sengikori then -- Equip Unkai Sune-ate +2 When Sengikori Is On --
    				equipSet = set_combine(equipSet,{feet="Unkai Sune-ate +2"})
    			end
    			if (spell.english == "Tachi: Fudo" or spell.english == "Tachi: Shoha") and (player.tp > 2990 or buffactive.Sekkanoki or (player.tp > 1990 and buffactive.Hagakure)) then -- Equip Vulcan's Pearl When You Have 300 TP or Sekkanoki On or 200+ TP For Hagakure --
    				equipSet = set_combine(equipSet,{ear2="Vulcan's Pearl"})
    			end
    			equip(equipSet)
    		end
    	elseif spell.type == "JobAbility" then
    		if sets.JA[spell.english] then
    			equip(sets.JA[spell.english])
    		end
    	elseif spell.action_type == 'Magic' then
    		if string.find(spell.english,'Utsusemi') then
    			if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
    				cancel_spell()
    				add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
    				return
    			else
    				equip(sets.Precast.FastCast)
    			end
    		else
    			equip(sets.Precast.FastCast)
    		end
    	elseif spell.type == "Waltz" then
    		refine_waltz(spell,action)
    		equip(sets.Waltz)
    	elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
    		cast_delay(0.2)
    		send_command('cancel Sneak')
    	end
    	if Twilight == 'Twilight' then
    		equip(sets.Twilight)
    	end
    	if Reive == 'Reive' then
    		equip(sets.Reive)
    	end
    		if Capacity == 'Capacity' then
    		equip(sets.Capacity)
    	end
    end
    [

  8. #3888
    Relic Shield
    Join Date
    Feb 2012
    Posts
    1,909
    BG Level
    6

    My LSmate is using the Kinematics BLM LUA but apparently it doesn't change his gear on t4 and above spells. I looked at the file myself and lowtiernukes are specifically defined but not hightiernukes. Do those need to be defined to get that gearswap to work? He's quite new to gearswap so I highly doubt he's changed anything in the lua side from what his gear is.

  9. #3889
    Puppetmaster
    Join Date
    Jan 2014
    Posts
    59
    BG Level
    2

    Quote Originally Posted by drip View Post
    Thanks for reply Quixacotl! When I use this I don't seem to get an error but the earring does not equip during proper conditions... When I use your suggestion I do get a error, so I'm not sure what's up. Maybe it would be best if I pasted my entire Precast function to suggest what I'm doing wrong. Thanks again!
    Just eyeballing your precast code, I can see a number of errors right off the bat. Precast() is the parent table for your sets. Don't use 'return equipSet' if you don't have a child table to process WS modes ie. Normal or Acc.

    Actually it would be much better if you could post your entire lua, especially since you're using non-Motes. Even with a new engine, your car won't run if it can't get a spark.

  10. #3890
    Smells like Onions
    Join Date
    Mar 2015
    Posts
    7
    BG Level
    0

    Quote Originally Posted by Quixacotl View Post
    Just eyeballing your precast code, I can see a number of errors right off the bat. Precast() is the parent table for your sets. Don't use 'return equipSet' if you don't have a child table to process WS modes ie. Normal or Acc.

    Actually it would be much better if you could post your entire lua, especially since you're using non-Motes. Even with a new engine, your car won't run if it can't get a spark.
    Here it is, it is a mauled version of Bokura's lua's. This is what I have working without errors- just want to figure out adding the night earring for WS... Again, thanks for taking the time to assist me!

    Code:
    function get_sets()
    	AccIndex = 1
    	AccArray = {"LowACC","MidACC","HighACC","Lentus"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. Can Delete Lentus If You Don't Need It. --
    	WeaponIndex = 1
    	WeaponArray = {"Tsurumaru","AnaheraBlade"} -- Default TP Set Is Tsurumaru. Can Delete Any Weapons/Sets That You Don't Need Or Replace/Add The New Weapons That You Want To Use. --
    	IdleIndex = 2
    	IdleArray = {"Movement","Regen"} -- Default Idle Set Is Regen --
    	Armor = 'None'
    	Twilight = 'None'
    	Reive = 'None'
    	Capacity = 'None'
    	warning = false
    	Attack = 'OFF' -- Set Default Attack Set ON or OFF Here --
    	Seigan = 'ON' -- Set Default Seigan Set ON or OFF Here --
    	Third_Eye = 'ON' -- Set Default Third Eye Set ON or OFF Here --
    	Samurai_Roll = 'ON' -- Set Default SAM Roll ON or OFF Here --
    	ammo_warning_limit = 10 -- Set Ammo Limit Check Here --
    	target_distance = 10 -- Set Default Distance Here --
    	select_default_macro_book() -- Change Default Macro Book At The End --
    
    	sc_map = {SC1="TachiFudo", SC2="TachiRana", SC3="NamasArrow"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
    
    	sets.Idle = {}
    	-- Idle/Town Sets --
    	sets.Idle.Regen = {
    			head="Sakonji Kabuto +1",
    			neck="Wiglen Gorget",
    			ear1="Dawn Earring",
    			ear2="Sanare Earring",
    			body="Mes. Haubergeon",
    			hands="Onimusha-no-Kote",
    			ring1="Defending Ring",
    			ring2="Paguroidea Ring",
    			back="Repulse Mantle",
    			waist="Flume Belt +1",
    			legs="Wakido Haidate +1",
    			feet="Sak. Sune-Ate +1"}
    	sets.Idle.Regen.Tsurumaru = set_combine(sets.Idle.Regen,{
    			main="Tsurumaru",
    			sub="Bloodrain Strap",
    			range="Cibitshavore",
    			ammo="Tulfaire Arrow"})
    	sets.Idle.Regen.AnaheraBlade = set_combine(sets.Idle.Regen,{
    			main="Anahera Blade",
    			sub="Bloodrain Strap",
    			range="Cibitshavore",
    			ammo="Tulfaire Arrow"})
    
    	sets.Twilight = {head="Twilight Helm",body="Twilight Mail"}
    	
    	sets.Reive = {neck="Adoulin's Refuge +1"}
    	
    	sets.Capacity = {back="Mecisto. Mantle"}
    
    	-- Preshot Set --
    	sets.Preshot = {}
    
    	-- Midshot Sets --
    	sets.Midshot = {}
    	sets.Midshot.MidACC = set_combine(sets.Midshot,{})
    	sets.Midshot.HighACC = set_combine(sets.Midshot.MidACC,{})
    
    	-- TP Base Set --
    	sets.TP = {}
    
    	-- Tsurumaru TP Sets --
    	sets.TP.Tsurumaru = {
    			main="Tsurumaru",
    			sub="Bloodrain Strap",
    			range="Cibitshavore",
    			head="Otomi Helm",
    			neck="Rioter's Collar",
    			ear1="Steelflash Earring",
    			ear2="Bladeborn Earring",
    			body="Mes. Haubergeon",
    			hands="Wakido Kote +1",
    			ring1="Rajas Ring",
    			ring2="K'ayres Ring",
    			back={ name="Takaha Mantle", augments={'STR+2','"Zanshin"+2','"Store TP"+2',}},
    			waist="Cetl Belt",
    			legs="Xaddi Cuisses",
    			feet="Sak. Sune-Ate +1"}
    	sets.TP.Tsurumaru.MidACC = set_combine(sets.TP.Tsurumaru,{
                head="Yaoyotl Helm"})
    	sets.TP.Tsurumaru.HighACC = set_combine(sets.TP.Tsurumaru.MidACC,{
    			waist="Olseni Belt",
    			feet="Otronif Boots +1"})
    
    
    	-- Tsurumaru(SAM Roll) TP Sets --
    	sets.TP.Tsurumaru.STP = set_combine(sets.TP.Tsurumaru,{})
    	sets.TP.Tsurumaru.MidACC.STP = set_combine(sets.TP.Tsurumaru.MidACC,{})
    	sets.TP.Tsurumaru.HighACC.STP = set_combine(sets.TP.Tsurumaru.HighACC,{})
    
    
    	-- AnaheraBlade(AM Down) TP Sets --
    	sets.TP.AnaheraBlade = {
    			main="Anahera Blade",
    			sub="Bloodrain Strap",
    			range="Cibitshavore",
    			head="Otomi Helm",
    			neck="Rioter's Collar",
    			ear1="Steelflash Earring",
    			ear2="Bladeborn Earring",
    			body="Mes. Haubergeon",
    			hands="Wakido Kote +1",
    			ring1="Rajas Ring",
    			ring2="K'ayres Ring",
                back={ name="Takaha Mantle", augments={'STR+2','"Zanshin"+2','"Store TP"+2',}},
    			waist="Cetl Belt",
    			legs="Xaddi Cuisses",
    			feet="Sak. Sune-Ate +1"}
    	sets.TP.AnaheraBlade.MidACC = set_combine(sets.TP.AnaheraBlade,{
                head="Yaoyotl Helm"})
    	sets.TP.AnaheraBlade.HighACC = set_combine(sets.TP.AnaheraBlade.MidACC,{
    			head="Yaoyotl Helm",
    			waist="Olseni Belt",
    			feet="Otronif Boots +1"})
    
    	-- AnaheraBlade(AM Up) TP Sets --
    	sets.TP.AnaheraBlade.AM = set_combine(sets.TP.AnaheraBlade,{})
    	sets.TP.AnaheraBlade.MidACC.AM = set_combine(sets.TP.AnaheraBlade.AM,{})
    	sets.TP.AnaheraBlade.HighACC.AM = set_combine(sets.TP.AnaheraBlade.MidACC.AM,{})
    
    	-- AnaheraBlade(AM Down: Ionis) TP Sets --
    	sets.TP.AnaheraBlade.Ionis =  set_combine(sets.TP.AnaheraBlade,{})
    	sets.TP.AnaheraBlade.MidACC.Ionis = set_combine(sets.TP.AnaheraBlade.Ionis,{})
    	sets.TP.AnaheraBlade.HighACC.Ionis = set_combine(sets.TP.AnaheraBlade.MidACC.Ionis,{})
    
    	-- AnaheraBlade(AM Up: Ionis) TP Sets --
    	sets.TP.AnaheraBlade.AM.Ionis =  set_combine(sets.TP.AnaheraBlade.AM,{})
    	sets.TP.AnaheraBlade.MidACC.AM.Ionis = set_combine(sets.TP.AnaheraBlade.AM.Ionis,{})
    	sets.TP.AnaheraBlade.HighACC.AM.Ionis = set_combine(sets.TP.AnaheraBlade.MidACC.AM.Ionis,{})
    
    	-- AnaheraBlade(AM Down: SAM Roll) TP Sets --
    	sets.TP.AnaheraBlade.STP = set_combine(sets.TP.AnaheraBlade,{})
    	sets.TP.AnaheraBlade.MidACC.STP = set_combine(sets.TP.AnaheraBlade.MidACC,{})
    	sets.TP.AnaheraBlade.HighACC.STP = set_combine(sets.TP.AnaheraBlade.HighACC,{})
    
    	-- AnaheraBlade(AM Up: SAM Roll) TP Sets --
    	sets.TP.AnaheraBlade.AM.STP = set_combine(sets.TP.AnaheraBlade.STP,{})
    	sets.TP.AnaheraBlade.MidACC.AM.STP = set_combine(sets.TP.AnaheraBlade.MidACC.STP,{})
    	sets.TP.AnaheraBlade.HighACC.AM.STP = set_combine(sets.TP.AnaheraBlade.HighACC.STP,{})
    
    	-- AnaheraBlade(AM Down: Ionis + SAM Roll) TP Sets --
    	sets.TP.AnaheraBlade.Ionis.STP = set_combine(sets.TP.AnaheraBlade.STP,{})
    	sets.TP.AnaheraBlade.MidACC.Ionis.STP = set_combine(sets.TP.AnaheraBlade.MidACC.STP,{})
    	sets.TP.AnaheraBlade.HighACC.Ionis.STP = set_combine(sets.TP.AnaheraBlade.HighACC.STP,{})
    
    	-- AnaheraBlade(AM Up: Ionis + SAM Roll) TP Sets --
    	sets.TP.AnaheraBlade.AM.Ionis.STP = set_combine(sets.TP.AnaheraBlade.AM.STP,{})
    	sets.TP.AnaheraBlade.MidACC.AM.Ionis.STP = set_combine(sets.TP.AnaheraBlade.MidACC.AM.STP,{})
    	sets.TP.AnaheraBlade.HighACC.AM.Ionis.STP = set_combine(sets.TP.AnaheraBlade.HighACC.AM.STP,{})
    
    	-- Seigan TP Set --
    	sets.TP.Seigan = {head="Unkai Kabuto +2"}
    
    	-- Third Eye TP Set --
    	sets.TP['Third Eye'] = {legs="Sakonji Haidate +1"}
    
    	-- PDT/MDT Sets --
    	sets.PDT = {
    			head="Otronif Mask +1",
    			neck="Agitator's Collar",
    			ear1="Steelflash Earring",
    			ear2="Bladeborn Earring",
    			body="Otro. Harness +1",
    			hands="Otronif Gloves +1",
    			ring1="Defending Ring",
    			ring2="Patricius Ring",
    			back="Repluse Mantle",
    			waist="Flume Belt +1",
    			legs="Otronif Brais +1",
    			feet="Otronif Boots +1"}
    
    	sets.MDT = set_combine(sets.PDT,{
    			head="Ogier's Helm",
    			ear1="Merman's Earring",
    			ear2="Sanare Earring",
    			body="Nocturnus Mail",
    			ring1="Shadow Ring",
    			back="Engulfer Cape",
    			waist="Resolute Belt"})
    
    	-- Hybrid Sets --
    	sets.TP.Hybrid = set_combine(sets.PDT,{
    			ear1="Steelflash Earring",
    			ear2="Bladeborn Earring",
    			hands="Sakonji Kote +1",
    			ring1="Patricius Ring",
    			back="Mollusca Mantle"})
    	sets.TP.Hybrid.MidACC = set_combine(sets.TP.Hybrid,{
    			head="Yaoyotl Helm",
    			ear1="Steelflash Earring",
    			ear2="Bladeborn Earring",
    			body="Sakonji Domaru +1",
    			hands="Wakido Kote +1"})
    	sets.TP.Hybrid.HighACC = set_combine(sets.TP.Hybrid.MidACC,{
    			body="Mes. Haubergeon",
    			waist="Dynamic Belt +1",
    			legs="Xaddi Cuisses"})
    
    	-- WS Base Set --
    	sets.WS = {
    			head="Otomi Helm",
    			neck="Fotia Gorget",
    			ear1="Moonshade Earring",
    			ear2="Brutal Earring",
    			body="Sakonji Domaru +1",
    			hands="Miki. Gauntlets",
    			ring1="Rajas Ring",
    			ring2="Pyrosoul Ring",
    			back="Buquwik Cape",
    			waist="Fotia Belt",
    			legs="Wakido Haidate +1",
    			feet="Sak. Sune-Ate +1"}
    
    	-- Tachi: Fudo Sets --
    	sets.WS["Tachi: Fudo"] = {
    			head="Otomi Helm",
    			neck="Fotia Gorget",
    			ear1="Moonshade Earring",
    			ear2="Brutal Earring",
    			body="Sakonji Domaru +1",
    			hands="Miki. Gauntlets",
    			ring1="Ifrit Ring",
    			ring2="Ifrit Ring",
    			back="Buquwik Cape",
    			waist="Fotia Belt",
    			legs="Wakido Haidate +1",
    			feet="Sak. Sune-Ate +1"}
    	sets.WS["Tachi: Fudo"].MidACC = set_combine(sets.WS["Tachi: Fudo"],{
    			hands="Miki. Gauntlets"})
    	sets.WS["Tachi: Fudo"].HighACC = set_combine(sets.WS["Tachi: Fudo"].MidACC,{
    			back="Vespid Mantle"})
    
    	-- Tachi: Fudo(4 Hits) Set --
    	sets.WS["Tachi: Fudo"].Lentus = set_combine(sets.WS["Tachi: Fudo"],{
    			ring2="Rajas Ring"})
    
    	-- Tachi: Fudo(SAM Roll) Sets --
    	sets.WS["Tachi: Fudo"].STP = set_combine(sets.WS["Tachi: Fudo"],{})
    	sets.WS["Tachi: Fudo"].MidACC.STP = set_combine(sets.WS["Tachi: Fudo"].MidACC,{})
    	sets.WS["Tachi: Fudo"].HighACC.STP = set_combine(sets.WS["Tachi: Fudo"].HighACC,{})
    
    	-- Tachi: Fudo(Attack) Set --
    	sets.WS["Tachi: Fudo"].ATT = set_combine(sets.WS["Tachi: Fudo"],{
    			head="Yaoyotl Helm",
    			hands="Miki. Gauntlets"})
    
    	-- Tachi: Shoha Sets --
    	sets.WS["Tachi: Shoha"] = {
    			head="Otomi Helm",
    			neck="Fotia Gorget",
    			ear1="Moonshade Earring",
    			ear2="Brutal Earring",
    			body="Sakonji Domaru +1",
    			hands="Miki. Gauntlets",
    			ring1="Ifrit Ring",
    			ring2="Ifrit Ring",
    			back="Buquwik Cape",
    			waist="Fotia Belt",
    			legs="Wakido Haidate +1",
    			feet="Sak. Sune-Ate +1"}
    	sets.WS["Tachi: Shoha"].MidACC = set_combine(sets.WS["Tachi: Shoha"],{
    			hands="Miki. Gauntlets"})
    	sets.WS["Tachi: Shoha"].HighACC = set_combine(sets.WS["Tachi: Shoha"].MidACC,{
    			back="Vespid Mantle"})
    
    	-- Tachi: Shoha(4 Hits) Set --
    	sets.WS["Tachi: Shoha"].Lentus = set_combine(sets.WS["Tachi: Shoha"],{})
    
    	-- Tachi: Shoha(SAM Roll) Sets --
    	sets.WS["Tachi: Shoha"].STP = set_combine(sets.WS["Tachi: Shoha"],{})
    	sets.WS["Tachi: Shoha"].MidACC.STP = set_combine(sets.WS["Tachi: Shoha"].MidACC,{})
    	sets.WS["Tachi: Shoha"].HighACC.STP = set_combine(sets.WS["Tachi: Shoha"].HighACC,{})
    
    	-- Tachi: Kasha Sets --
    	sets.WS["Tachi: Kasha"] = {
    			head="Otomi Helm",
    			neck="Fotia Gorget",
    			ear1="Moonshade Earring",
    			ear2="Brutal Earring",
    			body="Sakonji Domaru +1",
    			hands="Miki. Gauntlets",
    			ring1="Ifrit Ring",
    			ring2="Ifrit Ring",
    			back="Buquwik Cape",
    			waist="Fotia Belt",
    			legs="Wakido Haidate +1",
    			feet="Sak. Sune-Ate +1"}
    	sets.WS["Tachi: Kasha"].MidACC = set_combine(sets.WS["Tachi: Kasha"],{
    			hands="Miki. Gauntlets"})
    	sets.WS["Tachi: Kasha"].HighACC = set_combine(sets.WS["Tachi: Kasha"].MidACC,{
    			back="Vespid Mantle"})
    
    	-- Tachi: Kasha(Lentus) Set --
    	sets.WS["Tachi: Kasha"].Lentus = set_combine(sets.WS["Tachi: Kasha"],{})
    
    	-- Tachi: Kasha(SAM Roll) Sets --
    	sets.WS["Tachi: Kasha"].STP = set_combine(sets.WS["Tachi: Kasha"],{})
    	sets.WS["Tachi: Kasha"].MidACC.STP = set_combine(sets.WS["Tachi: Kasha"].MidACC,{})
    	sets.WS["Tachi: Kasha"].HighACC.STP = set_combine(sets.WS["Tachi: Kasha"].HighACC,{})
    
    	-- Tachi: Kasha(Attack) Set --
    	sets.WS["Tachi: Kasha"].ATT = set_combine(sets.WS["Tachi: Kasha"],{
    			head="Yaoyotl Helm",
    			hands="Miki. Gauntlets"})
    
    	-- Namas Arrow Sets --
    	sets.WS["Namas Arrow"] = {
    			ammo="Tulfaire Arrow",
    			head="Sakonji Kabuto +1",
    			neck="Fotia Gorget",
    			ear1="Vulcan's Pearl",
    			ear2="Vulcan's Pearl",
    			body="Phorcys Korazin",
    			hands="Unkai Kote +2",
    			ring1="Pyrosoul Ring",
    			ring2="Pyrosoul Ring",
    			back="Buquwik Cape",
    			waist="Fotia Belt",
    			legs="Wakido Haidate +1",
    			feet="Waki. Sune-Ate +1"}
    	sets.WS["Namas Arrow"].MidACC = set_combine(sets.WS["Namas Arrow"],{})
    	sets.WS["Namas Arrow"].HighACC = set_combine(sets.WS["Namas Arrow"].MidACC,{
    			body="Kyujutsugi"})
    
    	-- Apex Arrow Sets --
    	sets.WS["Apex Arrow"] = {
    			ammo="Tulfaire Arrow",
    			head="Sakonji Kabuto +1",
    			neck="Fotia Gorget",
    			ear1="Auster's Peral",
    			ear2="Dawn Earring",
    			body="Kyujutsugi",
    			hands="Unkai Kote +2",
    			ring1="Garuda Ring +1",
    			ring2="Garuda Ring +1",
    			back="Ik Cape",
    			waist="Fotia Belt",
    			legs="Wakido Haidate +1",
    			feet="Sak. Sune-Ate +1"}
    	sets.WS["Apex Arrow"].MidACC = set_combine(sets.WS["Apex Arrow"],{})
    	sets.WS["Apex Arrow"].HighACC = set_combine(sets.WS["Apex Arrow"].MidACC,{
    			body="Kyujutsugi"})
    
    	-- JA Sets --
    	sets.JA = {}
    	sets.JA.Meditate = {head="Myochin Kabuto",hands="Sao. Kote +2",back={ name="Takaha Mantle", augments={'STR+1','"Zanshin"+1','"Store TP"+1','Meditate eff. dur. +4',}}}
    	sets.JA["Warding Circle"] = {head="Wakido Kabuto +1"}
    	sets.JA["Meikyo Shisui"] = {feet="Sak. Sune-Ate +1"}
    	
    	-- Night Set --
        sets.Night = {ear2="Lugra Earring"}
    
    	-- Waltz Set --
    	sets.Waltz = {}
    
    	sets.Precast = {}
    	-- Fastcast Set --
    	sets.Precast.FastCast = {
    			neck="Orunmila's Torque",
    			ear1="Loquac. Earring",
    			ring1="Prolix Ring",
    			ring2="Veneficium Ring"}
    
    	sets.Midcast = {}
    	-- Magic Haste Set --
    	sets.Midcast.Haste = set_combine(sets.PDT,{})
    end
    
    function pretarget(spell,action)
    	if spell.action_type == 'Magic' and buffactive.silence then -- Auto Use Echo Drops If You Are Silenced --
    		cancel_spell()
    		send_command('input /item "Echo Drops" <me>')
    	elseif spell.english == "Berserk" and buffactive.Berserk then -- Change Berserk To Aggressor If Berserk Is On --
    		cancel_spell()
    		send_command('Aggressor')
    	elseif spell.english == "Seigan" and buffactive.Seigan then -- Change Seigan To Third Eye If Seigan Is On --
    		cancel_spell()
    		send_command('ThirdEye')
    	elseif spell.english == "Meditate" and player.tp > 2990 then -- Cancel Meditate If TP Is Above 290 --
    		cancel_spell()
    		add_to_chat(123, spell.name .. ' Canceled: ['..player.tp..' TP]')
    	elseif spell.action_type == 'Ranged Attack' and spell.target.distance > 24.9 then
    		cancel_spell()
    		add_to_chat(123, spell.name..' Canceled: [Out of Range]')
    		return
    	elseif spell.type == 'WeaponSkill' and player.status == 'Engaged' then
    		if spell.skill == 'Archery' then
    			if spell.target.distance > 16+target_distance then
    				cancel_spell()
    				add_to_chat(123, spell.name..' Canceled: [Out of Range]')
    				return
    			end
    		else
    			if spell.target.distance > target_distance then
    				cancel_spell()
    				add_to_chat(123, spell.name..' Canceled: [Out of Range]')
    				return
    			end
    		end
    	end
    end
    
    function precast(spell,action)
    	local check_ammo
    	local check_ammo_count = 1
    	if spell.action_type == 'Ranged Attack' then
    		check_ammo = player.equipment.ammo
    		if player.equipment.ammo == 'empty' or player.inventory[check_ammo].count <= check_ammo_count then
    			add_to_chat(123, spell.name..' Canceled: [Out of Ammo]')
    			cancel_spell()
    			return
    		else
    			equip(sets.Preshot)
    			if player.inventory[check_ammo].count <= ammo_warning_limit and player.inventory[check_ammo].count > 1 and not warning then
    				add_to_chat(8, '***** [Low Ammo Warning!] *****')
    				warning = true
    			elseif player.inventory[check_ammo].count > ammo_warning_limit and warning then
    				warning = false
    			end
    		end
    	elseif spell.type == "WeaponSkill" then
    		if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
    			cancel_spell()
    			add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
    			return
    			else
    			equipSet = sets.WS
    			if equipSet[spell.english] then
    				equipSet = equipSet[spell.english]
    		end
    			if Attack == 'ON' then
    				equipSet = equipSet["ATT"]
    			end
    			if equipSet[AccArray[AccIndex]] then
    				equipSet = equipSet[AccArray[AccIndex]]
    			end
    			if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
    				equipSet = equipSet["STP"]
    			end
    			if buffactive.Sekkanoki then -- Equip Unkai Kote +2 When Sekkanoki Is On --
    				equipSet = set_combine(equipSet,{hands="Unkai Kote +2"})
    			end
    			if buffactive.Sengikori then -- Equip Unkai Sune-ate +2 When Sengikori Is On --
    				equipSet = set_combine(equipSet,{feet="Unkai Sune-ate +2"})
    			end
    			if (spell.english == "Tachi: Fudo" or spell.english == "Tachi: Shoha") and (player.tp > 2990 or buffactive.Sekkanoki or (player.tp > 1990 and buffactive.Hagakure)) then -- Equip Vulcan's Pearl When You Have 300 TP or Sekkanoki On or 200+ TP For Hagakure --
    				equipSet = set_combine(equipSet,{ear2="Vulcan's Pearl"})
    			end
    			equip(equipSet)
    		end
    	elseif spell.type == "JobAbility" then
    		if sets.JA[spell.english] then
    			equip(sets.JA[spell.english])
    		end
    	elseif spell.action_type == 'Magic' then
    		if string.find(spell.english,'Utsusemi') then
    			if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
    				cancel_spell()
    				add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
    				return
    			else
    				equip(sets.Precast.FastCast)
    			end
    		else
    			equip(sets.Precast.FastCast)
    		end
    	elseif spell.type == "Waltz" then
    		refine_waltz(spell,action)
    		equip(sets.Waltz)
    	elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
    		cast_delay(0.2)
    		send_command('cancel Sneak')
    	end
    	if Twilight == 'Twilight' then
    		equip(sets.Twilight)
    	end
    	if Reive == 'Reive' then
    		equip(sets.Reive)
    	end
    		if Capacity == 'Capacity' then
    		equip(sets.Capacity)
    	end
    end
     
    
    function midcast(spell,action)
    	if spell.action_type == 'Ranged Attack' then
    		equipSet = sets.Midshot
    		if equipSet[AccArray[AccIndex]] then
    			equipSet = equipSet[AccArray[AccIndex]]
    		end
    		equip(equipSet)
    	elseif spell.action_type == 'Magic' then
    		if string.find(spell.english,'Utsusemi') then
    			if spell.english == 'Utsusemi: Ichi' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
    				send_command('@wait 1.7;cancel Copy Image*')
    			end
    			equip(sets.Midcast.Haste)
    		elseif spell.english == 'Monomi: Ichi' then
    			if buffactive['Sneak'] then
    				send_command('@wait 1.7;cancel sneak')
    			end
    			equip(sets.Midcast.Haste)
    		else
    			equip(sets.Midcast.Haste)
    		end
    	end
    end
    
    function aftercast(spell,action)
    	if not spell.interrupted then
    		if spell.type == "WeaponSkill" then
    			send_command('wait 0.2;gs c TP')
    		elseif spell.english == "Warding Circle" then -- Warding Circle Countdown --
    			send_command('wait 260;input /echo '..spell.name..': [WEARING OFF IN 10 SEC.];wait 10;input /echo '..spell.name..': [OFF]')
    		end
    	end
    	status_change(player.status)
    end
    
    function status_change(new,old)
    	if Armor == 'PDT' then
    		equip(sets.PDT)
    	elseif Armor == 'MDT' then
    		equip(sets.MDT)
    	elseif new == 'Engaged' then
    		equipSet = sets.TP
    		if Armor == 'Hybrid' and equipSet["Hybrid"] then
    			equipSet = equipSet["Hybrid"]
    		end
    		if equipSet[WeaponArray[WeaponIndex]] then
    			equipSet = equipSet[WeaponArray[WeaponIndex]]
    		end
    		if equipSet[AccArray[AccIndex]] then
    			equipSet = equipSet[AccArray[AccIndex]]
    		end
    		if buffactive["Aftermath: Lv.3"] and equipSet["AM3"] then
    			equipSet = equipSet["AM3"]
    		end
    		if buffactive.Ionis and equipSet["Ionis"] then
    			equipSet = equipSet["Ionis"]
    		end
    		if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
    			equipSet = equipSet["STP"]
    		end
    		if buffactive.Seigan and Seigan == 'ON' then -- Use Seigan Toggle For Seigan TP Set --
    			equipSet = set_combine(equipSet,sets.TP.Seigan)
    		end
    		if buffactive["Third Eye"] and Third_Eye == 'ON' then -- Use Third Eye Toggle For Third Eye TP Set --
    			equipSet = set_combine(equipSet,sets.TP["Third Eye"])
    		end
    		equip(equipSet)
    	else
    		equipSet = sets.Idle
    		if equipSet[IdleArray[IdleIndex]] then
    			equipSet = equipSet[IdleArray[IdleIndex]]
    		end
    		if equipSet[WeaponArray[WeaponIndex]] then
    			equipSet = equipSet[WeaponArray[WeaponIndex]]
    		end
    		equip(equipSet)
    	end
    	if Twilight == 'Twilight' then
    		equip(sets.Twilight)
    	end
    	if Reive == 'Reive' then
    		equip(sets.Reive)
    	end
    	if Capacity == 'Capacity' then
    		equip(sets.Capacity)
    	end
    end
    
    function buff_change(buff,gain)
    	buff = string.lower(buff)
    	if buff == "aftermath: lv.3" then -- AM3 Timer/Countdown --
    		if gain then
    			send_command('timers create "Aftermath: Lv.3" 180 down;wait 120;input /echo Aftermath: Lv.3 [WEARING OFF IN 60 SEC.];wait 30;input /echo Aftermath: Lv.3 [WEARING OFF IN 30 SEC.];wait 20;input /echo Aftermath: Lv.3 [WEARING OFF IN 10 SEC.]')
    		else
    			send_command('timers delete "Aftermath: Lv.3"')
    			add_to_chat(123,'AM3: [OFF]')
    		end
    	elseif buff == "perfect defense" then -- PD Timer --
    		if gain then
    			send_command('timers create "Perfect Defense" 57 down')
    		else
    			send_command('timers delete "Perfect Defense"')
    			add_to_chat(123,'PD: [OFF]')
    		end
    	elseif buff == "yaegasumi" then -- Yaegasumi Timer --
    		if gain then
    			send_command('timers create "Yaegasumi" 45 down')
    		else
    			send_command('timers delete "Yaegasumi"')
    			add_to_chat(123,'Yaegasumi: [OFF]')
    		end
    	elseif buff == 'weakness' then -- Weakness Timer --
    		if gain then
    			send_command('timers create "Weakness" 300 up')
    		else
    			send_command('timers delete "Weakness"')
    		end
    	end
    	if buff == "sleep" and gain and player.hp > 200 and player.status == "Engaged" then -- Equip Berserker's Torque When You Are Asleep & Have 200+ HP --
    		equip({neck="Berserker's Torque"})
    	else
    		if not midaction() then
    			status_change(player.status)
    		end
    	end
    	if name == "Meikyo Shisui" then
    		if gain then
    			enable("feet")
    			equip({feet="Sakonji Sune-Ate"})
    			disable("feet")
    		else
    			enable("feet")
    		end
    	end
    end
    
    -- In Game: //gs c (command), Macro: /console gs c (command), Bind: gs c (command) --
    function self_command(command)
    	if command == 'C1' then -- Accuracy Toggle --
    		AccIndex = (AccIndex % #AccArray) + 1
    		add_to_chat(158,'Accuracy Level: '..AccArray[AccIndex])
    		status_change(player.status)
    	elseif command == 'C17' then -- Main Weapon Toggle --
    		WeaponIndex = (WeaponIndex % #WeaponArray) + 1
    		add_to_chat(158,'Main Weapon: '..WeaponArray[WeaponIndex])
    		status_change(player.status)
    	elseif command == 'C5' then -- Auto Update Gear Toggle --
    		status_change(player.status)
    		add_to_chat(158,'Auto Update Gear')
    	elseif command == 'C2' then -- Hybrid Toggle --
    		if Armor == 'Hybrid' then
    			Armor = 'None'
    			add_to_chat(123,'Hybrid Set: [Unlocked]')
    		else
    			Armor = 'Hybrid'
    			add_to_chat(158,'Hybrid Set: '..AccArray[AccIndex])
    		end
    		status_change(player.status)
    	elseif command == 'C7' then -- PDT Toggle --
    		if Armor == 'PDT' then
    			Armor = 'None'
    			add_to_chat(123,'PDT Set: [Unlocked]')
    		else
    			Armor = 'PDT'
    			add_to_chat(158,'PDT Set: [Locked]')
    		end
    		status_change(player.status)
    	elseif command == 'C15' then -- Reive Toggle --
    		if Reive == 'Reive' then
    			Reive = 'None'
    			add_to_chat(123,'Reive Set: [Unlocked]')
    		else
    			Reive = 'Reive'
    			add_to_chat(158,'Reive Set: [Locked]')
    		end
    		status_change(player.status)
    			elseif command == 'C18' then -- Capacity Toggle --
    		if Capacity == 'Capacity' then
    			Capacity = 'None'
    			add_to_chat(123,'Capacity Set: [Unlocked]')
    		else
    			Capacity = 'Capacity'
    			add_to_chat(158,'Capacity Set: [Locked]')
    		end
    		status_change(player.status)
    	elseif command == 'C16' then -- Seigan Toggle --
    		if Seigan == 'ON' then
    			Seigan = 'OFF'
    			add_to_chat(123,'Seigan Set: [Unlocked]')
    		else
    			Seigan = 'ON'
    			add_to_chat(158,'Seigan Set: [Locked]')
    		end
    		status_change(player.status)
    	elseif command == 'C12' then -- Third Eye Toggle --
    		if Third_Eye == 'ON' then
    			Third_Eye = 'OFF'
    			add_to_chat(123,'Third Eye Set: [Unlocked]')
    		else
    			Third_Eye = 'ON'
    			add_to_chat(158,'Third Eye Set: [Locked]')
    		end
    		status_change(player.status)
    	elseif command == 'C11' then -- SAM Roll Toggle --
    		if Samurai_Roll == 'ON' then
    			Samurai_Roll = 'OFF'
    			add_to_chat(123,'SAM Roll: [OFF]')
    		else
    			Samurai_Roll = 'ON'
    			add_to_chat(158,'SAM Roll: [ON]')
    		end
    		status_change(player.status)
    	elseif command == 'C9' then -- Attack Toggle --
    		if Attack == 'ON' then
    			Attack = 'OFF'
    			add_to_chat(123,'Attack: [OFF]')
    		else
    			Attack = 'ON'
    			add_to_chat(158,'Attack: [ON]')
    		end
    		status_change(player.status)
    	elseif command == 'C3' then -- Twilight Toggle --
    		if Twilight == 'Twilight' then
    			Twilight = 'None'
    			add_to_chat(123,'Twilight Set: [Unlocked]')
    		else
    			Twilight = 'Twilight'
    			add_to_chat(158,'Twilight Set: [Locked]')
    		end
    		status_change(player.status)
    	elseif command == 'C8' then -- Distance Toggle --
    		if player.target.distance then
    			target_distance = math.floor(player.target.distance*10)/10
    			add_to_chat(158,'Distance: '..target_distance)
    		else
    			add_to_chat(123,'No Target Selected')
    		end
    	elseif command == 'C10' then -- Cancel Meikyo Shisui --
    		send_command('Cancel Meikyo Shisui')
    		add_to_chat(123,'Meikyo Shisui: [OFF]')
    	elseif command == 'C6' then -- Idle Toggle --
    		IdleIndex = (IdleIndex % #IdleArray) + 1
    		add_to_chat(158,'Idle Set: '..IdleArray[IdleIndex])
    		status_change(player.status)
    	elseif command == 'TP' then
    		add_to_chat(158,'TP Return: ['..tostring(player.tp)..']')
    	elseif command:match('^SC%d$') then
    		send_command('//'..sc_map[command])
    	end
    end
    
    function refine_waltz(spell,action)
    	if spell.type ~= 'Waltz' then
    		return
    	end
    
    	if spell.name == "Healing Waltz" or spell.name == "Divine Waltz" then
    		return
    	end
    
    	local newWaltz = spell.english
    	local waltzID
    
    	local missingHP
    
    	if spell.target.type == "SELF" then
    		missingHP = player.max_hp - player.hp
    	elseif spell.target.isallymember then
    		local target = find_player_in_alliance(spell.target.name)
    		local est_max_hp = target.hp / (target.hpp/100)
    		missingHP = math.floor(est_max_hp - target.hp)
    	end
    
    	if missingHP ~= nil then
    		if player.sub_job == 'DNC' then
    			if missingHP < 40 and spell.target.name == player.name then
    				add_to_chat(123,'Full HP!')
    				cancel_spell()
    				return
    			elseif missingHP < 150 then
    				newWaltz = 'Curing Waltz'
    				waltzID = 190
    			elseif missingHP < 300 then
    				newWaltz = 'Curing Waltz II'
    				waltzID = 191
    			else
    				newWaltz = 'Curing Waltz III'
    				waltzID = 192
    			end
    		else
    			return
    		end
    	end
    
    	local waltzTPCost = {['Curing Waltz'] = 20, ['Curing Waltz II'] = 35, ['Curing Waltz III'] = 50}
    	local tpCost = waltzTPCost[newWaltz]
    
    	local downgrade
    
    	if player.tp < tpCost then
    
    		if player.tp < 20 then
    			add_to_chat(123, 'Insufficient TP ['..tostring(player.tp)..']. Cancelling.')
    			cancel_spell()
    			return
    		elseif player.tp < 35 then
    			newWaltz = 'Curing Waltz'
    		elseif player.tp < 50 then
    			newWaltz = 'Curing Waltz II'
    		end
    
    		downgrade = 'Insufficient TP ['..tostring(player.tp)..']. Downgrading to '..newWaltz..'.'
    	end
    
    	if newWaltz ~= spell.english then
    		send_command('@input /ja "'..newWaltz..'" '..tostring(spell.target.raw))
    		if downgrade then
    			add_to_chat(8, downgrade)
    		end
    		cancel_spell()
    		return
    	end
    
    	if missingHP > 0 then
    		add_to_chat(8,'Trying to cure '..tostring(missingHP)..' HP using '..newWaltz..'.')
    	end
    end
    
    function find_player_in_alliance(name)
    	for i,v in ipairs(alliance) do
    		for k,p in ipairs(v) do
    			if p.name == name then
    				return p
    			end
    		end
    	end
    end
    
    function sub_job_change(newSubjob, oldSubjob)
    	select_default_macro_book()
    end
    
    function set_macro_page(set,book)
    	if not tonumber(set) then
    		add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
    		return
    	end
    	if set < 1 or set > 10 then
    		add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
    		return
    	end
    
    	if book then
    		if not tonumber(book) then
    			add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
    			return
    		end
    		if book < 1 or book > 20 then
    			add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
    			return
    		end
    		send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
    	else
    		send_command('@input /macro set '..tostring(set))
    	end
    end
    
    function select_default_macro_book()
    	-- Default macro set/book
    	if player.sub_job == 'WAR' then
    		set_macro_page(1, 12)
    	elseif player.sub_job == 'DNC' then
    		set_macro_page(2, 12)
    	elseif player.sub_job == 'NIN' then
    		set_macro_page(3, 12)
    	else
    		set_macro_page(1, 12)
    	end
    end

  11. #3891
    Puppetmaster
    Join Date
    Jan 2014
    Posts
    59
    BG Level
    2

    Your Vulcan's earring was getting in the way of your Lugra's whenever you did Fudo or Shoha or had Sekkanoki up. Didn't matter the time of day.

    I just moved the Lugra's logic underneath all the other WS checks. That should do it
    Code:
    function precast(spell,action)
    	local check_ammo
    	local check_ammo_count = 1
    	if spell.action_type == 'Ranged Attack' then
    		check_ammo = player.equipment.ammo
    		if player.equipment.ammo == 'empty' or player.inventory[check_ammo].count <= check_ammo_count then
    			add_to_chat(123, spell.name..' Canceled: [Out of Ammo]')
    			cancel_spell()
    			return
    		else
    			equip(sets.Preshot)
    			if player.inventory[check_ammo].count <= ammo_warning_limit and player.inventory[check_ammo].count > 1 and not warning then
    				add_to_chat(8, '***** [Low Ammo Warning!] *****')
    				warning = true
    			elseif player.inventory[check_ammo].count > ammo_warning_limit and warning then
    				warning = false
    			end
    		end
    	elseif spell.type == "WeaponSkill" then
    		if player.status ~= 'Engaged' then -- Cancel WS If You Are Not Engaged. Can Delete It If You Don't Need It --
    			cancel_spell()
    			add_to_chat(123,'Unable To Use WeaponSkill: [Disengaged]')
    			return
    			else
    			equipSet = sets.WS
    			if equipSet[spell.english] then
    				equipSet = equipSet[spell.english]
    		end
    			if Attack == 'ON' then
    				equipSet = equipSet["ATT"]
    			end
    			if equipSet[AccArray[AccIndex]] then
    				equipSet = equipSet[AccArray[AccIndex]]
    			end
    			if buffactive["Samurai Roll"] and equipSet["STP"] and Samurai_Roll == 'ON' then
    				equipSet = equipSet["STP"]
    			end
    			if buffactive.Sekkanoki then -- Equip Unkai Kote +2 When Sekkanoki Is On --
    				equipSet = set_combine(equipSet,{hands="Unkai Kote +2"})
    			end
    			if buffactive.Sengikori then -- Equip Unkai Sune-ate +2 When Sengikori Is On --
    				equipSet = set_combine(equipSet,{feet="Unkai Sune-ate +2"})
    			end
    			if (spell.english == "Tachi: Fudo" or spell.english == "Tachi: Shoha") and (player.tp > 2990 or buffactive.Sekkanoki or (player.tp > 1990 and buffactive.Hagakure)) then -- Equip Vulcan's Pearl When You Have 300 TP or Sekkanoki On or 200+ TP For Hagakure --
    				equipSet = set_combine(equipSet,{ear2="Vulcan's Pearl"})
    			end
    
    			if world.time <= (7*60) or world.time >= (17*60) then
    				equipSet = set_combine(equipSet, sets.Night)
    			end
    
    			equip(equipSet)
    		end
    	elseif spell.type == "JobAbility" then
    		if sets.JA[spell.english] then
    			equip(sets.JA[spell.english])
    		end
    	elseif spell.action_type == 'Magic' then
    		if string.find(spell.english,'Utsusemi') then
    			if buffactive['Copy Image (3)'] or buffactive['Copy Image (4)'] then
    				cancel_spell()
    				add_to_chat(123, spell.name .. ' Canceled: [3+ Images]')
    				return
    			else
    				equip(sets.Precast.FastCast)
    			end
    		else
    			equip(sets.Precast.FastCast)
    		end
    	elseif spell.type == "Waltz" then
    		refine_waltz(spell,action)
    		equip(sets.Waltz)
    	elseif spell.english == 'Spectral Jig' and buffactive.Sneak then
    		cast_delay(0.2)
    		send_command('cancel Sneak')
    	end
    	if Twilight == 'Twilight' then
    		equip(sets.Twilight)
    	end
    	if Reive == 'Reive' then
    		equip(sets.Reive)
    	end
    		if Capacity == 'Capacity' then
    		equip(sets.Capacity)
    	end
    end

  12. #3892
    Smells like Onions
    Join Date
    Mar 2015
    Posts
    7
    BG Level
    0

    Thank you Quixacotl.

  13. #3893
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    Ok so for the "Curse" debuff:

    buff id 9 is regular curse and buff id 20 is zombie curse (recovery curse, or you cant be cured or gain MP in any way). Both are called just "Curse". My question is, is there any way to use the ID number of it instead of name utilizing buffactive or the buff_change function? For example, for sneak attack you would use buffactive["Sneak Attack"] or buff == 'Sneak Attack' in the buff_change function. Is it possible to use the buff ID number of "65" instead of the buff name "Sneak Attack"? Would you have to word it differently to use the ID number?

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

    Quote Originally Posted by Trumpy View Post
    Ok so for the "Curse" debuff:

    buff id 9 is regular curse and buff id 20 is zombie curse (recovery curse, or you cant be cured or gain MP in any way). Both are called just "Curse". My question is, is there any way to use the ID number of it instead of name utilizing buffactive or the buff_change function? For example, for sneak attack you would use buffactive["Sneak Attack"] or buff == 'Sneak Attack' in the buff_change function. Is it possible to use the buff ID number of "65" instead of the buff name "Sneak Attack"? Would you have to word it differently to use the ID number?
    yes
    buffactive[9]

    and in the buff change function ;look at the buff_table im sure the id is there somewhere (i have not actually looked at this yet)

  15. #3895
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    Is the libs/res folder in the addons folder important for any addons? Cause mine doesnt seem to be up to date at all. there is no flurry spell in spells.lua. If that libs/res one doesnt matter do i just use the one in the base windower folder?

    As far as i can tell the zombie curse is ID = 20. but how do i word that in the buff change function? buff == 20 ?

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

    Quote Originally Posted by Trumpy View Post
    As far as i can tell the zombie curse is ID = 20. but how do i word that in the buff change function? buff == 20 ?
    as i said its probably in the buff_table which is part of the buff_change(name,gain,buff_table) function
    what you can do is put this in the buff_change function to see whats there
    Code:
    for i,v in pairs(buff_table) do
        print("buff_table."..i.." = "v)
    end
    what the out put will be i do not know

    if you do the same thing with spell
    Code:
    for i,v in pairs(spell) do
        print("spell."..i.." = "v)
    end
    you get(printed in windower console):
    spell.name = <currentspellname>
    spell.mp_cost = <currentspellsmpcost>
    etc.

    these are the most up to date event functions
    get_sets()
    pretarget(spell)
    precast(spell)
    midcast(spell)
    aftercast(spell)
    pet_change(pet,gain)
    pet_midcast(spell)
    pet_aftercast(spell)
    filtered_action(spell)
    sub_job_change(new,old)
    status_change(new,old)
    pet_status_change(new,old)
    buff_change(name,gain,buff_table)
    indi_change(indi_table,gain)
    self_command(command)
    file_unload(new_job)

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

    Quote Originally Posted by Trumpy View Post
    Is the libs/res folder in the addons folder important for any addons? Cause mine doesnt seem to be up to date at all. there is no flurry spell in spells.lua. If that libs/res one doesnt matter do i just use the one in the base windower folder
    No, it's an artifact of the old way we used to distribute Lua resources.

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

    OK Byrthn, thanks. I been lookin at the addons libs this whole time and never came across something not in them. but now i know and like they say knowing is half the battle. I even tried renaming the libs res folders and rebooting ffxi and it didnt redownload them So i suspected these werent used anymore. So I will be lookin at the right ones from now on thanks. Anywhoo onto my issues...

    Assuming i put it in the function right:
    Code:
    function buff_change(buff,gain)
    	for i,v in pairs(buff_table) do
    		print("buff_table."..i.." = "v)
    	end
    end
    I got the following error:
    WHM.lua:366: ')' expected near 'v'
    line 366 is the "print("buff_table."..i.." = "v)" line.

    i get the same kind of error putting that spell code in my precast where I would have magic rules.

    Once we get the ID number how would you word the syntax for it though? Like this?
    buff == 20


    Another issue I am having is:
    For my rdm lua I made it convert Haste 1 into Haste 2, when I try to cast Haste 1. Then I added for it to Just go ahead and cast Haste 1 if the recast for Haste 2 was not less than 1 second. So basically if Haste2 isnt ready to be casted it will go head and use Haste1. So I thought I could go ahead and use the recast id stuff to do a similiar thing on my whm lua. I want my whm to use divine caress 1st if a Na Spell is cast on a party member. I dont want it to use caress if it is cast on self.
    Code:
    if spell.skill == 'Healing Magic' then
    	equip(sets.FC.Cure)
    	if na_spells[spell.name] and ((spell.target.type == 'PLAYER' and spell.target.in_party) or (spell.target.type == 'NPC' and spell.target.in_party)) and not buffactive['Divine Caress'] then
    		local spell_recasts = windower.ffxi.get_spell_recasts()
    		if spell_recasts['32'] < 1 then
    			cancel_spell()
    			send_command('//DivineCaress;wait 2;//'..spell.name..' '..spell.target.name)
    			return
    		end
    	end
    end
    It works perfectly the first time. but if I use a na spell again while caress is on recast it just spams every 2 seconds divine caress. And when caress recast hits 0 it uses caress and the the na spell and stops. I even commented out the recast parts and it keeps tryin to spam caress. Now the really odd thing is its almost identical to my pianissimo code in my bard lua, which doesnt spam it at all. granted pianissimo's recast is like 5 seconds or something small (maybe I dont notice the spam cause its always ready?). The other thing I thought of is Divine caress's recast ID is 32. but in the spell.lua of resources Banish V is also recast ID = 32. So maybe there is different syntax for job ability recast ID that I dont know? I got the recast stuff from a Mote Bard lua and it worked for the rdm stuff.
    Code:
    if ((spell.target.type == 'PLAYER' and not spell.target.charmed) or (spell.target.type == 'NPC' and spell.target.in_party)) and not buffactive.pianissimo then
    	cancel_spell()
    	send_command('//Pianissimo;wait 2;//'..spell.name..' '..spell.target.name)
    	return
    end
    If I cant get it figured out I can just go back to my old way of doing it if need be. I wonder if this is similiar to that guy's issue where he wanted to automatically use Presto on DNC when he used steps, and it would spam it. Maybe its an issue with Job ability recasts?

  19. #3899
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Trumpy View Post
    OK Byrthn, thanks. I been lookin at the addons libs this whole time and never came across something not in them. but now i know and like they say knowing is half the battle. I even tried renaming the libs res folders and rebooting ffxi and it didnt redownload them So i suspected these werent used anymore. So I will be lookin at the right ones from now on thanks. Anywhoo onto my issues...

    Assuming i put it in the function right:

    I got the following error:

    line 366 is the "print("buff_table."..i.." = "v)" line.

    i get the same kind of error putting that spell code in my precast where I would have magic rules.

    Once we get the ID number how would you word the syntax for it though? Like this?




    Another issue I am having is:
    For my rdm lua I made it convert Haste 1 into Haste 2, when I try to cast Haste 1. Then I added for it to Just go ahead and cast Haste 1 if the recast for Haste 2 was not less than 1 second. So basically if Haste2 isnt ready to be casted it will go head and use Haste1. So I thought I could go ahead and use the recast id stuff to do a similiar thing on my whm lua. I want my whm to use divine caress 1st if a Na Spell is cast on a party member. I dont want it to use caress if it is cast on self.

    It works perfectly the first time. but if I use a na spell again while caress is on recast it just spams every 2 seconds divine caress. And when caress recast hits 0 it uses caress and the the na spell and stops. I even commented out the recast parts and it keeps tryin to spam caress. Now the really odd thing is its almost identical to my pianissimo code in my bard lua, which doesnt spam it at all. granted pianissimo's recast is like 5 seconds or something small (maybe I dont notice the spam cause its always ready?). The other thing I thought of is Divine caress's recast ID is 32. but in the spell.lua of resources Banish V is also recast ID = 32. So maybe there is different syntax for job ability recast ID that I dont know? I got the recast stuff from a Mote Bard lua and it worked for the rdm stuff.

    If I cant get it figured out I can just go back to my old way of doing it if need be. I wonder if this is similiar to that guy's issue where he wanted to automatically use Presto on DNC when he used steps, and it would spam it. Maybe its an issue with Job ability recasts?
    oops it should be
    Code:
    for i,v in pairs(buff_table) do
        print("buff_table."..i.." = "..v)
    end
    my bad i forgot the .. before v

    and here is the second part
    Code:
    if (spell.name:endswith("na") and spell.type == "WhiteMagic") and not (windower.ffxi.get_ability_recasts()[32] > 0 and spell.target.type ~= "SELF") then
        send_command('input /ja "Divine Caress" <me>;wait 1.5;input /ma "'..spell.name..'" <me>')
        cancel_spell()
        return
    end
    the above code will work on Poisona,Paralyna,Blindna,Silena,Stona,Viruna,Cursn a,Esuna

  20. #3900
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    OK with that new code I am gettin on a buff change a new error:
    blah blah blah flow.lua:295
    GS has detected an error in the user function buff_change:
    blah blah blah WHM.lua:365: bad argument #1 to 'pairs' (table expected, got nil)
    Line 365 is the:
    for i,v in pairs(buff_table) do

Page 195 of 302 FirstFirst ... 145 185 193 194 195 196 197 205 245 ... LastLast

Similar Threads

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