Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
BlackSmith
Apprentice


Joined: 08 Dec 2002
Posts: 152

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Nov 13, 2006 3:34 pm   
 
I copied that script exactly and it compiled fine for me.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: 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.
Reply with quote
BlackSmith
Apprentice


Joined: 08 Dec 2002
Posts: 152

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net