Reputation: 6522
I have searched far and wide for this but I cannot seem to find it. Is there any way to execute a Lua
script via double clicking it (to execute it in Lua (Command Line)
) and keep it open after execution?
For example:
print("Hello World")
This code compiles and runs, however if I double click on hello.lua
it runs and closes immediately without leaving my text on screen. I want something more like this, but without having to go to Command Prompt
, changing directory a bunch of times, typing lua file.lua
, etc.:
Upvotes: 6
Views: 4114
Reputation: 20858
The easiest way would be to just add a 'pause' at the end of your script:
print 'Hello World'
os.execute 'pause'
Upvotes: 7