LöveOS

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LöveOS

Post by Jasoco »

That works. Thanks, guys.
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: LöveOS

Post by jjmafiae »

FUCKING AWSOME!
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LöveOS

Post by Jasoco »

Okay, so I have this code to export all the globals in my project into a .log file:

Code: Select all

function exportGlobalLog()
	local transferTable = {}
	local i = 1
	for k, v in pairs(_G) do
		transferTable[i] = { name = k, type = type(v) }
		i = i + 1
	end

	table.sort( transferTable, 
		function(a, b)
			return a.type > b.type
		end
	)

	local t = "GLOBAL EXPORT LOG:\n"
	for k, v in pairs(transferTable) do
		t = t .. "  " .. v.type .. "  " .. v.name .. "\n"
	end
	lfs.write("global_export.log", t)
end
Is there any way to get the actual value of the variable as well? So I can have "variable type", "variable name", "variable value".
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: LöveOS

Post by Robin »

Ehm, put v itself in the transferTable?

Of course, if it is a table you'll get something like table: 0xadc3b0, unless you implement or use some form of serialization.
Help us help you: attach a .love.
User avatar
Jasoco
Inner party member
Posts: 3726
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: LöveOS

Post by Jasoco »

Robin wrote:Ehm, put v itself in the transferTable?

Of course, if it is a table you'll get something like table: 0xadc3b0, unless you implement or use some form of serialization.
That works. Brain fart. Thanks.
jjmafiae
Party member
Posts: 1331
Joined: Tue Jul 24, 2012 8:22 am

Re: LöveOS

Post by jjmafiae »

good work comrade!
User avatar
JesseH
Prole
Posts: 47
Joined: Mon Nov 19, 2012 6:04 am
Location: Georgia, USA
Contact:

Re: LöveOS

Post by JesseH »

Bringing you guys a status update. Here is a list of available commands for LoveOS.
https://github.com/jessehorne/loveos

Code: Select all

clear  -- Used for clearing the console
touch  -- Used for creating files with no content
mkdir  -- Used for creating directories
help  -- Help feature, shows available commands
ls   -- Lists the current directory
run  -- Runs a Lua script (all lua scripts much use the libloveos library)
rm  -- Removes a file/directory
cd   -- Used for changing directories
Help is welcome! We can chat about it in ##jesseh on Freenode, or #love on OFTC.
I would also like to see this used in a game or two as a in-game computer or something.
User avatar
baconhawka7x
Party member
Posts: 491
Joined: Mon Nov 21, 2011 7:05 am
Location: Oregon, USA
Contact:

Re: LöveOS

Post by baconhawka7x »

This is awesome!
User avatar
JesseH
Prole
Posts: 47
Joined: Mon Nov 19, 2012 6:04 am
Location: Georgia, USA
Contact:

Re: LöveOS

Post by JesseH »

I know right?! :P
User avatar
JesseH
Prole
Posts: 47
Joined: Mon Nov 19, 2012 6:04 am
Location: Georgia, USA
Contact:

Re: LöveOS

Post by JesseH »

So it's been a while since I worked on this, but I have some news. I just updated it, so it works with 0.9.*. I also fixed some major bugs with the filesystem library.

Some planned features...
1 - Add "love <dir>" command so that you could run love games "inside" LoveOS
2 - Add "derplang <dir>" command so that you could run Derplang programs "inside" LoveOS

If you have any ideas/suggestions, let me know!
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 1 guest