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
Takilara
Apprentice


Joined: 31 Jan 2002
Posts: 129
Location: Norway

PostPosted: Wed May 29, 2002 2:39 pm   

%mapvnum()
 
i am making a script that will loop through all rooms in a zone, then do something for each room. and in v6.26 as i use this alias to loop with:
(alias generate)
#if %1 {generateroom %1} {#loop 0,%numrooms {generateroom %mapvnum( %i)}}

however i also want this script to work in v5.55 that doesnt have the %mapvnum() function, what to do ?
#if %1 {generateroom %1} {#loop 0,%numrooms {generateroom %roomnum( %i)}}
would work fine if noone has ever deleted any rooms.. but i cant do that assumption, is there a way to check the roomnum of the highest numbered room or something?

Reply with quote
Takilara
Apprentice


Joined: 31 Jan 2002
Posts: 129
Location: Norway

PostPosted: Wed May 29, 2002 3:24 pm   
 
well i solved it, not a good solve so if anyone comes up with a better solution, please do tell:
my solution:
#if %1 {generateroom %1} {
#var tttroomnum 0
#var ttroomnum 0
#while (@tttroomnum<%numrooms) {generateroom @ttroomnum}
}

then in generateroom i do this:
#var myroom %1
#add ttroomnum 1
#if %roomexit( @myroom) {generateroom2;#add tttroomnum 1}


lots of overhead if someone has deleted lots of rooms from the zone though, thinking bout doing a check on the zmud version, and dooing this if v 5.55 and the previous solution if 6.26+

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