Advertisement
Guest User

baaa

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