WoW:API GetTotemInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(New page: {{wowapi}} __NOTOC__ <!-- Describe the purpose of the function, exhausting detail can be saved for a later section --> Returns information about totems <!-- List return values and argum...)
 
No edit summary
Line 6: Line 6:


<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
  arg1, totemName, startTime, duration = GetTotemInfo(1 through 4)
  haveTotem, totemName, startTime, duration = GetTotemInfo(1 through 4)




Line 15: Line 15:
:(integer)
:(integer)


:;integer: integer - index of the totem (fire=1 earth=2 water=3 air=4)
:;integer: integer - index of the totem (Fire = 1 Earth = 2 Water = 3 Air = 4)


=== Returns ===
=== Returns ===
<!-- List each return value, together with its type -->
<!-- List each return value, together with its type -->


:;arg1: seems to always return true.
:;haveTotem: returns true if you have the totem reagent in your bag ({{Loot|Common|Earth Totem}}, {{Loot|Common|Fire Totem}}, {{Loot|Common|Water Totem}}, {{Loot|Common|Air Totem}}).


:;totemName: returns the name of the currently active totem.
:;totemName: returns the name of the currently active totem.


:;totemName: returns the GetTime() value of when the totem started.
:;startTime: returns the GetTime() value of when the totem started.


:;duration: returns the duraiton (in seconds) of the currently active totem.
:;duration: returns the duraiton (in seconds) of the currently active totem.

Revision as of 20:31, 21 June 2008

WoW API < GetTotemInfo


Returns information about totems

haveTotem, totemName, startTime, duration = GetTotemInfo(1 through 4)


Parameters

Arguments

(integer)
integer
integer - index of the totem (Fire = 1 Earth = 2 Water = 3 Air = 4)

Returns

haveTotem
returns true if you have the totem reagent in your bag (Template:Loot, Template:Loot, Template:Loot, Template:Loot).
totemName
returns the name of the currently active totem.
startTime
returns the GetTime() value of when the totem started.
duration
returns the duraiton (in seconds) of the currently active totem.



Example

Displays the duration of all active totems

for index=1,4 do
  local arg1, totemName, startTime, duration = GetTotemInfo(index)
  local est_dur = round(startTime+duration-GetTime() )
  DEFAULT_CHAT_FRAME:AddMessage(totemName .. "  " .. est_dur)  
end

Details

Yeah, umm this is my first time making a page, so feel free to fix it up. --xkq