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
mdeming
Beginner


Joined: 08 Jul 2002
Posts: 10

PostPosted: Thu Jul 11, 2002 12:26 am   

Capturing Text
 
Hi again. This time I'm trying to capture whispers while I'm AFK. I want to save them into a database that I can view later. The output appears as:
Bob whispers "How are you today?" to Ted.

I made a database called 'Whispers'. I created columns "WhoSaid", "WhoHeard", and "What".

I then made the trigger to match the pattern:
&Said whispers "&What" to &Heard.
The trigger had the value of:
#ADDKEY Whispers {WhoSaid=&Said|WhoHeard=&Heard|What=&What}

Unfortunately the data isn't being saved to the database as hoped. Suggestions/Corrections? (Note: I've also tried it with quotes around the variables.)
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Thu Jul 11, 2002 1:07 am   
 
Try
#ADDKEY Whispers {WhoSaid=@Said|WhoHeard=@Heard|What=@What}

The ampersand (&) is used to assign variables as part of a trigger pattern while @ is used to access them.

Better yet, unless there is some reason to store them in variables, do

#trigger {(%w) whispers "(%*)" to (%w).} {#ADDKEY Whispers {WhoSaid=%1|WhoHeard=%2|What=%3}}

Note, this will need to be changed if you want to capture names that aren't single words or have anything besides letters in them.

 - Charbal
Reply with quote
mdeming
Beginner


Joined: 08 Jul 2002
Posts: 10

PostPosted: Thu Jul 11, 2002 1:19 am   
 
The current setup:
#ADDKEY Whispers {WhoSaid=@Said|WhoHeard=@Heard|What=@What}

Stored the values of the variables into the 'data record' of the variable 'Whispers' (which zmud created on its own). So I've managed to capture the text but still can't get it into the database as I'd like to.
Reply with quote
mdeming
Beginner


Joined: 08 Jul 2002
Posts: 10

PostPosted: Thu Jul 11, 2002 1:21 am   
 
Furthermore, the text isn't captured correctly in a long whisper because there is a word wrap. Is there a way to adjust the trigger so that it captures all the text?
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Thu Jul 11, 2002 2:13 am   
 
Figures.... I don't use the database often enough and I just copied your commands without checking. What you need is:

#NEW Whispers {WhoSaid=@Said|WhoHeard=@Heard|What=@What}

or

#trigger {(%w) whispers "(%*)" to (%w).} {#NEW Whispers {WhoSaid=%1|WhoHeard=%2|What=%3}}


 - Charbal
Reply with quote
mdeming
Beginner


Joined: 08 Jul 2002
Posts: 10

PostPosted: Thu Jul 11, 2002 6:11 pm   
 
This isn't working correctly.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 11, 2002 7:05 pm   
 
Assuming you have created a database with these fields and opened it as the current database this should work, since there's always an "All" view.
#trigger {(%w) whispers "(%*)" to (%w).} {#NEW All {WhoSaid=%1|WhoHeard=%2|What=%3}}
You may have to make the first entry by hand.

LightBulb
Senior Member
Reply with quote
mdeming
Beginner


Joined: 08 Jul 2002
Posts: 10

PostPosted: Fri Jul 12, 2002 5:51 pm   
 
Alright. I hate to be a pain in the ass. I really appreciate all the help so far. The problem I'm having now is that the DB is getting two blank lines in between each line of input. Any idea why?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jul 13, 2002 2:56 am   
 
Yes, because something in your script is sending it two blank lines.

However, you are the only one who can actually look at your entire script (all triggers, aliases, buttons, macros, etc) or use the debugging system. So you are the one who will have to search through it and find the specific setting that's the problem.

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