Advertisement
Baennon

GUI Test

Aug 26th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. if not fs.exists("GUI") then
  2. http.request("http://pastebin.com/raw/PmCUHuTr")
  3. local requesting = true
  4.  
  5. while requesting do
  6.   local event, url, sourceText = os.pullEvent()
  7.  
  8.   if event == "http_success" then
  9.     local respondedText = sourceText.readAll()
  10.    
  11.     sourceText.close()
  12.    local f = fs.open("GUI","w")
  13.    f.write(respondedText)
  14.    f.close()
  15.    
  16.     requesting = false
  17.   elseif event == "http_failure" then
  18.     print("Server didn't respond.")
  19.    
  20.     requesting = false
  21.   end
  22. end
  23. end
  24.  
  25. local gui = os.loadAPI("GUI")
  26. local menu = gui.newMenu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement