* trouble

Posted by Octavo on Wed 18 Aug 2004 04:16 AM — 5 posts, 18,400 views.

#0
Hi, I am trying to get the following trigger to work:

** You gain a practice point from *. **

Send to: Notepad(append) -> Prac from %3

The first and last two ** are sent by the mud, and the third * is the variable. Ive tried using reg expression like this:
^\*\* You gain a practice point from *. \*\*$

Send to: Notepad(append) -> Prac from %1

But it doesnt seem to work... What am I missing?
USA #1
When using regexps, you have other things meaning special things as well (* are no longer wildcards, instead a quantifier, read the regexp help)

try this:
^\* \* You gain a practice point from (.*?)\. \* \*$

Thats assuming theres spaces between the asterisks and such.
And youll use %1 to return the value.
USA #2
Trigger: ** You gain a practice point from *. **
and the * you want is %# where # is the number in numerical order which the * appears. For example.

You lose * points and your opponent loses * points.
%1 would be your points lost and %2 would be your opponents. Hope that clears it up for ya.
Amended on Wed 18 Aug 2004 05:38 AM by Jlzink
USA #3
Then youll use:
^\*\* You gain a practice point from (.*?)\. \*\*$
with %1 being the thing.

And:
^You lose (.*?) points and your opponent loses (.*?) points\.$

This wont match on singular points (unless they keep the s), you might want to try this instead:

^You lose (.*?) points? and your opponent loses (.*?) points?\.$

or if you want to get really picky and only match on digits, you could do this:
^You lose (\d+) points and your opponent loses (\d+) points\.$
And once again, that wont match if they drop the 's'.
#4
Thanks Flannel, that worked.

Jlzink, I used to have that as my old trigger, but the latest version of mushclient doesnt allow it anymore.