Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Yourmom
Beginner


Joined: 06 Jan 2003
Posts: 10

PostPosted: Mon Jan 06, 2003 12:55 pm   

Capturing Lines with Timestamps
 
I currently use a trigger to capture lines from my mud such as "abc tells you blah blah blah" to a window called "Tells" and lines like "abc oocs blah blah blah" to a window called "ooc". I wanted to add timestamps, and I have managed to make the trigger add a timestamp everytime it captures. The problem is, the timestamp appears on the line AFTER the captured text. Not only is this ugly and harder to read, it also takes twice as many lines up, and in a long mud session, that's not a good thing.

I'm wondering if anyone knows how to make it so it appears as:
hh.mm.ss: abc oocs blah blah blah

Instead of:
abc oocs blah blah blah
hh.mm.ss

Thanks everyone!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jan 06, 2003 2:19 pm   
 
Try posting the triggers you already have. Basically, if you are using #CAPTURE, you are going to have to use #WINDOW or execute a #SH command in the other window.

Kjata
Reply with quote
Yourmom
Beginner


Joined: 06 Jan 2003
Posts: 10

PostPosted: Mon Jan 06, 2003 5:31 pm   
 
My trigger text is:
tells you

It returns the value:
#echo Time:%time( hh:nn:ss)
#CAP 2 tell

I'm not sure how to use the #win command since I don't know how to put long strings (more than a word) in variables.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Jan 06, 2003 6:00 pm   
 
This should do it:
#TR {tells you} {#CAP tell}
#AL atconnect {#WIN tell;:tell:#TR {*} {#SUB {%time(hh:nn:ss) %trigger}}}

You'll need to reconnect to your MUD for the second trigger to take effect.

LightBulb
Senior Member
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jan 07, 2003 4:54 am   
 
When you want to work with long strings you simply surround them with some sort of bracket or quotes.

"this is a test of the %1 system"

The double-quotes are used in the same fashion as the curly brackets, but in general quoted text is not parsed (note that some commands will still let things within quotes get parsed). In places where you cannot use double-quotes, single quotes should work equally well.

#trigger {@oldmessage} {#sub "@newmessage"}

This trigger SHOULD replace whatever text was in @oldmessage with the phrase "@newmessage".

{this is a test for @name}
These curly brackets are used exclusively for grouping data together into one entity that you desire to have parsed, or evaluated to a literal form.

#trigger {@oldmessage} {#sub {@newmessage}}

This trigger will replace whatever was displayed on-screen in @oldmessage with the data in @newmessage (the variables' data does not change in any way).

[this is a test for @name]

These square brackets can probably be interchanged with the curly brackets, but that's not usually how they are used in relation to strings. Instead, you use them to force ZMud to evaluate the given expression contained within BEFORE it does any other parsing on that line. I don't much use these square brackets in this way, so I have no clue what a good example might be.

HTML brackets (greater-than symbol and less-than symbol)

The HTML brackets, in relation to strings, are used to force expansion. What this means is that any and all parsing action is executed for that particular expression before it gets done for the rest of the line. Again, I don't use the HTML brackets very much this way.

li'l shmoe of Dragon's Gate MUD
Reply with quote
Yourmom
Beginner


Joined: 06 Jan 2003
Posts: 10

PostPosted: Tue Jan 07, 2003 5:42 am   
 
Thanks for all the responses...

Lightbulb, your trigger worked for tells, but I can't make it work for my other similar triggers like ones that trigger on "ooc" and "replies" and "questtalks" and stuff like that. How do I modify it to make it work for those too?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jan 07, 2003 6:00 am   
 
Make sure the desired window is open when you connect (that's what the #WIN commands are for), then just add another line to the alias for each window where you want the trigger. I assume you already have the triggers to do the captures.
#AL atconnect {#WIN tell;:tell:#TR {*} {#SUB {%time(hh:nn:ss) %trigger;#WIN OOC;:OOC:#TR {*} {#SUB {%time(hh:nn:ss) %trigger;#WIN replies;:replies:#TR {*} {#SUB {%time(hh:nn:ss) %trigger;#WIN questtalks;:questtalks:#TR {*} {#SUB {%time(hh:nn:ss) %trigger}}}

LightBulb
Senior Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net