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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: Sun Dec 05, 2010 11:35 am   

Looping through all rooms
 
Hi, I want to go through all rooms on my map and put the first line of the description as the room name.
How do i begin looping through the rooms?
Reply with quote
mikeC130
Wanderer


Joined: 03 Jul 2006
Posts: 72

PostPosted: Sun Dec 05, 2010 1:16 pm   Re: Looping through all rooms
 
[quote="masterkrueger"]Hi, I want to go through all rooms on my map and put the first line of the description as the room name.
How do i begin looping through the rooms?[/quote]

%mapquery() will return all rooms. Cycling through them can be done with #forall %mapquery() {code here}.

You should be able to do it with something along these lines:

Code:


#LOCAL $Desc $Rname $newdesc

#forall %mapquery() {
$Desc=%roomdesc(%i,)
$Rname=%roomname(%i,)
$newdesc=%concat($Rname,$Desc)
#call %roomdesc(%i,$newdesc)
}


Not tested, however.

Mike
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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