Posted 11 September 2014 - 09:19 AM
How can i write something if http.get gives a error?
My current Code is:
My current Code is:
--ADMI-GET
--Made by admicos
--http://mchub.minecrafttr.com/
--kodlar asagidadir
local arg = { ... }
if arg[1] then
package = arg[1]
yn = "n"
print("Paket aliniyor...")
local pInfo = http.get("http://mchub.minecrafttr.com/files/Admicos/admi-get/"..package..".ainf")
print(pInfo.readAll())
pInfo.close()
print("Bu program indirmek istiyormusunuz? [E/H]")
yn = read()
if yn == "e" or yn == "E" then
local packageURL = http.get("http://mchub.minecrafttr.com/files/Admicos/admi-get/"..package..".apkg")
packageToWrite = packageURL.readAll()
local file = fs.open(package, "w")
file.write(packageToWrite)
file.close()
packageURL.close()
term.clear()
term.setCursorPos(1,1)
print("Paket Alindi! Admi-Get'i kullandiginiz icin tesekkur ederim!")
end
else
error("Kullanm: admi-get <program>", 0)
end