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
snoogans
Novice


Joined: 28 Oct 2001
Posts: 43
Location: USA

PostPosted: Thu Sep 26, 2002 7:07 am   

logging on a trigger
 
I want a trigger to log just the line it triggered off of, currently i have a trigger that triggers on

^~[CLAN~] *

to capture to a new window, i also want to log this to a file. Is there a way i can do this?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 26, 2002 5:26 pm   
 
See #WRITE

LightBulb
Senior Member
Reply with quote
cingulli
Wanderer


Joined: 30 Aug 2001
Posts: 53
Location: Finland

PostPosted: Thu Sep 26, 2002 6:29 pm   
 
and maybe %line
Reply with quote
snoogans
Novice


Joined: 28 Oct 2001
Posts: 43
Location: USA

PostPosted: Thu Sep 26, 2002 7:48 pm   
 
quote:

write

Syntax: %write(i,s,rec)

write string s to the ith file at record rec. For text files, rec is ignored and s is appended to the file. If rec is 0, s is written to the end of the file.


That is all i found in the help files, and i found noting on %line ... If i just do
%write(file) will that log the whole line?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 26, 2002 7:55 pm   
 
Who said anything about %write?

From the helpfile
(quote)
WRITE

Syntax: #WRI n value [rec]
Related: #READ

Write a value to the nth file. If n is 1-5 then the file is a text file, and the value is appended to the end - rec is ignored. If n is 6-10, then the file is structured, and value is written to the record given by rec. If rec is zero or omitted, value is appended to the file.

WRITE examples

#WRI 1 {logged onto Dark Castle}

append the string to the end of text file number 1.

#WRI 6 {this is record 3} 3

writes the string as the third record in file 6.
(endquote)

You'll probably also need to look at #FILE. You'll find both #FILE and #WRITE in the index under "commands". An easier way is to use the Contents, where they'll be under the booklet "Commands".
%line is a predefined variable, it's listed in the helpfile for predefined variables.

LightBulb
Senior Member
Reply with quote
Glinka
Wanderer


Joined: 20 Dec 2000
Posts: 53
Location: USA

PostPosted: Sat Sep 28, 2002 2:19 am   
 
~[CLAN~](*)
#file 1 clan.txt
#write 1 %1
#close 1

Love, Lyte, and Laughter...
Glink
Reply with quote
snoogans
Novice


Joined: 28 Oct 2001
Posts: 43
Location: USA

PostPosted: Wed Jan 22, 2003 1:17 am   
 
Okay i know this is a really old topic but i could never quite get it to work and just gave up =/ Glinka has the right idea except i want to capture the whole line not just %1 with a trigger that does

#file 1 stuff.txt
#write 1 %line
#close 1

It logs "Opened stuff.txt as file 1" Anyone know how i could do this? the trigger has to open and close the file itself because i want to write to the same file from more than one window.
Reply with quote
snoogans
Novice


Joined: 28 Oct 2001
Posts: 43
Location: USA

PostPosted: Wed Jan 22, 2003 1:38 am   
 
#file 1 stuff.txt
#write 1 %line2
#close 1

This logs the line correctly but it echoes the file opening and closing to the mud everytime. Is there any way to circumvent that without turning off echo's?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jan 22, 2003 2:21 am   
 
#FILE 1 stuff.txt
#GAG
#WRITE 1 %trigger
#CLOSE 1
#GAG

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jan 22, 2003 8:43 am   
 
Since you are capturing this to a new window (according to the first post), why not just run a logfile from there?
(Using CLAN as the window name)
#AL atconnect {#WINDOW CLAN;:CLAN:#LOG stuff.txt}

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