WoW:API UnitCastingInfo: Difference between revisions
Jump to navigation
Jump to search
(New page: {{wowapi}} __NOTOC__ Returns information on the spell currently cast by the specified unit. Returns nil if no spell is being cast. spell, rank, displayName, icon, startTime, endTime = ...) |
No edit summary |
||
Line 4: | Line 4: | ||
Returns information on the spell currently cast by the specified unit. Returns nil if no spell is being cast. | Returns information on the spell currently cast by the specified unit. Returns nil if no spell is being cast. | ||
spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo("unit") | spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitCastingInfo("unit") | ||
Line 18: | Line 18: | ||
:;startTime : Number - Specifies when casting has begun, in milliseconds. | :;startTime : Number - Specifies when casting has begun, in milliseconds. | ||
:;endTime : Number - Specifies when casting will end, in milliseconds. | :;endTime : Number - Specifies when casting will end, in milliseconds. | ||
:;isTradeSkill : Boolean - Specifies if the cast is a tradeskill | |||
== Example == | == Example == |
Revision as of 08:11, 24 January 2008
Returns information on the spell currently cast by the specified unit. Returns nil if no spell is being cast.
spell, rank, displayName, icon, startTime, endTime, isTradeSkill = UnitCastingInfo("unit")
Parameters
Arguments
- unit
- String - The UnitId to query (e.g. "player", "party2", "pet", "target" etc.)
Returns
- spell
- String - The name of the spell, or nil if no spell is being cast.
- rank
- String - The string describing the rank of the spell, e.g. "Rank 1".
- displayName
- String - The name to be displayed.
- icon
- String - The texture path associated with the spell.
- startTime
- Number - Specifies when casting has begun, in milliseconds.
- endTime
- Number - Specifies when casting will end, in milliseconds.
- isTradeSkill
- Boolean - Specifies if the cast is a tradeskill
Example
local spell, _, _, _, _, endTime = UnitCastingInfo("player") if spell then local finish = endTime/1000 - GetTime() ChatFrame1:AddMessage(spell .. ' will be finished casting in ' .. finish .. ' seconds.') end
Result
- If you're currently casting Shadowbolt:
Shadowbolt will be finished casting in 1.234 seconds.
Details
Not sure if displayName ever differs from spell.