Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update(name,prna)
- print("Searching for updates...")
- local function ininstaller(code,name2)
- local response = http.get(
- "http://pastebin.com/raw/"..code
- )
- if response then
- local sResponse = response.readAll()
- response.close()
- h = fs.open(name2,"w")
- h.write(sResponse)
- h.close()
- return sResponse
- else
- print( "Failed." )
- end
- end
- ininstaller(name,"file")
- h = fs.open("file","r")
- chfi = h.readAll()
- h.close()
- h = fs.open(prna,"r")
- fi = h.readAll()
- h.close()
- if chfi == fi == false then
- print("Updating...")
- fs.delete(prna)
- h = fs.open(prna,"w")
- h.write(chfi)
- h.close()
- print("Updated pls restart program")
- fs.delete("file")
- error()
- else
- print("No update")
- end
- end
- function updateAPI(name3,prna2)
- print("Searching for updates...")
- local function ininstaller(code,name2)
- local response = http.get(
- "http://pastebin.com/raw/"..code
- )
- if response then
- local sResponse = response.readAll()
- response.close()
- h = fs.open(name2,"w")
- h.write(sResponse)
- h.close()
- return sResponse
- else
- print( "Failed." )
- end
- end
- ininstaller(name3,"file")
- h = fs.open("file","r")
- chfi2 = h.readAll()
- h.close()
- h = fs.open(prna2,"r")
- fi2 = h.readAll()
- h.close()
- if chfi == fi == false then
- print("Updating...")
- fs.delete(prna)
- h = fs.open(prna2,"w")
- h.write(chfi)
- h.close()
- fs.delete("file")
- os.loadAPI(prna2)
- error()
- else
- print("No update")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement