trying to get around command parsing

Posted by Shaun Biggs on Thu 22 Mar 2007 12:48 AM — 4 posts, 12,523 views.

USA #0
I've been looking for a way to get around command parsing for command sent to MUSHclient, and I'm not sure if it's possible. I'd like to do this for two reasons.

1) Short commands being removed from history. I have any command only one or two character long sent to the mud, but omitted from the command history. I'd rather save the history for the harder to type items. This works fine until I try to send a like like this "open n;n" and I want to repeat that. The whole line is longer than what I want to gag, so I would like to have my script check the whole line to see if it should omit from the history.

2) I just thought of the easiest workaround for my other reason for wanting this. And I'm two lazy to get rid of the list.

So is there a way to check the whole command line, or has it already been too far to check after the parsing?
Australia Forum Administrator #1
Read this:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6572

You probably want a plugin that implements OnPluginCommandEntered, and inside that do the first steps outlined in that post. You can use world.Execute to do the bulk of the processing, and choose whether or not to add the command to the command history.
USA #2
Ok, that just makes life way too easy. It's precisely what I was looking for in regards to dealing with the command history. One quick question though... Once something is triggered in OnPluginCommandEntered, is there any way to stop that set of commands from matching in any other plugin or world aliases?

I wouldn't normally try to have a plugin be so greedy, but I'm looking for a way to process some really odd data that can get put in the command line.
Australia Forum Administrator #3
If a plugin implements OnPluginCommandEntered and returns a tab character (as described in the documentation), then the command is discarded and it will not be passed to aliases etc.

Thus providing you only have one plugin that uses OnPluginCommandEntered, you can be sure that the other plugin aliases will not be activated, because that is done later.

Then you would need to "manually" implement that particular command (eg. recognise ".clearcommandhistory" or some such thing), and directly implement processing for whatever you are trying to do.