Lua Shell
The lua shell is a tool to aid in the development of ToME and other T-Engine modules.
Installing the lua shell
Currently the most up-to-date version of the shell is only available from CVS. The module name is 'luashell'. Once you have checked it out, either link it, or copy it, into the game/addons directory of your ToME 3 installation (or source tree, if you run straight from the source tree).
Using the lua shell
Hit control-A, control-L. If you aren't already in debug mode, hitting control-A will force you to accept debug mode, this will mark your savefile as a cheater; the shell is for debugging, not for playing the game!
If you type a question mark '?' at the beginning of a line, you will see a few pages of basic help. Hit the escape key to return to the game.
In time these pages here may become more complete and more interesting than that short help text.
Command-line editing
The shell supports a small number of the 'emacs' editing commands. In particular:
- ^A - go to beginning of line
- ^E - go to end of line
- ^B - go back one character
- ^F - go forward one character
- ^P - go to previous command in history
- ^N - go to next command in history
The last two are really handy, as anyone who has ever used a unix shell will know.
Some things to try
Type any old lua expression and hit return. For example, try 1+2+3, or "a".."b".."c".
Try out a lua function which you want to test : gsub("Saruman","a","o")
Explore a ToME data structure; try player or k_info[44]
Try out the tab-completion; type FLAG_A and then hit the TAB key
BugReports
Describe any bugs you encounter here.
Discussion
Discuss the shell and possible features here.
TheFalcon: Gosh this is *really* useful. It gives the ability to check stuff I never knew existed until now.
Is there any way to check the results of previous things done in the shell? For example if I type player it gives a long list of variables and things over more than one "page", but I can't seem to find a way to get it to display the stuff on previous ones once I'm passed them.
As far as I can remember, there isn't a 'page up' command. I did forget to tell you about the command history and line editing commands. It helps a bit, at least, to be able to just go back to the previous command and re-enter it. I just added info about the editing commands above. -- JulesBean
ToME Wiki