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
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sun Feb 10, 2008 10:50 pm   

[2.18] A better way to do this?
 
Currently, I have 253 zones with a total of 27802 rooms. I've set up an alias for a zonewalk. Basically it walks to every room in the zone. This is what I use:

Code:
#ALIAS getrooms {#CALL %mapfilter("");zonerooms="";#CALL %mapfilter(%concat("ZoneID = ",%zonenum()));#CALL %mapfilter("");#CALL %mapfilter(%concat("ZoneID = ",%zonenum()));#CALL %mapfilter("");#CALL %mapfilter(%concat("ZoneID = ",%zonenum()));#loop %numrooms {#additem zonerooms %mapvnum( %i)}}

as a sidenote, I think there's a bug in this because I do have to call mapfilter a few times in order for it to work correctly
Code:
#ALIAS zonewalk {#FORALL @zonerooms {rrun %i}}

Code:
#ALIAS rrun {#exec %replace( %replace( %replace( %replace( %replace( %walk( %1), ".", "ru "), "(", ";"), ")", ";ru "), "ru ;", ""), "maze;", "maze ");#te %1}}


Now here's the issue:

I type "getrooms" when I'm in a certain zone, and it gathers up all the vnums of the rooms on the map. CMUD usually hangs quite a bit on this, though - especially when there's 1100 rooms in an area. In fact, everything halts on CMUD. No output from the MUD, can't close anything down, nothing. I'll add this wasn't a problem with zMUD, but it is a real problem with CMUD.

When it finally lets go, I get spammed with all the output that was in the queue, waiting for CMUD to finish this script. After that, things seem to work well. So... my question is:

Is there a much better/easier/faster way to handle this? I've thought about #THREAD, but I don't know anything really about it. The helpfile is a bit... unhelpful when it comes to learning about #THREAD, I think... at least, for me it is. I appreciate any help on this matter.

Charneus
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Feb 10, 2008 11:41 pm   
 
#ALIAS getrooms {zonerooms=%mapquery(%concat("ZoneID = ",%zonenum))}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Feb 11, 2008 12:13 am   
 
Wow... that was MUCH faster... thanks!

By the way, I'm trying to use some of the mapping stuff in your toolbox... but I'm failing to understand how some of it works. :P Oh well. I'll figure it out later, unless you decide to include a help alias in your next update.

Charneus
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Feb 11, 2008 1:54 am   
 
Sadly all of that has been put on hold while I get a new version of the regex engine in production order. I was just so incensed that %subregex can't do what I want that I have to get it right. Mainly I have been stumbling over limitations in Pascal, irritations with Delphi bugs, and translating between C and Pascal. Documentation is almost equally fun.

I am not going to rant (read as I typed an entire rant and decided no one wanted to read it) about it since it is a project I took on. Better documentation on all my published functions will be produced soon.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
alluran
Adept


Joined: 14 Sep 2005
Posts: 223
Location: Sydney, Australia

PostPosted: Fri Feb 22, 2008 4:20 am   
 
or just "fr %" seems you have my findrooms alias :P or were you leaked the copy where it's called froom, or findroom :P
_________________
The Drake Forestseer
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