health, mana, will, experience, and endurance bars along bottom of screen

ok, this is what i took it from:
all i want is the health mana etc.. guages. 
it says i need to make a trigger and i am not sure wether the lines go in the Script box or if they are the ones it triggers off
and if it goes in the script box, what does it trigger off? or vice-versa
this is the lines and instructions that came with them:


  • Please take the following with healthy skepticism because my Mudlet knowledge is based almost entirely on throwing stuff together and hoping it works.

    Basically what you need to do is create a trigger that will update your gauges with enough frequency to be accurate. I accomplished this by making the trigger fire on the game's prompt, which I'm told is actually not good practice, but it works, and I've not been able to think of any better alternatives. So your trigger would be called by something like this:
    ^(\d+)h, (\d*)m
    And execute the following code:
    vitals = gmcp.Char.Vitals

    health_percent = (vitals.hp/vitals.maxhp) * 100 if health_percent > 100 then health_percent = 100 end mana_percent = ( * 100 if mana_percent > 100 then mana_percent = 100 end end_percent = (vitals.ep/vitals.maxep) * 100 if end_percent > 100 then end_percent = 100 end will_percent = (vitals.wp/vitals.maxwp) * 100 if will_percent > 100 then will_percent = 100 end moonlightUI.hpbar:setValue (health_percent,100) moonlightUI.mpbar:setValue (mana_percent,100) moonlightUI.edbar:setValue (end_percent, 100) moonlightUI.wpbar:setValue (will_percent, 100)
    Good luck!
  • EldEld
    edited September 2014
    @Rohai has the right idea. I would point out that if you're going to be using the gmcp values (which I think makes sense) then you may as well just have a script that runs whenever you get the Char.Vitals gmcp event. To do that, create a new script in the script editor and in the "Add user defined event handler box" type "gmcp.Char.Vitals" and click the "+" on the right. Then in the main script box, define a function with the same name as the script that does the updating, basically as @Rohai showed. Here's a screenshot to illustrate (along with a more concise version of @Rohai's code):
    If you're not familiar with GMCP and want to learn more, I think a couple people have posted introductions to it on the forums which you should be able to find searching for GMCP, and there's a tutorial by Vadi on the IRE site, here

Sign In or Register to comment.