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
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Tue Oct 02, 2007 2:28 am   

Help with chatline trigger please...
 
I have a set of triggers that I'm just having a whole world of troubles with.

They work.... mostly.. except one of the problems I'm having, is that it forces extra lines to the chats window, and if I use SAYPROMPT, it will tab the 2nd line to the right half of the screen, and it won't wrap it.. Setting up a #gag trigger on the chats window, just blanks out the next line that's supposed to actually go there....

I've spoken already to the person who originally created this script, and he did it so long ago, he doesn't remember anymore... Could anyone help please? Or possibly show me a much easier way to do this?

I've scanned the completed scripts, and none are efficient as this one, or don't handle multiple lines/etc.

I've got multiple chatlines, and each chatline is automatically wrapped at 80chars(or 72 which I currently have it set at), and contain multiple lines in a single tell


What I currently have is this.

#CLASS {chatlines}
#REGEX {(?:> )?([(?:Mage\(\d+\)|Arch Mage|High Arch)] [A-Z][a-z]+ : .*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow)"%1"};:Guild:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow)"%1"}} "" {disable}
#REGEX {(?:> )?((?:You tell [A-Z][a-z]+|[A-Z][a-z]+ tells you): .*)$} {#BEEP;:chats:#SAY {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, red)"%1"};:tells:#SAY {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, red)"%1"}}
#COND {^ (.*)$} {:chats:#SAY {%ansi( hi, red)"%1"};:tells:#SAY {%ansi( hi, red)"%1"}} {looplines|param=5|prompt|regex}
#REGEX {(?:> )?((?:You LT|[A-Z][a-z]+ LTs) \(.*\))$} {#BEEP;:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, red)"%1"};:tells:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, red)"%1"}}
#COND {^(?: LT: | )(.*)$} {:chats:#SAY {%ansi( white)" %1"};:tells:#SAY {%ansi( white)" %1"}} {looplines|param=5|prompt|regex}
#TRIGGER {~-~-~<~@ (%w) ~@~>~-~- (*)} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, green, red)"~-~-~<~@ %1 ~@~-~-"%ansi( yellow)" %2"};:Other:#SAY {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, green, red)"~-~-~<~@ %1 ~@~-~-"%ansi( yellow)" %2"}}
#TRIGGER {(%w)~[NEX~] : (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( green)"%1[NEX] : %2"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( green)"%1[NEX] : %2"}}
#COND {^ (*)$} {:chats:#SAY {%ansi( green)" %1"};:Other:#SAY {%ansi( green)" %1"}} {looplines|param=5}
#TRIGGER {~[Clan~] (%w) : (*)$} {#BEEP;:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, blue)"~[Clan~] %1: "%ansi( hi, red)"%2"};:ClanWorld:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, blue)"~[Clan~] %1: "%ansi( hi, red)"%2"}}
#COND {^ (*)$} {:chats:#SAY {%ansi( hi, red)"%1"};:tells:#SAY {%ansi( hi, red)"%1"}} {looplines|param=5}
#TRIGGER {(%w) ~<ALPHA Uplink~>: (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, yellow, blue)"%1 ~<ALPHA Uplink~>:"%ansi( yellow)" %2"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, yellow, blue)"%1 ~<ALPHA Uplink~>:"%ansi( yellow)" %2"}}
#COND {^ (*)$} {:chats:#SAY {%ansi( yellow)"%1"};:Other:#SAY {%ansi( yellow)"%1"}} {looplines|param=5}
#TRIGGER {newb (%w) ~[(%w)/(%d)~]: (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( black, white)"newb %1 ~[%2/%3~] :"%ansi( yellow)" %4"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( black, white)"newb %1 ~[%2/%3~] :"%ansi( yellow)" %4"}} "" {disable}
#COND {^ (*)$} {:chats:#SAY {%ansi( yellow)"%1"};:Other:#SAY {%ansi( yellow)"%1"}} {looplines|param=5|disable}
#TRIGGER {newb (%w) ~[(%w)~]: (*)$} {#BEEP;#IF ((%lower( %2)="newbie") OR (%lower( %2)="wizard")) {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( black, white)"newb %1 ~[%2~]:"%ansi( yellow)" %3"}};#IF ((%lower( %2)="newbie") OR (%lower( %2)="wizard")) {:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( black, white)"newb %1 ~[%2~]:"%ansi( yellow)" %3"}}} "" {disable}
#TRIGGER {(%w) ~[HELPER~]: (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, red)"%1 ~[HELPER~]:"%ansi( yellow)" %2"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, red)"%1 ~[HELPER~]:"%ansi( yellow)" %2"}} "" {disable}
#COND {^ (*)$} {:chats:#SAY {%ansi( yellow)"%1"};:Other:#SAY {%ansi( yellow)"%1"}} {looplines|param=5|disable}
#TRIGGER {(%w) ~-~=PK~=~-: (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( black, red)"%1 ~-~=PK~=~-"%ansi( white)" %2"};:pkstuff:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( black, red)"%1 ~-~=PK~=~-"%ansi( white)" %2"}} "" {disable}
#COND {^ (*)$} {:chats:#SAY {%ansi( white)"%1"};:pkstuff:#SAY {%ansi( black, red)"%1"}} {looplines|param=5|disable}
#TRIGGER {~[Portal: (%w)~] (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( blue)"~["%ansi( hi, cyan)"Portal : "%ansi( hi, green)"%1" %ansi( blue)"~]"%ansi( yellow)" %2"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( blue)"~["%ansi( hi, cyan)"Portal : "%ansi( hi, green)"%1" %ansi( blue)"~]"%ansi( yellow)" %2"}} "" {disable}
#COND {^ (*)$} {:chats:#SAY {%ansi( yellow)"%1"};:Other:#SAY {%ansi( yellow)"%1"}} {looplines|param=5|disable}
#TRIGGER {~[PARTY~] (%w): (*)$} {#BEEP;:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow, red)"~[PARTY~] %1:"%ansi( hi, white)" %2"};:tells:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow, red)"~[PARTY~] %1:"%ansi( hi, white)" %2"}}
#COND {^ (*)$} {:chats:#SAY {%ansi( white)"%1"};:Other:#SAY {%ansi( white)"%1"}} {looplines|param=5}
#TRIGGER {~[Sorcerer~] (%w) : (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow)"~[Sorcerer~] %1 : %2"};:Guild:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow)"~[Sorcerer~] %1 : %2"}} "" {disable}
#TRIGGER {~[Arena Chat~] (%w): (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow, cyan)"~[Arena Chat~] %1 :"%ansi( white)" %2"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow, cyan)"~[Arena Chat~] %1 :"%ansi( white)" %2"}}
#COND {^ (*)$} {:chats:#SAY {%ansi( white)"%1"};:Other:#SAY {%ansi( white)"%1"}} {looplines|param=5}
#TRIGGER {(%w) ~>~>BOOK~>~> (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, blue)"%1"%ansi( hi, red)" ~>~>BOOK~>~> "%ansi( hi, blue)"%2"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( hi, blue)"%1"%ansi( hi, red)" ~>~>BOOK~>~> "%ansi( hi, blue)"%2"}}
#TRIGGER {From afar, (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( green, blue)"%1"}} "" {disable}
#TRIGGER {(%w) ~<(*)~>: (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( black, green)"%1 ~<%2~>:"%ansi( white)" %3"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( black, green)"%1 ~<%2~>:"%ansi( white)" %3"}}
#COND {^ (*)$} {:chats:#SAY %ansi( white)"%1";:Other:#SAY %ansi( white)"%1"} {looplines|param=5}
#TRIGGER {(*) ~-~=~(OMP~)~=~- (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( red, blue)"%1~-~=~(OMP~)~=~-:"%ansi( white)" %2"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( red, blue)"%1~-~=~(OMP~)~=~-:"%ansi( white)" %2"}}
#TRIGGER {(%w)~((*)~) (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow)"~[Clan Shout~] %1(%2) "%ansi( hi, white)"%3"};:ClanWorld:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow)"~[Clan Shout~] %1(%2) "%ansi( hi, white)"%3"}}
#TRIGGER {~[CLAN DEATH~] (%w) gives (%w) a mild case of death, in Clanworld~!} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow)"~[Clan Death~] "%ansi( hi, white)"%1"%ansi( yellow)" gives "%ansi( hi, white)"%2"%ansi( yellow)" a mild case of death, in Clanworld~!"};:ClanWorld:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow)"~[Clan Death~] "%ansi( hi, white)"%1"%ansi( yellow)" gives "%ansi( hi, white)"%2"%ansi( yellow)" a mild case of death, in Clanworld~!"}}
#TRIGGER {(%w) says: (*)$} {:chats:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow, cyan)"~[Say~] %1 :"%ansi( white)" %2"};:Other:#SAYPROMPT {%cr%ansi( white)"["%time( "h:nn:ss")"] "%ansi( yellow, cyan)"~[Say~] %1 :"%ansi( white)" %2"}}
#CLASS 0
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Oct 02, 2007 10:02 pm   
 
Quote:

I've got multiple chatlines, and each chatline is automatically wrapped at 80chars(or 72 which I currently have it set at), and contain multiple lines in a single tell


This right here. The 100x easier solution is to simply set your word wrapping on the game side to off or something large enough to avoid wrapping. This reduces every distinct message to a one-liner, allowing ZMud to use very simple single-line triggers.
_________________
EDIT: I didn't like my old signature
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Thu Oct 04, 2007 12:16 am   
 
The only problem with that, is everything else in the game gets wrapped at ungodly lengths, and it breaks some things(other triggers, my eyes, etc)

Was hoping someone had a good way to capture chatlines that maybe I missed, or hasn't been posted.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Thu Oct 04, 2007 1:00 am   
 
Turn on wordwrapping in CMUD (or adjust it)! (And off in the MUD.)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Oct 04, 2007 1:04 am   
 
Or zMUD, Seb :P

If you fix those other triggers to expect single-line input, you'll find it much easier to add things in the future.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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