Problems creating a slash command
I'm trying to expand on an ingame macro to free up some actionbar space which requires more than the 250 chars.
According to http://www.wowwiki.com/HOWTO:_Create_a_Slash_Command , this is what I have so far: Code:
function HunterAttack_OnLoad() Ingame, when I call /hatt via a macro, it gives me this: [sting "Interface\FrameXML\ChatFrame.lua"]:2043: attempt to call local 'value' (a table value). I tried to check out ChatFrame.lua, but it doesn't exist in that folder. Thoughts? |
Im by no means an expert here, in fact slash commands absolutely drive me insane with their flakey little rules.
But i was having lots of trouble in AggroAlert to get basic slash commands to work, in fact it was just one command to do a toggle just like yours, until i finally cracked it. I had to add if (cmd) then <command handler stuff> end inside the function. Again, this might not solve your problem at all, but it solved mine, and mine was set up almost the exact same way. |
Thanks Sathanas.
Still getting that error with your changes. Can you post your On_Load and your main function so I can have a look? |
Quote:
You could check the code in AutoRepair, it has a couple of commands in there. It looks like, first I didn't setup the chat handler until after the VARIABLES_LOADED event fired. like this: Code:
function AutoRepair_OnEvent(event) Code:
SlashCmdList["AUTOREPAIR"] = AR_SlashHandler; Code:
function AR_SlashHandler(msg) |
Hmmm, I move the slash command handler to the top, and renamed my function. Works good now.
Code:
function HunterAttack_OnLoad() Thanks for all the feedback! |
Awesome! glad it helped.
|
I would guess the problem had something to do with :
ChatMessage("Coskesh's HunterAttack Loaded."); where is that function defined? i dont believe its in the core api. |
could be defined anywhere, even in another mod.
Apprently the problem he had was the placement of the chathandler compared to the / declarations. Another example of the mystery that is blizzards lua. |
All times are GMT -6. The time now is 04:03 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI