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 modem = component.modem
- radar = component.radar
- modem.open(2412)
- modem.broadcast(2412,"Qr= component.proxy(component.list('radar')())")
- modem.broadcast(2412,"Qn= component.proxy(component.list('navigation')())")
- modem.broadcast(2412,"Qd= component.proxy(component.list('drone')())")
- 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")
- modem.broadcast(2412,"e_coords={0,0,0} ")
- modem.broadcast(2412,"local function getEntityCoord(e_name) for k,v in ipairs(Qr.getEntities()) do if v.name == e_name then return 1 end end return 0 end")
- modem.open(2013)
- modem.broadcast(2013,"Sr= component.proxy(component.list('radar')())")
- modem.broadcast(2013,"Sn= component.proxy(component.list('navigation')())")
- modem.broadcast(2013,"Sd= component.proxy(component.list('drone')())")
- modem.broadcast(2013,"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
- local Qcommand = "while true do local _,_,_port,_,brk =event.pull('modem_message') if port==2412 and brk == 'stop' then Qd.setLightColor(0xFF0000) break end Qd.setLightColor(0x00FF00) end"
- local command = "while true do local evt,_,_,port,_brk =computer.pullSignal() if evt=='modem_message' and port==2413 and brk =='stop' then Qd.setLightColor(0xFF0000) break end Qd.setLightColor(0x00FF00) sleep(1) end"
- local c = "local cmd local g=1 repeat cmd = select(6,computer.pullSignal(0.5)) Qd.setLightColor(0xFFFF00) Qd.setStatusText(\"Bingus \"..g) g=g+1 until cmd==\"stop\" Qd.setLightColor(0xFF0000) Qd.setStatusText(cmd)"
- local rad = "for k,v in ipairs(Qr.getEntities()) do if v.name == \"ph0\" then Qd.setLightColor(0x0000FF) Qd.setStatusText(v.name) end end"
- local rad2 ="getE(\"ph0\") Qd.setStatusText(tostring(e_coords[1]))"
- modem.broadcast(2412,"function getE(e_name) checkArg(1,e_name,'string','nil') for k,v in ipairs(Qr.getEntities()) do if v.name == e_name then e_coords[1]=v.x e_coords[2]=v.y e_coords[3]=v.z Qd.setLightColor(0x0000FF) Qd.setStatusText(v.name) break end end end")
- print("Bingus3")
- e_coords = {}
- function e_coords:deleteMe()
- e_coords = nil
- end
- local function getPlayerCoords(p_name)
- for k,v in ipairs(require("component").radar.getEntities()) do
- if v.name == p_name then
- e_coords[1] = v.x
- e_coords[2] = v.y
- e_coords[3] = v.z
- return 1
- end
- print(k,v.name,v.x,v.y,v.z)
- end
- return 0
- end
- if getPlayerCoords("ph0")==1 then
- for e in pairs(e_coords) do
- print(e)
- end
- else
- print("Entity Not Found")
- end
- e_coords:deleteMe()
- while true do
- local cmd=io.read()
- if not cmd then return end
- modem.broadcast(2412,cmd)
- if(cmd == "A") then
- modem.broadcast(2412,rad2)
- sleep(0.5)
- elseif(cmd == "S") then
- modem.broadcast(2412,"stop")
- sleep(0.5)
- else
- modem.broadcast(2412,cmd)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement