Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local drone = component.proxy(component.list("drone")())
- local wireless = component.proxy(component.list("modem")())
- local leash = component.proxy(component.list("leash")())
- local authorizedComputers = {"416b"}
- local result = false
- drone.setLightColor(0xDEDE6C)
- local clock = os.clock
- function sleep(n) -- seconds
- local t0 = clock()
- while clock() - t0 <= n do
- end
- end
- wireless.open(1337)
- computer.beep()
- sleep(0.05)
- computer.beep()
- drone.setLightColor(0x4C99B2)
- while true do
- result = false
- event, receiver, sender, port, distance, msg, a1, a2, a3 = computer.pullSignal()
- drone.setLightColor(0x7FCC19)
- drone.setStatusText(sender)
- for k, v in pairs(authorizedComputers) do
- if string.find(sender, v) then
- result = true
- end
- end
- if msg and result then
- if msg == "move" and tonumber(a1) and tonumber(a2) and tonumber(a3) then
- drone.move(tonumber(a1), tonumber(a2), tonumber(a3))
- elseif msg == "leash" then
- for i = 0, 5 do
- leash.leash(i)
- end
- elseif msg == "unleash" then
- leash.unleash()
- end
- end
- computer.beep()
- drone.setLightColor(0x4C99B2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement