Use the API protocol instead of SSH or whatever. It’s much less error prone in general when it comes to automation. You can see implementations for various languages at the bottom of the linked manual page.
It’s not a big learning curve. Considering all the stuff you need to handle with SSH and Expect (not just colors…), it will take you less time to learn to use the API and make your scripts than to handle all of those cases reliably (as in “so that they don’t brake with the next minor RouterOS upgrade”).
Some implementations (my one, the Java one by LeGrange) allow you to use terminal-like commands, so there’s really nothing to learn, except the client itself. Well, OK, almost… you must explicitly specify nameless arguments, since the protocol doesn’t allow for them, and there’s no way to infer them… but…
Some implementations (certainly my one) even allow you to relatively easily just run ACTUAL script code, by automatically wrapping it around a script in “/system script”, executing it, and removing it after execution.
Thanks for all the tips, but I just settled with parallelSSH and now I feel very well with clusterssh.
I can’t handle all my Mikrotiks seriously this way at once, but doing that interactively on more than one box is still a relief.
4.02_03 (a package in Lubuntu 14.04) works like charm with RouterOS 6 .
Anyway, if you come with another simplistic solution, it may be fun.