Testing slash-command before execution?
Hello,
I use the following function to execute slash-commands, or commands: Code:
-- .executeCmd("/sit", true) Thank you for your help. |
What function did you add to SlashCmdList to be called by your /xxx command? You could just use that.
Lua Code:
|
Quote:
Lua Code:
|
The function for a slash command receives a single string parameter. If you want to interpret that into say commmands and parameters, you need to break down the string that is passed eg:
Lua Code:
or are you saying you want to test if RunScript(strLine) is going to run without error before running RunScript(strLine)? |
Quote:
If I write RunScript("mmmkkhgrttt") I will have a lua error, and I would like to trap this error. In fact, I'm now able to do this with something like: Lua Code:
The tricky part is to catch errors when a macro is passed to the function .executeCmd() and processed with: Lua Code:
|
OK, I finally solve my problem, with the following code (maybe it could be optimized):
Lua Code:
|
All times are GMT -6. The time now is 04:18 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI