Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local radar = peripheral.find "radar"
- local radar_offset = {0, 0, -1}
- local x, y, z = gps.locate()
- while true do
- write "Target: "
- local target = read()
- print "Scanning..."
- local es = radar.getEntities()
- for _, e in pairs(es) do
- if e.name == target then
- print "Found matching entity."
- local tx, ty, tz = x + e.x + radar_offset[1], y + e.y + radar_offset[2], z + e.z + radar_offset[3]
- print(("Target is at %f %f %f"):format(tx, ty, tz))
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement