EvulOne

Untitled

Mar 4th, 2015
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. --Server to pull time from
  2. http.request("http://mc.ov-gaming.com:25566")
  3.  
  4. local requesting = true
  5.  
  6. while requesting do
  7.   local event, url, sourceText = os.pullEvent()
  8.  
  9.   if event == "http_success" then
  10.     local respondedText = sourceText.readAll()
  11.    
  12.     sourceText.close()
  13.     --Print the reply if successful;  debug info for now
  14.     print("Reply was: " .. respondedText)
  15.    
  16.     requesting = false
  17.   elseif event == "http_failure" then
  18.     print("Server didn't respond.")
  19.    
  20.     requesting = false
  21.   end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment