|
mrkelley Beginner
Joined: 15 Aug 2006 Posts: 14
|
Posted: Sun Aug 02, 2009 12:47 am
psub bug (3.10a) |
It seems when is use %ansi in a psub trigger, cmud is randomly coloring text sent from the mud (when i don't press enter) the same color as the aforementioned ansi.
|
|
|
|
mrkelley Beginner
Joined: 15 Aug 2006 Posts: 14
|
Posted: Sun Aug 02, 2009 12:56 am |
confirmed by simply changing the ansi color, the new color shows up on text sent from the mud when i don't press enter.
* has arrived from the west. (etc) |
|
|
|
mrkelley Beginner
Joined: 15 Aug 2006 Posts: 14
|
Posted: Sun Aug 02, 2009 1:09 am |
I should also note that this only occurs when i psub into my prompt. I use other psubs that use ansi that don't produce this result.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sun Aug 02, 2009 2:43 am |
Could you share the exact psub you are doing? From what you describe, it sounds to me like you are not closing the ansi color in your psub, which will quite naturally allow the color to continue into the text from the mud which completes the line.
|
|
|
|
mrkelley Beginner
Joined: 15 Aug 2006 Posts: 14
|
Posted: Sun Aug 02, 2009 5:02 pm |
Pattern:
Code: |
~(Hp: (%d)/(%d)~) ~(Ma: (%d)/(%d)~) ~(Mv: (%d)/(%d)~) ~(~$: (%*)~) ~((%*)~) ~((%*)~) ~((%*)~) ~((%*)~)~> |
Trigger:
Code: |
#VAR prompt.hpc {%eval( %1-@Prompt.hp)}
#var prompt.hp %1
#var prompt.maxhp %2
#VAR prompt.mac {%eval( %3-@Prompt.ma)}
#var prompt.ma %3
#var prompt.maxma %4
#VAR prompt.mvc {%eval( %5-@Prompt.mv)}
#var prompt.mv %5
#var prompt.maxmv %6
#var prompt.gold %7
#var prompt.agg %8
#var prompt.tnl %9
#var prompt.position %10
#var prompt.combat %11
#PSUB {%2/%ansi( red)@prompt.hpc} %x2
#PSUB {%4/%ansi( red)@prompt.mac} %x4
#PSUB {%6/%ansi( red)@prompt.mvc} %x6
#if (@prompt.hpc >= 30) {rep} |
Changes this:
Code: |
(Hp: 678/678) (Ma: 342/342) (Mv: 577/577) ($: 888) (0) (0%) (Standing) (-)> |
To this:
Code: |
(Hp: 678/678/0) (Ma: 342/342/0) (Mv: 577/577/0) ($: 888) (0) (0%) (Standing) (-)> |
I've been using this in various versions of zmud/cmud for 10 years, i've never had the issue of it bleeding onto random text. |
|
|
|
mrkelley Beginner
Joined: 15 Aug 2006 Posts: 14
|
Posted: Sun Aug 02, 2009 5:20 pm |
Further info:
Code: |
#PSUB {%2/%ansi( red)@prompt.hpc} %x2%ansi(reset)
#PSUB {%2/%ansi( red)@prompt.hpc}%ansi(reset) %x2
#PSUB {%2/%ansi( red)@prompt.hpc%ansi(reset)} %x2 |
All tried and produce the same bleeding result.
Also would like to note that when using ansi on this, it changes the color of the previous part of my prompt, which also hasn't happened for the past ten years in other versions. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Aug 03, 2009 4:11 pm |
Code: |
#PSUB {%2/%ansi( red)@prompt.hpc%ansi(reset)} %x2 |
This is the one I would have expected to work. Since it had been working in previous versions of Cmud and Zmud, I assume the mud prompt must already have ansi codes that are setting the color. If it's not working now, Zugg will probably need some output from the Script Debugger window showing the problem. Be sure that the Show ANSI codes is turned on in the Messages of the debugger. |
|
|
|
mrkelley Beginner
Joined: 15 Aug 2006 Posts: 14
|
Posted: Sun Aug 16, 2009 5:28 am |
Code: |
0.0008 | LegendMU | [1] LegendMUD Comline : start :
0.0076 | a LegendMU |(Hp: 258/678/1) (Ma: 342/342/0) (Mv: 577/577/0) ($: 755) (0) (0%) (Resting) (-)>l
0.0048 | j LegendMU >l
0.0009 | d LegendMU | [1] LegendMUD Comline : stopped
0.2881 | a LegendMU |
0.0017 | a LegendMU |Carthage's Thermal Baths
0.0017 | a LegendMU |[Exits: e]
0.0015 | a LegendMU |Dozens of grey marble columns stretch above you, supporting the domed roof.
0.0020 | a LegendMU |Warm waters gently fume in a large marble pool.
0.0019 | a LegendMU |A tightly-lidded clay jar contains a precious supply of fresh water.
0.0066 | a LegendMU |
0.0018 | a LegendMU ](Hp: 259/678) (Ma: 342/342) (Mv: 577/577) ($: 755) (0) (0%) (Resting) (-)>
0.0013 | f LegendMU | Pattern: ~(Hp: (%d)/(%d)~) ~(Ma: (%d)/(%d)~) ~(Mv: (%d)/(%d)~) ~(~... : (%1=259, %2=678, %3=342, %4=342, %5=577, %6=577, %7=755, %8=0, %9="0%", %10="Resting", %11="-")
0.0007 | c LegendMU | exec : Pattern "~(Hp: (%d)/(%d)~) ~(Ma: (%d)/(%d)~) ~(Mv: (%d)/(...
0.7542 | a LegendMU |(Hp: 259/678/1) (Ma: 342/342/0) (Mv: 577/577/0) ($: 755) (0) (0%) (Resting) (-)>
0.0024 | a LegendMU | |
|
|
|
|
|
|