Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bug on MissingBuffs?
#3
MissingBuffs is a lua function that we created, so the documentation is already pre-existing so to speak, as are most of our functions really. The API handles the basics, the lua API turns them into most of what you see being used.

In ffxiv_helpers.lua (currently line 1212):

Code:
function HasBuffs(entity, buffIDs, dura, ownerid)
    local duration = dura or 0
    local owner = ownerid or 0
    
    local buffs = entity.buffs
    if (buffs == nil or TableSize(buffs) == 0) then return false end
    for _orids in StringSplit(buffIDs,",") do
        local found = false
        for _andid in StringSplit(_orids,"+") do
            found = false
            for i, buff in pairs(buffs) do
                if (buff.id == tonumber(_andid)
                    and (duration == 0 or buff.duration > duration or HasInfiniteDuration(buff.id))
                    and (owner == 0 or buff.ownerid == owner))
                then
                    found = true
                end
            end
            if (not found) then
                break
            end
        end
        if (found) then
            return true
        end
    end
    return false
end

function MissingBuffs(entity, buffIDs, dura, ownerid)
    local duration = dura or 0
    local owner = ownerid or 0
    
    --If we have no buffs, we are missing everything.
    local buffs = entity.buffs
    if (buffs == nil or TableSize(buffs) == 0) then
        return true
    end
    
    --Start by assuming we have no buffs, so they are missing.
    local missing = true
    for _orids in StringSplit(buffIDs,",") do
        missing = true
        for _andid in StringSplit(_orids,"+") do
            for i, buff in pairs(buffs) do
                if (buff.id == tonumber(_andid)
                    and (duration == 0 or buff.duration > duration or HasInfiniteDuration(buff.id))
                    and (owner == 0 or buff.ownerid == owner))
                then
                    missing = false
                end
            end
            if (not missing) then
                break
            end
        end
        if (missing) then
            return true
        end
    end
    
    return false
end
Reply
 


Messages In This Thread
bug on MissingBuffs? - by Skive - 06-29-2015, 12:22 AM
RE: bug on MissingBuffs? - by CuteDragon - 06-29-2015, 01:17 AM
RE: bug on MissingBuffs? - by Ace - 06-29-2015, 02:35 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)

We help you win the game.

FFXIV Bot and More.

 

Products