|
Lain Novice
Joined: 26 Oct 2001 Posts: 38
|
Posted: 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 |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Apr 22, 2003 5:17 am |
You are looking for the #FORALL command.
#ALIAS scan {#FORALL @exits {look %i}}
Ton Diening |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Wed Apr 23, 2003 2:44 am |
Have triggers to capture the important stuff and summarize it after for example the scan!
Ton Diening |
|
|
|
|
|