Group Health Window

Kegor
Member
Kegor
Member
Joined: Feb 18 2008, 02:32 PM

Aug 12 2009, 09:07 PM #1

This script creates a window named "Health" that captures group information when the group list is viewed using the group command. When group members are hurt to small wounds or worse, it will display the hit point information and percentage with the color of their condition to the window which can be resized and docked to always be viewable.

You will need to use this trigger in a group situation where someone is hurt to small wounds or worse to activate it. Once activated, move, resize, and dock the window how you like it. Then click on the Health window and go to settings and save them. That way it will pop up that way each time you use it.

IMPORT:

Code: Select all

#CLASS HEALTH
#ALIAS gr {#CL Health;group}
#TRIGGER {move%s&#40;%d&#41;/&#40;%d&#41;%shit%s-%s&PLAYER} {#VAR PCT {};#MATH PCT %float&#40; %1&#41;/%float&#40; %2&#41;;#VAR PCT %format&#40; 2, @PCT&#41;;#VAR PCT %replace&#40; @PCT, "0.", ""&#41;;#IF &#40;@PCT = 1.00&#41; {@PCT = 100};#IF &#40;%isfloat&#40; @PCT&#41; > 0&#41; {@PCT = 100};#IF &#40;@PCT < 91 & @PCT > 75&#41; {#WINDOW Health %ansi&#40; 14&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER;#MAKEWINDOW _previous Redirect};#IF &#40;@PCT < 76 & @PCT > 50&#41; {#WINDOW Health %ansi&#40; 13&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER;#MAKEWINDOW _previous Redirect};#IF &#40;@PCT < 51 & @PCT > 33&#41; {#WINDOW Health %ansi&#40; 5&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER;#MAKEWINDOW _previous Redirect};#IF &#40;@PCT < 34 & @PCT > 15&#41; {#WINDOW Health %ansi&#40; 12&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER;#MAKEWINDOW _previous Redirect};#IF &#40;@PCT < 10 & @PCT > 0&#41; {#VAR PCT {%replace&#40; @PCT, "0", ""&#41;}};#IF &#40;@PCT < 16 & @PCT > -500&#41; {#WINDOW Health %ansi&#40; 4&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER;#MAKEWINDOW _previous Redirect}}
#CLASS 0
QUICK VIEW:

Code: Select all

ALIAS&#58; gr

#CL Health
group


TRIGGER&#58; move%s&#40;%d&#41;/&#40;%d&#41;%shit%s-%s&PLAYER

#VAR PCT {}
#MATH PCT %float&#40; %1&#41;/%float&#40; %2&#41;
#VAR PCT %format&#40; 2, @PCT&#41;
#VAR PCT %replace&#40; @PCT, "0.", ""&#41;
#IF &#40;@PCT = 1.00&#41; {@PCT = 100}
#IF &#40;%isfloat&#40; @PCT&#41; > 0&#41; {@PCT = 100}
#IF &#40;@PCT < 91 & @PCT > 75&#41; {
  #WINDOW Health %ansi&#40; 14&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER
  #MAKEWINDOW _previous Redirect
  }
#IF &#40;@PCT < 76 & @PCT > 50&#41; {
  #WINDOW Health %ansi&#40; 13&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER
  #MAKEWINDOW _previous Redirect
  }
#IF &#40;@PCT < 51 & @PCT > 33&#41; {
  #WINDOW Health %ansi&#40; 5&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER
  #MAKEWINDOW _previous Redirect
  }
#IF &#40;@PCT < 34 & @PCT > 15&#41; {
  #WINDOW Health %ansi&#40; 12&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER
  #MAKEWINDOW _previous Redirect
  }
#IF &#40;@PCT < 10 & @PCT > 0&#41; {#VAR PCT {%replace&#40; @PCT, "0", ""&#41;}}
#IF &#40;@PCT < 16 & @PCT > -500&#41; {
  #WINDOW Health %ansi&#40; 4&#41;%1~/%2 * @PCT~% %ansi&#40; 7&#41;- %ansi&#40; 11&#41;@PLAYER
  #MAKEWINDOW _previous Redirect
  }
Quote
Like
Share

Confirmation of reply: