|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: Fri Feb 29, 2008 3:27 pm |
I still get:
Code: |
illegal token: :#CLR at row 3 col 2 |
|
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Fri Feb 29, 2008 10:51 pm |
Oh I thought it was me
|
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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?
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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 |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: 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 |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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 :)
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Mar 03, 2008 9:59 am |
It wasn't originally - the thread was in the zMUD forum at first.
|
|
|
|
|
|