WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How to pickup a mount to the cursor by ID? (https://www.wowinterface.com/forums/showthread.php?t=56330)

alikim 07-02-18 05:47 AM

How to pickup a mount to the cursor by ID?
 
I want to write a lua code that picks up a mount ( I know it's ID from GetActionInfo) and places it on an Action Slot.
I know PickupSpell, PickupItem, PickupMacro to pickup those things by their ID, but that doesn't seem to work with mounts.

jeffy162 07-02-18 09:48 AM

While I know next to nothing about Lua, I have to ask you - can you still place your mount on the action bars? It's been almost two years since I played WoW and that's why I asked. I used to have a couple of mounts on my action bars and all I did was put them there manually.

alikim 07-02-18 10:36 AM

Quote:

Originally Posted by jeffy162 (Post 328521)
While I know next to nothing about Lua, I have to ask you - can you still place your mount on the action bars? It's been almost two years since I played WoW and that's why I asked. I used to have a couple of mounts on my action bars and all I did was put them there manually.

Yes, you can put all sorts of mounts on the action bars but I can't find a way to do it programmably.

The only way to put something on the action bars that I know of is to pick it on the cursor with PickupXXX(objectID) Lua command and then PlaceAction(actionBarSlotID) from the cursor. I made it work for spells, items and macroses but I got stuck with mounts.

AcidWeb 07-02-18 11:30 AM

C_MountJournal.Pickup(id). But you need check mount UI code as id might be internal.

saxitoxin 07-02-18 11:38 AM

what mount are you trying to pick up?

try this:
Code:

                local creatureName, spellID, icon, active, isUsable, sourceType, isFavorite, isFactionSpecific, faction, hideOnChar, isCollected, mountID = C_MountJournal.GetMountInfoByID(246)
                PickupSpell(spellID or creatureName)

mountID 246 is the Azure Drake

alikim 07-02-18 12:34 PM

That helped, thank you!


All times are GMT -6. The time now is 04:59 AM.

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