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
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Fri Feb 29, 2008 3:38 am   

problem with focus char
 
make an alias, pattern note or znote, whatever really and put this in it.
Code:
#addkey notes %eval(%numkeys(@notes)+1) %-2
:Notes:#CLR
:Notes:#showdb @notes

Then make it this
Code:
#if (%2 = add) {#addkey notes %eval(%numkeys(@notes)+1) %-2
:Notes:#CLR
:Notes:#showdb @notes}


gets an error message
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Feb 29, 2008 11:22 am   
 
The opening brace has to be at the end of the line.
Code:
#if (%2 = add) {
 #addkey notes %eval(%numkeys(@notes)+1) %-2
 :Notes:#CLR
 :Notes:#showdb @notes
}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Fri Feb 29, 2008 3:27 pm   
 
I still get:
Code:
illegal token: :#CLR at row 3 col 2
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 29, 2008 10:47 pm   
 
This may be silly but I have had sucess with using "%-2" instead of %-2 without meaning anything intelligent by it, just because the other did not work. I expect you will get a literal %2 or just a 2, but I never know with those as I don't think much on different levels but like to experiment


Last edited by Leitia on Fri Feb 29, 2008 10:51 pm; edited 1 time in total
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Feb 29, 2008 10:50 pm   
 
"%-2" actually works in zMUD - it still substitutes the value of %-2. Bizarre, I know - CMUD fixes this.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 29, 2008 10:51 pm   
 
Oh I thought it was me
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Sat Mar 01, 2008 2:04 am   
 
So is there any idea whats wrong with my IF statement and the focus character thats causing this error?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sat Mar 01, 2008 5:01 am   
 
Not sure what to suggest other make sure the indenting is right. Or try the code all one line. I'm not getting an error with it.
_________________
Asati di tempari!
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Mon Mar 03, 2008 2:44 am   
 
Could anyone maybe give suggestion as to what might be causing these errors besides a bad installation? Here is an image of a blank session with the script in it, and the error.
http://i25.tinypic.com/ogi4aq.jpg
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Mon Mar 03, 2008 3:39 am   
 
It really looks like Zugg is wanting you to use
#EXECWIN windowname {commands}
instead of :windowname:commands...
I AM seeing the error and I cannot think of any way to make it work short of changing it.

#if (%2 = add) {#addkey notes %eval(%numkeys(@notes)+1) %-2
#EXECWIN notes {#CLR}
#EXECWIN notes {#showdb @notes}}
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Mar 03, 2008 4:51 am   
 
Well, that ends one mystery. For future reference, CMud questions belong in CMud forums, so see you there. Wink
_________________
EDIT: I didn't like my old signature
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Mon Mar 03, 2008 6:07 am   
 
....this isn't a cmud question? And thanks for that workaround arminas, no idea why I didn't stumble on #execwin on my own :)
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Mar 03, 2008 9:59 am   
 
It wasn't originally - the thread was in the zMUD forum at first.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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