Item Search
     
BG-Wiki Search
Page 84 of 302 FirstFirst ... 34 74 82 83 84 85 86 94 134 ... LastLast
Results 1661 to 1680 of 6036

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

  1. #1661
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by viperkc View Post
    What do i need to change in this Moten:
    1) A simpler way of determining if you're using spells (and need echo drops) is:
    Code:
        if spell.action_type == 'Magic' and buffactive.silence then
    This also works for bard songs, which your code won't.

    2) Instead of calling get_ability_recasts() multiple times, just call it once and assign it to a variable. You can also do just a single check for amnesia at the top level, rather than checking it on every single conditional.

    Code:
    	elseif spell.english == 'Ranged' and not buffactive.amnesia then -- Auto WS/Decoy Shot/Double Shot --
    		if player.tp >= 100 and AutoMode == 'ON' then
    			cancel_spell()
    			autoWS()
    		else
    		    local recasts = windower.ffxi.get_ability_recasts()
    		    if recasts[52] < 1 then
        			cancel_spell()
        			send_command('DecoyShot')
    		    elseif recasts[126] < 1 then
        			cancel_spell()
        			send_command('DoubleShot')
    		    elseif recasts[129] < 1 then
        			cancel_spell()
        			send_command('VelocityShot')
        		end
            end
        end

    3) This one is a clumsy mess. I'd break it down into individual tests, even if the resulting actions are redundant.

    Code:
    	elseif (spell.english == 'Ranged' and spell.target.distance > 24.9) or
    	       (player.status == 'Engaged' and 
    	            ((ranged_ws:contains(spell.english) and spell.target.distance > 16+target_distance) or
    	             (spell.type == "WeaponSkill" and not ranged_ws:contains(spell.english) and spell.target.distance > target_distance))) then 
    		cancel_spell()
    		add_to_chat(123, spell.name..' Canceled: [Out of Range]')
    		return
    Note: I'm not sure about the player.status == 'Engaged' bit. Not entirely sure what your intent there is. As originally written, it will give you the distance warning if you're engaged, but won't warn you if you're not engaged. This does the same thing.

    Code:
    	elseif spell.english == 'Ranged' 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' or spell.skill == 'Marksmanship' 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
            		cancel_spell()
            		add_to_chat(123, spell.name..' Canceled: [Out of Range]')
            		return
                end
    	    end
    	~~

  2. #1662
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Astaro View Post
    I think I'm being an idiot, but this doesn't allow me to WS at all... it just says out of range? Any ideas?
    I didn't copy the entire rule, only the bit to show how to test for weaponskill skill types. You still need to add in the distance checks.

  3. #1663
    Melee Summoner
    Join Date
    May 2014
    Posts
    36
    BG Level
    1
    FFXI Server
    Ragnarok

    am interested in this code as well, did you find the solution?
    Spoiler: show

    Quote Originally Posted by Trumpy View Post
    OK for whm i made some code to change what tier cure spell is cast based on target's HP and caster MP. I like to use Cure 1 for this, so that i can directly cast Cure 2-6 if needed. I took my code in spellcast and tried to make something similiar in gearswap. Its crazy long and it works somewhat. Sometimes it doesnt do anything when i cast cure 1 (according to showswaps its doin precast and stopping.) usually when the target's hp is pretty close to topped off. And i suspect its is doin an infinite loop or something. So i am going to post the code from spellcast and then what i came up with, if anyone can take a look at what i got and tell me how i am doin it wrong or to fix it or show me a better way that would be awesome sauce!

    The spellcast code
    Code:
    <if Spell="Cure" SpellTargetType="PLAYER|SELF">					    <!-- Vanadiel #s 95  85  65  40  20  0 -->
    			<action type="Equip" when="precast" set="FCHeal" />
    			<action type="Equip" when="midcast" set="Healing" />
    			<if SpellTargetHPPGT="95">
    				<changespell Spell="Cure" />
    			</if>
    			<elseif SpellTargetHPPGT="90">
    				<changespell Spell="Cure II" />
    			</elseif>
    			<elseif SpellTargetHPPGT="70">
    				<if MPGT="46"> <changespell Spell="Cure III" /> </if>
    				<elseif MPGT="24"> <changespell Spell="Cure II" /> </elseif>
    				<else> <changespell Spell="Cure" /> </else>
    			</elseif>
    			<elseif SpellTargetHPPGT="40">
    				<if MPGT="88"> <changespell Spell="Cure IV" /> </if>
    				<elseif MPGT="46"> <changespell Spell="Cure III" /> </elseif>
    				<elseif MPGT="24"> <changespell Spell="Cure II" /> </elseif>
    				<else> <changespell Spell="Cure" /> </else>
    				</elseif>
    			<elseif SpellTargetHPPGT="20">
    				<if MPGT="135"> <changespell Spell="Cure V" /> </if>
    				<elseif MPGT="88"> <changespell Spell="Cure IV" /> </elseif>
    				<elseif MPGT="46"> <changespell Spell="Cure III" /> </elseif>
    				<elseif MPGT="24"> <changespell Spell="Cure II" /> </elseif>
    				<else> <changespell Spell="Cure" /> </else>
    			</elseif>
    			<elseif MPGT="227"> <changespell Spell="Cure VI" /> </elseif>
    			<elseif MPGT="135"> <changespell Spell="Cure V" /> </elseif>
    			<elseif MPGT="88"> <changespell Spell="Cure IV" /> </elseif>
    			<elseif MPGT="46"> <changespell Spell="Cure III" /> </elseif>
    			<elseif MPGT="24"> <changespell Spell="Cure II" /> </elseif>
    			<else> <changespell Spell="Cure" /> </else>
    		</if>
    the gearswap code (in the precast function, I think its where it should go?)

    Code:
    if spell.name == 'Cure' then
    			equip(sets.MA.FC.Cure)
    			if spell.target.type == 'SELF' or spell.target.type == 'PLAYER' then
    			if spell.target.hpp >= 98 then
    				cancel_spell()
    				send_command('Cure')
    			elseif spell.target.hpp >= 95 then
    				cancel_spell()
    				send_command('Cure II')
    			elseif spell.target.hpp >= 85 then
    				if player.mp >= 46 then
    					cancel_spell()
    					send_command('Cure III')
    				elseif player.mp >= 24 then
    					cancel_spell()
    					send_command('Cure II')
    				else 
    					cancel_spell()
    					send_command('Cure')
    				end
    			elseif spell.target.hpp >= 65 then
    				if player.mp >= 88 then
    					cancel_spell()
    					send_command('Cure IV')
    				elseif player.mp >= 46 then
    					cancel_spell()
    					send_command('Cure III')
    				elseif player.mp >= 24 then
    					cancel_spell()
    					send_command('Cure II')
    				else 
    					cancel_spell()
    					send_command('Cure')
    				end
    			elseif spell.target.hpp >= 30 then
    				if player.mp >= 135 then
    					cancel_spell()
    					send_command('Cure V')
    				elseif player.mp >= 88 then
    					cancel_spell()
    					send_command('Cure IV')
    				elseif player.mp >= 46 then
    					cancel_spell()
    					send_command('Cure III')
    				elseif player.mp >= 24 then
    					cancel_spell()
    					send_command('Cure II')
    				else 
    					cancel_spell()
    					send_command('Cure')
    				end
    			elseif player.mp >= 227 then
    				cancel_spell()
    				send_command('Cure VI')
    			elseif player.mp >= 135 then
    				cancel_spell()
    				send_command('Cure V')
    			elseif player.mp >= 88 then
    				cancel_spell()
    				send_command('Cure IV')
    			elseif player.mp >= 46 then
    				cancel_spell()
    				send_command('Cure III')
    			elseif player.mp >= 24 then
    				cancel_spell()
    				send_command('Cure II')
    			else 
    				cancel_spell()
    				send_command('Cure')
    			end
    			end
    		end

  4. #1664
    Melee Summoner
    Join Date
    May 2014
    Posts
    36
    BG Level
    1
    FFXI Server
    Ragnarok

    Would like to check if there is any lua code that checks monster's casting/actions?
    example, if monster cast firaga III or readies a weapon skill, anything to capture those actions? Thanks.

  5. #1665
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Tronian View Post
    Would like to check if there is any lua code that checks monster's casting/actions?
    example, if monster cast firaga III or readies a weapon skill, anything to capture those actions? Thanks.
    Not in GearSwap, no.

  6. #1666
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Tronian View Post
    am interested in this code as well, did you find the solution?
    I have -a- solution. Whether you want to use it is up to you. If you're using my includes, you can add it to Mote-Utility. If you're using your own version you'll need to make adjustments to get it to fit how you built your code.

    This is designed to handle adjusting cures for all jobs that can cast cure spells natively, whether main or subjob. It does not auto-correct when casting a spell on someone outside your party/alliance. It's also not perfect with respect to light arts/dark arts.

    Spoiler: show

    Code:
    local cure_mp_cost = {['Cure'] = 8, ['Cure II'] = 24, ['Cure III'] = 46, ['Cure IV'] = 88, ['Cure V'] = 135, ['Cure VI'] = 227}
    
    
    -- Utility function for automatically adjusting the waltz spell being used to match HP needs and MP limits.
    -- Handle spell changes before attempting any precast stuff.
    function refine_cure(spell, action, spellMap, eventArgs)
        -- Only handles single-target cures.
        if not spell.english:startswith('Cure') then
            return
        end
    
        -- Get the estimated amount of HP the target of the spell is below max.
        -- Returns nil for targets outside of alliance (no info available).
        local missingHP = get_targets_missing_hp(spell)
    
        local preferredCure = spell.english
        
        -- If we have an estimated missing HP value, we can adjust the preferred spell used.
        if missingHP then
            -- Whm has high skill and up to Cure VI
            if player.main_job == 'WHM' then
                if missingHP < 150 then
                    preferredCure = 'Cure'
                elseif missingHP < 350 then
                    preferredCure = 'Cure II'
                elseif missingHP < 650 then
                    preferredCure = 'Cure III'
                elseif missingHP < 1000 then
                    preferredCure = 'Cure IV'
                elseif missingHP < 1600 then
                    preferredCure = 'Cure V'
                else
                    preferredCure = 'Cure VI'
                end
            -- Rdm, Sch and Pld have high skill and up to Cure IV
            elseif player.main_job == 'RDM' or player.main_job == 'SCH' or player.main_job == 'PLD' then
                if missingHP < 150 then
                    preferredCure = 'Cure'
                elseif missingHP < 350 then
                    preferredCure = 'Cure II'
                elseif missingHP < 650 then
                    preferredCure = 'Cure III'
                else
                    preferredCure = 'Cure IV'
                end
            -- Subbing /whm or /rdm gets you up to Cure IV
            elseif player.sub_job == 'WHM' or player.sub_job == 'RDM' then
                if missingHP < 150 then
                    preferredCure = 'Cure'
                elseif missingHP < 300 then
                    preferredCure = 'Cure II'
                elseif missingHP < 550 then
                    preferredCure = 'Cure III'
                else
                    preferredCure = 'Cure IV'
                end
            -- Subbing /sch or /pld gets you up to Cure III
            else
                if missingHP < 150 then
                    preferredCure = 'Cure'
                elseif missingHP < 300 then
                    preferredCure = 'Cure II'
                else
                    preferredCure = 'Cure III'
                end
            end
        end
        
        local mpCost = cure_mp_cost[preferredCure]
        
        if buffactive['Light Arts'] or buffactive['Addendum: White'] then
            mpCost = math.floor(mpCost * 0.9)
        elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
            mpCost = math.floor(mpCost * 1.1)
        end
    
        local downgrade_msg
        
        -- Downgrade the spell to what we can actually afford
        if player.mp < mpCost and not (buffactive['Manafont'] or buffactive['Mana Well']) then
            if player.mp < 8 then
                add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
                eventArgs.cancel = true
                return
            elseif player.mp < 24 then
                preferredCure = 'Cure'
            elseif player.mp < 46 then
                preferredCure = 'Cure II'
            elseif player.mp < 88 then
                preferredCure = 'Cure III'
            elseif player.mp < 135 then
                preferredCure = 'Cure IV'
            elseif player.mp < 227 then
                preferredCure = 'Cure V'
            end
            
            downgrade_msg = 'Insufficient MP ['..tostring(player.mp)..']. Downgrading to '..preferredCure..'.'
        end
    
        
        if preferredCure ~= spell.english then
            eventArgs.cancel = true
            send_command('@input /ma "'..preferredCure..'" '..tostring(spell.target.raw))
            if downgrade then
                add_to_chat(122, downgrade_msg)
            end
            return
        end
    
        if missingHP and missingHP > 0 then
            add_to_chat(122,'Trying to cure '..tostring(missingHP)..' HP using '..preferredCure..'.')
        end
    end
    
    
    
    function get_targets_missing_hp(spell)
        local missingHP
        
        -- If curing ourself, get our exact missing HP
        if spell.target.type == "SELF" then
            missingHP = player.max_hp - player.hp
        -- If curing someone in our alliance, we can estimate their missing 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
        
        return missingHP
    end

  7. #1667
    Smells like Onions
    Join Date
    Apr 2013
    Posts
    6
    BG Level
    0
    FFXI Server
    Sylph

    should this in Mote-Include.lua

    Code:
    function get_default_midcast_set(spell, action, spellMap, eventArgs)
    	local equipSet
    
    	-- If there are no midcast sets defined, bail out.
    	if not sets.midcast then
    		return {}
    	end
    	
    	-- Determine base sub-table from type of action being performed.
    	-- Only ranged attacks and items get specific sub-categories here.
    	
    	if spell.action_type == 'Ranged Attack' then
    		equipSet = sets.precast.RA or sets.precast.RangedAttack
    	elseif spell.action_type == 'Item' then
    		equipSet = sets.midcast.Item
    	else
    		equipSet = sets.midcast
    	end
    	
    	-- If no proper sub-category is defined in the job file, bail out.
    	if not equipSet then
    		return {}
    	end
    be midcast and not precast? pretty sure but not sure if there is anywhere else it should be fixed.

  8. #1668
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Xtinae View Post
    should this in Mote-Include.lua

    be midcast and not precast? pretty sure but not sure if there is anywhere else it should be fixed.
    Whoops. You're right. I'll fix that momentarily.

  9. #1669
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    Mote: Thank you for the coding...

    Should it say player.mp instead of tp? just guessing you converted a waltz codeblock to cure...

    Code:
     -- Downgrade the spell to what we can actually afford
        if player.mp < mpCost and not (buffactive['Manafont'] or buffactive['Mana Well']) then
            if player.tp < 8 then
                add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
                eventArgs.cancel = true
                return
            elseif player.tp < 24 then
                preferredCure = 'Cure'
            elseif player.tp < 46 then
                preferredCure = 'Cure II'
            elseif player.tp < 88 then
                preferredCure = 'Cure III'
            elseif player.tp < 135 then
                preferredCure = 'Cure IV'
            elseif player.tp < 227 then
                preferredCure = 'Cure V'
            end
    So could I just copy this code into a separate lua file and put a include to it and it will work Without anything else? I dont need to put this into a precast function or anything? What does the word local mean in lua? Also will this alter any cure spell or just Cure 1? And if its any cure spell can i just adjust

    if not spell.english:startswith('Cure') then

    to be

    if not spell.english('Cure') then

    to only work with cure 1?

  10. #1670
    RIDE ARMOR
    Join Date
    Jan 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Leviathan

    Ok so I got BRD working and most everything seems to be working great. Thanks for the update/fix to the utilities to allow for player name-globals by the way Mote, thats awesome. Another quick and hopefully easy question I have though is that my stoneskin is not removing itself midcoast if I am recasting it. I see a function built for it in utilities, but do i have to initiate anything to have it called? I don't see it called anywhere and I'm sure I am just missing something. Actually now that I type this I was toying with pld/dnc earlier as well and the waltz function from utilities didn't seem to change anything either. How do I take advantage of these prebuilt functions? I have made no revisions to any files from Mote's files outside of a few of my own binds and gear sets.

    EDIT:
    yes cancel is running and working properly, tested with my old spell cast set up.

  11. #1671
    Can you spare some gil?
    Join Date
    Feb 2009
    Posts
    8,773
    BG Level
    8

    Looking to resub shortly and I have a few gearswaps built from when I last played, I've been looking around but can't seem to find out if gear swap will pull gear from wardrobe or not, going to assume that it will be able to but just wanting to make sure is all >.>;

  12. #1672
    RIDE ARMOR
    Join Date
    Jan 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Leviathan

    Doesn't need to 'pull' any gear, thats not how wardrobe works, but yes gear swap works just fine with any gear in your wardrobe. If you need to check for something specific you can use something like:

    if player.inventory[info.DaurdablaInstrument] or player.wardrobe[info.DaurdablaInstrument] then

    This was copy/pasted from Motes BRD.lua

  13. #1673
    Melee Summoner
    Join Date
    May 2014
    Posts
    27
    BG Level
    1

    Hi, i set that code in my lua, and using one or the other on feet spot. But it doesnt equip anything in feet spot with that setting. Am I doing something wrong ?

    --- Qaaxo Leggings differentiation

    QaaxoAcc = {name="Qaaxo Leggings",augments={"[1]Accuracy+9","[2]STR+4"}}

    QaaxoMAB = {name="Qaaxo Leggings",augments={"[1]Attack+12","[2]\"Mag.Atk.Bns\"+12","[3]STR+11"}}

  14. #1674
    Melee Summoner
    Join Date
    May 2014
    Posts
    36
    BG Level
    1
    FFXI Server
    Ragnarok

    Spoiler: show

    Quote Originally Posted by Motenten View Post
    I have -a- solution. Whether you want to use it is up to you. If you're using my includes, you can add it to Mote-Utility. If you're using your own version you'll need to make adjustments to get it to fit how you built your code.

    This is designed to handle adjusting cures for all jobs that can cast cure spells natively, whether main or subjob. It does not auto-correct when casting a spell on someone outside your party/alliance. It's also not perfect with respect to light arts/dark arts.

    Spoiler: show

    Code:
    local cure_mp_cost = {['Cure'] = 8, ['Cure II'] = 24, ['Cure III'] = 46, ['Cure IV'] = 88, ['Cure V'] = 135, ['Cure VI'] = 227}
    
    
    -- Utility function for automatically adjusting the waltz spell being used to match HP needs and TP limits.
    -- Handle spell changes before attempting any precast stuff.
    function refine_cure(spell, action, spellMap, eventArgs)
        -- Only handles single-target cures.
        if not spell.english:startswith('Cure') then
            return
        end
    
        -- Get the estimated amount of HP the target of the spell is below max.
        -- Returns nil for targets outside of alliance (no info available).
        local missingHP = get_targets_missing_hp(spell)
    
        local preferredCure = spell.english
        
        -- If we have an estimated missing HP value, we can adjust the preferred spell used.
        if missingHP then
            -- Whm has high skill and up to Cure VI
            if player.main_job == 'WHM' then
                if missingHP < 150 then
                    preferredCure = 'Cure'
                elseif missingHP < 350 then
                    preferredCure = 'Cure II'
                elseif missingHP < 650 then
                    preferredCure = 'Cure III'
                elseif missingHP < 1000 then
                    preferredCure = 'Cure IV'
                elseif missingHP < 1600 then
                    preferredCure = 'Cure V'
                else
                    preferredCure = 'Cure VI'
                end
            -- Rdm, Sch and Pld have high skill and up to Cure IV
            elseif player.main_job == 'RDM' or player.main_job == 'SCH' or player.main_job == 'PLD' then
                if missingHP < 150 then
                    preferredCure = 'Cure'
                elseif missingHP < 350 then
                    preferredCure = 'Cure II'
                elseif missingHP < 650 then
                    preferredCure = 'Cure III'
                else
                    preferredCure = 'Cure IV'
                end
            -- Subbing /whm or /rdm gets you up to Cure IV
            else player.sub_job == 'WHM' or player.sub_job == 'RDM' then
                if missingHP < 150 then
                    preferredCure = 'Cure'
                elseif missingHP < 300 then
                    preferredCure = 'Cure II'
                elseif missingHP < 550 then
                    preferredCure = 'Cure III'
                else
                    preferredCure = 'Cure IV'
                end
            -- Subbing /sch or /pld gets you up to Cure III
            else
                if missingHP < 150 then
                    preferredCure = 'Cure'
                elseif missingHP < 300 then
                    preferredCure = 'Cure II'
                else
                    preferredCure = 'Cure III'
                end
            end
        end
        
        local mpCost = cure_mp_cost[preferredCure]
        
        if buffactive['Light Arts'] or buffactive['Addendum: White'] then
            mpCost = math.floor(mpCost * 0.9)
        elseif buffactive['Dark Arts'] or buffactive['Addendum: Black'] then
            mpCost = math.floor(mpCost * 1.1)
        end
    
        local downgrade_msg
        
        -- Downgrade the spell to what we can actually afford
        if player.mp < mpCost and not (buffactive['Manafont'] or buffactive['Mana Well']) then
            if player.tp < 8 then
                add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
                eventArgs.cancel = true
                return
            elseif player.tp < 24 then
                preferredCure = 'Cure'
            elseif player.tp < 46 then
                preferredCure = 'Cure II'
            elseif player.tp < 88 then
                preferredCure = 'Cure III'
            elseif player.tp < 135 then
                preferredCure = 'Cure IV'
            elseif player.tp < 227 then
                preferredCure = 'Cure V'
            end
            
            downgrade_msg = 'Insufficient MP ['..tostring(player.mp)..']. Downgrading to '..preferredCure..'.'
        end
    
        
        if preferredCure ~= spell.english then
            eventArgs.cancel = true
            send_command('@input /ma "'..preferredCure..'" '..tostring(spell.target.raw))
            if downgrade then
                add_to_chat(122, downgrade_msg)
            end
            return
        end
    
        if missingHP and missingHP > 0 then
            add_to_chat(122,'Trying to cure '..tostring(missingHP)..' HP using '..preferredCure..'.')
        end
    end
    
    
    
    function get_targets_missing_hp(spell)
        local missingHP
        
        -- If curing ourself, get our exact missing HP
        if spell.target.type == "SELF" then
            missingHP = player.max_hp - player.hp
        -- If curing someone in our alliance, we can estimate their missing 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
        
        return missingHP
    end


    I am using your code, I tried it and the Mote-Utility is getting an error of unexpected symbol near '=' at the below line.

    else player.sub_job == 'WHM' or player.sub_job == 'RDM' then

  15. #1675
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Trumpy View Post
    Mote: Thank you for the coding...

    Should it say player.mp instead of tp? just guessing you converted a waltz codeblock to cure...

    Code:
     -- Downgrade the spell to what we can actually afford
        if player.mp < mpCost and not (buffactive['Manafont'] or buffactive['Mana Well']) then
            if player.tp < 8 then
                add_to_chat(122, 'Insufficient MP ['..tostring(player.mp)..']. Cancelling.')
                eventArgs.cancel = true
                return
            elseif player.tp < 24 then
                preferredCure = 'Cure'
            elseif player.tp < 46 then
                preferredCure = 'Cure II'
            elseif player.tp < 88 then
                preferredCure = 'Cure III'
            elseif player.tp < 135 then
                preferredCure = 'Cure IV'
            elseif player.tp < 227 then
                preferredCure = 'Cure V'
            end
    Yeah, I missed a few. Have corrected that in the original post, above.


    Quote Originally Posted by Trumpy View Post
    So could I just copy this code into a separate lua file and put a include to it and it will work Without anything else? I dont need to put this into a precast function or anything?
    Mostly correct. Add an include('yourfile.lua') in get_sets() to load it, and put refine_cure(spell) in precast(). Also, since you're not using my includes, change instances of eventArgs.cancel = true to cancel_spell(). Make sure not to run additional code after that, if you do, though.

    Quote Originally Posted by Trumpy View Post
    What does the word local mean in lua?
    A local variable is one that goes away when its current scope ends. In this case, the scope is the function being run, so once the function returns, those variables go away. If you didn't add the local attribute, they'd stick around indefinitely.

    Quote Originally Posted by Trumpy View Post
    Also will this alter any cure spell or just Cure 1?
    Any cure.

    Quote Originally Posted by Trumpy View Post
    And if its any cure spell can i just adjust

    if not spell.english:startswith('Cure') then

    to be

    if not spell.english('Cure') then

    to only work with cure 1?
    Yes, if you want this function to only run when you cast a basic Cure, rather than adjust all Cure spells, that would be fine.

  16. #1676
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by wigmasterflex View Post
    I see a function built for it in utilities, but do i have to initiate anything to have it called? I don't see it called anywhere and I'm sure I am just missing something. Actually now that I type this I was toying with pld/dnc earlier as well and the waltz function from utilities didn't seem to change anything either. How do I take advantage of these prebuilt functions?
    If you don't call the functions, they don't get run. If you want the utility, you need to call the appropriate function. For the utility cancel and waltz adjustments, that should be in the precast period.

  17. #1677
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Keme View Post
    Hi, i set that code in my lua, and using one or the other on feet spot. But it doesnt equip anything in feet spot with that setting. Am I doing something wrong ?
    Those are improperly formatted augments. Put on the gear you want to consider for augments, then enter "//gs export set". This will create a lua file in data/exports, and you can use that when adjusting your job lua file.

  18. #1678
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    Quote Originally Posted by Tronian View Post
    I am using your code, I tried it and the Mote-Utility is getting an error of unexpected symbol near '=' at the below line.

    else player.sub_job == 'WHM' or player.sub_job == 'RDM' then
    Change the 'else' to 'elseif'.

  19. #1679
    RIDE ARMOR
    Join Date
    Jan 2010
    Posts
    24
    BG Level
    1
    FFXI Server
    Leviathan

    Oh ok, that makes sense. I thought most things were set up to be called already, I can see why you wouldn't want to do that however. Thanks much I'll add some calls to precasts.

  20. #1680
    Melee Summoner
    Join Date
    May 2014
    Posts
    36
    BG Level
    1
    FFXI Server
    Ragnarok

    Quote Originally Posted by Motenten View Post
    Change the 'else' to 'elseif'.
    Got an error of "attempt to compare number with nil" for the below line after changing to elseif

    if player.mp < mpCost and not (buffactive['Manafont'] or buffactive['Mana Well']) then

Page 84 of 302 FirstFirst ... 34 74 82 83 84 85 86 94 134 ... LastLast

Similar Threads

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