Binding a spell @cursor
I would like to do "alt click" and it to drop D&D where the cursor is, no questions asked. I can do "SetBindings("ALT-BUTTON1", "SPELL Death and Decay") but it's missing the "@cursor". The way around it I can see is to do "SetBindings("ALT-BUTTON1", "MACRO DeathAndDecay")" where the macro does "/cast [@cursor] Death and Decay".
Is there a better way of doing this so that I can skip the macro? IN ADDITION: I have a number of key bindings to macros where my addon code sets up the key bindings in LUA, this ties a key press to a macro, and the macro calls back the addon via the /command system. A bit of round about way. Can I instead bind a key to execute some LUA code directly and to avoid having to set up macros which are stored and maintained externally to my addon ? |
I think you could try something along these lines
Code:
local button = CreateFrame( Code:
SetBindingClick("ALT-BUTTON1", "NameThisButton") Code:
local MODS = { |
OK thanks. The first example allows me to set up a macro from the addon, without using the WoW client. This is good, if it means I do not have to litter the WoW client with macros.
The second example, I believe, allows me to listen to keystrokes but I am not sure why I would want to listen to raw keystrokes - maybe this allows me to run ANY code at all without even using a macro attached to a button ? |
The second example is how to have an addon run its own code when a key is pressed. It won't let you do protected actions like use an ability. You have to still mess around with the keybind system and SecureActionButton templates.
|
Thank you. I have not had time to analyse the second part yet, as I am still trying to find my way around the best way to do what I want to do.
|
All times are GMT -6. The time now is 05:00 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI