Alrighty, this is everything I have for it.
<triggers>
<trigger
enabled="y"
match="^(\d+)h, (\d+)m\, (\d+)e\, (\d+)p\, (\d+)en\, (\d+)w\ (.*?)$"
regexp="y"
script="prompt"
send_to="12"
sequence="100"
>
<send>sipper ()</send>
</trigger>
<trigger
enabled="y"
match="^\| Health \: (.*?)\/(.*?) Mana \: (.*?)\/(.*?) Ego \: (.*?)\/(.*?) (.*?) \|$"
regexp="y"
script="set_max"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^The potion heals and soothes you\.$"
regexp="y"
script="sip_balance_off"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^You may drink another health\, mana\, or bromide potion\.$"
regexp="y"
script="sip_balance_on"
sequence="100"
>
</trigger>
</triggers>
function prompt (name, line, matches, styles)
SetVariable ("current_h", matches [1])
SetVariable ("current_m", matches [2])
SetVariable ("current_e", matches [3])
end -- function
function set_max (name, line, matches, styles)
SetVariable ("max_h", matches [2])
SetVariable ("max_m", matches [4])
SetVariable ("max_e", matches [6])
end -- function
function percent_h (name, line, matches, styles)
max = {}
max_h = GetVariable ("max_h")
percents = {}
SetVariable ("perc_h", max_h / ( 100 / matches [1] ))
end -- function
function percent_m (name, line, matches, styles)
max = {}
max_m = GetVariable ("max_m")
percents = {}
SetVariable ("perc_m", max_m / ( 100 / matches [1] ))
end -- function
function percent_e (name, line, matches, styles)
max = {}
max_e = GetVariable ("max_e")
percents = {}
SetVariable ("perc_e", max_e / ( 100 / matches [1] ))
end -- function
function sip_off (name, line, matches, styles)
SetVariable ("sip_balance", "false")
end -- function
function sip_on(name, line, matches, styles)
SetVariable ("sip_balance", "true")
end -- function
function sipper ()
sip = {}
base_sip = GetVariable ("base_sip")
current_h = GetVariable ("current_h")
perc_h = GetVariable ("perc_h")
sip_balance = GetVariable ("sip_balance")
if current_h < perc_h and sip_balance then
Send ("sip health")
SetVariable ("sip_balance", "false")
end -- if
end -- function
|