FBMW++

By Pea Cracker Last update Feb 24, 2009 — Installed 39,028 times.

More colourful status bars

in
Subscribe to More colourful status bars 1 post, 1 voice

Chrisos User

Hey all,

Here's some code I quickly knocked out to make the status bars a little more visible (I'm colourblind), and so that they change colour based on status.

Just look for the block of code that starts with this:

if (boss.preferences.gui)

And replace it and the following block with:

if (boss.preferences.gui)
  {
  var pixels = 160;
  var HpRatio = boss.health / boss.max_health;
  var HpBar = Math.floor(pixels * HpRatio);
  var HpBarColor = HpRatio <= 0.2 ? '#FF0000' : HpRatio >= 0.6 ? '#00FF00' : HpRatio <= 0.3 ? '#AA0000' : '#3333FF';
  var EnRatio = boss.energy / boss.max_energy;
  var EnBar = Math.floor(pixels * EnRatio);
  var EnBarColor = EnRatio <= 0.2 ? '#FF0000' : EnRatio >= 0.6 ? '#00FF00' : '#3333FF';
  var StRatio = boss.stamina / boss.max_stamina;
  var StBar = Math.floor(pixels * StRatio);
  var StBarColor = StRatio <= 0.2 ? '#FF0000' : StRatio >= 0.6 ? '#00FF00' : '#3333FF';
  menuCode.push('<div style="background:#000000;color:#ffffff;height:41px;margin-top:1px;margin-bottom:1px;">');
  menuCode.push('<div style="margin:2px 0px 0px 2px;height:12px;float:left;background-color:'+HpBarColor+';width:'+HpBar+'px;"> </div><div style="margin:2px 2px 0px 0px;height:12px;float:left;background-color:#FFAAD4;width:'+(pixels-HpBar)+'px;"> </div> Health: '+boss.health + '/' + boss.max_health);
  menuCode.push('<br /><div style="margin:1px 0px 0px 2px;height:12px;float:left;background-color:'+EnBarColor+';width:'+EnBar+'px;"> </div><div style="margin:1px 2px 0px 0px;height:12px;float:left;background-color:#FFAAD4;width:'+(pixels-EnBar)+'px;"> </div> Energy: '+boss.energy + '/' + boss.max_energy);
  menuCode.push('<br /><div style="margin:0px 0px 2px 2px;height:12px;float:left;background-color:'+StBarColor+';width:'+StBar+'px;"> </div><div style="margin:0px 2px 2px 0px;height:12px;float:left;background-color:#FFAAD4;width:'+(pixels-StBar)+'px;"> </div> Stamina: '+boss.stamina + '/' + boss.max_stamina);
  menuCode.push('</div>');
  }

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel