WoW:API GetCursorInfo: Difference between revisions

no edit summary
(it doesn't return an actionid, but a spellid)
No edit summary
Line 36: Line 36:
== Example ==
== Example ==
  local infoType, info1, info2 = GetCursorInfo()
  local infoType, info1, info2 = GetCursorInfo()
  if infoType == "item" then
  if (infoType == "item") then
   DEFAULT_CHAT_FRAME:AddMessage(info2)
   print(info2)
elseif (infoType == "spell") then
  local name, rank = GetSpellName(info1, info2)
  if (rank ~= "") then
    name = name .. "(" .. rank .. ")"
  end
  print(name)
  end
  end


<big>'''Result'''</big>
<big>'''Result'''</big>
  If the cursor is holding an item, its item link is displayed in the default chat window.
  If the cursor is holding an item, its item link is displayed in the default chat window.
Anonymous user