Hi, i'm a new user of mudlet and had a quick question on aliases.
So basically i would like to make an alias to work as the second word.. example: "half-elf"
i tried: send (matches[2] .. " half-elf") pattern: ^(.*) he$
This worked but not to the extent that i need it to work. Normally the first word(letter) would be an alias itself which is making this tough for me to figure out.
Help is appreciated! I love the client!
Question on Aliases
Re: Question on Aliases
Check the manual.... I don't quite follow what you are tring to do but maybe this will help...
matches[1] is the entire line
matches[2] is the first wildcard value
matches[3] is the second wildcard value
...
matches[1] is the entire line
matches[2] is the first wildcard value
matches[3] is the second wildcard value
...
Re: Question on Aliases
More or less I'm trying to have 2 aliases go off at the same time.. not sure if its possible.
Say fh is full heal and he is half-elf
I would like to simply do
fh he
and get
cast 'full heal' half-elf as the final product
Say fh is full heal and he is half-elf
I would like to simply do
fh he
and get
cast 'full heal' half-elf as the final product
Re: Question on Aliases
You will need to do something with the second varible as it will change(unless I don't understand the problem) so
maybe alias a pattern like...
^fh (.*)$ (assumes you want to fully heal the target)
you will need some way to interpert the target... I would use a table
raceTable= {}
raceTable["he"]= "half-elf"
raceTable["e"]= "elf"
raceTable["ho"]= "hobbit"
then....
m2=matches[2]
if raceTable[m2] then
target = raceTable[m2]
send("full heal "..target)
end
Edited to fix braces on table...oops
(have not tried any of this code but it should be close to what you want.... if not let me know.)
maybe alias a pattern like...
^fh (.*)$ (assumes you want to fully heal the target)
you will need some way to interpert the target... I would use a table
raceTable= {}
raceTable["he"]= "half-elf"
raceTable["e"]= "elf"
raceTable["ho"]= "hobbit"
then....
m2=matches[2]
if raceTable[m2] then
target = raceTable[m2]
send("full heal "..target)
end
Edited to fix braces on table...oops
(have not tried any of this code but it should be close to what you want.... if not let me know.)
Re: Question on Aliases
Or you could make seperate aliases on for each one, and use expandAlias() when you need to call one.
For example:
For example:
In z/cmud you could just use the alias itself without any special precursors. Which made infinite looping of an alias a problem if you weren't careful. Eitherway, its worth a read if you haven't used expandAlias() before.
Re: Question on Aliases
Excellent, thanks alot for the info. I think i'm going to try both... and will look at the manual.