Wyvern67

Untitled

Jul 17th, 2015
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. function data_set(channel, data)
  2.     data = tostring(data)
  3.     url = "http://craft-a-cloud.mooo.com/upload.php?name="..channel.."&data="..data
  4.     encoded=textutils.urlEncode(url)
  5.     http.request(url)
  6.     local i=0
  7.     while data_get(channel) ~= data do
  8.         if i >= 20 then
  9.             return false
  10.         end
  11.         sleep(0.25)
  12.         i = i+1
  13.     end
  14.     return true
  15. end
  16.  
  17. function data_get(channel)
  18.     url = "http://craft-a-cloud.mooo.com/download.php?name="..channel
  19.     encoded=textutils.urlEncode(url)
  20.     response = ""
  21.     while response == "" do
  22.         http.request(url)
  23.         event, returnurl, response = os.pullEvent("http_success")
  24.         response = response.readAll()
  25.     end
  26.     return response
  27. end
Add Comment
Please, Sign In to add comment