This is the script that I use in MUSHclient to give me a status bar at the bottom of the window displaying my current HP, GP and XP.
It collects data from "
score brief", the combat monitor ("
monitor on" if you haven't already done that...) and the MXP entities that the MUD sends back every time you enter a command (if you have MXP enabled), then estimates your current HP/GP/XP based on the number of heartbeats that have elapsed since the last set of data was received and your HP/GP regen rate. It isn't 100% accurate, but I've found that it's good enough for my purposes.
- The MUD only sends MXP entities for HP/GP/XP immediately upon you sending a command, so if, for example, you queue commands to perform rituals, at the end of the queue your GP will have reduced, but the status bar won't have been updated to reflect that. If you only send a single command, the GP cost of it is likely to be updated correctly, but only if the command is executed immediately.
- This script is unable to detect if your HP and/or GP regen rates are changed at any point while playing, such as from stat changes. Mishal's GP regen rate is changed from 3 to 4 when he wears his flat cap, so I set up extra triggers and script functions to handle it correctly, but that's outside the scope of this little page. (It doesn't require much JScript/MUSHclient knowledge to implement, however).
- Similarly it will be unable to detect when your idle XP rate changes. It's set to always use 3 XP per heartbeat, but apparently this changes if you gain too much XP in a given time period (over 500,000 XP per hour or something like that). I doubt that this will be an issue for too many people, though.
- (I will be assuming in the below instructions that you do not already have a MUSHclient script installed. If you do, you will need to merge them, and that is up to you.)
- Firstly you will need this .js file.
- Extract the .js file from the .zip somewhere (the location does not matter, but remember it as you will need it later).
Open the world properties dialog in MUSHclient and select the Scripts section. In there, set the "Script File" text box to be the path to the .js file you just extracted, and ensure that "JScript" is selected as the Scripting Language.
Next select the Triggers section of preferences. You will need to create three new triggers:
Then select the Timers section. You will need to create two new timers:
- Ensure that the "Info Bar" option is ticked in the "View" menu of MUSHclient's main window.
Only limited configuration is needed. Open up the downloaded .js file in Notepad (or your text editor of choice - Visual Studio handles .js files nicely, but that's overkill for these purposes); the only two lines that you need to check are the first two non-comment lines:
var HPRegenRate = 3;
This needs to be changed to your HP regeneration rate. If you don't know it, you can get a calculator to determine it at Skills, Stats and Bonuses web site, and it will probably be a value between 1 and 6.
var GPRegenRate = 3;
This needs to be changed to your GP regeneration rate. If you don't know it, you can get a calculator to determine it at Skills, Stats and Bonuses web site, and it will probably be a value between 1 and 4.
After those two lines, the rest of the configuration only affects the aesthetics of the status bar:
var barRedPercent = 0;
This is the percentage of HP/GP at which the bar will be "red". Obviously this should be left at 0.
var barYellowPercent = 33;
This is the percentage of HP/GP at which the bar will be "yellow". Default is 33, i.e. a third.
var barGreenPercent = 66;
This is the percentage of HP/GP at which the bar will be "green" (dark green). Default is 66, i.e. two thirds.
var barFullPercent = 100;
This is the percentage of HP/GP at which the bar will be "full" (bright green). Default is 100, but a slightly lower value might be preferable, depending on your purposes.
var barRed = "#ff0000";
The HTML hex code that the bar will be in its "red" state. Default is "
#ff0000", i.e. bright red.
var barYellow = "#ffff00";
The HTML hex code that the bar will be in its "yellow" state. Default is "
#ffff00", i.e. bright yellow.
var barGreen = "#00a000";
The HTML hex code that the bar will be in its "green" state. Default is "
#00a000", i.e. dark green.
var barFull = "#00ff00";
The HTML hex code that the bar will be in its "full" state. Default is "
#00ff00", i.e. bright green.
var barBackground = "#808080";
The HTML hex code for the status bar background. Default is "
#808080", i.e. a neutral grey.
I provide this script for free without any warranties, implied or otherwise, etc. etc. etc., but should you have problems with it, feel free to give me (i.e. Mishal) a shout on the MUD and I can try to help you. As for the copyright status of this script; yes, I made it, but it's so short (under 200 lines) and comparitively trivial, so I'm not going to come running after anyone using it in any way, so long as it's not in a way that is detrimental to myself (e.g. converting it to a script that does damage to the user's computer, then blaming it on me).
Also, major fluffs to Wodan for adding the MaxGP and MaxHP MXP entities recently. The data has existed inside the entities as an attribute for some time, but MUSHclient wasn't able to extract it - the new entities have fixed that little problem.