forked from hkc/cc-stuff
32 lines
455 B
Lua
32 lines
455 B
Lua
local args = { ... }
|
|
|
|
local tape = peripheral.find("tape_drive")
|
|
if not tape then
|
|
print("tape where")
|
|
return
|
|
end
|
|
|
|
if not http then
|
|
print("no http, check config")
|
|
return
|
|
end
|
|
|
|
tape.stop()
|
|
tape.seek(-tape.getSize())
|
|
tape.stop()
|
|
|
|
local req = http.get(args[1], {}, true)
|
|
if not req then
|
|
print("oopsie")
|
|
return
|
|
end
|
|
|
|
while true do
|
|
local chunk = req.read()
|
|
if not chunk then
|
|
print("EOF")
|
|
end
|
|
tape.write(chunk)
|
|
end
|
|
|