Advertisement
Guest User

sdf

a guest
Jun 3rd, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. local internet = component.proxy(component.list("internet")())
  2. local drone=component.proxy(component.list('drone')())
  3. local res, data, reason, ev, a, b
  4. local sContent = ""
  5.  
  6. function sleep(n)
  7.   local t0 = computer.uptime()
  8.   while computer.uptime() - t0 <= n do computer.pushSignal("wait") computer.pullSignal() end
  9. end
  10.  
  11. while true do
  12.     sleep(0.5)
  13.     drone.setStatusText("F")
  14.     local code, message, header = pcall(internet.request, "http://example.com")
  15.     if pcall(internet.finishConnect) then
  16.     text = message.read()
  17.     drone.setStatusText(text)
  18.     else
  19.         drone.setStatusText("hmm")
  20.     end
  21.     sleep(3)
  22.     drone.setStatusText("T")
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement