161 lines
2.5 KiB
XML
161 lines
2.5 KiB
XML
<?xml version="1.0" encoding="US-ASCII"?>
|
|
|
|
<!DOCTYPE muclient [
|
|
<!ENTITY regexp_match
|
|
"^\<\-?(\d+)\/(\d+) hp \-?(\d+)\/(\d+) m \-?(\d+)\/(\d+) mv\>(.*?)$"
|
|
>
|
|
]>
|
|
|
|
<!-- Saved on Friday, February 13, 2004, 4:48 PM -->
|
|
<!-- MuClient version 3.44 -->
|
|
|
|
<!--
|
|
You will probably need to customise the regular expression to match your MUD.
|
|
|
|
See ENTITY line near top of file. The above regular expression will match on:
|
|
|
|
<54/1000 hp 90/100 m 600/750 mv>
|
|
|
|
A simpler trigger would be:
|
|
|
|
<*/*hp */*m */*mv>
|
|
|
|
-->
|
|
|
|
<!-- Plugin "Status_Bar_Prompt" generated by Plugin Wizard -->
|
|
|
|
<muclient>
|
|
<plugin
|
|
name="Status_Bar_Prompt"
|
|
author="Nick Gammon"
|
|
id="ff9331b06c15ab21046be001"
|
|
language="VBscript"
|
|
purpose="Updates the status bar from the prompt"
|
|
date_written="2004-02-13 16:41:24"
|
|
requires="3.44"
|
|
version="1.0"
|
|
>
|
|
|
|
</plugin>
|
|
|
|
|
|
<!-- 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 OnPluginPartialLine (sText)
|
|
Dim regEx, Matches, Match
|
|
|
|
'
|
|
' Make a regular expression to match on the line:
|
|
'
|
|
'
|
|
Set regEx = New RegExp
|
|
|
|
'
|
|
' exit CDATA block so we can use the trigger entity
|
|
'
|
|
]]>
|
|
|
|
regEx.Pattern = "®exp_match;"
|
|
|
|
<![CDATA[
|
|
|
|
'
|
|
' Execute regular expression
|
|
'
|
|
|
|
Set Matches = regEx.Execute (sText)
|
|
|
|
'
|
|
' Exit if no match
|
|
'
|
|
|
|
if Matches.Count = 0 then
|
|
Set regEx = Nothing
|
|
Set Matches = Nothing
|
|
exit sub
|
|
end if
|
|
|
|
Set Match = Matches.Item (0)
|
|
|
|
Set regEx = Nothing
|
|
Set Matches = Nothing
|
|
|
|
InfoClear
|
|
|
|
'
|
|
' World name
|
|
'
|
|
|
|
InfoFont "Arial", 12, 1 ' 12 point Arial *bold*
|
|
InfoColour "purple"
|
|
Info GetInfo (2) ' world name
|
|
|
|
DoGauge " HP: ", Match.SubMatches (0), Match.SubMatches (1), "darkgreen", "maroon"
|
|
DoGauge " Mana: ", Match.SubMatches (2), Match.SubMatches (3), "mediumblue", "mediumblue"
|
|
DoGauge " Move: ", Match.SubMatches (4), Match.SubMatches (5), "gold", "gold"
|
|
|
|
Set Match = Nothing
|
|
|
|
end sub
|
|
|
|
'
|
|
' Do this once
|
|
'
|
|
ShowInfoBar vbTrue
|
|
|
|
|
|
]]>
|
|
</script>
|
|
|
|
</muclient>
|