alias suggestion

Posted by Tspivey on Thu 11 May 2006 12:01 AM — 5 posts, 19,465 views.

Canada #0
I think that you should be able to write aliases that:
1. can use the command seperator character as their first character,
2. are able to set a flag which ignores the command stacking character for the current line, similar to tintin's \ command to send something as is. I tried to set the command_stack_character from inside an alias, but it takes effect before the alias can get to it.
Australia Forum Administrator #1
Just make the alias "send to script" and send what you want with a simple script line. I assume you are using something like ";" as the command separator, and want a ";" in the line?

Try this:


Send "@dig Waterfall = West;W, East;E"


Adding the word "Send" isn't a big extra imposition. If you need to send multiple lines, use Lua as your script language, because that has multi-line literals, like this:


Send [[
@dig Waterfall = West;W, East;E
@open East;E =#88,West;W
]]


Inside a multi-line literal you don't need to worry about quote symbols either.
Canada #2
That will work from inside a script, but what if I want to send something with a ; from the command line? That's where the alias comes in.
Australia Forum Administrator #3
OK, I see what you mean.

Can anyone see an objection to changing the behaviour so that, if the very first character of a command is the command stack character, command stacking is disabled for the rest of the command input?

I can't offhand think why you would start a command with the command stack character, so this is probably safe enough.
Australia Forum Administrator #4
There is now an option in version 3.75 to pre-process typed commands in a plugin. This would let you make "smarter" command stacking, for example if the command starts with a certain word, command stacking is disabled for that command.