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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
asira
Beginner


Joined: 24 Jun 2002
Posts: 24
Location: United Kingdom

PostPosted: Wed Aug 13, 2008 11:50 pm   

[2.35 Pro] CMUD line wrapping and #GAG/#SUB
 
I've encountered a couple of problems that seem to be related to the way CMUD line wraps text when first received.

First, the following code from a trigger:
Code:
if (%regex(%line(1),"^$"))
{
  #gag -1
}
A straightforward attempt to gag the previous line if it is blank. Works fine most of the time, not when the triggering line is long enough for CMUD to wrap it.


Also, using #SUB to insert an MXP tag messes up when the line wraps. This happens with <color> and <send>; I would imagine it works with other tags as well but haven't tested them all yet.
If I receive text with wrapping turned off, but later turn it on the previously received text will be perfectly fine. Likewise, if I receive text with wrapping turned on, but later turn it off the problem will still be there. Example image:



The names of people should all be <send> links and coloured the dark gray, the phrase "communefavoured" should always be fully red, and both changes were done by using #SUB to insert tags. (#CW works correctly, so the colour issue for "communefavour" can be worked around, but mixing #CW and <send> links creates some unusal results as well.)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Aug 14, 2008 9:15 pm   
 
I confirmed the first problem. There are actually 2 bugs there. The first is that the %line function doesn't handle wrapped lines, so your trigger won't even fire on a long wrapped line. But then when I changed it to %line(2) for a wrapped line, I found that "#GAG -1" also doesn't work correctly in that case. So I've added that to the bug list.

But I wasn't able to reproduce any problem with using #SUB and MXP tags on wrapped lines. You'll need to post the *exact* #SUB, MXP and color triggers that you are using. Just right-click on the trigger and select Copy in the settings editor Tree view, and the paste the result within [CODE] tags here in the forum.
Reply with quote
asira
Beginner


Joined: 24 Jun 2002
Posts: 24
Location: United Kingdom

PostPosted: Sat Aug 16, 2008 3:56 pm   
 
(I can't directly paste into the forum, because either the code segment or my broswer eats the mxp tags, but with a space added at the start of the tag everything seems ok.)

I have several triggers, which are all similar and all have a problem:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger priority="100" trigontrig="false" regex="true" copy="yes">
    <pattern>\b(@align_glom)\b</pattern>
    <value>#sub {< color 0x666666 0x000000>@fealtyMenu(%1)< /color>}</value>
  </trigger>
</cmud>

The variable @align_glom is simply a sting list full of names and @the fealtyMenu function is designed to return a <send> tag surrounding the name.
I have tried taking the function out and putting in the send tag directly, with and without the color tag, and get the same problem each time the line wraps.

The red colouration is even simpler:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger priority="620" regex="true" copy="yes">
    <pattern>(communefavoured)</pattern>
    <value>#sub {< color red>%1< /color>}</value>
  </trigger>
</cmud>

I've even tried:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger priority="620" regex="true" copy="yes">
    <pattern>communefavoured</pattern>
    <value>#sub {< color red>communefavoured< /color>}</value>
  </trigger>
</cmud>

Neither colouration trigger works correctly, but either varition using a simple #CW red instead of the #SUB does.

Something else I noticed - if I ask the mud to send the lines again, the wrapping issue occurs in exactly the same way every single time.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Sun Aug 17, 2008 5:15 pm   
 
Do you still have this problem in the new 2.36 version?

I just tested your color triggers here and couldn't get them to fail using the #SHOW command to generate long wrapped lines. So I guess the next step would be to turn on the Script Debugger in CMUD and turn on the Raw Input/Output messages and then paste the exact text being sent by the MUD for your long lines that are wrapping (into [CODE] tags here). It's possible your MUD is sending some sort of control codes that is messing up the text replacement or coloring.
Reply with quote
asira
Beginner


Joined: 24 Jun 2002
Posts: 24
Location: United Kingdom

PostPosted: Tue Aug 19, 2008 1:40 am   
 
Still happens in 2.36 unfortunately.

Output from the script debugger window:
Code:
       | d  Lusterni |[1] Lusternia Comline : stopped
11.140 | ---
0.0011 | c  Lusterni |[1] Lusternia Comline : start :
0.0012 | f  Lusterni |  Command Input: .*
0.0010 | c  Lusterni |  exec : Command Input "blank after command" : #noop
0.0009 | a  Lusterni |readlog glomdoring 0 0
0.0043 | j  Lusterni >readlog glomdoring 0 0
0.0011 | d  Lusterni |[1] Lusternia Comline : stopped
0.2222 | a  Lusterni #Telnet 200: Char.Vitals<LF>NL:5/100 H:832/832 M:636/684 E:489/516 P:10/10 N:2480/2480 W:2240/2240
0.0008 | f  Lusterni |Telnet: ^Char\.Vitals\n(NL:(?$x:\d+)/100 H:(?$h:\d+)/(?$hx:\d+) M... : (%1="NL:5/100 H:832/832 M:636/684 E:489/516 P:10/10 N:2480/2480 W:2240/2240 ", %2=5, %3=832, %4=832, %5=636, %6=684, %7=489, %8=516, %9=10, %10=10, %11=2480, %12=2480, %13=2240, %14=2240)
0.0011 | c  Lusterni |exec : Telnet "^Char\.Vitals\n(NL:(?$x:\d+)/100 H:(?$h:\d+)/(?$h...
0.0009 | a  Lusterni |
0.0007 | f  Lusterni |Within Lines: ^$
0.0010 | c  Lusterni |exec : Within Lines "^$" : #gag
0.0007 | f  Lusterni |Within Lines: ^$
0.0009 | c  Lusterni |exec : Within Lines "^$" : #gag
0.0005 | g  Lusterni |-> Line 116 gagged
0.0009 | a  Lusterni |2008/08/19 00:39:44 - Haraneth stepped out of the Portal of Fate as a commune member.
0.0028 | a  Lusterni |2008/08/19 00:54:29 - Arel communefavoured Adele for: Working for and making suggestions for the betterment of Glomdoring and the growth of the Wyrden culture.
0.0023 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Arel")
0.0010 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0039 | f  Lusterni |Pattern: (communefavoured) : (%1="communefavoured")
0.0012 | c  Lusterni |exec : Pattern "(communefavoured)" : #sub {<color red>%1</color>}
0.0035 | a  Lusterni |
0.0009 | a  Lusterni |832h, 636m, 489e, 10p, 2480en, 2240w elrx-
0.0009 | f  Lusterni |Pattern: ^\d+h, .*-(<>)?$
0.0010 | c  Lusterni |exec : Pattern "blank after promt" : #noop
1.2488 | ---
0.0006 | c  Lusterni |[1] Lusternia Comline : start :
0.0013 | f  Lusterni |  Command Input: .*
0.0010 | c  Lusterni |  exec : Command Input "blank after command" : #noop
0.0011 | a  Lusterni |readlog glomdoring 0 1
0.0061 | j  Lusterni >readlog glomdoring 0 1
0.0035 | d  Lusterni |[1] Lusternia Comline : stopped
0.3043 | a  Lusterni #Telnet 200: Char.Vitals<LF>NL:5/100 H:832/832 M:636/684 E:489/516 P:10/10 N:2480/2480 W:2240/2240
0.0031 | f  Lusterni |Telnet: ^Char\.Vitals\n(NL:(?$x:\d+)/100 H:(?$h:\d+)/(?$hx:\d+) M... : (%1="NL:5/100 H:832/832 M:636/684 E:489/516 P:10/10 N:2480/2480 W:2240/2240 ", %2=5, %3=832, %4=832, %5=636, %6=684, %7=489, %8=516, %9=10, %10=10, %11=2480, %12=2480, %13=2240, %14=2240)
0.0041 | c  Lusterni |exec : Telnet "^Char\.Vitals\n(NL:(?$x:\d+)/100 H:(?$h:\d+)/(?$h...
0.0051 | a  Lusterni |
0.0027 | f  Lusterni |Within Lines: ^$
0.0032 | c  Lusterni |exec : Within Lines "^$" : #gag
0.0027 | f  Lusterni |Within Lines: ^$
0.0030 | c  Lusterni |exec : Within Lines "^$" : #gag
0.0025 | g  Lusterni |-> Line 124 gagged
0.0028 | a  Lusterni |2008/08/18 00:41:15 - Nadjia communefavoured Baurai for: for replanting the fallen ravenwood trees.
0.0039 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Nadjia")
0.0028 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0067 | f  Lusterni |Pattern: (communefavoured) : (%1="communefavoured")
0.0028 | c  Lusterni |exec : Pattern "(communefavoured)" : #sub {<color red>%1</color>}
0.0050 | a  Lusterni |2008/08/18 01:09:11 - Ashai communefavoured Talan for: For taking part in wildnodes. Still to be favored: Ashteru, Borca, Izekeal, Ryleth.
0.0044 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Ashai")
0.0028 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0105 | f  Lusterni |Pattern: (communefavoured) : (%1="communefavoured")
0.0028 | c  Lusterni |exec : Pattern "(communefavoured)" : #sub {<color red>%1</color>}
0.0052 | a  Lusterni |2008/08/18 01:28:38 - Xenthos restored Hizach's access to the Master Ravenwood Tree.
0.0036 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Xenthos")
0.0029 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0076 | a  Lusterni |2008/08/18 01:44:01 - Synl communefavoured Borca for: aiding in wildnodes. Still to be favoured: Izekeal, Ryleth.
0.0037 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Synl")
0.0023 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0057 | f  Lusterni |Pattern: (communefavoured) : (%1="communefavoured")
0.0023 | c  Lusterni |exec : Pattern "(communefavoured)" : #sub {<color red>%1</color>}
0.0038 | a  Lusterni |2008/08/18 01:51:51 - Serk stepped out of the Portal of Fate as a commune member.
0.0134 | a  Lusterni |2008/08/18 03:19:47 - Eliron communefavoured Izekeal for: aiding in wildenodes.
0.0028 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Eliron")
0.0023 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0031 | f  Lusterni |Pattern: (communefavoured) : (%1="communefavoured")
0.0038 | c  Lusterni |exec : Pattern "(communefavoured)" : #sub {<color red>%1</color>}
0.0031 | a  Lusterni |2008/08/18 08:05:38 - Rika slew a dark nighthag that was loyal to you.
0.0034 | a  Lusterni |2008/08/18 08:08:02 - Rika slew a dark nighthag that was loyal to you.
0.0036 | a  Lusterni |2008/08/18 13:32:52 - Synl disconnected the portal chamber from The Paunchy Pilgrim.
0.0028 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Synl")
0.0023 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0032 | a  Lusterni |2008/08/18 16:01:52 - Bael communefavoured Ryleth for: aiding in the wildnodes.
0.0028 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Bael")
0.0023 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0045 | f  Lusterni |Pattern: (communefavoured) : (%1="communefavoured")
0.0023 | c  Lusterni |exec : Pattern "(communefavoured)" : #sub {<color red>%1</color>}
0.0027 | a  Lusterni |2008/08/18 17:41:23 - Daedalion sang a song of inspiration in Glomdoring Forest.
0.0028 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Daedalion")
0.0023 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0135 | a  Lusterni |2008/08/18 17:42:05 - Laggothog stepped out of the Portal of Fate as a commune member.
0.0037 | a  Lusterni |2008/08/18 21:12:03 - Credits: +10. Reason: Commune Member purchase.
0.0033 | a  Lusterni |2008/08/18 22:17:29 - Daedalion sang a song of inspiration in Glomdoring Forest.
0.0030 | f  Lusterni |Pattern: \b(@align_glom)\b : (%1="Daedalion")
0.0035 | c  Lusterni |exec : Pattern "\b(@align_glom)\b" : #sub {<color 0x666666 0x000...
0.0035 | a  Lusterni |2008/08/18 22:46:07 - Yeoj stepped out of the Portal of Fate as a commune member.
0.0036 | a  Lusterni |2008/08/18 23:38:50 - Brianus stepped out of the Portal of Fate as a commune member.
0.0037 | a  Lusterni |2008/08/18 23:58:04 - Nyss stepped out of the Portal of Fate as a commune member.
0.0132 | a  Lusterni |
0.0023 | a  Lusterni |832h, 636m, 489e, 10p, 2480en, 2240w elrx-
0.0029 | f  Lusterni |Pattern: ^\d+h, .*-(<>)?$
0.0037 | c  Lusterni |exec : Pattern "blank after promt" : #noop
0.0000 |

What I see:


I also have the raw and normal text files generated by the #debugfile command if that will help.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Aug 19, 2008 4:47 pm   
 
If you disable the \b(@align_glom)\b trigger, then does the communefavoured color trigger work? And if you disable the communefavoured trigger, does the @align_glom trigger work?

In other words, does it only fail when both triggers are enabled, or does each trigger fail by itself too.

I also noticed that both of these are RegEx triggers. If you change them to normal zScript triggers, do they still fail?

The first trigger would have a pattern of: %b({@align_glom})%b
and the second trigger would have a pattern of: (communefavoured)
Reply with quote
asira
Beginner


Joined: 24 Jun 2002
Posts: 24
Location: United Kingdom

PostPosted: Tue Aug 19, 2008 9:23 pm   
 
It looks very much as though both triggers are experiencing the same problem independently, however they do occaisionally overlap. If I disable one of the triggers then most of the time the sub that is still done is done incorrectly in exactly the same way as when both triggers are enabled. The best example of the overlap is the "Arel communefavoured Adele" line, with most of the communefavoured in the dark gray colour. With the @align_glom trigger disabled, only the first three letters of the communefavoured are coloured red. With the communfavoured trigger disabled, the word isn't affected at all.

Converting to zScript triggers seems to have impact at all. The trigger pattern compiler doesn't seem to like %b, so I just used ({@align_glom}) and that made no difference.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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