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


Joined: 28 Jun 2004
Posts: 9

PostPosted: Sat Jul 03, 2004 3:07 pm   

Captured Window Formatting
 
Here's a screenshot of my new Chats window in Achaea:
http://www.flex.net/~snk/Achaea/ss.jpg

See all the pre-mature line wraps? Achaea sends carriage returns that canoot be configured, but I would like my chats window to be formatted a little nicer by having a consistent indent, which I could achieve in the ZMud settings, but the newlines from Achaea prevent this.

Would it be possible to store the strings in a var and strip the newlines? any other suggestions?

Many thanks! Ya'll are making my mudding a more enjoyable experience.
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Sat Jul 03, 2004 5:52 pm   
 
Double gag in the triggers I guess
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Sat Jul 03, 2004 6:51 pm   
 
How are you capturing multi-line tells now? Obviously you could trigger on 'You tell' and on '%w~:" for the first line, but how do you do it for the second?

One possible solution might be:
CHATS:#SHOW %concat(@first_capurted_line," ",@second_captured_line)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jul 03, 2004 7:02 pm   
 
Yes, storing the strings in a variable and stripping the newlines would be possible.
Start with an empty variable. For each line, check to see if there is anything in the variable. If there is, then this is a continuation line and should be appended to the variable following a space. If there isn't anything in the variable, it's the first line and should be stored directly to the variable.

#VAR chatline {}
#IF (@chatline) {#VAR chatline {@chatline %1}} {#VAR chatline {%1}}

Edit: Typos
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Sat Jul 03, 2004 7:17 pm   
 
I found another thing the other day
#TRIG "MultiLineCap" {Tells you} {#TEMP {^$} {#STATE MultiLineCap 0};#CAP Tells;#GAG}
#COND {*} {#CAP Tells;#GAG} {manual}
Reply with quote
Teleos
Newbie


Joined: 28 Jun 2004
Posts: 9

PostPosted: Tue Jul 06, 2004 8:38 pm   
 
I am confident in these replies, but don't quite know how to implement with my current system...here's my capture code to my :Chats: window...which is where I need to fix the line wrap problem!

#CLASS {Captures}
:Chats:#SUB {^~(Shallam~)} {"S"}
:Chats:#SUB {^~(Priests~)} {"P"}
:Chats:#SUB {^~(Church~)} {"C"}
:Chats:#SUB {^~(Aspirants~)} {"A"}
:Chats:#SUB {%stells you,} {":"}
:Chats:#SUB {%ssays~,%s} {"-"}
#TR {^~(Shallam~):} {#T+ CapturesCode}
#TR {^~(Church~):} {#T+ CapturesCode}
#TR {^~(Priests~):} {#T+ CapturesCode}
#TR {^~(Aspirants~):} {#T+ CapturesCode}
#TR {^%w tells you, } {#T+ CapturesCode}
#TR {^You tell %w} {#T+ CapturesCode}
#TR {^(%d)h, (%d)m (*)(%w)-} {#T- CapturesCode}
#CLASS 0

#CLASS {CapturesCode}
#TRIGGER {*} {#CAP Chats;#GAG}
#CLASS 0
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jul 06, 2004 10:25 pm   
 
You would need to do three things to your script to store your text to a variable and then display it in another window.
1. Clear the variable before capturing text by using the #VARIABLE command before the #T+ command.
2. Combine the lines of text in the variable, using the #IF command, instead of capturing them directly to the Chats window.
3. Send the contents of the variable to the Chats window when the end of a communication is detected, immediately following the #T- command.
WARNING: This will remove the colors provided by the MUD. That's unavoidable, but it's your decision whether the colors or the format is more important.

#CLASS {Captures}
:Chats:#SUB {^~(Shallam~)} {"S"}
:Chats:#SUB {^~(Priests~)} {"P"}
:Chats:#SUB {^~(Church~)} {"C"}
:Chats:#SUB {^~(Aspirants~)} {"A"}
:Chats:#SUB {%stells you,} {":"}
:Chats:#SUB {%ssays~,%s} {"-"}
#TR {^~(Shallam~):} {#VAR chatline {};#T+ CapturesCode}
#TR {^~(Church~):} {#VAR chatline {};#T+ CapturesCode}
#TR {^~(Priests~):} {#VAR chatline {};#T+ CapturesCode}
#TR {^~(Aspirants~):} {#VAR chatline {};#T+ CapturesCode}
#TR {^%w tells you, } {#VAR chatline {};#T+ CapturesCode}
#TR {^You tell %w} {#VAR chatline {};#T+ CapturesCode}
#TR {^(%d)h, (%d)m (*)(%w)-} {#T- CapturesCode;#WINDOW Chats {@chatline}}
#CLASS 0
#CLASS {CapturesCode}
#TRIGGER {*} {#IF (@chatline) {#VAR chatline {@chatline %1}} {#VAR chatline {%1}};#GAG}
#CLASS 0
Reply with quote
Teleos
Newbie


Joined: 28 Jun 2004
Posts: 9

PostPosted: Tue Jul 06, 2004 11:01 pm   
 
Heh, now everything is gagged, and nothing is sent to :Chats:.

and everything is super laggy on my end, like the screen is trying to refresh occasionaly...

Appreciate the effort and time...I am still trying to work this out, it's not a huge deal but I am perfectionist and don't give in easily to little challenges like this!

If you have any other ideas or see any bugs in your code you edited for me please lemme know!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jul 07, 2004 4:20 am   
 
You should probably set the Prompt option on your prompt trigger. You should also probably move the prompt trigger to the CapturesCode class. Sorry, I should have checked your script.

#CLASS Captures
#UNTR {^(%d)h, (%d)m (*)(%w)-}
#CLASS 0
#TR {^(%d)h, (%d)m (*)(%w)-} {#T- CapturesCode;#WINDOW Chats {@chatline}} {CapturesCode} {Prompt}
Reply with quote
Teleos
Newbie


Joined: 28 Jun 2004
Posts: 9

PostPosted: Wed Jul 07, 2004 4:55 am   
 
No apology taken! You have been more than helpful!

Here's a new screenshot...the line wrap that Achaea sends is still a problem, see the last few tells.

http://www.flex.net/~snk/Achaea/ss2.jpg

Also, the CHATS window keeps stealing focus and disables my input line, is there a command to keep a specific window focused?

Thanks Lightbulb, your time and effort are very much appreciated!
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jul 07, 2004 3:53 pm   
 
I forgot the () around the *, so @chatline would have always been empty. That means the #WINDOW command would never have had any text to send so your #CAPTURE trigger must still be going. That's also why the focus keeps shifting: When the #WINDOW command doesn't have any text to send to the window it changes the focus.

Here's the whole thing, hopefully without mistakes this time. Make sure you delete or disable the #CAPTURE triggers.

#CLASS {Captures}
:Chats:#SUB {^~(Shallam~)} {"S"}
:Chats:#SUB {^~(Priests~)} {"P"}
:Chats:#SUB {^~(Church~)} {"C"}
:Chats:#SUB {^~(Aspirants~)} {"A"}
:Chats:#SUB {%stells you,} {":"}
:Chats:#SUB {%ssays~,%s} {"-"}
#TR {~(Shallam~):} {#VAR chatline {};#T+ CapturesCode}
#TR {~(Church~):} {#VAR chatline {};#T+ CapturesCode}
#TR {~(Priests~):} {#VAR chatline {};#T+ CapturesCode}
#TR {~(Aspirants~):} {#VAR chatline {};#T+ CapturesCode}
#TR {%w tells you, } {#VAR chatline {};#T+ CapturesCode}
#TR {You tell %w} {#VAR chatline {};#T+ CapturesCode}
#CLASS {CapturesCode}
#TR {(%d)h, (%d)m (*)(%w)-} {#T- CapturesCode;#WINDOW Chats {@chatline}} {} {prompt}
#TR {(*)} {#IF (@chatline) {#VAR chatline {@chatline %1}} {#VAR chatline {%1}};#GAG}
#CLASS 0
#T- CapturesCode

NOTE: Unless you have other important settings in them, I'd recommend deleting both classes before pasting this in.
#DELCLASS Captures
#DELCLASS CapturesCode
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Wed Jul 07, 2004 3:57 pm   
 
quote:
Originally posted by Teleos

Here's a screenshot of my new Chats window in Achaea:
http://www.flex.net/~snk/Achaea/ss.jpg

See all the pre-mature line wraps? Achaea sends carriage returns that canoot be configured, but I would like my chats window to be formatted a little nicer by having a consistent indent, which I could achieve in the ZMud settings, but the newlines from Achaea prevent this.

Would it be possible to store the strings in a var and strip the newlines? any other suggestions?

Many thanks! Ya'll are making my mudding a more enjoyable experience.



Heehee! I sorta got carried away with colors and things when I was doing this. I've decided to use this script(modified) myself.
Anyway, here's my try:

Right-click on the Chats window and put a command line on the window. You can reomve the command line afterwards. Enter this in the chats window command line:

#CLASS {My script}
#ALIAS colcheck {#IF (@{clcol.@cscheme} = "off") {#IF (@colornum = "1") {#VAR clcol.%ismember( "off", @clcol) @default_off_colors.@colornum};colornum = 2} {#VAR clcol.%ismember( "off", @clcol) @{default_off_colors.@colornum};colornum = 1}}}
#VAR fline {} {}
#VAR default_off_colors {beige|bisque}
#VAR colornum {} {1}
#VAR quote {"} {"}
#VAR sline {}
#VAR clcol {white|yellowgreen|off} {White}
#VAR cscheme {1}
#TRIGGER {^~(Shallam~)} {#sub "S";#VAR clcol {bisque|honeydew|off}}
#TRIGGER {^~(Priests~)} {#sub "P";#VAR clcol {aquamarine|honeydew|off}}
#TRIGGER {^~(Church~)} {#sub "C";#VAR clcol {"#FF8A5E"|honeydew|off}}
#TRIGGER {^~(Aspirants~)} {#sub "A";#VAR clcol {"#ED97F9"|honeydew|off}}
#TRIGGER {%stells you,} {#sub ":";#VAR clcol {"#F4F400"|"#F4F400"|"#F4F400"}}
#TRIGGER {%ssays,} {#sub "-";#VAR clcol {white|"#F4F400"|"#F4F400"}}
#TRIGGER {^You %w%s} {#sub ":";#VAR clcol {"#F4F400"|"#F4F400"|"#F4F400"}} "" {case}
#TRIGGER {^You say,} {#sub "You-";#VAR clcol {white|yellow|"#F4F400"}}
#TRIGGER "lcap" {(*)} {#GAG;#VAR fline "%1";#IF (%ends( @fline, @quote)) {colcheck;#SHOW ~<color @{clcol.@cscheme} >@fline~</color>;#STATE lcap 0}} "" {notrig}
#COND {(*)} {#GAG;#VAR sline "%1";#VAR fline %concat( @fline, " ", @sline);#IF (%ends( @fline, @quote)) {colcheck;#SHOW ~<color @{clcol.@cscheme} >@fline~</color>;#STATE lcap 0} {#STATE lcap 1}} {notrig}
#CLASS 0

In the main command line, paste this:

#CLASS {Captures}
#TRIGGER {^%w says, *} {#T+ CapturesCode}
#TRIGGER {^You say,} {#T+ CapturesCode}
#CLASS 0

If you give the chats window focus and open its settings, you can change the cscheme variable(as written, it can have values of 1,2, or 3) to change how the colors are displayed.

If check the color picker under the help menu, you can find other colors to use, or create your own.
Reply with quote
Teleos
Newbie


Joined: 28 Jun 2004
Posts: 9

PostPosted: Wed Jul 07, 2004 4:18 pm   
 
It works!

You forgot the #CLASS 0 line for the Captures Class, but other than that...nice work! I really appreciate the help.

Many Thanks...
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