Allows you to update without modem

This commit is contained in:
LDDestroier 2019-03-01 18:34:39 -05:00 committed by GitHub
parent cf883e5394
commit 465747fb52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 17 deletions

View File

@ -322,6 +322,24 @@ if argumentName then
argumentName = argumentName:sub(1, 15) -- gotta enforce that limit
end
if doUpdateGame then
print("Downloading...")
local net = http.get("https://github.com/LDDestroier/CC/raw/master/tron.lua")
if net then
local file = fs.open(shell.getRunningProgram(), "w")
file.write(net.readAll())
file.close()
print("Updated!")
else
printError("Couldn't update!")
end
if useOnce then
return
else
sleep(0.2)
end
end
local modem, skynet
if not doGridDemo then
if useSkynet then
@ -1695,23 +1713,6 @@ local main = function()
end
end
if doUpdateGame then
print("Downloading...")
local net = http.get("https://github.com/LDDestroier/CC/raw/master/tron.lua")
if net then
local file = fs.open(shell.getRunningProgram(), "w")
file.write(net.readAll())
file.close()
print("Updated!")
else
printError("Couldn't update!")
end
if useOnce then
return
else
sleep(0.2)
end
end
if doGridDemo then
parallel.waitForAny(function()
local step, gsX, gsY = 0, 0, 0