<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Sunday, May 28, 2006, 11:29 AM -->
<!-- MuClient version 3.65 -->

<!-- Plugin "Aardwolf_GroupMonitorLUA" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Aardwolf_GroupMonitorLUA"
   author="Onoitsu2"
   id="f21da20d1ba38ffa9ef8f7fa"
   language="Lua"
   purpose="Monitors the output of the group message for healing"
   save_state="y"
   date_written="2006-05-28 11:28:24"
   requires="3.65"
   version="1.1"
   >
<description trim="n">
<![CDATA[
Aardwolf_GroupMonitorLUA Help File

This will alter and colorize the output from the group command
This plugin is permenantly enabled, while installed, there is NO toggle.
To disable functionality, remove from the plugin list, located in the file menu.

To display help file again, reinstall plugin.

]]>
</description>

</plugin>


<!--  Get our standard constants -->

<include name="constants.lua"/>

<!--  Triggers  -->
<triggers>

</triggers>


<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   group="groupmonitor"
   keep_evaluating="y"
   match="\[\s?(\d{1,3})\s(.+)\]\s{2}(\w+)\s*(\d+)\/(\d+)\s*(\d+)\/(\d+)\s*(\d+)\/(\d+)\s*(\d+)\s*(.+)"
   omit_from_output="y"
   regexp="y"
   repeat="n"
   script="GroupMon"
   send_to="12"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="y"
   group="groupmonitor"
   match="^(Lvl \/ Gld  Name          Hp          Mana        Moves       Align   TNL|\-\-\-\-\-\-\-\-\-  \-\-\-\-\-\-\-\-\-\-\-\-  \-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-  \-\-\-\-)$"
   omit_from_output="y"
   regexp="y"
   repeat="y"
   sequence="100"
  >
  </trigger>
</triggers>

<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="gmhelp"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
function GroupMon(sName,sLine,wildcards)
--Note(wildcards[1] .. "-" .. wildcards[2]  .. "-" .. wildcards[3] .. "-" .. wildcards[4] .. "-" .. wildcards[5] .. "-" .. wildcards[6] .. "-" .. wildcards[7] .. "-" .. wildcards[8] .. "-" .. wildcards[9] .. "-" .. wildcards[10] .. "-" .. wildcards[11])
local message = ""
local hp, mn, mv, tnl, alignw
local hpc, mnc, tnlc, alignc
name = wildcards[3]
if string.len(name) < 13 then
name = name .. string.rep(" ",13-string.len(name)) .. " - "
else
name = name .. " - "
end -- if name
level = tonumber(wildcards[1])
nlevel = tostring(level + 1)
hppct = tonumber(wildcards[4]) / tonumber(wildcards[5])
mnpct = tonumber(wildcards[6]) / tonumber(wildcards[7])
mvpct = tonumber(wildcards[8]) / tonumber(wildcards[9])
exp = wildcards[11]
align = tonumber(wildcards[10])

if hppct <= 0.1 then
hpc = "tomato"
elseif hppct <= 0.4 and hppct > 0.1 then
hpc = "yellow"
else
hpc = "lime"
end -- if hp colors

if mnpct <= 0.1 then
mnc = "tomato"
elseif mnpct <= 0.25 and mnpct > 0.1 then
mnc = "yellow"
else
mnc = "deepskyblue"
end -- if mn colors

if tonumber(exp) < 100 then
tnlc = "greenyellow"
else
tnlc = "violet"
end -- if tnl colors

if hppct < 0.1 then
hppct = string.sub(tostring(hppct),-1)
hp = hppct .. "%HP"
else
hppct = string.sub(tostring(hppct),1,4)
hp = hppct * 100 .. "%HP"
end -- if hp

if mnpct < 0.1 then
mnpct = string.sub(tostring(mnpct),-1)
mn = mnpct .. "%MN"
else
mnpct = string.sub(tostring(mnpct),1,4)
mn = tonumber(mnpct) * 100 .. "%MN"
end -- if mn

if mvpct < 0.1 then
mvpct = string.sub(tostring(mvpct),-1)
mv = mvpct .. "%MV"
else
mvpct = string.sub(tostring(mvpct),1,4)
mv = tonumber(mvpct) * 100 .. "%MV"
end -- if mn

if string.len(exp) < 4 then
exp = string.rep(" ",4-string.len(exp)) .. exp
end -- if
if string.len(nlevel) < 3 then
nlevel = string.rep(" ",3-string.len(nlevel)) .. nlevel
end -- if
tnl = "   " .. exp .. "XP (Lvl " .. nlevel .. ")  "

if tonumber(align) < -333 and tonumber(align) >= -1000 then
alignw = "Evil"
alignc = "orangered"
elseif tonumber(align) >= -333 and tonumber(align) <= 333 then
alignw = "Neutral"
alignc = "gainsboro"
elseif tonumber(align) > 333 and tonumber(align) <= 1000 then
alignw = "Good"
alignc = "gold"
end -- if align

if string.len(hp) < 6 then
hp = string.rep(" ",6-string.len(hp)) .. hp
end -- if
if string.len(mn) < 8 then
mn = string.rep(" ",8-string.len(mn)) .. mn
end -- if
if string.len(mv) < 8 then
mv = string.rep(" ",8-string.len(mv)) .. mv
end -- if
if string.len(tnl) < 15 then
tnl = tnl .. string.rep(" ",15-string.len(tnl))
end -- if

--message = {"palegoldenrod","black",name,hhpc,"black",hp,mnc,"black",mn,"darkorange","black",mv,tnlc,"black",tnl,alignc,"black",alignw}
message = {"palegoldenrod","black",name,hpc,"black",hp,mnc,"black",mn,tnlc,"black",tnl,alignc,"black",alignw}
ColourNote(unpack(message))
end -- GroupMon

function OnPluginInstall()
OnHelp()
end -- OnPluginInstall

function OnHelp ()
  world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script> 

</muclient>

