Jump to content

Welcome to Gaming On Steroids Forums
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account
Photo

GetBuff().stacks not working on twitch?


  • Please log in to reply
2 replies to this topic

#1
Kevin1334

Kevin1334

    Member

  • Members
  • 10 posts

function getStacks()
	for i=0, Game.Hero(2).buffCount do
		buff = Game.Hero(2):GetBuff(i)
		if buff.count > 0 and buff.name == "TwitchDeadlyVenom" then
			print(buff.stacks)
		end
	end
end

I'm trying to get how many stacks a hero has, but it always returns 0.. is the .stacks attribute something else?


  • 0

#2
Kevin1334

Kevin1334

    Member

  • Members
  • 10 posts

I've made my own way to keep track of stacks for twitch for the time being

stacks = {}
function generateTable()
    for i=1, Game.HeroCount() do
        if (Game.Hero(i).isAlly == false) then
            stacks[Game.Hero(i).charName] = {count = 0, old_expireTime=0}
        end
    end
end

generateTable()


function getStacks(unit)
    for i=1, unit.buffCount do
        buff = unit:GetBuff(i)
        if (buff.name == "TwitchDeadlyVenom" and buff.count > 0) then
            if (buff.expireTime > stacks[unit.charName].old_expireTime and stacks[unit.charName].count < 6) then
                stacks[unit.charName].count = stacks[unit.charName].count + 1
                stacks[unit.charName].old_expireTime = buff.expireTime
            elseif (Game.Timer() >= buff.expireTime - 0.1 or buff.count < 0 or unit.dead) then
                stacks[unit.charName].count = 0
            end
        end
    end
    return unit.charName .. " " .. stacks[unit.charName].count
end

If you know a better way please let me know..


  • 0

#3
RMAN

RMAN

    Advanced Member

  • Contributor
  • 523 posts

It never worked.
Another way would be checking particles after W Cast and AAs.

 


  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users