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
➜ Trigger Issue
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| JL
(3 posts) Bio
|
Date
| Sun 18 Mar 2007 11:52 PM (UTC) |
Message
| Is there a way to establish a trigger that will allow me to send a blank line to myself between blocks of text? Essentially, I want to insert a blank line between one paragraph and the next.
I've tried using regular expressions, I've tried tweaking the display settings and nothing works. With regular expressions, every time it comes across my trigger-expression it performs the requested action. So I end up with three+ lines separating one paragraph from the next. If I could just figure out how to limit <expression> to <block of text> I'd be good to go.
Suggestions? | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #1 on Mon 19 Mar 2007 12:15 AM (UTC) |
Message
| You can try this trigger (scripting must be enabled and set to Lua):
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match=".*?$"
regexp="y"
send_to="12"
sequence="1"
>
<send>print("\r\n")</send>
</trigger>
</triggers>
| Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #2 on Mon 19 Mar 2007 12:37 AM (UTC) |
Message
| Could you explain a bit more how you're matching to separate the paragraphs? Maybe post your trigger and an example of the mud output what you're trying to separate? If it's something as simple as a line that starts with a tab, then ^\t.* should work as a trigger.
Ked's trigger will just spit out blank lines after every line of text, which might be what you want. The .*?$ can also be shortened to just * with no regex, or .* with regex |
It is much easier to fight for one's ideals than to live up to them. | Top |
|
Posted by
| JL
(3 posts) Bio
|
Date
| Reply #3 on Mon 19 Mar 2007 02:44 AM (UTC) |
Message
| The trigger I'm using is relatively simple, compared to most I've seen here. The problem might even be with it, though I couldn't find a way to just exclude everything but the last line of the paragraph.
The trigger: \.$ (expression: @pemit me=%n)
Also - I'm really not familiar with scripts and such, so any help on that will be appreciated. | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #4 on Mon 19 Mar 2007 03:03 AM (UTC) |
Message
| From that trigger expression it seems like you treat the end of a paragraph to be a line with a full stop as the last character on it. Technically speaking, a newline marks the end of a paragraph, so if your MUD's server wraps long lines by breaking them up with newlines then you'll have many small paragraphs where you'd expect a single one.
But that aside, you seem to be trying to send a newline to be echoed back at you by the server. This would explain how you manage to get more than one blank line after each paragraph: by the time your newline reaches the server and comes back to you, the server might have already sent several other paragraphs, which were matched by the trigger, and you end up with batches of incoming newlines.
What you probably want is to display the newline in the client's output window, and to do that you don't need to send anything to the server - you don't even need scripting if you don't want to do that. You just need to display the newline by sending it to output from the trigger. Like this:
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="\.$"
regexp="y"
send_to="2"
sequence="1"
>
<send>\r\n</send>
</trigger>
</triggers>
| Top |
|
Posted by
| JL
(3 posts) Bio
|
Date
| Reply #5 on Wed 21 Mar 2007 02:09 AM (UTC) |
Message
| Thanks for all the help. I'll try Ked's solution since it's the only one I think I can understand and likely won't mess up in the process. | 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.
18,727 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top