It wont let me add the entire thing so i'm adding only the parts that I changed.
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="^[PL\: (\d+)][KI\: (\d+)][STA\: (\d+)] "
regexp="y"
script="do_prompt"
sequence="100"
>
</trigger>
<trigger
enabled="y"
lines_to_match="2"
match="^\|CUR Pl\: [(\d+)] CUR KI\: [(\d+)] CUR STA\: [(\d+)]\n|MAX Pl\: [(\d+)] MAX KI\: [(\d+)] MAX STA\: [(\d+)]"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>
hp = %1
max_hp = %4
endurance = %2
max_endurance = %5
guile = %3
max_guile = %6
-- draw gauge
do_prompt ("", "", { pl, ki, sta } )
function do_prompt (name, line, wildcards)
pl = tonumber (wildcards [1])
ki = tonumber (wildcards [2])
sta = tonumber (wildcards [3])
-- don't know maxima yet? can't proceed
if max_pl == 0 or
max_ki == 0 or
max_sta <= 0 then
return
end
local pl_percent = pl / max_pl
local ki_percent = ki / max_ki
local sta_percent = sta / max_sta
DoGauge ("PL: ", pl_percent, ColourNameToRGB "red")
DoGauge ("KI: ", ki_percent, ColourNameToRGB "mediumblue")
DoGauge ("STA: ", sta_percent, ColourNameToRGB "gold")
WindowShow (win, true)
-- get maxima from last time
max_pl, max_ki, max_sta =
tonumber (GetVariable ("max_pl")) or 0,
tonumber (GetVariable ("max_ki")) or 0,
tonumber (GetVariable ("max_sta")) or 0
function OnPluginEnable ()
WindowShow (win, true)
-- draw gauge again if possible
if pl and ki and sta then
do_prompt ("", "", { pl, ki, sta } )
end -- if know pl, ki and sta
end -- OnPluginEnable
function OnPluginSaveState ()
-- save window current location for next time
movewindow.save_state (win)
SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
SetVariable ("max_pl", max_pl or 0)
SetVariable ("max_ki", max_ki or 0)
SetVariable ("max_sta", max_sta or 0)
end -- OnPluginSaveState
]]>
</script>
</muclient>
|