|
coamenel Newbie
Joined: 31 Aug 2005 Posts: 7
|
Posted: Wed Aug 31, 2005 1:26 pm
help with triggers using white space before numeric value |
Hi,
I'm having some troubles creating triggers to keep track of my herbs.
They are used to update the values of some variables. Whenever i check my rift, the screen would look something like this:
Code: |
[1367] bayberry bark [ 16] bellwort flower [ 117] black cohosh
|
To capture the numeric values, I've tried the following triggers:
Quote: |
~[&%dcohosh~] black cohosh
~[%s&%dcohosh~] black cohosh
|
Since some fields are started with one or more spaces, I prefer the second one. However, for fields like the bayberry above. The %s is too much, %d only captures the last number then.
Is there any way to solve this problem?
Thanks in advance! |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Wed Aug 31, 2005 2:14 pm |
try using
{|%s}
rather than just %s
That will match anything with any number of spaces or no spaces
so
~[{|%s}&%dcohosh~] black cohosh |
|
|
|
coamenel Newbie
Joined: 31 Aug 2005 Posts: 7
|
Posted: Fri Sep 02, 2005 6:42 am |
Didn't think of that one.. thanks for the suggestion!
However, i doesn't seem to work. Within my alias i get the following error:
Quote: |
#TRIGGER {~[{|%s}&%dcohosh~] black cohosh} {} concoctions
^ syntax error
|
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Sep 02, 2005 9:02 am |
I edited your post to use code tags instead of quote so we could see the actual spacing. Since they all have 4 spaces I would suggest using a fixed width pattern.
#TRIGGER {~[(&4)~] black cohosh} {#VARIABLE cohosh {%trim("%1")}} concoctions |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
coamenel Newbie
Joined: 31 Aug 2005 Posts: 7
|
Posted: Fri Sep 02, 2005 9:19 am |
works like a charm!
thanks!
I was fooling around with the &nn thingie, but wasn't able to get it to work. Now i've got a working trigger AND i know how to use &nn!! |
|
|
|
|
|