|
BlackSmith Apprentice
Joined: 08 Dec 2002 Posts: 152
|
Posted: Mon Nov 13, 2006 3:19 pm
[1.15] expressions |
Code: |
#If (@Party.Boolean && (@Resister.Name !=~ %1 || @Resister.Level !=~ zero)) {
#Send {party report %1 screems from psionic damage}
} |
compiles to:
Code: |
Error compiling script:
unmatched parenthesis |
...what im doing wrong? |
|
_________________ BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient.
Last edited by BlackSmith on Mon Nov 13, 2006 4:32 pm; edited 2 times in total |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Nov 13, 2006 3:34 pm |
I copied that script exactly and it compiled fine for me.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Nov 13, 2006 8:42 pm |
There is currently some bugs regarding the @varname.property syntax in #IF statements.
But also, the !=~ operation doesn't make any sense. This is not a supported expression operator. You should use
#IF (!(@whatever =~ pattern)) {...}
to test if something doesn't match a pattern. This shouldn't have worked in zMUD either.
What it's doing in CMUD is that the ~ is escaping the following character (a space), so it's the same as doing
#IF (@Resister.Name != { %1})
which probably isn't what you wanted. |
|
|
|
BlackSmith Apprentice
Joined: 08 Dec 2002 Posts: 152
|
Posted: Tue Nov 14, 2006 10:59 am |
Zugg wrote: |
This is not a supported expression operator. |
Uh, oh. i just combined these two.
Quote: |
v1 != v2 true if value1 is not equal to value2
v1 =~ v2 true if the string v1 matches the pattern in v2 |
Zugg wrote: |
What it's doing in CMUD is that the ~ is escaping the following character (a space), so it's the same as doing
#IF (@Resister.Name != { %1})
which probably isn't what you wanted. |
Yeah, it is not. Im not using ~ in zMud so maybe thats why it does not work right in Cmud if its made static in it. |
|
_________________ BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient. |
|
|
|
|
|