Jump to content

[Solution] How to check for specific buff duration

Recommended Posts

I was trying to figure this out for vanilla to optimize my combat rotation. Finally made it work.

public decimal BuffTimeLeft()
	var SliceAndDiceTimeLeft = Lua.LuaDoString<decimal>("for i=0,31 do\r\n  local id,cancel = GetPlayerBuff(i,\"HELPFUL|HARMFUL|PASSIVE\");\r\n  if(id > -1) then\r\n    local buffTexture = GetPlayerBuffTexture(id);\r\n    if(strfind(buffTexture,\"Ability_Rogue_SliceDice\")) then\r\n      local timeleft = GetPlayerBuffTimeLeft(id);\r\n      return timeleft;\r\n    end\r\n  end\r\nend");
	return SliceAndDiceTimeLeft;

Just change the buff texture from "Ability_Rogue_SliceDice" to the texture name you are checking for.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...