AdaCode / reflections.xml

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, December 03, 2012, 12:00 PM -->
<!-- MuClient version 4.77 -->

<!-- Plugin "Reflections" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Reflections"
   author="Ada"
   id="dca419617298d7aac80a6069"
   language="Python"
   purpose="Reflections"
   date_written="2013-01-12 12:00:00"
   requires="4.62"
   version="1.0"
   >
<description trim="y">
<![CDATA[
A collection of triggers and aliases to help me track a reflection target in the fray.
]]>
</description>

</plugin>

<!--  Get our standard constants -->

<include name="constants.pys"/>

<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   group="SetAllies"
   keep_evaluating="y"
   match="^You see the following people here\:$"
   name="WhoHerePreamble"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
peoplehere = []
world.EnableTrigger("PeopleHere", True)
world.EnableTrigger("PromptPeopleHere", True)
  </send>
  </trigger>
  <trigger
   enabled="n"
   group="SetAllies"
   keep_evaluating="y"
   match="(.+)"
   name="PeopleHere"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
peoplehere.append("%0")
  </send>
  </trigger>
  <trigger
   enabled="n"
   group="SetAllies"
   keep_evaluating="y"
   match="^\d+h(, \d+m)?(, \d+e)?(, \d+w)? [@cexkdb]*(?: Vote)?-"
   name="PromptPeopleHere"
   regexp="y"
   send_to="12"
   sequence="900"
  >
  <send>
world.EnableTrigger("PeopleHere", False)
world.EnableTrigger("PromptPeopleHere", False)
peoplehere = peoplehere[0].split(", ")
  </send>
  </trigger>
  <trigger
   enabled="y"
   group="ReadAllies"
   keep_evaluating="y"
   match="^(\w+) is an ally\."
   name="AllyLine"
   regexp="y"
   send_to="12"
   sequence="900"
  >
  <send>
allies["%1"] = True
  </send>
  </trigger>
</triggers>

<!--  Aliases  -->

<aliases>
  <alias
   match="^Reflections:allyall$"
   enabled="y"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>
for i in peoplehere:
    world.Send("ALLY %s" % i)
  </send>
  </alias>
  <alias
   match="^Reflections:reflect$"
   enabled="y"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>
Reflect(ref_target)
  </send>
  </alias>
  <alias
   match="^Reflections:test (.*?)$"
   enabled="y"
   regexp="y"
   send_to="12"
   ignore_case="y"
   sequence="100"
  >
  <send>exec("%1")</send>
  </alias>
</aliases>

<!--  Script  -->

<script>
<![CDATA[
def Note(message): # not writing world.Note everywhere ^_^
    world.Note(message)

peoplehere = []
allies = {}
ref_target = ""

danger_lines = [
    # Occultist:
    "^\w+ stands an Aeon tarot on (?:his|her) .+ at (\w+)\.$",
    "^\w+ tosses a tarot card at (\w+) and as it reaches (?:him|her), a huge mass of rope bursts out of it, entrapping and hindering (?:him|her)\.$",
    "^\w+ draws back with a knowing smirk and utters some alien word that you cannot comprehend\. (\w+) suddenly becomes very still and bleeds from (?:his|her) eyes and ears\.",

    # Dragon:
    "^Abruptly the keening ends\, and a blossom of ethereal tendrils bursts from (.*?)\'s chest\, ensnaring (?:him|her) in a web of undulating bonds\.$",
    "^\w+ viciously seizes (\w+) in (?:his|her) jaws\, tossing (?:him|her) effortlessly into the air before catching (?:him|her) in a second bite\.",

    # Meteor:
    "^The meteor slams into (\w+)\'s shield\, shattering it\.$",
    "^(\w+) stands\, wide\-eyed with terror\, as the blazing sphere slams into (?:his|her) body\, burning (?:him|her) horribly\.$",

    # Arrow:
    "^The arrow strikes (\w+)\, gouging a deep and bloody wound\.$",

    # Soulspear:
    "^A glowing spear comes flying in towards (\w+)\.",

    # Web:
    "^Sticky strands of webbing spray out from \w+ to cover (\w+)\.$",

    # Monk:
    "^You see a wave of energy shoot out from \w+ and slam into (\w+)\.$",
]

def ActionTriggers():
    for i in range(len(danger_lines)):
        world.AddTriggerEx(
            "danger_%d" % i,        # Trigger name
            danger_lines[i],        # Match text
            "RefTarget(\"%1\")",    # Response text
            eEnabled + eKeepEvaluating + eTriggerRegularExpression, # flags
            custom7,                # Colour
            0,                      # Wildcard
            "",                     # Sound file name
            "",                     # Script name
            12,                     # Send to (12 - script engine)
            900                     # Sequence
        )

ActionTriggers()

def RefTarget(name):
    global ref_target
    for i in allies.keys():
        if i == name:
            Note("REFLECT -> %s" % name)
            ref_target = name

def Reflect(name):
    world.Send("CAST REFLECTION AT %s" % name)
]]>
</script>

<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="Reflections:help"
   ignore_case="y"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
def OnHelp (a, b, c):
    world.note (world.GetPluginInfo (world.GetPluginID, 3))
]]>
</script>

</muclient>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.