lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


That's neat. I wish I could do something with the shebang (like #echo off would work)  

However you could technically remove the silly syntax and lua code and just call:DownloadFIle "https://www.foobar.com/main.lua" "main.lua" and run it from the batch file.

On Tue, Oct 2, 2018 at 11:10 PM Albert Chan <albertmcchan@yahoo.com> wrote:

On Oct 2, 2018, at 4:12 PM, Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:

I'm using DOS command "cls" for clearing the screen :-)
http://lua-users.org/lists/lua-l/2018-07/msg00404.html

I just add a simple 2 lines patch to luaL_loadfile()
If a file start with @, Lua skip it all, to <ESC> (ascii 27)
Example:

@echo off
echo Running batch file test.bat
echo Loading Lua to run itself ...
Lua test.bat
exit/b

<ESC>
print("Lua code start here ...")

The patch made the Lua DLL code smaller, and Lua run faster. Weird ...
Batch file also look cleaner, without the hackish ::_:: --[[ stuff