Skip to content

Commit 7e6f7f9

Browse files
committed
library/lua/dfhack.lua interactive interpreter banner: list shortcuts
When the `lua` interactive interpreter is started, the help banner now lists the shortcuts (that is, variable names with special handling) already implemented in `library/lua/utils.lua` `df_shortcut_var()`. These keywords allow the interpreter to use the currently-selected object in the DF UI. They are currently undocumented, as far as I can tell. (The `lua` interpreter documentation does contain two hints in the Examples.)
1 parent 0f3726c commit 7e6f7f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/lua/dfhack.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,8 @@ function dfhack.interpreter(prompt,hfile,env)
855855
" '^ foo' => 'printall_recurse(foo)'\n"..
856856
" '@ foo' => 'printall_ipairs(foo)'\n"..
857857
"All of these save the first result as '_'.")
858+
print("These keywords refer to the currently-selected object in the game:")
859+
print(" unit item plant building bld job workshop_job wsjob screen scr")
858860
print_banner = false
859861
end
860862

0 commit comments

Comments
 (0)