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
Threndil
Newbie


Joined: 09 Jan 2006
Posts: 9
Location: Guatemala

PostPosted: Sat Feb 09, 2008 3:21 am   

Question about logging a certain word
 
Hello,

I've been trying to develop a way to 'log' a certain name but I've failed entirely at it.
What I'm trying to do basically is when a person gives me gold I save that name and the name only.
I've saved them on variables but those go away after the next person gives me gold, so that's no good, and I've tried to keep it logged using #log, but it's too spammy. Full of unnecessary information.

I was hoping there was a way of saving the name only out of this trigger:

(%W) gives you 1,000,000 gold coins.

#VARIABLE name %1
%1 say Thank you, your name has been saved.

How do I save @name into a separate window/memory?

Thank you in advance,

Threndil.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Feb 09, 2008 5:04 am   
 
#TRIGGER {^(%w) gives you 1,000,000 gold coins.} {#FILE 1 goldgiver.txt;#WRITE 1 {%1};#CLOSE 1}

That'll create a file called "goldgiver" in your session folder. It'll write ONLY the name to the list. If you ever want to read it, you can do this:

#FILE 1 goldgiver.txt
#TYPE 1

There you go.

Charneus

Alternatlively, if you want to just make a variable out of it, just do #ADDITEM name %1 instead of #VAR name %1.
Reply with quote
Threndil
Newbie


Joined: 09 Jan 2006
Posts: 9
Location: Guatemala

PostPosted: Sat Feb 09, 2008 5:21 am   
 
Excellent! I hadn't seen #FILE.

That's exactly what I needed. Many thanks good person, this will work greatly.


Threndil.
Reply with quote
daemoan
Beginner


Joined: 04 Feb 2008
Posts: 23

PostPosted: Sat Feb 09, 2008 9:04 am   
 
on this can a tell recorder be bult the same way for the status window?

in status window I have
@tellwindow

then for the trigger i have
Example pattern: Snipe tells you 'ok test tell'.

pattern: %1 tells you %w
value: #ADDITEM tellwindow {(%1) %2}


will something like that work for tells? and the send em to status window for listing and view?


DaeMoan VerMillious
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Feb 09, 2008 4:35 pm   
 
A couple of things, DaeMoan.

You're better off just capturing it and putting it into it's own window instead of a status window. Second, the pattern you put for your tells is not correct. You don't want to use %1 in your patterns. It was never intended to work, and is actually considered a bug that it /does/ work. It just was never fixed. Anyway, here's what you may want to consider:

#TRIGGER {^%w tells you '*'.$} {#CAP tells}

Simple trigger, and it sends all tells to your "tells" window. And I'm assuming that the period at the end of your example pattern is supposed to be there.

If you /really/ want it to go to your status window, then use the following:

#TRIGGER {^(%w) tells you (*)$} {#ADDITEM tellwindow {~(%1~) %2}}

Now, while untested, it /should/ work. :P

Charneus
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