 |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Mon Apr 30, 2007 10:25 pm
[1.30] 'invalid local variable' in trigger pattern |
#TRIGGER {^Test1$Test2$} {whatever}
(When trying to match a line following another)
Throws an error saying $Test2 isn't valid. There was another post Zugg commented on saying we should escape $, but that would affect the trigger pattern in this case |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Apr 30, 2007 10:49 pm |
Hmm, I write triggers in both regex and zscript as the need\whim arises.
A work around for this would be to use regex. In regex \n is the same as $ in zscript. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Mon Apr 30, 2007 10:53 pm |
Or you can use conditions, or just edit the trigger in the settings editor after it's been created.
Just reporting it anyway ;) |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue May 01, 2007 12:27 am |
Doesn't putting a ~ in front of the first $ work?
|
|
|
|
 |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue May 01, 2007 12:29 am |
But then it looks for the $ symbol, rather than an end of line. You can put ~$ to make CMUD create a trigger, but then you need to go into the editor and remove the ~
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue May 01, 2007 2:01 am |
Ahh, ok, I see what you mean. Yes, this is a bit weird. Putting a ~ before the $ *should* tell it to match a $ character verbatim, so that's working as it should. I'll add this to the bug list, but it probably won't get fixed for a few versions...I'll have to give more thought to how this should work.
|
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue May 01, 2007 2:45 am |
Well, if it really comes to it, multistate triggers with the within=1 set will do the same job. I personally haven't used $ in the middle of a pattern for a long, long time.
|
|
|
|
 |
|
|
|