I am in the process of fixing up the way aliases work, with a view to letting them execute commands (eg. other aliases) without having to call a script.
However when I look at the alias handling code it seems that they currently behave in a way that is rather bizarre, and I hope no-one is using this behaviour. :P
In early versions of MUSHclient, multi-alias matches simply replaced individual words. eg.
foo => bar
eat => drink
Now if you typed "foo eat" it would send "bar drink" - both would match and both would substitute.
However in current versions it appears that whilst it still multi-matches, it takes the output from the previous alias, and reprocesses that, in an undefined order, which I personally think is pretty useless.
eg.
foo => bar
bar => sausage
Now if you type "foo" it becomes "bar", then it matches "bar" and it becomes "sausage". However, and this is the important bit, because the evaluation order is undefined it might do this:
You type "foo", it becomes "bar", but because it looked for "bar" *before* "foo" it does *not* become "sausage".
I hope no-one is relying on this behaviour, and would be pleased to get some feedback about how you think aliases should work, if multiple matches are likely on one line.
If no-one expects multi alias matches on one line, then I will simplify the code, and then add the option to "send to" "execute" along the same lines as triggers currently do.
However when I look at the alias handling code it seems that they currently behave in a way that is rather bizarre, and I hope no-one is using this behaviour. :P
In early versions of MUSHclient, multi-alias matches simply replaced individual words. eg.
foo => bar
eat => drink
Now if you typed "foo eat" it would send "bar drink" - both would match and both would substitute.
However in current versions it appears that whilst it still multi-matches, it takes the output from the previous alias, and reprocesses that, in an undefined order, which I personally think is pretty useless.
eg.
foo => bar
bar => sausage
Now if you type "foo" it becomes "bar", then it matches "bar" and it becomes "sausage". However, and this is the important bit, because the evaluation order is undefined it might do this:
You type "foo", it becomes "bar", but because it looked for "bar" *before* "foo" it does *not* become "sausage".
I hope no-one is relying on this behaviour, and would be pleased to get some feedback about how you think aliases should work, if multiple matches are likely on one line.
If no-one expects multi alias matches on one line, then I will simplify the code, and then add the option to "send to" "execute" along the same lines as triggers currently do.