About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
saryon
Beginner


Joined: 27 Nov 2003
Posts: 13
Location: USA

PostPosted: Mon Dec 22, 2003 12:17 am   

Logging certain Lines to a file
 
Looking through the archives, and reading through the help files, I have come up with this as a trigger.

Pattern:
Code:
^~(In Character~) (*) [says][say] ~*~*~*(*)~*~*~*


Value::
Code:
#FI 1 "C:Zmud"%time( mm-dd-yy)".txt"
#write 1 %time( hh:nn:ss) ~(%1~) %2 %3 %4
#Close 2


It works wonderfully except that if the string has a word with a comma at the end of it,(such as that) it will stop the "logging" of that line to the file. Any help would be appreciated.

Matt
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Dec 22, 2003 2:20 am   
 
Put {} around the text being written.
#WRITE 1 {%time( hh:nn:ss) ~(%1~) %2}

You have some other mistakes.
  • You open file 1 but close file 2. Unless you are using file 1 for other purposes, you don't really need to close it until the end of a session. But if you are going to close it, you have to close 1

  • Your pattern has [says][say]. These both match exactly the same set of characters and will match any number (starting with one) of those characters. [asy] is all that's needed to match either "say" or "says"

  • Your pattern only has parentheses around two sections (the two * wildcards) so only %1 and %2 are defined. Your value also uses %3 and %4, but these are meaningless and can (and should) be removed.
  • Reply with quote
    saryon
    Beginner


    Joined: 27 Nov 2003
    Posts: 13
    Location: USA

    PostPosted: Mon Dec 22, 2003 7:13 am   
     
    Thank you much for your help. It works perfect now.

    I was unknowing of the syntax of the matching scheme and the extra variables were for something I was trying when trying to get it to recognize stuff after the comma.

    Thanks again.
    Matt
    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