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


Joined: 11 Apr 2005
Posts: 2

PostPosted: Tue Apr 12, 2005 4:15 pm   

Making A Multiline Command Trigger
 
Alright, so I was fooling around with a 'hypnosis' script. Keep in mind that I am new at this. Anyways, the parts are something like this:
#ALIAS HYP {tell @hypnotarget you feel compelled to:}
#VAR HYPNOTARGET {zugg} {zugg}
(From Zugg's view}
#TRIGGER {Xhado tells you, "You feel compelled to: %1."} {%1}

Now, this script works for short things, like 'HYP JUMP', and Zugg would jump. But if I send a command that is longer than one line received on the mud, the command doesn't go through at all, as the outside quotation marks are on a different line, and the pattern needs to match inside and outside quotations. If any of you know how to match ALL characters between point A and point B, regardless of how many lines are in between, it would be greatly appreciated. This trigger also requires that the second party, in this case Zugg, have the '#TRIGGER' command on their system. It's a playful script... if you and a friend want to roleplay being hypnotised. Thanks for any help.
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Tue Apr 12, 2005 5:17 pm   
 
Multiline triggers which can break anywhere are always tough to do.
The script below should be real close and can handle up to two lines. I cant test it from where I am now... the only thing I am not sure on is the ~" for escaping a double quote.

Code:
#TRIGGER {Xhado tells you, "You feel compelled to: (*)} {#IF (%ends(%1,".~"")) {%leftback(%1,2)} {#VAR holdline {%1};#TEMP {^(*)$} {%leftback(@temp%1,2)}}}
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