Run pure lua programs
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Run pure lua programs
Hey,how do I run a .lua file whitout love?And what if i want to make .exe from it,how`s that possible?Thanks!
Twitter: https://twitter.com/Murii5
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Run pure lua programs
Google "lua for windows"... it allows you to run pure lua files. Not sure about how to make an .exe though
OTHER OPTION:
You could call your lua file main.lua, and add a conf.lua file with the following code
You must not define love.load, love.update or love.draw in you code or else the magic wont happen (love.graphics wont work so dont call it either)...
Then you can pack all your files in a .love file and then make an exe
It should work as you want... try it and tell me
OTHER OPTION:
You could call your lua file main.lua, and add a conf.lua file with the following code
Code: Select all
love.conf = function (t)
t.console = true
t.window.width = 0 -- The window width (number)
t.window.height = 0 -- The window height (number)
t.modules.graphics = false -- Enable the graphics module (boolean)
t.modules.window = false -- Enable the window module (boolean)
end
Then you can pack all your files in a .love file and then make an exe
It should work as you want... try it and tell me
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Run pure lua programs
or you could do t.window = false in your conf, so it's not even initialized... OR even better, just set the window module to false, so it's not even loaded. (i -think- it's not needed for a console on win, and on other OSes, it interfaces with the proper console anyway)
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Run pure lua programs
To create self-running Lua programs, use srlua: https://github.com/LuaDist/srlua
To run Lua files without LÖVE, download the Lua source code: http://www.lua.org/ftp/
Then compile it to get the Lua interpreter.
If you want to try it out without jumping through fiery hoops, then go here: http://joedf.users.sourceforge.net/luabuilds/
To run Lua files without LÖVE, download the Lua source code: http://www.lua.org/ftp/
Then compile it to get the Lua interpreter.
If you want to try it out without jumping through fiery hoops, then go here: http://joedf.users.sourceforge.net/luabuilds/
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: Run pure lua programs
Yeah that is what I said, but console is needed if you want to see a console (at least in windows) since he wants an .exe. That means he doesnt want to run it from a console but from a filezorg wrote:or you could do t.window = false in your conf, so it's not even initialized... OR even better, just set the window module to false, so it's not even loaded. (i -think- it's not needed for a console on win, and on other OSes, it interfaces with the proper console anyway)
so yeah the two key lines in conf are:
Code: Select all
t.console = true
t.modules.window = false
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Run pure lua programs
agreed, i did not actually state that he should set console to false, just that i wasn't sure whether window was needed for the console window or not; guess not then!
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot] and 10 guests