Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local internet = component.proxy(component.list("internet")())
- local modem = component.proxy(component.list('modem')())
- local drone=component.proxy(component.list('drone')())
- function sleep(n)
- local t0 = computer.uptime()
- while computer.uptime() - t0 <= n do computer.pushSignal("wait") computer.pullSignal() end
- end
- while true do
- sleep(0.5)
- drone.setStatusText("F")
- local response = internet.request("http://example.com")
- if response.finishConnect() then
- code, message, header = response.response()
- text = response.read()
- drone.setStatusText("M: "..tostring(text))
- else
- drone.setStatusText("whoeps")
- end
- sleep(3)
- drone.setStatusText("T")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement