Thread Tools Display Modes
10-22-23, 09:48 AM   #1
Blandros
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Sep 2023
Posts: 13
Bind spell to a actionbutton

Is there an API or method available that allows for the assignment of a spell to an action button without the need to manually drag and drop the spell from the spellbook to the desired action button?


SetBindingSpell does this:

SetBindingSpell("key", "spell");


I need something like this:

SetBindingSpell("ACTIONBUTTON1", "Frostbolt");
  Reply With Quote
10-22-23, 10:24 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,934
I use SetAttribute on my MagePorts addon.

https://warcraft.wiki.gg/wiki/API_Frame_SetAttribute


Another addon that uses it is https://www.wowinterface.com/downloa...ofessions.html which was based on an early version of my MagePorts addon.

But these are on newly created buttons and not Blizzard created ones.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 10-22-23 at 10:30 AM.
  Reply With Quote
10-27-23, 02:07 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
I'd take a look at these two. Be aware they may be protected functions despite not being labeled as such.

PickupSpell()
PlaceAction()

Note: The Pickup/Place functions are what facilitate the drag-and-drop system and as such manipulate what's being held by the cursor.
You may want to call ClearCursor() first to make sure it isn't holding anything if you wish to do this in code.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-28-23 at 05:21 AM. Reason: Fixed link for PickupSpell()
  Reply With Quote
10-28-23, 03:19 AM   #4
Blandros
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Sep 2023
Posts: 13
Thank you @Xrystal and @SDPhantom
I‘ll have a look at it
  Reply With Quote
10-30-23, 06:24 PM   #5
Blandros
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Sep 2023
Posts: 13
Thank you SDPhantom! Your hint was awesome!

https://legacy.curseforge.com/wow/ad.../files/4827860
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Bind spell to a actionbutton


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off