4
How do I run two routines simultaneously in the same program? I’m trying to download a file, and print a value while downloading. Exactly that:
http = require "socket.http"
function downloadFile(url)
download = http.request(url)
return download
end
repeat
print("--")
until downloadFile("http://pokedg/patch/1.7z")
But just return:
--
And it ends.
How can I do that?
– Gabriel Sales
@Gabrielsales, you need to know how to create and run separate threads. Once done, create a Moon states in each of them and run Moon normally.
– lhf
I found what you needed, thank you. http://www.lua.org/pil/9.4.html
– Gabriel Sales
@Gabrielsales, great! I had forgotten this... I suggest you add an answer explaining this.
– lhf