1
votes

I'm running on windows 10. I built lua, added it to my environment variables PATH but I cant figure out how to successfully run it.

I tried dragging a .lua file onto lua.exe but that just causes my explorer window to freeze up and crash. I tried calling lua or my particular lua file in the command prompt but it does nothing - no error, just sits there with no output. I've tried moving files around, using the command prompt while in the same directory as the lua.exe but nothing is working.

EDIT: Here's a picture of my command prompt. from tutorials and videos I've seen, simply executing lua like that should allow me to instantly start typing commands.

3
Just type lua test.lua. Try to write single line print"Hello world" in test.lua to see it works. And add C:\Program Files (x86)\Lua\5.3 to your PATH env variable to be able to invoke Lua from any folder. - Egor Skriptunoff
Yes that's what I did and nothing happens. I just get a blinking cursor. - Mason
What does lua.exe say when started in console without arguments? What "just sits there with no output" means? Does it hangs? - Egor Skriptunoff
How did you build Lua? - Egor Skriptunoff
youtube.com/watch?v=X5D_h2X8LCk I followed this video using the visual studio command prompt and just copied those commands with 5.3 as the version number - Mason

3 Answers

0
votes

Apparently renaming "Lua.exe" to "Lua53.exe" fixed the problem.

0
votes

if you just want to run simple lua script to get the result, you can get "code runner" from chrome extension store. you can run lua on it.furthermore, you can share or load code with others with it.

0
votes

try using dofile("directory of the lua file you want to call ex. lualib/lua.lua") on your lua file. or if you want to run the script you can use repl.it