|
cxs410 Beginner
Joined: 04 Oct 2005 Posts: 20
|
Posted: Thu Nov 03, 2005 11:42 pm
Really tough one.. |
I want to capture these...
[Spells Memorized]
1: ( 3)create food ( 2)create water ( 4)cure light
( 1)know alignment
2: ( 1)bless ( 1)detect invisibility ( 1)infravision
( 3)cure serious ( 1)protection from good
3: ( 4)cure critic ( 1)summon ( 1)sense life
( 1)aid
[Spells Being Memorized]
2: ( 1h)protection from evil
5: ( 1h)magic vestment ( 1h)sanctuary
And put them into variables, preferably I would capture what I really care about is memed, not what is being memed... any ideas how i can capture this... and put the ( 3) into a varable.. like @create_food_count |
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Thu Nov 03, 2005 11:57 pm |
well.. if you got a small amount of things that you need to capture..
#trigger {~( (%n)~)create food} {#var createFoodCount {%1}
#trigger {~( (%n)~)create water} {#var createWaterCount {%1}
etc etc...
or...
#var spellList {createfood|createwater|curelight}
#trigger {~( (%n)~)(*){$|~(}} {#forall {@spelllist} {#if (%replace(%2," ", "") = %i) {#var %replace(%2," ", "")count {%1}} } }
that second one may need some tweaking... but I just noticed the clock hit 8.. and that means I am outta work.. I might work on it some more later |
|
|
|
cxs410 Beginner
Joined: 04 Oct 2005 Posts: 20
|
Posted: Fri Nov 04, 2005 12:22 am |
ok the first way works, but what needs to change if the variable is (10)create food that seems to not work..
|
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Fri Nov 04, 2005 2:44 am |
#trigger {~({ (%n)|(%n)}~)create food} {etc}
|
|
|
|
cxs410 Beginner
Joined: 04 Oct 2005 Posts: 20
|
Posted: Fri Nov 04, 2005 3:41 am |
That doesn't seem to work...
(10)cure light hrmm. |
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Fri Nov 04, 2005 7:03 am |
guess you gotta go two seperate triggers... since if it's only 1 digit.. it's tossing a space in there
#trigger {~((%n)~)create food} {etc}
and
#trigger {~( (%n)~)create food} {etc} |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Fri Nov 04, 2005 1:34 pm |
rather than %n just use %d
|
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Fri Nov 04, 2005 3:53 pm |
Just a question, what's the major difference? the only difference I know is that %n will capture commas... does %d do variable spaces around it?
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Fri Nov 04, 2005 4:30 pm |
You can see here for more information on pattern matching..
Quote: |
%d match any number of digits (0-9)
%n match a number that starts with a + or - sign
|
|
|
_________________ Asati di tempari! |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Nov 04, 2005 8:56 pm |
And actully this can be accomplished with 1 trigger using Fixed-Width matching
#TRIGGER {~((&2))~)create food} {#SAY %trim("%1")} |
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Sat Nov 05, 2005 3:20 am |
Can I ask where Fixed-Width matching is listed in helps any chance?
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sat Nov 05, 2005 3:43 am |
Pattern Matching &nn matches exactly nn characters (fixed width pattern)
|
|
|
|
|
|