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


Joined: 09 Oct 2003
Posts: 40

PostPosted: Thu Dec 09, 2004 9:51 pm   

#walk (aka goto) list populator
 
Well just recently I started using the automapper in zmud. I love it, I really love using the shortnames for rooms to speed path to them.

So now I have roughly 8000 rooms in my mapping system with 180+ zones and like 40 or so room names that i can #walk to(i aliased goto to #walk, hence goto guild). I relized that I couldn't remember all the short names one day so I tried, with some success, to build a glist alias. The alias should look through all the rooms in the mapping system and populate them to a list. The problem i have as far as i can tell, when i have been mapping I have been erasing rooms and have missing vnums with in my database. So when i run glist to populate the list it doesn't search all the rooms. I am at my wits end here, could one of you guys be a sweetheart and help me out with this script i have built, help me make it better and or explain to me what I did wrong?


#var dummy2 0
#if ("%1"="pop") {
#if (%null( %numrooms)=1) {#echo %ansi( hi, red) ~>~> %ansi( hi, cyan)MAPPING SYSTEM NOT ON, TURN ON AND TYPE COMMAND AGAIN %ansi( hi, red)~<~<} {
#var gotolist ""
#gauge pop "Populating List" {@dummy2} {%numrooms} {0} {} {hi,red} {} {}
#loop %numrooms {
#add dummy2 1
#if (%null( %roomid( %i))=0) {
#additem gotolist %roomid( %i)
#echo %ansi( hi, red) ~>~> %ansi( hi, cyan)added room %i as %roomid( %i)%ansi( hi, red) ~<~<
}
}
#unbutton pop
#gag
#echo %ansi( hi, red) ~>~> %ansi( hi, cyan)TOTAL ROOMS @DUMMY2%REPEAT( " ", 5)TOTAL GOTO KEYS ADDED %numitems( @gotolist) %ansi( hi, red)~<~<
}
} {
#if ("%1"="add") {#echo worked!!} {
#var dummy2 0
#cr
#if (%null( @gotolist)=1) {#echo %ansi( hi, red) ~>~> %ansi( hi, cyan)LIST HAS NOT BEEN POPULATED, TYPE glist pop TO POPULATE THE LIST %ansi( hi, red)~<~<} {
#var gotolist %sort( @gotolist)
#loop %numitems( @gotolist) {#if (%len( %item( @gotolist, %i))>@dummy2) {#var dummy2 %len( %item( @gotolist, %i))}}
#add dummy2 5
#pri {
#echo %ansi( hi, red) ~>~>%ansi( hi, cyan) GOTO LIST %ansi( hi, red)~<~<
#echo %ansi( hi, red) |%repeat( "-", %eval( @dummy2-1))|
#loop %numitems( @gotolist) {#echo %ansi( hi, red) |%ansi( hi, cyan) %item( @gotolist, %i)%repeat( " ", %eval( @dummy2 - (%len( %item( @gotolist, %i))+2)))%ansi( hi, red)|}
#echo %ansi( hi, red) |%repeat( "-", %eval( @dummy2-1))|
#echo %ansi( hi, red) ~>~> %ansi( hi, cyan)%numitems( @gotolist) KEYS OUT OF %numrooms ROOMS IN %numzones ZONES%ansi( hi, red)~<~<
}
}
}
}
#unvar dummy2
#gag

I never finished it as i started having troubles with it. The add command is suppose to be when i add a new roomid to a room i am in and be able to add it to the list with out going through the populating again.

Thanks guys
Phanku
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Dec 10, 2004 12:05 am   
 
All you really need to do is add %mapvnum around your %i references when loopping to %numrooms. It is a mouthful, so here is one quick example:
#if (%null( %roomid( %i))=0) {
should be
#if (%null( %roomid( %mapvnum( %i)))=0) {
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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