Aliases in a stringlist

Scripts and support for your favorite MUD client.
Vipplin
Sojourner
Posts: 434
Joined: Thu Jun 14, 2001 5:01 am
Location: Hawaii

Aliases in a stringlist

Postby Vipplin » Fri Mar 24, 2006 2:13 pm

I am trying to have a list, say AliasList that holds a bunch of alias names of aliases that I use. Then I want to be able to call/use those aliases through the list.

Let's say I've got 3 aliases These, Those, Any (that each execute several commands) and so AliasList = {These|Those|Any}

What can I type at the command line to execute Those through the list? My end goal is to have meta-aliases like C1, C2, C3 that will execute These, Those, Any respectively. I would then be able to change the members of AliasList directly and/or change the commands in These Those or Any and _without_ changing C1...C3 they would execute the proper commands.

Would #alias C1 {@{@AliasList.1}} work? I haven't tried it yet (no zmud or zuggsoft forum access right now), but anticipate failure (somehow it doesn't look right)... help appreciated.
Vipplin
Sojourner
Posts: 434
Joined: Thu Jun 14, 2001 5:01 am
Location: Hawaii

Postby Vipplin » Fri Mar 31, 2006 12:16 am

Also, I've been successfully using the @StringList.# to access stringlist data, but using that method to change members seems to not work (StringList.2=Blah). Is #replaceitem the only way to do it?

Thanks again for help on either score...
Disoputlip
Sojourner
Posts: 956
Joined: Thu Feb 21, 2002 6:01 am
Location: Copenhagen

Postby Disoputlip » Fri Mar 31, 2006 11:36 am

To the first question:

Code: Select all

#AL a1 {foo;foo2}
#AL a2 {bar;bar2}
@commandArray = {a1|a2}
#AL aa1 {#execute {@commandArray.1}}
#AL aa2 {#execute {@commandArray.2}}


To the second question:

@commandArray.1 does not have what computer people call an lvalue, this means you can't directly assign into it. But the function you found does it.
Vipplin
Sojourner
Posts: 434
Joined: Thu Jun 14, 2001 5:01 am
Location: Hawaii

Postby Vipplin » Fri Mar 31, 2006 5:51 pm

Thanks.

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 5 guests