|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Sat Apr 12, 2008 7:22 pm
[2.22] $ |
Using $ in a trigger pattern to capture multiple lines will give you an error on the 'Compiled Pattern' tab, because it thinks the user is trying to use a local variable.
It still runs fine. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Apr 23, 2008 7:44 pm |
Hmm, true. That might be a hard one to fix in the parser since it's such a special case. Especially since it's ambiguous whether you are really using a local variable or not.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Wed Apr 23, 2008 8:01 pm |
I don't think it should be looking for a local variable in the pattern.
At no time should it be possible for it to have a definition when the trigger fires. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Apr 23, 2008 8:13 pm |
($localvar:test) is why it's looking for them - it needs to do so. Perhaps if it were (?$localvar:test)? Fits with the var=value syntax, too.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Apr 23, 2008 8:30 pm |
Shalimar: That isn't true. There are several cases where you would want a local variable in a trigger pattern if you were defining your own triggers dynamically:
Code: |
$target="Zugg"
#TRIGGER {$target tells you} {#show fired} |
That's just a simple case, but there is no way I can remove this since local variables are always expanded within {} and it would be a huge kludge to disable this for trigger patterns. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Wed Apr 23, 2008 9:45 pm |
Zugg, thats at creation.
if at some later point you saw
Zugg tells you, "Hi!"
Would $target still be defined as Zugg for it to match?
And if so, how is it the definition being retained between settings?
I though local variables were only defined for the duration of the single setting they are defined in.
Now if you could define a local variable in your room script and have that value remain in memory as long as you stay in that room, i could see it being possible. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Apr 24, 2008 12:24 am |
Also for ($localvar:test) I would suggest just letting it go, and having the background regex system handle it. Named captures exist now, and the list of names is available after pattern compilation.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Zhiroc Adept
Joined: 04 Feb 2005 Posts: 246
|
Posted: Thu Apr 24, 2008 2:54 am |
Perl lets you put a '\n' in a pattern, such as /line1\nline2/. That might be the syntax you want to support, but it doesn't work in CMUD. It does work in a zMUD REGEX trigger though.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Apr 24, 2008 5:15 am |
Yes, my example was only for creation. But it shows that the $ is a valid character in the trigger pattern for a local variable reference.
|
|
|
|
|
|