Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API GetCursorInfo

Last wiki revision 2023-01-29

Returns what the mouse cursor is holding. infoType, ... = GetCursorInfo

The first return value is a string indicating the nature of an object on the cursor; additional return values provide detail. The following return value combinations have been observed:

  • "item", itemID, itemLink
  • itemId : - Item ID of the item on the cursor.
  • itemLink : - ItemLink of the item on the cursor.
  • "spell", spellIndex, bookType, spellID
  • spellIndex: - The index of the spell in the spell book.
  • bookType : - Always BOOKTYPE_SPELL (or else the type would have been "petaction").
  • spellID : - Spell ID of the spell on the cursor
  • "petaction", spellID, spellIndex, retVal3
  • spellID: - Spell ID of the pet action on the cursor, or unknown 0-4 number if the spell is a shared pet control spell (Follow, Stay, Assist, Defensive, etc...)..
  • spellIndex: - The index of the spell in the pet spell book, or nil if the spell is a shared pet control spell (Follow, Stay, Assist, Defensive, etc...).
  • retVal3: Needs summary.
  • "macro", index
  • index : - The index of the macro on the cursor.
  • "money", amount
  • amount : - The amount of money in copper.
  • "mount", useless_index, C_MountJournal index
  • useless_index: this index is not useful since no other API receives it as a parameter.
  • C_MountJournal index: index in the C_MountJournal (used by C_MountJournal API functions). These indexes varies with game locale.
  • "merchant", index
  • index : - The index of the merchant item.
  • "battlepet", petGUID
  • petGUID : - GUID of a battle pet in your collection.

The following snippet, if you're holding an item, prints out the amount of that item in your bags. local infoType, itemID, itemLink = GetCursorInfo if infoType == "item" then print("You have " .. GetItemCount(itemLink) .. "x" .. itemLink .. " in your bags.") else print("You're not holding an item on your cursor.") end

Source

https://warcraft.wiki.gg/wiki/API_GetCursorInfo · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.