|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Wed Oct 24, 2007 4:50 am
[2.08] %numparam broken. |
So I missed out on a few weeks of CMUD updates (since 2.03). I fired up 2.07 a couple of days ago, but didn't have much time. I noted that several of my scripts no longer work. Today 2.08 came out and I had more time to figure out what is wrong. Problem number 1:
Updated help file for %numparam says:
Quote: |
numparam
Syntax: %numparam()
returns the number of parameters passed to an alias or function.
Example:
#ALIAS testParam {#SAY %numParam()}
testparam 123 "456 789" {abc def}
displays: 3 |
If you follow that example precisely, nothing at all gets displayed. |
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Oct 24, 2007 5:03 am |
Looking at the old zMud help only the Note was removed because of the change in aliases. Aliases now optionally append unused parameters.
Everything in that help should still be accurate, which means %numparam is returning a null. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Wed Oct 24, 2007 5:15 am |
It should be returning 3 though. Hence broken.
It worked a few versions ago. I only wrote the script recently.
Code: |
<alias name="end" id="166">
<value>#IF (%null(%1)) {wp dirk} {
#LOOP %numparam,1 {envenom dirk with %param(%i)}
}</value>
</alias>
<alias name="v1" id="185">
<value>wipe dirk
end xentio kalmia curare vernalius curare euphorbia darkshade curare euphorbia xentio xentio kalmia slike gecko voyria aconite</value>
</alias> |
Running "V1" sends the commands:
Quote: |
wipe dirk
envenom dirk with
envenom dirk with kalmia
|
|
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Wed Oct 24, 2007 8:27 pm Re: [2.08] %numparam broken. |
Caled wrote: |
Example:
Code: |
#ALIAS testParam {#SAY %numParam()}
testparam 123 "456 789" {abc def}
displays: 3 |
If you follow that example precisely, nothing at all gets displayed. |
Just checked it in the untitled session and in my primary session: in both it displays 3 as promised. |
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Wed Oct 24, 2007 9:56 pm |
I just retested in the untitled session, by copy/pasting the quote from your post to the command line, and it doesn't work. What's going on? What further testing can I do to narrow this down, any suggestions?
|
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Wed Oct 24, 2007 10:46 pm |
Try testing these
Code: |
#SAY something
#SHOW another thing
#ECHO nothing
#ALIAS testParam {#INPUT %numParam()}
testparam 123 "456 789" {abc def} |
The preferences bug in 2.07 was causing preferences to be written to the default.pkg and the untitled.pkg. If you you used 2.07 at all it is possible that one of those files may have been damaged. The default.pkg should have been overwritten during installation of 2.08, and you can safely delete the untitled.pkg to cause a new one to be made. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Wed Oct 24, 2007 11:37 pm |
Okay..
I did as you asked. Did not work.
I quit CMUD, deleted untitled.pkg, reloaded CMUD, retried your test.
It worked! It also worked with #show %numparam().
Then I went into my actual package files and tested again. Failure :(
I returned to the untitled package, and now it does not work there either.
I deleted untitled.pkg again, loaded CMUD, this time opened up my character's session, quit the session immediately, went to the untitled session and %numparam failed.
I deleted once again, loaded CMUD, went directly to the untitled session and %numparam works.
This time I loaded a blank package file for a different IRE mud I do not play. %numparam works. Going back to untitled session, it still works.
Now I've loaded my package files from 1.34 (i.e. pre-2.07 backups), into a new character session, and %numparam() works! Yay.
Final test: I load them into my existing character session (i.e. editing the character icon in the char selection), and %numparam() fails.
Help :p I'm out of my depth with the testing. |
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Wed Oct 24, 2007 11:40 pm |
Oh, oops.. hehe. I forgot to delete the main package file, i.e. the one matched to my session window, that is not in the "packages" folder. It seems to be working for now :)
Thanks for the help. |
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Tue Oct 30, 2007 10:53 am |
I also deleted the default package from the Package folder. Now the examples work. Even the one for #FUNCTION. So now, let me see if my fucntions work...
|
|
_________________ Sic itur ad astra. |
|
|
|
|
|