Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function data_set(channel, data)
- data = tostring(data)
- url = "http://craft-a-cloud.mooo.com/upload.php?name="..channel.."&data="..data
- encoded=textutils.urlEncode(url)
- http.request(url)
- local i=0
- while data_get(channel) ~= data do
- if i >= 20 then
- return false
- end
- sleep(0.25)
- i = i+1
- end
- return true
- end
- function data_get(channel)
- url = "http://craft-a-cloud.mooo.com/download.php?name="..channel
- encoded=textutils.urlEncode(url)
- response = ""
- while response == "" do
- http.request(url)
- event, returnurl, response = os.pullEvent("http_success")
- response = response.readAll()
- end
- return response
- end
Add Comment
Please, Sign In to add comment