Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Variable list in trigger pattern

Variable list in trigger pattern

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Larkin   (278 posts)  Bio
Date Wed 20 Aug 2008 02:36 AM (UTC)
Message
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?

Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #1 on Wed 20 Aug 2008 02:40 AM (UTC)
Message
I tried this the other day too for a gag trigger. I encountered the same issue.
Top

Posted by Larkin   (278 posts)  Bio
Date Reply #2 on Wed 20 Aug 2008 03:02 AM (UTC)
Message
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. :)
Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #3 on Wed 20 Aug 2008 03:08 AM (UTC)
Message
Ahh, thanks. Didn't know about that one either :)
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,127 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.