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
Glinka
Wanderer


Joined: 20 Dec 2000
Posts: 53
Location: USA

PostPosted: Sun Sep 15, 2002 4:15 pm   

losing last word on a logfile...? lil help please?
 


Hihi all,

I'm trying to do this...

"Talar offers you a large ruby."

....take this msg and stick it in a log file.

here is my trigger.
(%w) offers you (*)

and here is my command
#write 1 %1 's gift: %2


so it should go into the log like this...

Talar 's gift: a large ruby.

however I'm losing the last word of every entry...
any ideas?

thanks for any help,
Glink
redsun001@aol.com

Love, Lyte, and Laughter...
Glink
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Sep 15, 2002 5:38 pm   
 
From the help for #WRITE
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.



So that means that the parser is taking ruby in your example and trying to use it record number for the command. Using the proper syntax "#write 1 {%1 's gift: %2}" will fix this problem.
Reply with quote
Glinka
Wanderer


Joined: 20 Dec 2000
Posts: 53
Location: USA

PostPosted: Mon Sep 16, 2002 3:59 pm   
 
sorries..it didn't work..
tried on prompt, and newline, tried puttin brackets everywhere...

just cant figger it out..

Thanks for any help folks..
Glink
redsun001@aol.com

Love, Lyte, and Laughter...
Glink
Reply with quote
Glinka
Wanderer


Joined: 20 Dec 2000
Posts: 53
Location: USA

PostPosted: Tue Sep 17, 2002 5:33 am   
 
dunno if this will help anyone else but...


here is how i worked around it..
trigger pattern (%w) offers you(*).
value #write 1 %1 ....%2

i had to leave a space after the (%w) to match
the space in the mudtext. also..a capital W
seemed to make things weird.

I had to put the (*) ryte behind the word "you" so it would include any spaces..

also added a period after the (*) so now the only thing that gets lost is the period.

so now the logfile looks like this...
************************************
__text from MUD__

Talar offers you a large rainbow diamond.

__text in logfile__

Talar....a large rainbow diamond

hope this helps someone...
i use this to keep track of gifts, but could be used for other purposes..

Love, Lyte, and Laughter,
Glink

Love, Lyte, and Laughter...
Glink
Reply with quote
YZilla
Beginner


Joined: 24 Jun 2002
Posts: 24
Location: Canada

PostPosted: Tue Sep 17, 2002 11:36 pm   
 
Try..

(%w) offers you (*)$

It should force zMUD to capture every thing in the line following "you".

- This signature intentionally blank -
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