Because macros and keymaps are stored as series of characters not as a series of commands there is no way for macros to distinguish between character-that-is-an-argument and character-that-is-a-command.
To give a practical example, if you have the following action string
w2Tw1
(w)ield pick{@w2}, (T)unnel, (w)ield weapon{@w1}
'w' will be taken as the direction parameter for the (T)unnel command.
The proper solution would probably be to redo the way commands are handled entirely (something I looked at once but was scared off by the work involved ). However I think it might be possible to fudge a work-around with a macro-only command that temporarily interrupts the execution of a macro until a direction / target is returned (or escape) and then continues with the rest of the macro (or cancels the macro).
So the previous string would now be ...
w2T\255w1
(w)ield pick{@w2}, (T)unnel, wait for direction parameter, (w)ield weapon{@w1}
A simpler solution for that particular problem might be to allow the (T)unnel command to automatically wield the first item with {=T) inscribed before tunnelling and automatically replace it with the first item with {=W} inscribed afterwards.
To give a practical example, if you have the following action string
w2Tw1
(w)ield pick{@w2}, (T)unnel, (w)ield weapon{@w1}
'w' will be taken as the direction parameter for the (T)unnel command.
The proper solution would probably be to redo the way commands are handled entirely (something I looked at once but was scared off by the work involved ). However I think it might be possible to fudge a work-around with a macro-only command that temporarily interrupts the execution of a macro until a direction / target is returned (or escape) and then continues with the rest of the macro (or cancels the macro).
So the previous string would now be ...
w2T\255w1
(w)ield pick{@w2}, (T)unnel, wait for direction parameter, (w)ield weapon{@w1}
A simpler solution for that particular problem might be to allow the (T)unnel command to automatically wield the first item with {=T) inscribed before tunnelling and automatically replace it with the first item with {=W} inscribed afterwards.