Help with a trigger

Posted by AquaBrother on Sun 07 Oct 2007 09:28 PM — 2 posts, 12,432 views.

Brazil #0
hi, i have a trigger like: ^(?P<target>.*) told \'fly\'$
and in the send box: cast fly %<target>
i'd like to make a list of ppl which my trigger would not launch the fly spell, something like this:
if %<target> is not (ppl1|ppl2|and so on)
cast fly %<target>

was i clear? hehe...

hope you can help me, thanks anyway for your supporting will :D
Amended on Sun 07 Oct 2007 09:29 PM by AquaBrother
Australia Forum Administrator #1
Something like this should work - we use scripting to make a decision:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="^(?P&lt;target&gt;[A-Za-z]+) told \'fly\'$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>

target = "%&lt;target&gt;"

-- build exclusions table by key
if not exclusions then

  exclusions = {}

  for k, v in ipairs {

    "person1",
    "person2",
    "person3",  
    -- and so on

    } do
    exclusions [v] = true
  end -- for loop

end -- table not built yet

if not exclusions [target] then
  Send ("cast fly " .. target)
end -- if not in exclusions table

</send>
  </trigger>
</triggers>