Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ trying to get around command parsing
|
trying to get around command parsing
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Shaun Biggs
USA (644 posts) Bio
|
| Date
| Thu 22 Mar 2007 12:48 AM (UTC) |
| Message
| 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? |
It is much easier to fight for one's ideals than to live up to them. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Thu 22 Mar 2007 05:33 AM (UTC) |
| Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Shaun Biggs
USA (644 posts) Bio
|
| Date
| Reply #2 on Thu 22 Mar 2007 09:02 AM (UTC) |
| Message
| 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. |
It is much easier to fight for one's ideals than to live up to them. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Thu 22 Mar 2007 07:54 PM (UTC) |
| Message
| 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
12,019 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top