Shoutbox

Automatically insert double // when it's an unrecognized command? - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Automatically insert double // when it's an unrecognized command? (/showthread.php?tid=93553)

Automatically insert double // when it's an unrecognized command? by prashker on 01-16-2010 at 10:25 PM

quote:
---------------------------
Messenger Plus! Live
---------------------------
The command you entered was not recognized.
If the message was not meant to be a command, insert a second '/' at its beginning.
---------------------------
OK   
---------------------------

If /dog is not a command, send //dog

Possible?

Posted this in Scripting because I assumed it might be possible via scripting.

Thanks,
-Sam
RE: Automatically insert double // when it's an unrecognized command? by Spunky on 01-16-2010 at 10:27 PM

I don't think it would be possible as a script wouldn't know if another script is using a certain command. The only way I could think of is somehow reading the commands list and checking that, but not all scripts add their commands to it in the first place


RE: Automatically insert double // when it's an unrecognized command? by prashker on 01-16-2010 at 10:37 PM

Ok, how about an array, if (command is not in array) double // it.

array= ('/busy', '/online')

:p?


RE: Automatically insert double // when it's an unrecognized command? by Spunky on 01-16-2010 at 10:41 PM

That will break the other scripts though that use custom commands :p


RE: Automatically insert double // when it's an unrecognized command? by prashker on 01-16-2010 at 10:50 PM

:zippy: okay then.

Thanks anyways :p


RE: Automatically insert double // when it's an unrecognized command? by CookieRevised on 01-17-2010 at 01:28 AM

The only way I can think of is to somehow catch the error message coming from Plus!. Because that is the only way you are sure that no other script uses the command. It speaks for itself that it would be a rather clumsy approach though.

Not to mention that some (not well made scripts) do not return properly when they handle a command. So, eventhough they have handled the command, Plus! still thinks the command is invalid. A lot of such examples can be found in scripts from first-time/beginner scripters.