Quantcast
Binding a key directly to a companion - WoWInterface
Thread Tools Display Modes
11-16-10, 12:03 PM   #1
kraftman
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 63
Binding a key directly to a companion

I'm trying to allow users of my addon to directly bind keys to companions.

SetBindingSpell("key", "spell name") doesn't seem to work, SetBindingSpell("key", "spellID") seems to set the spell properly, in that GetSpellTexture(GetBindingAction("key")) returns the correct texture for the spell, however pressing the key doesn't call the companion.

Is there another way to do this that doesn't involve either creating a macro, or creating a button?
  Reply With Quote
11-16-10, 04:39 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
SetBindingSpell requires a spell name to work; giving it a spell ID won't generate any errors, but it won't work either.

It looks like the answer to your question, though, is that you cannot directly keybind companions (or mounts).
  Reply With Quote
11-16-10, 05:46 PM   #3
Coote
A Scalebane Royal Guard
 
Coote's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 440
You can check out ncHoverBind and see how it's done there (it SHOULD work, though I haven't had the chance to really test it). If you find it of any use, you're welcome to try replicating it to work with your addon.
__________________

"This is the fifteen-thousandth four hundredth and ninety-eighth occurence".
  Reply With Quote
11-16-10, 07:09 PM   #4
Xchg
A Defias Bandit
Join Date: Nov 2010
Posts: 2
Not an ideal solution, since the buttons can shift around, but you could do something like:

SetBindingClick("Q", "SpellBookCompanionButton1")

Would require some extra work to check what's currently in that slot.
  Reply With Quote
11-22-10, 04:40 PM   #5
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
Originally Posted by Xchg View Post
Not an ideal solution, since the buttons can shift around, but you could do something like:

SetBindingClick("Q", "SpellBookCompanionButton1")

Would require some extra work to check what's currently in that slot.
That will only work one the first page. All subsequent pages reuse those buttons. Oh well, it would have been pretty messy trying to track down the right button anyway. Plus keeping it updated...
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Binding a key directly to a companion

Thread Tools
Display Modes

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