|
Zeius Novice
Joined: 02 Nov 2006 Posts: 35 Location: Italy
|
Posted: 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? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Apr 28, 2007 4:06 pm |
Probably need to use %concat() or quotes.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
Zeius Novice
Joined: 02 Nov 2006 Posts: 35 Location: Italy
|
Posted: 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 |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
Zeius Novice
Joined: 02 Nov 2006 Posts: 35 Location: Italy
|
Posted: Sun Apr 29, 2007 1:54 pm |
yes, it works (=send the command)
|
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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" |
|
|
|
|
|
|