diff options
-rw-r--r-- | hole.lua | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -8,19 +8,15 @@ end local scanner = assert(peripheral.wrap"right") local laser = assert(peripheral.wrap"left") -repeat +while true do local targets = {} local scanned = scanner.scan() for _,v in ipairs(scanned) do if v.z <= 7 and v.z >= -8 and v.x <= 7 and v.x >= -8 and v.y < 0 then - - table.insert(targets,v) + local yaw,pitch = yaw_pitch(t.x,t.y,t.z) + laser.fire(yaw,pitch,4) end end - for _,t in ipairs(targets) do - local yaw,pitch = yaw_pitch(t.x,t.y,t.z) - laser.fire(yaw,pitch,1) - end until #targets == 0 |