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


Joined: 15 Nov 2005
Posts: 8

PostPosted: Thu Nov 17, 2005 10:39 am   

Advanced zMud Triggers (Multi-Line Channel)
 
Alright, I've been working on this for quite some time.

I can get zMud to smoothly capture two lines without error using States and line1 being the regular with no " and line2 being a *" that occurs within one line.

A second method I've done the same thing is with using Trigger: ChannelInfowith*'s%if("%rightback(%-1,1)" = ~",,^(*)$)

Now that works just fine but trying to expand it past two lines I'm running into errors and until just a bit ago I realised why the %rightback is having error. I was taking it up to 5, 6 and 7 %rightbacks in the triggerline but it dawned on me what each one of those things is just a newline*endline so until it gets to that last amount of data to fill that then it just keeps going and filling variables until the trigger is satisfied and then #window the %0 of it all.

Any ideas to keep this going for more then two lines? While I'd like something more dynamic the 10 nested things if 10 nested things are the only way to get the job done then thats what I'll have to use.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Nov 20, 2005 5:30 pm   
 
You might need to use two separate, single-state triggers, like so:

#trigger {the start of your tell, "(*)} {#if (%ends("%1",~")) {#noop single-line tell} {#noop multiline tell or wonky message (ie, GM send typo);#T+ tMultiLineTells};TellText = "";TellText = %left("%1",%eval(%len("%1") - 1)}

#trigger "tMultiLineTells" {(*)} {TellText = %concat(@TellText,%left("%1",%eval(%len("%1") - 1));#if (%ends("%1",~")) {#noop end of tell;#T- tMultiLineTells} {#noop more lines to come}}
_________________
EDIT: I didn't like my old signature
Reply with quote
luggage
Novice


Joined: 20 Jul 2004
Posts: 38
Location: Australia

PostPosted: Sun Dec 04, 2005 11:51 am   
 
Heh. I had a similar problem with my communication windows...
Until I set the colour in the mud of any comm line to reverse video as almost nothing else in the mud is reverse video, then created a colour trigger for the reverse video to capture to my comm window, after which I recoloured it in the comm window to whatever colour I wanted that comm line to be in.
If your mud generates a bit of output the same colour as what you are triggering on, you might need to create an exemption list as well in the capture part.

Luggage
Reply with quote
bushd
Newbie


Joined: 15 Nov 2005
Posts: 8

PostPosted: Mon Dec 05, 2005 6:11 pm   
 
Code:

#CLASS {Illusion|Communication}
#VAR lastchancolor {1}
#VAR moreLines {0}

#TRIGGER "CaptureChan1" {^~((*)~): (*), ~"(*)$} {#va moreLines 0;#if (@lastchancolor) {#va lastchancolor 0} {#va lastchancolor 1};#if ("%rightback( %3, 1)" == "~"") {#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))[%time( hh:mm:ss)] %0};#state CaptureChan1} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))[%time( hh:mm:ss)] %0}}}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}

#TRIGGER "CaptureChan2" {^You tell (*), ~"(*)$} {#va moreLines 0;#if (@lastchancolor) {#va lastchancolor 0} {#va lastchancolor 1};#if ("%rightback( %2, 1)" == "~"") {#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))[%time( hh:mm:ss)] %0};#state CaptureChan2} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))[%time( hh:mm:ss)] %0}}}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan2;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan2;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan2;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}

#TRIGGER "CaptureChan3" {^(*) tells you, ~"(*)$} {#va moreLines 0;#if (@lastchancolor) {#va lastchancolor 0} {#va lastchancolor 1};#if ("%rightback( %2, 1)" == "~"") {#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))[%time( hh:mm:ss)] %0};#state CaptureChan3} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))[%time( hh:mm:ss)] %0}}}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan3;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan3;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan3;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#COND {(*)$} {#if (@moreLines) {#va moreLines 0;#if ("%rightback( %0, 1)" == "~"") {#state CaptureChan3;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}} {#va moreLines 1;#window Communication {%ansi( %if( @lastchancolor, "high,yellow", "high,cyan"))---------- %0}}}} {within|param=1}
#CLASS 0
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