I hope that you don't mind Nick, but I adapted you Health_Bar plugin for the MUD called Achaea, just because so many people asked for help about it. It doesn't require any knowledge of VBScript and only needs a reconnect after being setup. Check the help file for more info.
Here's the code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient [
<!ENTITY trigger_match
"^(\d+)h, (\d+)m, (\d+)e, (\d+)w c?e?x?k?d?b?-(.*)$" >
]>
<!-- Saved on Monday, April 28, 2003, 9:53 AM -->
<!-- MuClient version 3.41 -->
<!-- Plugin "Health_Bar" generated by Plugin Wizard -->
<!--
You will probably need to customise the trigger to match your MUD.
See ENTITY line near top of file. The above trigger will match on:
<54/1000 hp 90/100 m 600/750 mv>
A simpler trigger would be:
<*/*hp */*m */*mv>
-.-.-.-.-.-.-.- ADAPTED TO ACHAEA! -.-.-.-.-.-.-.-
Reconnect to Achaea in order to lauch the plugin properly.
-->
<muclient>
<plugin
name="Health_Bar"
author="Nick Gammon"
id="a2af5216d68563401888e01e"
language="VBscript"
purpose="Shows HP, Mana, Endurance and Willpower in a colour bar"
date_written="2003-04-28 09:50:05"
date_modified="2003-04-28 12:40:05"
requires="3.29"
version="1.12"
>
<description trim="y">
<![CDATA[
IMPORTANT: In order for plugin to work properly you need to reconnect to Achaea or call out the SCORE.
ALSO, configure your PROMP to show ALL, i.e. Health, Mana, Endurance and Willpower. In order to do so, type CONFIG PROMPT ALL.
Original text:
Install this plugin to show an info bar with HP, Mana,
and Movement points shown as a bar (between 0 and 10 blocks).
You need your prompt line to display the appropriate information,
naturally. I used this in SMAUG:
prompt <%h/%H hp %m/%M m %v/%V mv>
fprompt <%h/%H hp %m/%M m %v/%V mv>
"prompt" sets the normal prompt, "fprompt" sets the fight prompt.
Customise the plugin if you want to match a different sort of prompt line.
To see this message, type: Health_Bar:help
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-.-.-.-.- Original Script -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.- by -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.- Nick Gammon -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-.-.-.-.- ADAPTED TO ACHAEA! -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.- by -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.- Caecilius Azon -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="&trigger_match;"
name="InfoBar"
regexp="y"
script="DoPrompt"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^Password correct\. Welcome to Achaea\.$"
regexp="y"
script="RunScore"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="Multi Line"
lines_to_match="3"
keep_evaluating="y"
match="You are level (.*?)\.\nHealth\: (.*?)\/(.*?) Mana\: (.*?)\/(.*?)\nEndurance\: (.*?)\/(.*?) Willpower\: (.*?)\/(.*?)\Z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>world.setvariable "HealthMax", %3
world.setvariable "ManaMax", %5
world.setvariable "EnduranceMax", %7
world.setvariable "WillpowerMax", %9</send>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
sub DoGauge (sPrompt, iCurrent, iMax, sGoodColour, sBadColour)
dim pc, count
'
' Do prompt in black Arial
'
InfoColour "black"
InfoFont "Arial", 10, 0
Info sPrompt
'
' Use Webdings for gauge (black square)
'
InfoFont "Webdings", 10, 0
pc = CInt ((CInt (iCurrent) / CInt (iMax)) * 10)
'
' Below 20% warn by using different colour
'
if pc < 2 then
InfoColour sBadColour
else
InfoColour sGoodColour
end if
'
' Draw active part of gauge
'
for count = 0 to pc
Info "g"
next
'
' Draw rest of gauge in grey (ie. unfilled bit)
'
InfoColour "dimgray"
while count <= 10
count = count + 1
Info "g"
wend
end sub
sub RunScore (sName, sLine, wildcards)
world.send("SCORE")
end sub
sub DoPrompt (sName, sLine, wildcards)
dim MaxH, MaxM, MaxE, MaxW
MaxH = world.getvariable("HealthMax")
MaxM = world.getvariable("ManaMax")
MaxE = world.getvariable("EnduranceMax")
MaxW = world.getvariable("WillpowerMax")
InfoClear
'
' World name
'
InfoFont "Times New Roman", 12, 1 ' 12 point Arial *bold*
InfoColour "darkgrey"
Info GetInfo (2) ' world name
DoGauge " HP: ", wildcards (1), MaxH, "darkgreen", "maroon"
DoGauge " Mana: ", wildcards (2), MaxM, "DarkBlue", "Blue"
DoGauge " Endurance: ", wildcards (3), MaxE, "orange", "orange"
DoGauge " Willpower: ", wildcards (4), MaxW, "purple", "purple"
end sub
'
' Do this once
'
ShowInfoBar vbTrue
]]>
</script>
<!-- Variables -->
<variables>
<variable name="WillpowerMax">1000</variable>
<variable name="HealthMax">1000</variable>
<variable name="ManaMax">10000</variable>
<variable name="EnduranceMax">10000</variable>
</variables>
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="Health_Bar:help"
enabled="y"
>
</alias>
</aliases>
<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script>
</muclient>
Just create a file called Health_Bar.xml with your notepad and paste in the code from above.
I really hope that you don't mind me posting it.
EDIT: A slight update has been made on 30th August 2005.
EDIT2: CONFIG PROMPT ALL notion added on 23rd February 2006. |