Variable list in trigger pattern

Posted by Larkin on Wed 20 Aug 2008 02:36 AM — 4 posts, 17,898 views.

#0
I have this variable:
<variables>
  <variable name="treant_fluids">absinthe|glowing ink|magical salt|magical sulfur|aleutian|anatine|anerod|botulinum|calcise|chansu|charybdon|contortrin|crotamine|dendroxin|dulak|escozul|hadrudin|haemotox|ibululu|inyoka|mactans|mantakaya|mellitin|morphite|niricol|saxitin|senso|tetrodin|allheale|antidote|bromides|choleric|fire|frost|healing|love|mana|phlegmatic|quicksilver|sanguine|vitae|liniment|melancholic|mending|regeneration|empty</variable>
</variables>


And it's being used in this trigger:
<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   group="Treant_Potionlist"
   match="^\d+\s+an? (.+?) vial\s+.*?(@treant_fluids).*?\s+(\d+)\s+(\d+)$"
   name="potionadd__"
   regexp="y"
   send_to="12"
   sequence="10000"
  >
  <send>potions:add("%1", "%2", %3, %4)</send>
  </trigger>
</triggers>


Text to trigger it:
120083   a glowing jade vial            a phlegmatic purgati      100        2
120140   a glowing emerald vial         empty                       0        2
120234   a turquoise vial               the poison morphite        50      152


It's not firing on lines like these unless I replace the variable with the literal list of strings. Is there something I'm missing here?

USA #1
I tried this the other day too for a gag trigger. I encountered the same issue.
#2
Okay! I finally found the answer to my problem.

I vaguely remembered that there was a special syntax for using a variable as a string list in a regex pattern, but I forgot the exact usage. If I change (@treant_fluids) to (@!treant_fluids), the trigger fires as it should.

Don't know if that helps you at all, WillFa, but there it is. :)
USA #3
Ahh, thanks. Didn't know about that one either :)