summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hole.lua10
1 files 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