Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Thu Jul 29, 2004 3:32 pm   

Listing all zone names
 
Trying to get a listing of all the zones.
Working with the mapvnum example in the help file I figured this would work for listing the zone names
Quote:
#LOOP %numzones {#SHOW %zonename( %mapvnum( %i))}
But this is part of the output
Quote:
Adventurers Guild

Chessboard

Moria

Forest of Hoan Dor
Land of Dominia
Smurf Village
There's over 200 zones, and the whole list from the command shows only about 70 with gaps thru out it.

Any ideas?
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Thu Jul 29, 2004 5:49 pm   
 
#LOOP %numzones {#ECHO %zonename(%i)}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 29, 2004 6:33 pm   
 
Or, an actual example from the helpfile (in case your zonenumbers aren't all consecutive)
#LOOP %numzones(#ECHO %zonename(%zonevnum(%i))}

Don't use a ROOM-function (%mapvnum) if you want ZONE names.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Thu Jul 29, 2004 6:59 pm   
 
Funny tho that it even gave me some....
_________________
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Thu Jul 29, 2004 8:01 pm   
 
Oh, and %zonevnum dont work. Went to check it in the help file, and theres no entry there for it either. v6.15 here. Maybe thats why?
Basically, what I am trying to do in the long run is create a log of rooms for each zone.
I think I would need to tie in together:
Code:
#LOOP %numzones {#ECHO %zonename(%i)}   <---which works for me
#log DeathDealer\RoomNames\%zonename
#LOOP %numrooms {#show RoomNum %roomnum( %mapvnum( %i)) Room: %roomname( %mapvnum( %i))}
#log
And have it loop from zone to zone outputting the rooms into a log.
Tho from what I have been able to figure out, the only way for the %roomnum to work is by having THAT particular map open. And I have been unable to the get #teleport to work with just a zone name. #tel "port" does not work since i need to input something else to signify where I want IN Port I want to be, which I can't do since I am trying to get the info :-)
If nothing else, i'll just have to have the zmud and mapper windows open side by side and click and send, click and send etc Crying or Very sad
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Jul 30, 2004 12:56 am   
 
Yes, if you are using obsolete software then that's usually the first thing you should tell us. If you don't, we'll expect you to have current software since upgrades are free. Version 6.15 is over three years out-of-date, so I'm afraid that you are the expert on it and will often have to solve your own problems.

Since there are almost always more rooms than zones, there's nothing unusual about some rooms having the same vnum as some zones while others don't. Zones are seldom deleted, so just going sequentially from 1 (or 0) to the number of zones (as per DeRep) should give you most of the zone names.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Fri Jul 30, 2004 6:36 pm   
 
Sorry I didn't mention i was using an older version of zmud, I did it in all my other posts, but forgot in this one.
K, so i decided to just go ahead and do the "click, enter, click, enter" version of what I wanted to do.
Code:
#log DeathDealer\RoomNames\%zonename
#LOOP %numrooms {#show RoomNum %roomnum( %mapvnum( %i)) Room: %roomname( %mapvnum( %i))}
#log
But then after I did all 196 areas, I realized that I had wanted the SW's to each of those rooms from the starting point as well.
I have this code:
Code:
#ALIAS swshow
#var path %walk( %1)
#var path %replace( @path, ., "run ")
#show @path
The alias works great as a stand alone, and I wanted to put that into the #LOOP like so:
Code:
#LOOP %numrooms {#show RoomNum %roomnum( %mapvnum( %i)) Room: %roomname( %mapvnum( %i)) SW: swshow( %i)}
But that gives me out put like this:
Quote:
RoomNum 2 Room: Intersection of Junket Way and Megway SW: swshow( 1)
RoomNum 3 Room: Mahmount Allesh Megway SW: swshow( 2)
rather than like this
Quote:
RoomNum 2 Room: Intersection of Junket Way and Megway SW: run ss
RoomNum 3 Room: Mahmount Allesh Megway SW: run sss
This works perfectly fine
Quote:
#LOOP %numrooms swshow %mapvnum( %i)
run ss
run sss
but for some reason i can't get it to work as part of the larger loop.
I tried a few different combinations of this, none of which obviously worked.
I KNOW it's something S.O.S (Small & Obviously Silly)

As usual, ANY help is appreciated.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jul 31, 2004 6:19 pm   
 
Quote:
#LOOP %numrooms {#show RoomNum %roomnum( %mapvnum( %i)) Room: %roomname( %mapvnum( %i)) SW: swshow( %i)}

#SHOW doesn't execute commands or aliases. Commands and aliases are only executed at the beginning of a line anyway, they can't be used in the middle or at the end of a line. You can't change an alias to a function just by putting () around the parameters either. Use your script directly.
(untested)
#LOOP %numrooms {#show RoomNum %roomnum( %mapvnum( %i)) Room: %roomname( %mapvnum( %i)) SW: %replace( %walk( %i), ., "run ")}
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Sun Aug 01, 2004 9:00 pm   
 
Sad
Nope it don't work.
While standing in room 56, I execute the script and I get
Quote:
RoomNum 30 Room: An Owl's Nest SW:
RoomNum 31 Room: The Snowy Path SW:
RoomNum 56 Room: In Front of Storm Mountain SW: run nun
But typing swshow 56 shows me nothing as it should.
And typing swshow 30 & 31 gives me:
run nuueneeu
run nuunuenn

Tried
#echo %replace( %walk(30), ., "run ")
on it's own, and it runs correctly, so i am totally at a loss as to why it will not give the correct result as part of the loop.
Checked a few other areas, and there are errors in there as well. Not sure why it is doing that.
Checked to see if i could just run the loop on it's own without the roomnum stuff and just the swshow but I got the same errors.
Starting to think that copying and pasting swshow 0, swshow 1 etc is the way to go Crying or Very sad
Reply with quote
DeathDealer
Adept


Joined: 20 Jul 2004
Posts: 268

PostPosted: Sun Aug 01, 2004 9:25 pm   
 
Wait, I just thought of the reason that it might not be working.
It's because there are room vnums missing.
like there is no room 16.
RoomNum 15 Room: The Mountain Trail. SW: run nuueneeees
RoomNum 17 Room: The Mountain Trail. SW:

So of course a swshow 16 means nothing and thats what it's trying to do for room 17.
_________________
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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