WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Bind spell to a actionbutton (https://www.wowinterface.com/forums/showthread.php?t=59696)

Blandros 10-22-23 09:48 AM

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");

Xrystal 10-22-23 10:24 AM

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.

SDPhantom 10-27-23 02:07 PM

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.

Blandros 10-28-23 03:19 AM

Thank you @Xrystal and @SDPhantom
I‘ll have a look at it :)

Blandros 10-30-23 06:24 PM

Thank you SDPhantom! Your hint was awesome!

https://legacy.curseforge.com/wow/ad.../files/4827860


All times are GMT -6. The time now is 03:38 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI