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


Joined: 26 Oct 2001
Posts: 38

PostPosted: Tue Apr 22, 2003 4:47 am   

Looking into all adjoining rooms
 
I'm attempting to make an alias that will look in all directions listed as exits adjoining, much like the "scan" command found on some MUDs.

I already have an exits variable which stores every room exit found as a seperate value:

Exits: north, east, and southwest.
@exits = north|east|southwest

What I cannot figure out, is how to make an alias that will take each direction listed in the variable, and send them seperately to the MUD with the look command prefixed. As in,

scan
look north
look east
look southwest

I expect it's a simple case of finding the right function or variable do this, which I just haven't spotted in the help files.

Lain
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Apr 22, 2003 5:17 am   
 
You are looking for the #FORALL command.

#ALIAS scan {#FORALL @exits {look %i}}

Ton Diening
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Apr 23, 2003 1:01 am   
 
quote:

You are looking for the #FORALL command.

#ALIAS scan {#FORALL @exits {look %i}}

Ton Diening



I found that #FORALL and other loops can usually scroll through their code faster than I can keep up with any generated output. An alternative to #FORALL, if you want to slow down the loop action is to use an alarm:

#alarm "tScan" *@ScanInterval {#if (%numitems(@exits)) {look %item(@exits,1);#delnitem Exits 1} {#noop nothing to look at;#T- tScan}}

li'l shmoe of Dragon's Gate MUD
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Apr 23, 2003 2:44 am   
 
Have triggers to capture the important stuff and summarize it after for example the scan!

Ton Diening
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