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
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Sun Dec 02, 2007 3:21 pm   

[2.14a Pro] #SUB/SAY/SHOW with %ansi
 
#SUB, #SHOW and #SAY are not showing color using %ansi(color)

This #sub used to work to show colors prior to 2.14a

#SUB {%ansi(green)Outside Rhosgobel(s, n, cave, w, se, e and sw)%ansi(yellow) travelto(thranduils, rivendell, dolguldur and lothlorien)}
#SAY {%ansi(cyan)Huntbreaks %ansi(white)(%ansi(red)rho1, rho2, rho3, rho4 and rho5%ansi(white))}
#SAY {%ansi(high, gray)Counters %ansi(white)(%ansi(magenta)arh1 and arh2%ansi(white))}

Now the only things that end up colored are the travelto(osgiliath...) the (edo1, edo2...) inside the parenthies and the (aed1, aed2...)

This is very odd to me. It was working fine previously.

Edit by Vijilante: Descriptive titles are useful.
_________________
Yama
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Dec 02, 2007 5:06 pm   
 
I saw this the first time I loaded up 2.14a pro but after that it started working properly.

It was odd because the first ansi color of a line just would NOT work but any subsequent color on the line would. Also MXP colors were working fine for the MXP color but then the NEXT ansi color after the mxp color wasn't working.

Like I said I restarted Cmud and it started working properly for me.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sun Dec 02, 2007 5:51 pm   
 
I had this problem too. It seemed to be random...mainly when first starting it. I just got rid of all %ansi and started using MXP. It's much better looking and more colors anyway.

By the way, I didn't post about it for that reason. I noticed if for instance I would enter your example with %ansi on the command line it would color correctly, but if it was called from a trigger it would not. Also it DOES show the colors in the Debug window but not the main window which is odd.
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Sun Dec 02, 2007 8:30 pm   
 
I am running on vista, but that doesn't seem to be causing this issue.

The kicker is I have some #subs that work, and others that partially work.

This is one that is working fine for me.
#sub {(%ansi(green)worn%ansi(white))}
_________________
Yama
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Dec 03, 2007 6:03 pm   
 
If you still have one that doesn't work, please post the trigger that isn't working. I have not been able to reproduce this. It might depend upon the exact text being sent from the MUD that is causing your #SUB trigger to fire.

A problem with #SUB might depend upon the ANSI color of the text sent from the MUD. But the #SAY/#SHOW problem wouldn't depend upon that, so if you are still having any trouble with #SAY/#SHOW, definitely post exactly what you are doing. But your examples worked fine for me here.
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Tue Dec 04, 2007 12:12 am   
 
Triggers with subs that are working correctly:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <trigger priority="4300">
<pattern>~(worn~)</pattern>
<value>#sub {(%ansi(green)worn%ansi(white))}</value>
</trigger>
</cmud>

Sample text:
Mud Sent: A steel ring (worn).

Shown: A steel ring (worn).
This sample text is displaying correctly with a white () and worn displaying in green.


Triggers with subs that are partially working correct:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <trigger priority="7140" regex="true">
<pattern>West of Osgiliath\(\w+, \w+, \w+, \w+ and \w+\) [\w+, \w+ and \w+]</pattern>
<value>#SUB {%ansi(green)West of Osgiliath(s, n, w, e and sw) [ne and se]%ansi(yellow) travelto(minastirith and edoras)} #SAY {%ansi(cyan)Huntbreaks %ansi(white)(%ansi(red)osg1 and osg2%ansi(white))} #SAY {%ansi(high, gray)Counters %ansi(white)(%ansi(magenta)aosg1%ansi(white))}</value>
</trigger>
</cmud>

Sample text:
Mud Sent: West of Osgiliath(n, w, e, sw and s) [se, e and ne]

Shown:
West of Osgiliath(s, n, w, e and sw) [ne and se] travelto(minastirith and edoras)
Huntbreaks (osg1 and osg2)
Counters (aosg1)

The "West of Osgiliath(s, n, w, e and sw [se, e and ne] should be green but isn't.
Huntbreaks should be cyan and isn't.


Triggers not working correctly:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <trigger priority="3610">
<pattern>(*) is in perfect shape.</pattern>
<value>#SHOW {%ansi(green)%1 is at PERFECT SHAPE!!! PERFECT SHAPE!!! HP: @HP EP: @EP}</value>
</trigger>
</cmud>

Sample text:
Mud Sent: Yamabushi is in perfect shape.

Shown:
Yamabushi is in perfect shape.
Yamabushi is at PERFECT SHAPE!!! PERFECT SHAPE!!! HP: 220 EP: 220

The Yamabushi at PERFECT SHAPE!!! should be green however its not.


I also noted this oddity in the bug for the shape command.

If you use:
#SHOW %ansi() {%ansi(green)%1 is at PERFECT SHAPE!!! PERFECT SHAPE!!! HP: @HP EP: @EP}
The yamabushi at PERFECT!!!! becomes green as you wished.
However, as soon as you change it back to:
#SHOW %ansi(){%ansi(green)%1 is at PERFECT SHAPE!!! PERFECT SHAPE!!! HP: @HP EP: @EP}
It goes back to white text.


It seems like the first %ansi() command is ignored while the next ' ' that occurs allows the next %ansi() command in line to be processed.

If you want to look at this further, I'll gladly ship you my mud file.

I'm playing on towers.t2tmud.org port 9999.
_________________
Yama
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Tue Dec 04, 2007 12:28 am   
 
I also came up with a quick and dirty reproduction without my mud file.

Here we go:
First open Cmud 2.14a Pro.
hit escape to run Cmud without the mud files.
Next type in #show test (this will show test in the default mud text color)
Next type in #show %ansi(magenta) test (this should show test in magenta, but it doesn't and shows it in the default mud text color)

Next type in #show %ansi() %ansi(magenta)test (this shows text in magenta)

Then try #show %ansi(magenta) test (back to default text color)



Trying the same thing with #say does not get the same results, this function seems to be handling %ansi correctly, as does #ECHO.

I believe that #SUB would do the same thing as #show, but I can't figure out at the moment how to test for the #sub.
_________________
Yama
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Dec 04, 2007 1:56 am   
 
OK, I found the %ansi problem and I have this fixed for v2.15.

However, there was a problem with one of your triggers:
Code:
 <pattern>West of Osgiliath\(\w+, \w+, \w+, \w+ and \w+\) [\w+, \w+ and \w+]</pattern>

It is probably because you posted this to the forum without putting it into a [code] [/code] tag, but it should be:
Code:
 <pattern>West of Osgiliath\(\w+, \w+, \w+, \w+ and \w+\) \[\w+, \w+ and \w+\]</pattern>

with the slashes before the square brackets. In general, be sure to always put code tags around your XML text. Also, I don't know what you are copying it from, but always try to copy it from CMUD's XML tag itself. Whatever you were copying it from was adding - characters to the beginning of some lines. And that makes it very difficult for me (and others) to just copy your XML text and paste it into CMUD for testing.
Reply with quote
Yamabushi
Apprentice


Joined: 29 Jul 2003
Posts: 101
Location: USA

PostPosted: Tue Dec 04, 2007 4:14 am   
 
I exported the trigger using the export XML, I'll make sure to tag it as code the next time.

I checked the trigger and it was correct in cmud, so I don't know where that \ went.
_________________
Yama
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Dec 04, 2007 4:15 am   
 
Well, the square brackets are used by the BBcode in the forum, so if you don't put them within [code] tags, the slashes get eaten by the forum. That's why it's really important to use [code] to preserve your scripts properly in the forum.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Dec 04, 2007 5:19 am   
 
Moderators can actually see the unadulterated source for his post by editing it. His trigger's correct in his XML.

As an aside, I'm sure I found a circumstance the other day when I had to put slashes before some square brackets I was using to get the forums to display them - [neat, huh?] - but damned if I can find it again.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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