Advertisement
Wyvern67

Untitled

Aug 10th, 2015
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Chest(chest)
  2.     chestID = chest
  3. end
  4.  
  5. function Target(chest)
  6.     if (not chestID) then
  7.         error("A Cloud Chest has not been specified yet.  First call Chest(id) where the id is your cx4 Chest key.")
  8.     end
  9.     return chestID
  10. end
  11.  
  12. function Set(location, data)
  13.     if (not chestID) then
  14.         error("A Cloud Chest has not been specified yet.  First call Chest(id) where the id is your cx4 Chest key.")
  15.     end
  16.     url = "http://boomtree.com/guid/" .. chestID .. ".cc?location=" .. location
  17.     local ret = http.post(url, data)
  18. end
  19.  
  20. function Get(location)
  21.     url = "http://boomtree.com/guid/" .. chestID .. ".cc?location="..location
  22.     loop = true
  23.     http.request(url)
  24.  
  25.     event, returnurl, response = os.pullEvent()
  26.     while loop == true do
  27.         if event == "http_success" then
  28.             return response.readAll()
  29.         else
  30.             return
  31.         end
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement