Infobar

Posted by Safiya on Sat 08 Aug 2009 07:41 PM — 5 posts, 21,431 views.

#0
In the Aard version of MUSH there is an infobar that has HP/Mana/Moves/EngagedMob Name and HP on the bottom of the screen all using bars.

Is there a way to add other info there as well? Like Xp TnL and/or Alignment? Not in bars.
Amended on Sat 08 Aug 2009 08:39 PM by Safiya
Australia Forum Administrator #1
Edit the plugin (in the plugins list click Edit), and in the middle somewhere find:


function draw_bar ()

  InfoClear ()
  
   -- item 7 is our HP
  DoGauge ("  HP: ",   stats.hp_percent, "darkgreen", "maroon")

  -- item 13 is enemy HP and item 12 is what we are doing, which should be "... fighting (enemy)"
  if stats.enemy_percent ~= "9999" then
    DoGauge ("  " .. stats.enemy .. ": ", stats.enemy_percent, "darkred", "red")
  end -- if fighting 

  -- item 8 is our mana
  DoGauge ("  Mana: ", stats.mana_percent, "mediumblue", "mediumblue")
  
  --  item 9 is our movement points
  DoGauge ("  Move: ", stats.moves_percent, "gold", "gold")
 
end -- draw_bar


Add some extra stuff before the find "end" like this:


function draw_bar ()

  InfoClear ()
  
   -- item 7 is our HP
  DoGauge ("  HP: ",   stats.hp_percent, "darkgreen", "maroon")

  -- item 13 is enemy HP and item 12 is what we are doing, which should be "... fighting (enemy)"
  if stats.enemy_percent ~= "9999" then
    DoGauge ("  " .. stats.enemy .. ": ", stats.enemy_percent, "darkred", "red")
  end -- if fighting 

  -- item 8 is our mana
  DoGauge ("  Mana: ", stats.mana_percent, "mediumblue", "mediumblue")
  
  --  item 9 is our movement points
  DoGauge ("  Move: ", stats.moves_percent, "gold", "gold")

  InfoColour "black"
  InfoFont ("Arial", 9, 0)
  Info ("  To level: ", stats.to_level)
  Info ("  Align: ", stats.align)
  
end -- draw_bar
#2
Ok, thank you. That is exactly what I was looking for. I was going crazy looking for an infobar plugin..its named Health Bar (I should have read the descriptions better).

What I dont see (or recognize as such) is where the size of the bar is determined. As is, it does not extend across the bottom of my screen and I would like it to so I can add more info there.

I am trying to learn this stuff but even the simple tasks are beyond me atm.
Australia Forum Administrator #3
The width of the infobar is fixed, unfortunately.

However if you want to do fancier things you are probably better off using miniwindows. They can be made any size, and can have bars, text, images, whatever you want.

To help you get started, check out Willfa's module which does most of the work, so you can quickly draw text and gauges with a minimum of effort.

http://www.gammon.com.au/forum/?id=9097
Australia Forum Administrator #4
Also take a look at this:

http://www.gammon.com.au/forum/?id=9270

That is a health bar plugin done with miniwindows. You could adapt that, too.

The Aardwolf version of that is here:

http://www.gammon.com.au/forum/?id=9575