|
Neuro Beginner
Joined: 22 Feb 2007 Posts: 19
|
Posted: Thu Feb 21, 2008 5:28 am
Capturing a number in a VAR.. |
(Glowing) a Solstice Potion (17)
(Glowing) a glowing violet potion (258)
a dispel magic potion (22)
Say I wanted to capture the quantity of my violet potions in a variable, when I examine the container.
Just doing, #trigger {(glowing) a glowing violet potion ((%w))} isn't doing anything, and is that because of the (( ))?
I'm not even sure how to word this question, heh. Hopefully someone just knows what I mean. |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Thu Feb 21, 2008 6:08 am |
Try
Code: |
#TRIGGER {~(Glowing~) a glowing violet potion (~(%d~))} |
That might work better IMHO.
Even better use a regex pattern...
Code: |
#TRIGGER {(\(Glowing\) a glowing violet potion (\(\d+\))} |
which is probably faster. |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Thu Feb 21, 2008 6:25 am |
%w captures a word, %d captures a number. You can look at Pattern Matching for more info.
|
|
_________________ Asati di tempari! |
|
|
|
Neuro Beginner
Joined: 22 Feb 2007 Posts: 19
|
Posted: Thu Feb 21, 2008 7:03 am |
IGNORE THIS, got it. thanks. (had another question here but figured it out)
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Feb 21, 2008 11:19 am |
Anaristos wrote: |
use a regex pattern... which is probably faster. |
A regex will only be about 0.000001s faster, and only the first time a trigger fires for that session. The only difference between a CMUD pattern and a regex is that CMUD patterns need to be converted into regexes before they're compiled. Once that happens, there's no speed benefit to using a regex. |
|
|
|
|
|