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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Zeius
Novice


Joined: 02 Nov 2006
Posts: 35
Location: Italy

PostPosted: Sat Apr 28, 2007 2:30 pm   

[1.30] zMUD script : Does not compile
 
cMUD says it cannot compile this line

#mxp %repeat( " ", 5) Click ~<send {add_resanc %1}>here</send> to add %-1 to resanc list
Does not compile : extra } brace at row 1 col 57


(it works correctly in zMUD)
how can I fix it?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Apr 28, 2007 4:06 pm   
 
Probably need to use %concat() or quotes.
_________________
EDIT: I didn't like my old signature
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Apr 29, 2007 4:31 am   
 
The MXP command does not like to expand it's arguments. So use this trick.

$text=%repeat( " ", 5)"Click <send 'add_resanc "%1"'>here</send> to add "%-1" to resanc list"
#mxp $text
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Apr 29, 2007 4:35 am   
 
Also, although the {} seems to work in Zmud it is improper to use it there. And it does not work in Cmud
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Zeius
Novice


Joined: 02 Nov 2006
Posts: 35
Location: Italy

PostPosted: Sun Apr 29, 2007 10:25 am   
 
ok I got it in this way:
#mxp -----Click ~<send ~"%concat("add_resanc ",%-1}">here</send> to add %-1 to resanc list


also tried, but cMUD wont expand the %repeat funciton
#mxp %repeat( " ", 5) Click ~<send ~"%concat("add_resanc ",%-1}">here</send> to add %-1 to resanc list


this is ok by now :D
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Apr 29, 2007 12:49 pm   
 
CMud Will expand it, but the MXP command does not like to do so. That is why I used the local variable...

The way you have that written should NOT work. That is just strange. Have you clicked on the link it creates?
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Zeius
Novice


Joined: 02 Nov 2006
Posts: 35
Location: Italy

PostPosted: Sun Apr 29, 2007 1:54 pm   
 
yes, it works (=send the command)
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Sun Apr 29, 2007 8:32 pm   
 
Arminas is right. You have a } without a {! You can get your spaces by just enclosing them in quotes (" "), so no need for %repeat. If I were going to try to expand the functions in this, I would put curly brackets around the entire thing rather than a small piece in the middle.

Does this work?
Code:
#mxp "     Click <send 'add_resanc "%-1"'>here</send> to add "%-1" to resanc list"
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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