The small plugin below illustrates using how you can update the status line (or do something else with it if you want) based on incoming text from the MUD *before* receiving a newline.
This has been asked for so often in the past, it is nice to be able to release a working example.
You need MUSHclient version 3.44 which is the first to support the new plugin callback OnPluginPartialLine.
You will probably need to customise the regular expression it matches on (or change your prompt) to get it to work for you, but this is a minor detail.
What it does is inspect incoming text and if it matches the regular expression, immediately update the status line.
You could use a variation of it to warn you (with world.ColourNote for instance) if your HP are running low.
This has been asked for so often in the past, it is nice to be able to release a working example.
You need MUSHclient version 3.44 which is the first to support the new plugin callback OnPluginPartialLine.
You will probably need to customise the regular expression it matches on (or change your prompt) to get it to work for you, but this is a minor detail.
What it does is inspect incoming text and if it matches the regular expression, immediately update the status line.
You could use a variation of it to warn you (with world.ColourNote for instance) if your HP are running low.
<?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 regular expression 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 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
'
' Update the status line
'
SetStatus "Hp = " & Match.SubMatches (0) & _
"/" & Match.SubMatches (1) & _
", Mana = " & Match.SubMatches (2) & _
"/" & Match.SubMatches (3) & _
", Move = " & Match.SubMatches (4) & _
"/" & Match.SubMatches (5)
Set Match = Nothing
end sub
]]>
</script>
</muclient>