TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

code color not displaying correctly...

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
karvec



Joined: 16 Jul 2010
Posts: 50

PostPosted: Sun Jul 25, 2010 12:55 am    Post subject: code color not displaying correctly... Reply with quote

The ANSI is displaying correctly under 2.00.1 but not under 2.00.2-- it's an hpbar setup for a guild on 3kingdoms, I'll give an example hp line as well so you can test it with #showme.

In 2.00.1 it displays correctly by changing the color displayed at a certain health percentage, however, in 2.00.2 it's staying plain green. Here's the code:

Code:
#function {colscale}
{
        #switch {10 * %1 / %2}
        {
                #case {0} {#return <119>};
                #case {1} {#return <119>};
                #case {2} {#return <119>};
                #case {3} {#return <139>};
                #case {4} {#return <139>};
                #case {5} {#return <139>};
                #case {6} {#return <139>};
                #case {7} {#return <169>};
                #case {8} {#return <169>};
                #case {9} {#return <169>};
                #default  {#return <129>}
        }
}

#var hpbar_label <088>;
#var hpbar_points_full <129>;
#var hpbar_points_high <169>;
#var hpbar_points_med <139>;
#var hpbar_points_low <119>;

#action {%1HP: %2/%3 PP: %4/%5 Chi: %6/%7 G2:%8 Mind: %9 AE:%10/%11% CF:%12}
{
   #var hpcolor @colscale{%2 %3};
   #var spcolor @colscale{%4 %5};
   #var chicolor @colscale{%6 %7};
   #var mindcolor @colscale{%9 288};
   #var aecolor @colscale{%11 100};

   #var hpcur %2;
   #var hpmax %3;

   #var spcur %4;
   #var spmax %5;

   #var chicur %6;
   #var chimax %7;

   #var next_gxp %8;

   #var mindcur %9;
   #var mindmax 282;

   #var numae %10;
   #var aepct %11;
   #var aemax 100;

   #var cf %12;

   #format {firstmsg} {%s%s} {$hpbar_label} {%1};
   #format {hpmsg}    {%sHP:%s%+4s%s/%s%s} {$hpbar_label} {$hpcolor} {$hpcur} {$hpbar_label} {$hpbar_points_full} {$hpmax};
   #format {spmsg}    {%sPP:%s%+3s%s/%s%s} {$hpbar_label} {$spcolor} {$spcur} {$hpbar_label} {$hpbar_points_full} {$spmax};
   #format {chimsg}   {%sCHI:%s%+3s%s/%s%s%s} {$hpbar_label} {$chicolor} {$chicur} {$hpbar_label} {$hpbar_points_full} {$chimax} {$hpbar_label};
   #format {gxpmsg}   {%sG2:%s%+8s} {$hpbar_label} <169> {$next_gxp};
   #format {mindmsg}  {%sMind:%s%+3s} {$hpbar_label} {$mindcolor} {$mindcur};
   #format {aemsg}    {%sAE:%s%s%s/%s%+2s%s%s} {$hpbar_label} <139> {$numae} {$hpbar_label} {$aecolor} {$aepct} {$hpbar_label} {%};
   #format {cfmsg}    {%sCF:%s%s} {$hpbar_label} <139> {$cf};

   #format {prompt1} {%s %s %s %s %s %s %s %s} {$firstmsg} {$hpmsg} {$spmsg} {$chimsg} {$gxpmsg} {$mindmsg} {$aemsg} {$cfmsg};
   #format {prompt2} {%s} {};
}
{2};

#action {%1HP: %2/%3 PP: %4/%5 Chi: %6/%7 G2:%8 Mind: %9 AE:%10/%11% CF:%12%sT: %13}
{
   #showme {%1HP: %2/%3 PP: %4/%5 Chi: %6/%7 G2:%8 Mind: %9 AE:%10/%11% CF:%12}

   #NOP un-nop the line below when you've advanced your evaluation mskill.
   #NOP #var mob_health_color @colscale{%13 100};
   #var mob_health_color <129>;
   #var mob_health %13;

   #format {enemymsg} {%sT:%s%s} {$hpbar_label} {$mob_health_color} {$mob_health};
   #format {prompt2} {%s} {$enemymsg};
}
{1};

#prompt {%1HP: %2/%3 PP: %4/%5 Chi: %6/%7 G2:%8 Mind: %9 AE:%10/%11% CF:%12} ${prompt1} ${prompt2}



And, here's a sample HP bar output--- yes, the * and & symbols are part of it.

Code:
*&HP: 525/525 PP: 521/521 Chi: 249/257 G2:2787806 Mind: 288 AE:4/88% CF:T
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3818

PostPosted: Sun Jul 25, 2010 8:42 am    Post subject: Reply with quote

It's the function argument change causing this.

Change every occurrence of: @colscale{%2 %3}; to @colscale{%2;%3}; and it'll work again.
Back to top
View user's profile Send private message Send e-mail
karvec



Joined: 16 Jul 2010
Posts: 50

PostPosted: Sun Jul 25, 2010 11:47 am    Post subject: Reply with quote

Changed it and working perfectly, thanks!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Bug Reports All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group