Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drone = component.proxy(component.list("drone")())
- modem = component.proxy(component.list("modem")())
- leash = component.proxy(component.list("leash")())
- modem.open(27)
- route = {}
- path = {}
- current = ""
- while true do
- name, _, sender, _, _, message, x, y, z, point, from = computer.pullSignal(1)
- if name == "modem_message" then
- if message == 'add' then
- add(tonumber(x), tonumber(y), tonumber(z), point, from)
- if current == "" then current = point end
- elseif message == 'to' then
- to(x)
- elseif message == 'catch' then
- catch()
- elseif message == 'drop' then
- drop()
- end
- end
- if #path > 0 and drone.getOffset() < 1 then
- drone.move(route[path[#path]].x-route[current].x,
- route[path[#path]].y-route[current].y,
- route[path[#path]].z-route[current].z)
- current = path[#path]
- path[#path] = nil
- end
- end
- modem.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement