<triggers>
  <trigger
   enabled="y"
   group="system_triggers"
   keep_evaluating="y"
   match="^(?:The elixir heals and soothes you|Your mind feels stronger and more alert)\.$"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  <send>prebal.hm = true
ResetTimer ("failsafe_prebal_hm")
EnableTimer ("failsafe_prebal_hm", false)
balances.hm = false
EnableTimer ("failsafe_balances_hm", true)
ResetTimer("failsafe_balances_hm")</send>
  </trigger>
  <trigger
   enabled="y"
   group="system_triggers"
   keep_evaluating="y"
   match="^You may drink another health or mana elixir\.$"
   regexp="y"
   send_to="14"
   sequence="100"
  >
  <send>balances.hm = true
ResetTimer ("failsafe_balances_hm")
EnableTimer ("failsafe_balances_hm", false)</send>
  </trigger>
  <trigger
   enabled="y"
   group="system_vitals"
   keep_evaluating="y"
   match="^(\d+)h\, (\d+)m(?:\, \d+e)?(?:\, \d+w)? [cexkdb@]*\-"
   name="prompt"
   regexp="y"
   send_to="14"
   sequence="25"
  >
  <send>stats.health = %1
stats.mana = %2
heartbeat ()</send>
  </trigger>
  <trigger
   enabled="y"
   group="system_vitals"
   keep_evaluating="y"
   match="^Health\:\s+\d+\s*\/\s*(\d+)\s+Mana\:\s+\d+\s*\/\s*(\d+)$"
   name="score"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>stats.maxhealth = %1
stats.maxmana = %2</send>
  </trigger>
</triggers>

<aliases>
  <alias
   match="^(pause|unpause)$"
   enabled="y"
   group="system_commands"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>local x = string.lower ("%1")
system.paused = (x == "pause")
Note ("System " .. x .. "d.")</send>
  </alias>
  <alias
   match="^system$"
   enabled="y"
   group="system_commands"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>Note ("System Data")
local yesno = function (x) return x and "yes" or "no" end
Note ("")
Note ("Paused: " .. yesno (system.paused))
Note ("")
Note ("Health: " .. stats.health)
Note ("Max Health: " .. stats.maxhealth)
Note ("Mana: " .. stats.mana)
Note ("Max Mana: " .. stats.maxmana)
Note ("")
Note ("Sip Balance: " .. yesno (balances.hm))
Note ("Sip PreBalance: " .. yesno (prebal.hm))
Note ("")</send>
  </alias>
</aliases>

<timers>
  <timer name="failsafe_balances_hm" second="5.00" offset_second="0.00"    send_to="12"
>
  <send>balances.hm = true
if not system.paused then check.hm () end
ResetTimer ("failsafe_balances_hm")
EnableTimer ("failsafe_balances_hm", false)</send>

  </timer>
  <timer name="failsafe_prebal_hm" second="2.00" offset_second="0.00"    send_to="12"
>
  <send>prebal.hm = true
if not system.paused then check.hm () end
ResetTimer ("failsafe_prebal_hm")
EnableTimer ("failsafe_prebal_hm", false)</send>

  </timer>
</timers>