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
➜ Problem With Omitting Prompt?
|
Problem With Omitting Prompt?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Lucindrielle
(10 posts) Bio
|
| Date
| Thu 09 Sep 2010 02:15 AM (UTC) Amended on Thu 09 Sep 2010 02:47 AM (UTC) by Lucindrielle
|
| Message
| So, I want to make it so that my prompt is stripped from my log files. Saves me ages of work to post it to our forums later. I had it working, Nick Gammon helped me a long, long time ago - but since then I've changed my prompt and now I can't get it to work; no matter what I do.
At any given time, my prompt looks like:
NAME: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [3:00am Night Time] [Craftskill: 334]
That's: NAME: <%h/%Hhp %m/%Mm %v/%Vmv %g %s %q> [%t %d] [Craftskill: %C]
So, I took it into a trigger and changed all the parts that will change:
NAME: <*/*hp */*m */*mv * * *> [* *] [Craftskill: *]
BUT: it doesn't work. At all. I even tried adding in extra spaces to account for the color code ( {r and {x and whatnot).
And, yes, I made sure to check "omit from log" and my triggers are enabled and all that good stuff.
Help?
EDIT:
OH! I also -when it was working- I noticed that very often my prompt will do this:
NAME: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [9:30pm Night Time] [Craftskill: 334] You drink milk from a delicate amethyst decanter.
For some reason, frequently, I'll get a line of normal text right after the prompt and I'll lose entire lines of stuff from the log because it took out the entire thing.
Is there any way to fix this issue, as well? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Thu 09 Sep 2010 02:46 AM (UTC) |
| Message
| I tried your trigger against what you posted and it matched.
Can you post the whole thing in XML form?
 |
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
|
As for the extra lines, can you get the MUD to start a new line after a prompt? Maybe check the option "Convert IAC EOR/GA to new line".
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Lucindrielle
(10 posts) Bio
|
| Date
| Reply #2 on Thu 09 Sep 2010 02:48 AM (UTC) Amended on Thu 09 Sep 2010 02:52 AM (UTC) by Lucindrielle
|
| Message
|
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="MADILYN: <*/*hp */*m */*mv * * *> [* *] [Craftskill: *]"
omit_from_log="y"
regexp="y"
sequence="100"
>
</trigger>
</triggers>
EDIT: I checked the box to convert IAC..... and it did not fix the problem. My test immediately after shows:
MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [8:00pm Dusk] [Craftskill: 334] You drink milk from a delicate amethyst decanter.
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Thu 09 Sep 2010 02:52 AM (UTC) |
| Message
| | What you have there is not a regular expression. Uncheck that. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Lucindrielle
(10 posts) Bio
|
| Date
| Reply #4 on Thu 09 Sep 2010 02:53 AM (UTC) |
| Message
| | Okay. Unchecked "regular expression" and it does not clear up the issue. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Thu 09 Sep 2010 03:01 AM (UTC) |
| Message
| Well this is what I used to test:
<triggers>
<trigger
custom_colour="2"
enabled="y"
keep_evaluating="y"
match="MADILYN: <*/*hp */*m */*mv * * *> [* *] [Craftskill: *]"
omit_from_log="y"
send_to="2"
sequence="100"
>
<send>Matched! %0</send>
</trigger>
</triggers>
 |
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
And with this line:
MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [3:00am Night Time] [Craftskill: 334]
I get this:
MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [3:00am Night Time] [Craftskill: 334]
Matched! MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [3:00am Night Time] [Craftskill: 334]
The first one is the trigger colouring the line, the second is it echoing it back.
However even a single space after that final square bracket will make it not match.
Safer might be to add a trailing asterisk:
<triggers>
<trigger
custom_colour="2"
enabled="y"
keep_evaluating="y"
match="MADILYN: <*/*hp */*m */*mv * * *> [* *] [Craftskill: *]*"
omit_from_log="y"
send_to="2"
sequence="100"
>
<send>Matched! %0</send>
</trigger>
</triggers>
(See extra asterisk at end of match line). Now it matches the prompt, with anything following it (which of course will also match those lines of yours with extra stuff on them).
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Lucindrielle
(10 posts) Bio
|
| Date
| Reply #6 on Thu 09 Sep 2010 03:23 AM (UTC) Amended on Thu 09 Sep 2010 03:31 AM (UTC) by Lucindrielle
|
| Message
| YES! That totally worked!
EXCEPT: It doesn't fix the line issue.
MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [5:00pm Day Time] [Craftskill: 334]
ok 'Hahahahha'
Chel'rei OOC Kingdom: 'The movie was out ages ago. This is based off of the comic/video game look.'
MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [5:00pm Day Time] [Craftskill: 334] You OOC Kingdom: 'Hahahahha'
MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [5:00pm Day Time] [Craftskill: 334] Zayin OOC Kingdom: 'I want to see the Expendables'
MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [5:00pm Day Time] [Craftskill: 334]
Gaeruwn OOC Kingdom: 'amazing movie'
MADILYN: <1344/1344hp 1540/1540m 406/406mv 204 12 733> [5:00pm Day Time] [Craftskill: 334]
Zayin OOC Kingdom: 'And Pirahna 3d'
comes out as:
Chel'rei OOC Kingdom: 'The movie was out ages ago. This is based off of the comic/video game look.'
Gaeruwn OOC Kingdom: 'amazing movie'
Zayin OOC Kingdom: 'And Pirahna 3d'
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #7 on Thu 09 Sep 2010 04:11 AM (UTC) Amended on Thu 09 Sep 2010 08:04 AM (UTC) by Nick Gammon
|
| Message
| You need a newline after the prompt, so they are treated as separate lines. Can you configure that? It looks like Smaug, try "help prompt" to see if there is an option to put a newline at the end.
Try checking the option "Convert IAC EOR/GA to new line".
If that doesn't work, try looking at this post:
http://mushclient.com/forum/?id=7430
You may need a small plugin that detects your prompt, and adds a newline after it, so that the trigger then matches that line and not the stuff after it. An example plugin for your prompt would be:
 |
To save and install the Add_NewLine_To_Prompt plugin do this:
- Copy between the lines below (to the Clipboard)
- Open a text editor (such as Notepad) and paste the plugin into it
- Save to disk on your PC, preferably in your plugins directory, as Add_NewLine_To_Prompt.xml
- Go to the MUSHclient File menu -> Plugins
- Click "Add"
- Choose the file Add_NewLine_To_Prompt.xml (which you just saved in step 3) as a plugin
- Click "Close"
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="Add_NewLine_To_Prompt"
author="Nick Gammon"
id="d47076042b899a0fc81d3c09"
language="Lua"
purpose="Forces a newline after a prompt line"
date_written="2010-09-09"
requires="3.82"
version="1.0"
>
</plugin>
<!-- Script -->
<script>
<![CDATA[
function OnPluginPacketReceived (s)
return (string.gsub (s,
"\nMADILYN: <[%d/]+hp [%d/]+m [%d/]+mv[%d ]+> %[.-%] %[Craftskill: %d+%]", "%1\n"))
end -- function OnPluginPacketReceived
]]>
</script>
</muclient>
In this case it is a Lua regular expression, which looks a bit different. Mind you, this is a bit of a hack, because it won't work if the prompt is split between packets from the MUD. I would try my other suggestions first.
The regexp is fairly simple:
- %d means a digit (0 to 9)
- [%d/] means the set of digits or the slash character
- [%d/]+ means "one or more digits or slashes" (that would match "1344/1344")
- %d+ means "one or more digits" (that would match "334")
- [%d ]+ means "one or more digits or spaces (that would match "204 12 733")
- %[.-%] matches square brackets with anything between them (that would match "[5:00pm Day Time]")
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Lucindrielle
(10 posts) Bio
|
| Date
| Reply #8 on Thu 09 Sep 2010 10:07 PM (UTC) Amended on Thu 09 Sep 2010 10:23 PM (UTC) by Lucindrielle
|
| Message
| Okay.
I tried the "Convert IAC EOR/GA to new line" and it didn't work.
Before I try your other stuff, I was futzing around and just realized I have a option to do this:
%c : Display a carriage return (useful for multi-line prompts)
If I add this to the end of my prompt, will that help (I'd obviously be using that first script you fixed for me with it)?
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #9 on Thu 09 Sep 2010 10:18 PM (UTC) |
| Message
| | Well if you put the %c directly after that last square bracket, then your trigger should work because there won't be anything after the square bracket. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Lucindrielle
(10 posts) Bio
|
| Date
| Reply #10 on Thu 09 Sep 2010 10:26 PM (UTC) |
| Message
| Excellent! I'll try this and if that doesn't work, I'll go back to the last script you gave me with the plug in!
Thanks in advance for all the help. I reaaaaaallllly appreciate the time and effort. :) | | 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.
32,842 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top