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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Dec 03, 2004 4:18 pm   

Multi-Line Capture Triggers for any Mud
 
The Easiest way to capture lines is to hope your mud has some way to disable wordwrapping and just let Zmud do the wrapping, But for some reason Mud coders think this must be something that is hard too doo? Maybe if any mud coders watch this forum they can explain why but until then here are some triggers to capture a Multi-Line channels.

NOTE: Please pick the Example closely related to your mud If you need more help please create a NEW topic in the Zmud general forum with mud output examples.
As always these scripts are meant to be entered in the command line (where you type mud commands), Will NOT work with zmud versions that do not support #COND triggers. And are not guaranteed to work on versions prior to 7.0

Complexity Rating: 3 of 10 (10 being most complex)

EXAMPLE 1:
Desc: My tell Always ends with some form of punctuation (adjust pattern accordingly example uses ')
Note1: Throughly tested to insure accuracy
Note2: Only works correctly on channels that END with some form of punctuation.

#TRIGGER "CapTell" {%x tells you, '(*)} {
#CAP Tells
#IF (%ends( "%1", "'")) {#STATE CapTell 0} {#STATE CapTell 1}
}
#COND {(*)} {
#IF (!%null( "%1")) {
#IF (%ends( "%1", "'")) {
#CAPTURE tells
#STATE CapTell 0
} {
#CAPTURE tells
#STATE CapTell 1
}
} {#STATE Captell 0}
} {manual}

Now obviously if it could change to any number of differant punction we need to change this:
#IF (%ends( "%1", "'")) {
To something like this (Make the changes in both locations)
#IF (%ends( "%1"."?") OR %ends( "%1", ".") OR %ends( "%1", "!")) {


EXAMPLE 2:
Desc: My Chat donesn't have Punction but all channels are followed by a blank line

#TRIGGER "CapChat" {~[Chat~] %w:*} {#CAP Chat}
#COND {(*)} {#IF (!%null( "%1")) {#CAP chat} {#STATE CapChat 0}}

EXAMPLE 3:
Desc: Mud Indent 1 space on multi line chats, Originally posted by Danlo
Note: Due to forum space stripping trigger adjusted, just add more spaces betwwen ^ * in the #COND trigger depending on indent

#TRIGGER {(%w) tells you: *} {#CAPTURE TellHist %line}
#COND {%match(%line,"^ *$")} {#CAPTURE TellHist %line} {loopexp|param=2}

There are Many ways to do this ......
More Examples to come Soon
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Hera
Newbie


Joined: 15 Feb 2005
Posts: 3

PostPosted: Tue Feb 15, 2005 10:07 am   Wrap at 70 Characters
 
As a mud founder, I can tell you why most muds wrap at 70 characters wide. Telnet allows text 70 characters wide. Most mud admins want their muds to be usable by as many players as possible no matter what client they are using to connect.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Feb 15, 2005 9:54 pm   
 
Blah ok sometimes I have a bad habit of not fully explaining the situtation in a true sentance type structure :P.
It should have actually have read more like:

With the advent of all these fancy Mud clients to make life easier, Why don't more modes code in a way to *DISABLE* wordwrap on a certarin group of things, like Channels (says - chats - emotes), Prompt, and Room Descs? And then just have mud side worwrapping on by default.
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Thu Feb 17, 2005 12:22 pm   
 
Coming from a SMAUG Background:

Never really looked at channel wrapping. never been a problem. I just checked and my trigger


You ask 'omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRY'

#TRIGGER {(*) ask* '(*)'} {#Capture Channels}

Worked fine and got all of it
Code:

You ask 'omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRYomgineedtotestSORRYomgineedtotestSORRY
omgineedtotestSORRY'


As for room descs they aren't word wrapped as they are processed.

This isn't an issue that normally comes up :P Hehe

[edit: Edited to not mess up page format -k]
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Sat Nov 22, 2014 12:51 am   
 
Does anyone know how I would make this capture something like this where there is no " on the first line to start a detection of an ending " (the " starts on the NEXT line :()?

like this
Code:
The tiny, glassy-eyed kitten sends you a telepathic message:
     "I like fisheses."
Reply with quote
kittyfish
Novice


Joined: 20 Sep 2011
Posts: 37

PostPosted: Sun May 31, 2015 2:00 pm   
 
I never got a reply to this if anyone can maybe help it would be awesome
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun May 31, 2015 7:44 pm   
 
Typically each 'problem' gets its own thread, I imagine it was lost because you kinda hijacked this thread.
Furthermore, this thread is also in the wrong section, Its called Finished cause its just for sharing, not for getting answers, but that was the OPs mistake.

Based on this information I would use something like:

#TR {(*) sends you a telepathic message:} {#CAP someWindow}
#COND {"(*)"} {#CAP someWindow}
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts 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