This site makes extensive use of JavaScript.
Please enable JavaScript in your browser.
Live
PTR
10.2.7
PTR
10.2.6
Beta
Editing existing slash commands
Post Reply
Return to board index
Post by
HighFive
I am looking for an explanation on how to edit slash commands defined by the default UI.
Google has been unfortunately unable to shed some light and apparently simply editing the function in the "SlashCmdList" table doesn't do it.
Is hooking my only option? I hope not.
Edit: Also, FYI, I'm not looking for how to edit the protected commands like "/tar" or "/use"; I do realize I couldn't replicate them.
Post by
Wanderingfox
Edit them how?
Post by
HighFive
Edit them how?Replace their function with my own.
@zdouze who deleted their post: /chicken = /flap = /strut.
Post by
Wanderingfox
Can't you just register over them, or does that error out these days? (I haven't tried anything like this since way the hell back in classic)
Post by
HighFive
A slash command is added by adding the function in SlashCmdList with a specific full-case (dunno if that's a must?) key, for example "FUNC", and defining globals strings with the name "SLASH_FUNCn" (where n is 1 or 2 (or 3 etc) for additional versions) such as "/func".
I am guessing SlashCmdList is a metatable since,
As I
said:
simply editing the function in the "SlashCmdList" table doesn't do it.
Post by
Wanderingfox
Ah right... I've gotten so used to doing things with Ace I completely forget how the core API works sometimes :3
Not really sure what you could do in that case...
You could try copying the metatable and then setting it with setmetatable? I'm not sure what kind of ramifications that would have on the rest of the environment though... That's a pretty hefty table to be !@#$ing around in.
Post by
409946
This post was from a user who has deleted their account.
Post by
Wanderingfox
Is that anything like there not being a spoon?
Post by
409946
This post was from a user who has deleted their account.
Post by
HighFive
Thanks Neffy. I should've known better than posting before looking through ChatFrame.lua.
Post by
Breadzilla
Am I the first to think this when I say 'lolwut?' ?
Post by
127599
This post was from a user who has deleted their account.
Post by
Breadzilla
Considering the problem was already solved, a little joke never hurt anyone; loosen up.
Post by
pelf
Is that anything like there not being a spoon?
No, because the spoon always existed in a virtual sense. Whether or not it existed in the "real world" was irrelevant considering it existed in the world which the boy was a part of. It was part of his reality. It was that reality he was looking to bend, not the spoon.
The meta-table on the other hand just doesn't exist.
Aww Neffy. I knew I'd like you as soon as you made your first post.
Post Reply
You are not logged in. Please
log in
to post a reply or
register
if you don't already have an account.