Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not http then
- print( "WCON requires http API" )
- print( "Set enableAPI_http to 1 in mod_ComputerCraft.cfg" )
- return
- end
- os.unloadAPI("wcon")
- os.loadAPI("wcon")
- local r = http.get("http://mindblow.no-ip.org/wcon/api/version")
- local v = r.readLine()
- r.close()
- if(tonumber(v) > wcon.getVersion()) then
- print("Updaiting. . .")
- local id = wcon.getId()
- local pass = wcon.getPassword()
- print("Making and downloading WCON API")
- wcon = fs.open("wcon/wcon", "w")
- wcon.write("local id = "..id.."\n")
- wcon.write("local password=\""..pass.."\"\n")
- wcon.write("local ver = "..v.."\n")
- file = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode("RKbavkNe"))
- if file == nil then print("Error!") return end
- wcon.write(file.readAll())
- file.close()
- wcon.close()
- print("Downloading update. . .")
- update = fs.open("wcon/update", "w")
- file = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode("ry12vuie"))
- if file == nil then print("Error!") return end
- update.write(file.readAll())
- file.close()
- update.close()
- print("Downloading launch. . .")
- launch = fs.open("launch", "w")
- file = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode("7EaDxV1e"))
- launch.write(file.readAll())
- file.close()
- launch.close()
- print("Downloading update_check. . .")
- u_check = fs.open("wcon/update_check", "w")
- file = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode("D1e06P2r"))
- u_check.write(file.readAll())
- file.close()
- launch.close()
- print("Done!")
- else
- print("No WCON update aviawable!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement