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

Achaea mud healthbar, wintin++.

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Finished Scripts
View previous topic :: View next topic  
Author Message
corda



Joined: 16 Jan 2011
Posts: 28

PostPosted: Thu May 19, 2011 10:49 am    Post subject: Achaea mud healthbar, wintin++. Reply with quote

Basically this is a multi coloured healthbar with dynamic width, the trick is you can resize resize wintin++ and it will use the new width.

Code:
#ACTION {^%1h, %2m {c?e?x?k?d?b?}-$}
{
   #nop *********************************************************************;
    #nop * prompt healthbar trigger, using the #SPLIT 0 1 split-line
   #nop * $hpsize is the total width of the bar, resize wintin++ to update;
    #nop * healthbar is a combination of ||||:: characters, feel free to change;
   #nop * %1 is the current health, to get your $maxhealth catch it using QSC;
    #nop * $bar variable contains the full healthbar that we use in #PROMPT;
    #nop * at the moment there is a 150 char width limit, it should be enough.;
    #nop *********************************************************************;
    #variable bar {};
   #math healthbar $hpsize * %1/$maxhealth;
   #if {$healthbar > $hpsize}
   {
      #nop sometimes your current health is bigger than max, if a rune fades etc;
      #variable healthbar $hpsize
   };
   #loop {1} {$healthbar} {count}
   {
      #if {$count < 150 && $healthbar != 0}
      {
         #if {$count < 20 && $count > 0}
         {
                #nop | char represents your health;
            #variable bar $bar<179>|
         };
         #if {$count < 45 && $count > 19}
         {
                #variable bar $bar<029>|
         };
         #if {$count < 150 && $count > 44}
         {
            #variable bar $bar<129>|
         }
      }
   };
   #math rightside $hpsize-$healthbar;
   #if {$rightside != 0}
   {
      #loop {1} {$rightside} {temp}
      {
         #if {$temp < 150}
         {
                #nop red : is the damage;
            #variable bar $bar<109>:
         }
      }
   };
   #if {%1 < $maxhealth-$sipthreshold}
   {
      #nop sip/quaff yer health elixer
   }
}
{5}


Use #split 0 1 or simply #split when you login, #prompt will use the splitline

Code:
#PROMPT           {%1h, %2m %3-}  {$bar}  {2}




Code:

#EVENT {SCREEN RESIZE}
{
   #echo {New screen size is: %0 x %1 now.};
   #variable hpsize %0;
   #cr
}


This is how it looks like:
Back to top
View user's profile Send private message
goofy



Joined: 24 Mar 2008
Posts: 164

PostPosted: Tue Dec 16, 2014 8:59 am    Post subject: Reply with quote

neat.
_________________
www.abandonedrealms.com
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 -> Finished Scripts 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