<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>

<muclient>

<plugin
 name="Offering"
 author="Trevize"
 id="f9a86b675c4c314dab7a7f04"
 language="Lua"
 purpose="Automatic Offering"
 requires="4.40"
 version="2.20">

<description trim="y">
<![CDATA[

Automatic Offering 2.2.0

SAC offers all corpses in your inventory
GC gets all corpses on the ground
GIVEC <person> gives all corpses to another

Enjoy!

-Trevize

]]>
</description>

</plugin>


<triggers>
  <trigger
   group="offering"
   ignore_case="y"
   match="^\s*([^ ]+)\s+the corpse of"
   regexp="y"
   send_to="12"
   sequence="100">
    <send>Send (offering.prefix .. "%1" .. offering.suffix)</send>
  </trigger>

  <trigger
   group="offering"
   match="^Number of matching objects\: \d+ \(out of \d+ total\)$"
   regexp="y"
   send_to="12"
   sequence="100">
    <send>
      EnableTriggerGroup ("offering", false)
      ResetTimer ("failsafe")
      EnableTimer ("failsafe", false)
    </send>
  </trigger>

  <trigger
   group="offering"
   match="^You are wearing\:$"
   regexp="y"
   send_to="12"
   sequence="100">
    <send>
      EnableTriggerGroup ("offering", false)
      ResetTimer ("failsafe")
      EnableTimer ("failsafe", false)
    </send>
  </trigger>

  <trigger
   group="offering"
   match="^\[Type MORE if you wish to continue reading. \(\d+\% shown\)\]$"
   regexp="y"
   send_to="12"
   sequence="100">
    <send>
      EnableTriggerGroup ("offering", false)
      ResetTimer ("failsafe")
      EnableTimer ("failsafe", false)
    </send>
  </trigger>
</triggers>


<timers>
  <timer
   name="failsafe"
   second="2.50"
   offset_second="0.00"
   send_to="12">
    <send>
      EnableTriggerGroup ("offering", false)
      ResetTimer ("failsafe")
      EnableTimer ("failsafe", false)
    </send>
  </timer>
</timers>


<aliases>
  <alias
   match="^gc$"
   enabled="y"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100">
    <send>
      EnableTriggerGroup ("offering", true)
      EnableTimer ("failsafe", true)
      ResetTimer ("failsafe")
      Send ("ih corpse")
      offering.prefix = "get "
      offering.suffix = ""
    </send>
  </alias>

  <alias match="^givec (\w+)$"
   enabled="y"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100">
    <send>
      EnableTriggerGroup ("offering", true)
      EnableTimer ("failsafe", true)
      ResetTimer ("failsafe")
      Send ("ii corpse")
      offering.prefix = "give "
      offering.suffix = " to %1"
    </send>
  </alias>

  <alias
   match="^sac$"
   enabled="y"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100">
    <send>
      EnableTriggerGroup ("offering", true)
      EnableTimer ("failsafe", true)
      ResetTimer ("failsafe")
      Send ("ii corpse")
      offering.prefix = "offer "
      offering.suffix = ""
    </send>
  </alias>
</aliases>


<script>
<![CDATA[

offering = {
  prefix = "offer ",
  suffix = "",
  }

]]>
</script>

</muclient>
