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
GenericGun
Beginner


Joined: 23 Jul 2009
Posts: 12

PostPosted: Thu Jul 23, 2009 5:14 pm   

[3.09] Word wrapping/MXP/Substitution Bug
 
Hi there,

Recently I've stumbled onto a very "interesting" bug in cMUD. I believe someone has already mentioned a variation of that bug
(word wrapping + ANSI colours?), but I think this one is more serious.

Two triggers are fired when receiving a "speech" line from my mud: the first one marks up the speech, the second one identifies
the speaker. When word wrapping is enabled, the second trigger fires only every second time, however if I turn of word wrap
(haven't tested it with autowrap) it fires every time.

I believe the implementation of the triggers is not very relevant, however the important aspect is that both use substitution
with the use of MXP colours. Here is how it looks:

Code:
The line I receive from the MUD:
Big troll says: Hey (text long enough to wrap). 

First trigger changes it to
Big troll -> <color yellow blue> Hey</color>

Second trigger ( "\b(@descriptions)\b" ) where descriptions contains Big troll is supposed to change it to:
Big troll <color white>(Coalface)</color> -> <color yellow blue> Hey</color>


But as I already mentioned, the second trigger works only every second time.
If I switch the order of triggers even stranger things tend to occur (for example part of the yellow-blue color overlaps the white part)
Disabling word wrapping fixes everything,

Thanks in advance for any help/explanation that you can provide.

EDIT: Seeing as I might have given not enough info, I was able to recreate the MXP color overflowing bug with two triggers I post
below (both in Lua, sorry):

Code:

Pattern: ^(*) says:(*)$
Code: zs.sub(zs.param(1) .. " -> <color green blue>" .. zs.param(2) .. "</color>")

Pattern: \b(Big Troll)\b
Code: zs.sub(zs.param(1) .. "<color red> (Coleface)</color>")

Test line: #SH Big Troll says: Hello 123451 123451 123451 123451 123451 123451 123451 123451 123451 123451 123451 123451 123451



(My wrapping is set to 90, and depending on the length of the test line, the overflow might be smaller or bigger)

I have yet been unable to reproduce the other bug I mentioned, in a simple manner.

GenericGun.

P.S. Great work with Lua, Zugg, have been testing it for a week now, and it gives amazing possibilities!
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