Thank you! as always your advice was perfect. And for your prize, here is what I was actually doing:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="MM_Extended_Prompt"
author="Brian Lake"
id="01f94fbc27ac45564681f20a"
language="Lua"
purpose="Extends Prompt Functionality"
date_written="2010-06-26 10:04"
requires="4.37"
version="1.0"
>
<description trim="y">
<![CDATA[
Extends the prompt to show the amount of change
in HP, SP and ST per round.
]]>
</description>
</plugin>
<triggers>
<trigger
enabled="y"
match="^(?:.+|)\<(?P<hp>[0-9]{1,4})hp (?P<sp>(?1))sp (?P<st>(?1))st\>"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="90"
>
<send>
HP = %1
SP = %2
ST = %3
for _,v in ipairs(TriggerStyleRuns) do
ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), v.text)
end
if (HP - Old_HP) ~= 0 or (SP - Old_SP) ~= 0 or (ST - Old_ST) ~= 0 then
ColourTell("mediumblue","black", "[ ")
if (HP - Old_HP) > 0 then
ColourTell("green","black", (HP - Old_HP))
Old_HP = HP
elseif (HP - Old_HP) == 0 then
ColourTell("silver","black", (HP - Old_HP))
Old_HP = HP
else
ColourTell("firebrick","black", (HP - Old_HP))
Old_HP = HP
end
ColourTell("silver","black"," - ")
if (SP - Old_SP) > 0 then
ColourTell("green","black", (SP - Old_SP))
Old_SP = SP
elseif (SP - Old_SP) == 0 then
ColourTell("silver","black", (SP - Old_SP))
Old_SP = SP
else
ColourTell("firebrick","black", (SP - Old_SP))
Old_SP = SP
end
ColourTell("silver","black"," - ")
if (ST - Old_ST) > 0 then
ColourTell("green","black", (ST - Old_ST))
Old_ST = ST
elseif (ST - Old_ST) == 0 then
ColourTell("silver","black", (ST - Old_ST))
Old_ST = ST
else
ColourTell("firebrick","black", (ST - Old_ST))
Old_ST = ST
end
ColourTell("mediumblue","black"," ]")
end
Note() -- finish the line</send>
</trigger>
</triggers>
<script>
<![CDATA[
]]>
function OnPluginInstall ()
Old_HP = 0
Old_SP = 0
Old_ST = 0
end -- OnPluginInstall
</script>
</muclient>
If you can't immediately tell, it's a little plugin to extend the prompt in Materia Magica to show the amount of change in Hit Points, Spell Points, and Stamina per round, if and only if there has been any change. |