Page 1 of 1

Entering Lua-commands directly in Celestia

Posted: 29.01.2004, 16:45
by Harry
Hi,

after Marc Griffith brought up the idea to create a Lua-console to type in commands directly in Celestia, I found out that this is already possible with Celestia 1.3.2pre1 (earlier version didn't have the necessary keyboard-input for scripts).

So I have written a script which reads lines from the keyboard and executes them as Lua-scripts (or more precise as functions) when pressing Enter. You can get the script here:
http://www.h-schmidt.net/celestia/
Currently you can only type, delete (backspace) and execute the current line (Return), but this should be enough to test some Lua-commands. To see the value of something, you have to return it (the line is executed as a function, so if you type "return 1+1", the result will be 2). Variables can be used, so you can save values across different lines.

E.g.

Code: Select all

o = celestia:getobserver()
sol = celestia:find("Sol")
o:goto(sol, 10)

There is no documentation for the new scripting features (like keyboard, mutliviews, etc) yet, so if you have questions, please ask here.

Harald

Posted: 30.01.2004, 02:28
by marc
Harald, I like your webpage, how come it is not in the webring yet? :)

http://mostlyharmless.sourceforge.net/webring/index.htm

Re: Entering Lua-commands directly in Celestia

Posted: 31.01.2004, 06:39
by don
Harry wrote:So I have written a script which reads lines from the keyboard and executes them as Lua-scripts (or more precise as functions) when pressing Enter.

VERY KEWEL! 8O

Thanks Harald! :D

-Don G.

Posted: 20.04.2004, 23:07
by Harry
I've just uploaded a minor update of the lua-console script (lua-console_v1.1.celx). The new version adds the possibility to access already entered commands again. Press CTRL-P to go to the previous line, and CTRL-N to go to the next line (the latter one obviously works only if you've used CTRL-P before). I have only tested on Linux, so I don't know if these keys work ok on Windows...

Harald

Posted: 20.04.2004, 23:57
by don
Works just fine in WinXP.

Thank you Harald!