This addon will be made obsolete in the upcoming patch. See my comment below *******
UseOnSelf by Cogwheel
Current version 1.1
Provides slash commands and Lua functions to use an item on the player. It will always use it on the player regardless of your target. If you are in combat with an enemy targetted, you will remain in combat after using the item. It also exposes its "use item by name" feature in a slash command and Lua function.
Since this used to be the CastOnSelf addon, I have left the /castonself, /cos, and CastOnSelf features intact for backwards compatability. However, you can now use /script CastSpellByName("Spell Name", 1) without this addon if you like.
Usage:
In macros:
/useonself (or /uos) Item Name
/use Item Name
/castonself (or /cos) Spell Name
In scripts:
UseOnSelf("Item Name")
UseByName("Item Name")
CastOnSelf("Spell Name")
Examples of use:
----------------
/castonself Power Word: Shield
----------------
/uos Scroll of Spirit II
----------------
/script if GetRealZoneText() == "Arathi Basin" then UseOnSelf("Runecloth Bandage") else UseOnSelf("Heavy Mageweave Bandage") end
----------------
Item Name can be all or part of the name. In other words, /uos Bandage will use the first bandage it comes accross in your bags. Spell Name should match what is required for the /cast command.
Note: Dispel Magic is able to target both friends and enemies which interferes with the functioning of my addon. You should use /script CastSpellByName("Dispel Magic", 1) instead of /castonself, /cos, or /script CastOnSelf("Dispel Magic").