|
ksignorini Beginner
Joined: 04 Aug 2006 Posts: 12
|
Posted: Sat Aug 05, 2006 5:48 pm
GAG and blank lines |
I'm using the following to capture and gag my MUD's Newbie channel into its own window:
#CAP 1 Newbie
#GAG
when the pattern Newbie comes up.
It works great, but my main window still scrolls by 1 line each time a Newbie line comes up (so I get a blank line printed in main window instead of the Newbie line which now goes into its own cap window).
How do I get GAG to completely GAG the line and not print the blank in the main window?
Thanks,
Kent! |
|
|
|
saet Apprentice
Joined: 12 Jun 2006 Posts: 106
|
Posted: Sat Aug 05, 2006 7:25 pm |
I can't figure out how to capture something, gag it and remove that blank line, but I also don't have much experience with using #CAP. I prefer using #WINDOW to do these things, because I completely change how it displays. Let say this is what your mud output looks like:
PROMPT>
[Newbie: Saet] blah blahb blah
PROMPT>
#TRIGGER {^~[Newbie: (%w)~] (*)} {#GAG;#WINDOW {Newbie} {~[Newbie: %1~] %2}}
This will send the exact same line to the newbie window and get rid of that blank line. You can make the line look anyway you want to though.
#TRIGGER {^~[Newbie: (%w)~] (*)} {#GAG;#WINDOW {Newbie} {%1 newbies, ~"%2~"}} (I really hope no mud has Someone newbies, "help")
Just use %1 for the name and %2 for the message. Your mud output will now look this:
PROMPT>
PROMPT>
I don't think anyone has figured out a reliable way to get rid of double prompts(if someone has please tell me), so I can end up with a whole screen of prompts if I've been idling. |
|
|
|
ksignorini Beginner
Joined: 04 Aug 2006 Posts: 12
|
Posted: Sat Aug 05, 2006 9:30 pm |
Thanks. Could you break this down a bit for me?
What's the %w?
What would I do if the line looks more like this:
[Newbie] Joe says blah blah.
Thanks,
Kent! |
|
|
|
saet Apprentice
Joined: 12 Jun 2006 Posts: 106
|
Posted: Sat Aug 05, 2006 9:45 pm |
%w matches any combination of alpha characters, but only them. Here is a list of all wild cards you can use: http://forums.zuggsoft.com/modules/mx_kb/kb.php?page=3&mode=doc&k=627
[ & ] are special characters so when matching them you use ~ in front them. Tilde makes anything that is a special character no longer so special.
^ makes sure it matches the pattern from the beginning of the line. So it won't match with Someone tells you: [Newbie] Joe says blah blah.
#TRIGGER {^~[Newbie~] (%w) says (*).} {#WINDOW {Newbie} {Whatever you want to send}}
When you put ( ) around something in a pattern it saves it to %1 through %99. So Joe will be saved to %1 and "blah blah" to %2.
Search through the help file it has a lot of good information. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Aug 06, 2006 6:37 am |
Quote: |
It works great, but my main window still scrolls by 1 line each time a Newbie line comes up (so I get a blank line printed in main window instead of the Newbie line which now goes into its own cap window).
|
#GAG doesn't generate new lines, so what you're seeing is a second carriage return from your mud for double-spacing and readability purposes. To dispose of it, you have two options:
1)use a multi-state trigger:
#trigger {newbie blah blah blah} {stuff}
#condition {^$} {#gag}
2)remove all blank lines completely:
#trigger {^$} {#gag} |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
ksignorini Beginner
Joined: 04 Aug 2006 Posts: 12
|
Posted: Sun Aug 06, 2006 6:52 am |
Thanks all! Fantastic information!
Kent! |
|
|
|
ksignorini Beginner
Joined: 04 Aug 2006 Posts: 12
|
Posted: Sun Aug 06, 2006 6:46 pm |
Using the multi-state, is:
#GAG
part of {stuff} in line 1? That is, should it look like this:
#CAP 1 Newbie
#GAG
#CONDITION {^$} {#GAG}
or like this:
#CAP 1 Newbie
#CONDITION {^$} {#GAG}
Because when I do it like the second example, the line gets pushed into the cap window but doesn't get gagged. If I do it like the first example, the line gets gagged but the carriage return doesn't (defeating the purpose of the CONDITION statement).
Also, a bit off topic, but everyone seems to give examples using:
#TRIGGER ......
Why would I type #TRIGGER .... in (and where) when I could just use the trigger editor in zMUD?
Kent! |
|
|
|
ksignorini Beginner
Joined: 04 Aug 2006 Posts: 12
|
Posted: Sun Aug 06, 2006 7:14 pm |
Nevermind..I feel stupid.
I know what I was doing wrong.
Thanks.
(That said, IS there an editor I can enter multiple lines of code in without doing it at the command prompt 1 line at a time?)
Kent! |
|
|
|
ksignorini Beginner
Joined: 04 Aug 2006 Posts: 12
|
Posted: Sun Aug 06, 2006 7:54 pm |
Oh boy. The second line, the condition, is only working about 1/2 the time.
The other half the time, the carriage returns STILL show up in the main window.
What's up?
Kent! |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Aug 06, 2006 10:41 pm |
Yes, there's an editor for working on long commands or large scripts. It's mostly a beefed up Notepad, and you can get to it by using CTRL-SHIFT-ENTER.
Quote: |
Also, a bit off topic, but everyone seems to give examples using:
#TRIGGER ......
Why would I type #TRIGGER .... in (and where) when I could just use the trigger editor in zMUD?
|
There are two ways to express scripts in ZMud:
1)the code way, meant for cutting and pasting directly into either the command line or the Text Editor:
#trigger {blah} {stuff}
#condition {blah} {stuff}
2)the UI way (you do not copy/paste the whole thing):
Trigger Pattern: blah
Value: stuff |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|