Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local httpResponse = http.get('http://localhost:8080/')
- if httpResponse == nil then printError('visit https://tweaked.cc/guide/local_ips.html') return end
- local names = textutils.unserialise(httpResponse.readAll())
- for I = 1, table.getn(names) do
- if fs.exists(names[I]) then
- fs.delete(names[I])
- end
- local afile = fs.open(names[I], "w")
- local response = http.get('http://localhost:8080/test?name='..names[I])
- afile.write(response.readAll())
- afile.close()
- end
- print('Successfully loaded '..table.getn(names)..' files')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement