Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local event = require("event")
- local serialization= require("serialization")
- local computer= require("computer")
- local radar = component.radar
- local modem = component.modem
- modem.open(2412)
- modem.broadcast(2412,"n= component.proxy(component.list('navigation')())")
- modem.broadcast(2412,"d= component.proxy(component.list('drone')())")
- modem.broadcast(2412,"rbt= component.proxy(component.list(‘robot’)())")
- modem.broadcast(2412,"function sleep(timeout) checkArg(1, timeout, 'number', 'nil') local deadline = computer.uptime() + (timeout or 0) repeat computer.pullSignal(deadline - computer.uptime()) until computer.uptime() >= deadline end")
- local function sleep(timeout) checkArg(1, timeout, "number", "nil") local deadline = computer.uptime() + (timeout or 0) repeat computer.pullSignal(deadline - computer.uptime()) until computer.uptime() >= deadline
- end
- while true do
- local cmd=io.read()
- if not cmd then return
- end
- if cmd=="F" then
- print("Target: ") tag=io.read()
- print("Drone No.: ") srm=io.read()
- repeat
- local cmd=select(1,event.pull(1))
- for k, v in ipairs(radar.getEntities()) do
- if v.name==tag then
- x= v.x y=v.y z=v.z
- end
- if v.y>0 then y=v.y+1
- end
- end
- modem.broadcast(2412,"for k, v in ipairs (n.findWaypoints(100)) do if v.label=='yeet' and d.name()=='"..srm.."' then a=-v.position[1]-'"..x.."' math.abs(a) if ( -v.position[1]>"..x..") then a=-a elseif(-v.position[1]<="..x..")then a=math.abs(a) end d.move(a,0,0) end end")
- print (x,y,z)sleep(0.0001)
- until cmd=="key_down"
- end
- print(select(6, event.pull(3, "modem_message")))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement