WoW:API PickupSpell: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{protectedcombatapi|2.0}} {{wowapi}}
Puts the specified spell onto the mouse cursor.
  PickupSpell("spellName" | spellId, bookType)
  PickupSpell("spellName" | spellId, bookType)


Puts a spell with spellId on mouse cursor.
== Arguments ==
;spellName: String - the name of the spell.
or
;spellId : Numeric - the offset (position) of spell in spellbook. SpellId can change when you learn new spells.
;bookType : String - Either BOOKTYPE_SPELL ("spell") or BOOKTYPE_PET ("pet").


----
== Notes ==
;''Arguments''
* This function will put a spell on mouse cursor. The spell is defined by spellbook and it's position in the spellbook.
 
* The cursor needs to be clear in order to use this function.
:;spellName: String - the name of the spell.
 
:;spellId : Numeric - the offset (position) of spell in spellbook. SpellId can change when you learn new spells.
:;bookType : String - Either BOOKTYPE_SPELL ("spell") or BOOKTYPE_PET ("pet").
 
----
;''Returns''
 
<!-- List each return value, together with its type -->
:Nothing.
 
----
;''Details''
 
:This function will put a spell on mouse cursor. The spell is defined by spellbook and it's position in the spellbook.
:The cursor needs to be clear in order to use this function.
 
----
;''Example''


==  Example ==
This example shows, how to put the most powerful version of a spell on cursor.
This example shows, how to put the most powerful version of a spell on cursor.
 
PickupSpell("Moonfire")
  PickupSpell(spellName)


or
or
Line 51: Line 38:
   local id = findSpell(spellName, bookType);
   local id = findSpell(spellName, bookType);
   PickupSpell(id, bookType);
   PickupSpell(id, bookType);
----
see also [[API PickupAction | PickupAction()]], [[API PickupPetAction | PickupPetAction()]], [[API PickupBagFromSlot | PickupBagFromSlot()]], [[API PickupContainerItem | PickupContainerItem()]], [[API PickupInventoryItem | PickupInventoryItem()]], [[API PickupItem | PickupItem()]], [[API PickupMacro | PickupMacro()]], [[API PickupMerchantItem | PickupMerchantItem()]],[[API PickupPetAction | PickupPetAction()]], [[API PickupPlayerMoney | PickupPlayerMoney()]], [[API PickupStablePet | PickupStablePet()]], [[API PickupTradeMoney | PickupTradeMoney()]], [[API ClearCursor | ClearCursor()]]


----
== See Also ==
{{wowapi}}
* {{api|PickupAction}}, {{api|PickupPetAction}}, {{api|PickupBagFromSlot}}, {{api|PickupContainerItem}}, {{api|PickupInventoryItem}}, {{api|PickupItem}}, {{api|PickupMacro}}, {{api|PickupMerchantItem}}, {{api|PickupPlayerMoney}}, {{api|PickupStablePet}}, {{api|PickupTradeMoney}}
* {{api|ClearCursor}}