summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-06-27 23:38:07 +0100
committerubq323 <ubq323@ubq323.website>2022-06-27 23:38:07 +0100
commitfc6b1a255c1f962816e7a2b942b9275c9c197bb8 (patch)
tree4ef0c5f11f8b5b49af7166b6373e961e88eebcaa
parentbd59ebc242dd2486a917fb2eaf83b289c807e353 (diff)
pm
-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