About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Mon Jul 06, 2009 1:04 pm   

[3.08] #CAP ANSI issue
 
Hello,

Description: #CAP capture line to other window and line has wrong colors - only first char's color (or first color - dont know exaclty b/s first char has color definition) is used for rest of line even

When I disable #GAG in trigger's code where I use #CAP both lines - in main window and in capturing window - differs with colors (of course there are no triggers in capturing window).

Question / help request: I have no idea how to debug above problem, so looking now for any help from you how can I do that to give you more informations about #CAP problem.

Rgds,
W.
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Mon Jul 06, 2009 4:53 pm   
 
I have a few captures triggers that capture several colors on the same line, but i'm not having any problems. Can you give a more specific example?
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jul 06, 2009 5:18 pm   
 
To debug this problem, open the Script Debugger window and make sure the Show ANSI and Show Raw Input/Output message is enabled. Then, when you receive the text from the MUD with the colors that are not capturing, post the text from the debugger window showing the raw data being sent from the MUD. And also post your exact #capture trigger. Also let us know if you have the "Capture MXP" option enabled in your MXP preferences menu (which allows non-ANSI HTML colors to be captured).
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Mon Jul 06, 2009 6:06 pm   
 
Everything in MXP is disabled (none of checkboxes checked)

Trigger code:
Code:
<trigger priority="12390" trigontrig="false" regex="true" id="1236">
  <pattern>^IMG:</pattern>
  <value>;startCaptureChannels "harko" 1 1
#CAPTURE "harko"
;#GAG</value>
</trigger>


Debug infos (enabled a/f/g/h/j):
Code:
0.0038 | a      dune |com ansi color capture test
0.0015 | h      dune |<ESC>[2Scom ansi color capture test<ESC>[0m
0.0078 | j      dune >com ansi color capture test
0.1711 | a      dune |IMG: [Hatash] ansi color capture test
0.0008 | f      dune |  Pattern: ^IMG:
0.0012 | a     harko |IMG: [Hatash] ansi color capture test


I'm attaching screenshot, b/s in debug window I dont see any ANSI codes.
"Dune" is main window, and "harko" is capturing window.
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Mon Jul 06, 2009 6:14 pm   
 
wrym wrote:
I have a few captures triggers that capture several colors on the same line, but i'm not having any problems. Can you give a more specific example?
I have few others too. But in this specific case it doesnt work - dont know why.
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Mon Jul 06, 2009 6:19 pm   
 
I've made additional debug with i-enabled too (showing prompt too)

Code:
0.0031 | a      dune |com ansi color capture test
0.0023 | h      dune |<ESC>[2Scom ansi color capture test<ESC>[0m
0.0079 | i      dune >com ansi color capture test<CR><LF>
0.1595 | i      dune <<ESC>[36mIMG: [<ESC>[0mHatash<ESC>[36m] <ESC>[0mansi color capture test<CR><LF>
0.0000 | HP: <ESC>[31m<ESC>[1m9221<ESC>[0m/<ESC>[31m<ESC>[1m9221<ESC>[0m CP: <ESC>[36m<ESC>[1m1111<ESC>[0m/<ESC>[36m<ESC>[1m1143<ESC>[0m [<ESC>[36me<ESC>[0m,<ESC>[36mnw<ESC>[0m]><CR><LF>
0.0017 | a      dune |IMG: [Hatash] ansi color capture test
0.0008 | f      dune |  Pattern: ^IMG:
0.0014 | a     harko |IMG: [Hatash] ansi color capture test
0.0017 | g      dune |-> Line 998 gagged
0.0008 | a      dune |HP: 9221/9221 CP: 1111/1143 [e,nw]>
0.0007 | h      dune |HP: <ESC>[1;31m9221<ESC>[0m/<ESC>[1;31m9221<ESC>[0m CP: <ESC>[1;36m1111<ESC>[0m/<ESC>[1;36m1143<ESC>[0m [<ESC>[36me,<ESC>[36mnw]><ESC>[0m
0.0007 | f      dune |  Pattern: ^HP: (\d+)/(\d+)\s+CP: (\d+)/(\d+) : (%1=9221, %2=9221, %3=1111, %4=1143)
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Wed Jul 08, 2009 7:53 am   
 
Any1 ?
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jul 08, 2009 4:44 pm   
 
Well, I tried looking at your examples but I'm perplexed because there isn't an "h" line for the corresponding "a" line that is supposed to show the colors in that line. When I simulate the raw input (the "i" line) then it looks fine for me here. So I'm not sure what else to suggest or look at. It's very weird.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Thu Jul 09, 2009 8:37 am   
 
Most funny is that in script both "a" lines in "dune" and "harko" window are full cyan. I have also no idea why this happens. Most funny is that for "tell" triggers have in 80% of cases same problem, and sometimes it doesnt appear.

My suggestion is that maybe cMud sets temporary default color for something (triggers/other windows) to 1st escape color code, especially maybe if ansi code is at line begging. Or something with parsing "<ESC>[0m"

Rgds,
W.
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Thu Jul 09, 2009 8:47 am   
 
Hmmm.... When I have disabled "Emulate control codeS" in session setting for window "harko" I got:
Code:
<27>[36mIMG: [Hatash<27>[36m] test<27>[0m<27>[K


So I dont see corresponding <27>[0m code that you see in debug I've send:
Code:
0.1595 | i      dune <<ESC>[36mIMG: [<ESC>[0mHatash<ESC>[36m] <ESC>[0mansi color capture test<CR><LF>


Ideas?
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
Zugg
MASTER


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

PostPosted: Thu Jul 09, 2009 4:42 pm   
 
OK, this is weird. Now I can reproduce it. Here is what I did:
Code:
#trigger {^IMG:} {#CAPTURE Harko}
#SHOW {%e[36mIMG: [%e[0mHatash%e[36m] %e[0mansi color capture test}

and that showed the problem in a blank session. I could have sworn I did this same test before and it worked, so I must have made a typo or something before. Very odd. In any case, this should allow me to fix the problem before the next version is released. Thanks for your patience on this!

Edited: Btw, the ESC[0m and ESC[K are added by CMUD to the end of the line to reset the color to the default and to clear the rest of the line. This is normal and isn't part of the bug.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Thu Jul 09, 2009 8:45 pm   
 
Ah!!! That's why multiline output has second lines proper color :D
You too thx for patience - it was quite hard to debug and reproduce
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Mon Jul 20, 2009 9:33 am   
 
Fix confirmed in cMud 3.09
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
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