Page 1 of 1

online changelog? --help please

Posted: Thu Nov 05, 2015 10:38 pm
by CloudyYard
Hello everyone!,
i need to put a ChangeLog in My game but is possible make the changelog online?
for example:
in the site: http://www.example.com/changelog.txt

and shows the changelog.txt content in the Love2D window!


thanks.

Re: online changelog? --help please

Posted: Fri Nov 06, 2015 12:02 am
by HugoBDesigner
If you already have the text online somewhere, then it should be possible by using http.request:

http://w3.impa.br/~diego/software/luasocket/http.html

Re: online changelog? --help please

Posted: Fri Nov 06, 2015 12:33 am
by CloudyYard
Thanks, but how to print what have in the File:http://www.cs.princeton.edu/~diego/prof ... /http.html?

i need to make a changelog to my game, to make the Updates and News...

Re: online changelog? --help please

Posted: Fri Nov 06, 2015 3:11 am
by HugoBDesigner
I personally think it is easier to learn from examples than from boring explanations (that's how I actually learned programming :rofl: )

So here's a very simple example on how to load/print online content:

Code: Select all

function love.load()
	http = require("socket.http")
	a, b = http.request("http://pastebin.com/raw.php?i=NW3H038r")
	love.graphics.setBackgroundColor(255, 255, 255)
	if a and b then
		a = string.gsub(a, "\r\n", "\n")
	end
end

function love.draw()
	love.graphics.setColor(0, 0, 0, 255)
	if b then
		love.graphics.print("Code: " .. tostring(b), 7, 7)
	end
	if a then
		love.graphics.print("Content:\n\n" .. tostring(a), 7, 7+32)
	end
end

Re: online changelog? --help please

Posted: Fri Nov 06, 2015 8:45 pm
by CloudyYard
Thanks!!,
thanks too much, now is working,

soon i will publish my game!!.