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


Joined: 07 Apr 2007
Posts: 2

PostPosted: Sat Apr 07, 2007 9:43 pm   

Capture multi line to single line
 
(name) is in (place).
In the (place2), direction: (direction)
In the room: (room name).

I want to make a trigger which would capture lines, 1 and 3, sometimes line 2.

I want something similiar to :
#say (name) at (place) in (room name)

Line 2 only appears sometimes, if it does I would want it to:
#say (name) is at (place) in (room) the (place2) (direction) of me.
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sat Apr 07, 2007 10:04 pm   
 
Code:


#trigger {{@name} is in {@place}} {}
#cond {In the {@place2}, direction~:{@direction}} {}
#cond {In the room~:{@roomname}} {info}
#alias info {#say @name is in @place In the @place2: @direction In the room: @roomname.}
#var name {} {}
#var place {} {}
#var place2 {} {}
#var direction {} {}
#var roomname {} {}



It should capture all the things you need into variables, then once it sees the last conditional line, it will hit info alias which will give all the info into a single line via #say. I'm not sure if it will work, its supposed to be just a raw idea of how it should work. Play around with it.


Prog
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Apr 07, 2007 10:39 pm   
 
The first condition will hang the trigger, Prog. He'll probably have to make that one a Within Lines type (though I'm not sure if it just moves on or resets the trigger if it doesn't appear), or barring that removing it entirely from the multi-state trigger and making it a separate trigger (which is always enabled with the first state and disabled with the second state.)
_________________
EDIT: I didn't like my old signature
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sat Apr 07, 2007 10:53 pm   
 
Yeah, was just about to edit my original message to say that it doesn't work, just tried it out myself. However, I think that within lines type might work. Didn't think about states myself though, multiline trigger with conds was the first idea I got.


Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
anticon0442
Newbie


Joined: 07 Apr 2007
Posts: 2

PostPosted: Sun Apr 08, 2007 2:06 am   
 
When I change the state to within line my mud just crashes, I'm using 7.21 also.
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