for the computer with controller:
--load APIs os.unloadAPI("sensors") os.loadAPI("rom/apis/sensors") -- wireless rednet.open("top") --declare constants scontrol = sensors.getController() print("Attaching Sensor Controller on "..scontrol.." side") avSensors = sensors.getSensors(scontrol) --get sensors sUseSensor = avSensors[1] avProbes = sensors.getProbes(scontrol, sUseSensor) --get probes sPlayer = avProbes[4] -- end -- while true do for i,val in ipairs(sensors.getAvailableTargetsforProbe(scontrol,sUseSensor,"LivingEntities")) do what,x,y,z=string.match(val,"([a-z]+),(-?[0-9]+),(-?[0-9]+),(-?[0-9]+)") x,y,z=tonumber(x),tonumber(y),tonumber(z) if (what=="vq") then rednet.broadcast(""..x..","..y..","..z) end end sleep(0.1) endthe sleeping is neccesary or it will overload if in a loop
for console on right side of monitor(s):
rednet.open("top") mon = peripheral.wrap("left") while true do a,b,c = rednet.receive() x = 0 y = 0 z = 0 for d, e, f in string.gmatch(b, "(%w+),(%w+),(%w+)")do x = d y = e z = f end mon.setCursorPos(1,1) mon.clear() mon.write("x: "..x) mon.setCursorPos(1,2) mon.write("y: "..y) mon.setCursorPos(1,3) mon.write("z: "..z) endi also used part of 11lol's code so thanks to him