diff options
author | ubq323 <ubq323@ubq323.website> | 2022-06-27 23:38:07 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-06-27 23:38:07 +0100 |
commit | fc6b1a255c1f962816e7a2b942b9275c9c197bb8 (patch) | |
tree | 4ef0c5f11f8b5b49af7166b6373e961e88eebcaa | |
parent | bd59ebc242dd2486a917fb2eaf83b289c807e353 (diff) |
pm
-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 |