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
Vortigen
Novice


Joined: 10 Dec 2000
Posts: 44
Location: United Kingdom

PostPosted: Sat Nov 10, 2001 4:45 pm   

Setting Room ID to Room Name
 
I need to have my room ID's the same as my Room names on my mapper.
I have already got a hell of a lot of rooms and I don't fancy going through each one and changing them by hand.
Is there some code I could use to do this change over?

Any help would be greatly appreciated.


Vortigen

"It's not just a riot of blots and blurs and disjointed jottings linked by bursts of speed...it only looks as if it is, damn it."
Reply with quote
Vortigen
Novice


Joined: 10 Dec 2000
Posts: 44
Location: United Kingdom

PostPosted: Sat Nov 10, 2001 5:59 pm   
 
Its ok I have solved it using this script

#ALIAS roomiding
#VAR room 1
#LOOP X {%roomid( @room, %roomname(@room));#ADD room 1}
#SAY Finished!!!!


Where X is the number of rooms.


Vortigen

"It's not just a riot of blots and blurs and disjointed jottings linked by bursts of speed...it only looks as if it is, damn it."
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Nov 10, 2001 8:02 pm   
 
quote:

Its ok I have solved it using this script

#ALIAS roomiding
#VAR room 1
#LOOP X {%roomid( @room, %roomname(@room));#ADD room 1}
#SAY Finished!!!!


Where X is the number of rooms.


Vortigen

"It's not just a riot of blots and blurs and disjointed jottings linked by bursts of speed...it only looks as if it is, damn it."



It's not really important given the way you wrote it, but %i will start at 0 (which means it's looping one extra time). You might be getting an extra room, but I'm not familiar with the %room functions.

Anyways, you could eliminate the @room variable and change the loop to this:

#alias roomiding {
#loop 1,X {%roomid( %i, %roomname(%i))}
#say Finished!!!!
}

This will start with room #1 and end with Room #X, with no chance of messing with Room #0 or Room #X+1 (both of which should be invalid rooms?)

li'l shmoe of Dragon's Gate MUD
Reply with quote
einar
Wanderer


Joined: 06 Nov 2000
Posts: 80
Location: USA

PostPosted: Sun Nov 11, 2001 5:07 am   
 
I know I sound like the newbie I am, but...
Do we have to change X to be the number of rooms in the zone?
And do I have to run that alias on every room or once in each zone?

Master, seventh circle of idling
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Nov 11, 2001 7:46 am   
 
quote:

I know I sound like the newbie I am, but...
Do we have to change X to be the number of rooms in the zone?
And do I have to run that alias on every room or once in each zone?

Master, seventh circle of idling



For the above question, just replace X with %numrooms() and then run the alias once in each zone.

However, there IS a way to do it so that you need only run the alias just once per map. You need to check out the %numrooms(), %numzones(), %zonename(), and %zonenum() functions. It SHOULD work along the same lines as the roomiding aliases shown earlier.

li'l shmoe of Dragon's Gate MUD
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