From fc6b1a255c1f962816e7a2b942b9275c9c197bb8 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 27 Jun 2022 23:38:07 +0100 Subject: pm --- hole.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hole.lua b/hole.lua index 2d45af6..6dbae37 100644 --- a/hole.lua +++ b/hole.lua @@ -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 -- cgit v1.2.3