View Single Post
05/12/14, 06:23 PM   #7
Roupine
Join Date: May 2014
Posts: 18
Originally Posted by stjobe View Post
For instance, GetUnitBuffInfo() returns ten values, but if I'm only interested in the name of the buff (which is first on the list of return values), it's perfectly fine to use it like this:
Lua Code:
  1. local buffName = GetUnitBuffInfo("player", 1)
instead of the slightly ridiculous
Lua Code:
  1. local buffName, _, _, _, _, _, _, _, _, _ = GetUnitBuffInfo("player", 1)
or even more ridiculous naming nine variables I won't ever use.

It gets a bit messier if I'm only interested in the last return value though...

You could wrap it in {} to get a table and index it from there:
Lua Code:
  1. local buffInfo = {GetUnitBuffInfo("player",1)}
  Reply With Quote