quote:
Originally posted by wiseguyxp
I really want to start my command with a slash, but when I had tried to use the slash command, it said "The command you entered was not recognized." I took a look at OnGetScriptCommands (as you suggested) and it pointed to me to ScriptInfo.xml. After defining the command in ScriptInfo.xml, it all works fine. Thanks a lot!
As I said before, the two things ("
command not recognized" error and the
OnGetScriptCommands() function) don't have anything to do with eachother.
OnGetScriptCommands() (or the equivalent in the ScriptInfo.xml
which is indeed rarely used by scripters) simply lists your command in the command browser window which pops up when the user types a slash "/" in a conversation window. It does _not_ make the command 'recognizable' by Plus!, it simply adds the command to that list which has the sole purpose of displaying something to the user, nothing more.
You get the "
command not recognized" error because you didn't tell Plus! that your script did recognize the text as a command. And that is done by returning something in the
OnEvent_ChatWndSendMessage() function.
If you don't return something, Plus! will think that the command wasn't recognized by any installed and running script and will eventually show that error message after it has parsed that text to all the
OnEvent_ChatWndSendMessage() functions in all the installed and running scripts.
To see an example of all that, see
CookieRevised's reply to Gettin data from "/" commands.
PS: I didn't link to that before because (re)searching such things yourself is very vital to learn scripting in Plus!.