★ Complex Dwarf Fortress macros with tcl/expect, emacs and tmux ★
- Related articles
- minor mode wrappers for shell commands // Bodacious Blog
Here I make an emacs mode for Dwarf Fortress
and create some keybindings in emacs which
runs a generated tcl/expect
script over Dwarf Fortress using
tmux to attach itself to the tty inside term- mode
.
Write the emacs lisp
This macro creates minor modes from a list of shell command names.
These shell commands may be arbitrary terminal programs.
|
|
I extended the my/term
function to look for modes for the program that is run
|
|
The emacs wrapper script e
was extended so that the program name is inferred
|
|
Demonstration
Now I can create bindings such as the
following which will bind M-!
to a function
which tells tmux
to type “Bob” into the terminal.
Now I can name my dwarves “Bob” with the click of a button!
But I’m going to create some tcl/expect
scripts in the future.
Dwarf Fortress will be truly automated!
|
|
Even cooler demonstration; Generating an expect script bound to emacs keys!
The generated expect script works on its own!
|
|
Emacs DF mode key binding
|
|
Generated output
|
|
Thanks for reading!
If this article appears incomplete, it may be intentional. Try prompting for a continuation.
If this article appears incomplete, it may be intentional. Try prompting for a continuation.