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
peewee
Wanderer


Joined: 22 Oct 2000
Posts: 90
Location: Sweden

PostPosted: Tue Dec 18, 2001 1:56 am   

Alias with arrays in it
 
Don't we all just love aliases? They rule! Anyway, I've tried to write an alias to equip my character when I log on. Most of the equipment is stored in closed chests or racks or in closed jars or wardrobes in the guild's storeroom.

What I wanted to do is an alias like this:

gc items

that gives the result:

open chest
get %items[0] from chest
get %items[1] from chest
get %items[2] from chest etc. until all the items in the array are retrieved...
close chest

This alias requires me to create an array, but I don't know how to write the parser or how I would have to create the syntax for the alias... I'd appreciate any help...





"May the Force be with you"
[url]peewee@mars11.net[/url]
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Tue Dec 18, 2001 4:02 am   
 
While an array would be a spiffy tool for your problem, I would rather use a string list. It's easier to fill and modify, at least in version 6.15.



#VAR gear {helm|gloves|tunic|cloak|necklace|amulet|visor|etc.}
#ALIAS gc {
open chest
#FORALL @gear {get %i chest; wear %i}
close chest
}


The #FORALL statement will step through each item in the string list @gear, placing each element in %i in turn.

Troubadour
Reply with quote
peewee
Wanderer


Joined: 22 Oct 2000
Posts: 90
Location: Sweden

PostPosted: Wed Dec 19, 2001 2:29 am   
 
My humble thanks.


"May the Force be with you"
[url]peewee@mars11.net[/url]
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