Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Sun Mar 25, 2007 12:24 am   

#capture
 
I am wondering what I can do to capture mulitple lines from a mud.
I have a simple trigger

pattern
says:

script
#cap talking

this is what I see

Quote:
121/121hp 130/130vp > help dragon
A small nymph guide says: So you wish to know more about the Dragons?
Dragons are rather massive creatures and believe me, you do not want to get on
a dragon's bad side. When Dragons are born, they are called Drakes. They are
fully formed Dragons, only in their infantile stage. Although a Drake's wings
are not usually strong enough yet to support them in flight, they can be used
to blow a foe away, literally!



121/121hp 130/130vp >


all it will capture is this

Quote:
A small nymph guide says: So you wish to know more about the Dragons?


My question is how do i get it to copy more then one line. Thanks in advance
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Mar 25, 2007 12:49 am   
 
Option 1)
set your mud's wordwrap column to either off or as some astronomically high number. This will prevent the game from wrapping text and allow CMud to handle it. When CMud handles the wrapping, triggers perform on the text as though it's all on one line. Amazingly easy solution, not always available in MUDs that have wordwrapping.

Option 2)
a)create #trigger to match the start of the say. This trigger will take the speech part and assign it to a variable, and will enable the trigger mentioned in part C.

b)create #condition for the trigger you created to match some ending boundary (in your case, it would either be a blank line or your prompt). This condition will send the variable used in part A to the appropriate place (in your case, a window named "talking") and turn off the trigger mentioned in C. May optionally clear or delete the variable as well, but it's not required.

c)create a second #trigger with a pattern of (*) and an id. This trigger will %concat() the pattern (%1) to the end of the variable mentioned in part A and do nothing else.
_________________
EDIT: I didn't like my old signature
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Mar 25, 2007 12:51 am   
 
This is because you're triggering on only a single line. One way I handle this is to turn on a capture trigger when I get the pattern. Then turn off the trigger when I get the prompt. So in your case I would do this.

Code:
#trigger {says:} {#t+ says;#T+ saysp}
#trigger "saysp" {^%d/%dhp} {#t- says;#t- saysp}
#trigger "says" {*} {#capture talking}


Copy those and paste them into the command line.

Edit: Ha! Matt beat me to it.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Sun Mar 25, 2007 1:02 am   
 
Thanks a bunch that worked great
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Sun Mar 25, 2007 1:23 am   
 
just curious shouldnt this work then? there are several other I want to add


asks,
exclaims,
says,

I changed the says: to says, shouldnt it work?
Quote:

#trigger {says,} {#t+ says;#T+ saysp}
#trigger "saysp" {^%d/%dhp} {#t- says;#t- saysp}
#trigger "says" {*} {#capture talking}
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Mar 25, 2007 1:37 am   
 
It should but, if you are going to trigger multiple patterns why not do this?
Open this trigger up in the trigger editor
#trigger {says:} {#t+ says;#T+ saysp}
And replace the says: with {says:|says,|exclaims,|asks,}

Of course you can also just make multiple triggers. One for says: one for says, one for asks, ect.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
dravond
Beginner


Joined: 02 Apr 2006
Posts: 20

PostPosted: Sun Mar 25, 2007 1:58 am   
 
ah When I copied and pasted it from my wordpad it added spaces
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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