Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- -- Config
- if args[1] then
- fileName = args[1]
- if args[2] then
- location = "lua/" .. args[2]
- else
- location = "lua/"..args[1]
- end
- host = "http://wiki.evilcraft.net/"
- -- Do not Edit below this line
- print("Updating " .. fileName)
- link = host .. location
- print("Downloading New File From\n" .. link)
- data = http.get(link)
- if data then
- if fs.exists(fileName) then
- print("Removing Old Data")
- fs.delete(fileName)
- end
- file = fs.open(fileName,"w")
- if file then
- print("Saving Data")
- file.write(data.readAll())
- print("Update Completed")
- file.close()
- else
- error("Could Not Create File " .. fileName)
- end
- else
- print("Could Not Download File\n".. link)
- end
- else
- print("update filename [fileOnServer]")
- end
Advertisement
Add Comment
Please, Sign In to add comment