|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: Wed Jun 13, 2007 11:29 am
problem with %zonenum |
There is no message displayed when a zone doesn't exist.
#show %zonenum(fsdfef47)
will just show you your current zone instead of -1. Is this intended behavior, and if so, is there anyway to make it work as I am trying to use it. I am using an alias that sets the zone using %zonenum, but sometimes there are inconsistencies with the zone name on my map and the zone name from the mud 'areaname' command. So what is happening is the zone is being set to whatever zone my map is lost defaulted in rather than the zone shown from the areaname command. If i had a way to test against the 'areaname' command giving a result of -1 I could make it prompt me to enter the zone or whatever. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jun 13, 2007 4:10 pm |
I've added this to the bug list. It is supposed to return -1 if the zone doesn't exist. I'm not sure if there is any workaround for this.
|
|
|
|
Thinjon100 Apprentice
Joined: 12 Jul 2004 Posts: 190 Location: Canada
|
Posted: Fri Jul 13, 2007 4:27 pm |
I just thought up a "temp" workaround for this until Zugg gets this bug fixed. I just did the following in my code:
(Assume %3 returns the zone name)
Code: |
$zonename = %3
$zonenum = %zonenum($zonename )
#IF (%zonename($zonenum) != $zonename) {
//Handle bad zone name
} {
//Handle properly-found zone name
}
|
This way, you get the double-check... if the zone name is bad, it'll return your current zone... when you do %zonename() on that, you'll get your current zone name, which won't match the name of the requested zone... thus you'll know it's invalid, and can adjust as necessary.
Hope that helps :) |
|
_________________ If you're ever around Aardwolf, I'm that invisible guy you can never see. Wizi ftw! :) |
|
|
|
|
|