diff options
author | ubq323 <ubq323@ubq323.website> | 2022-06-28 00:30:48 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-06-28 00:30:48 +0100 |
commit | 6983d873e5533297b10972184f129574c53f12e1 (patch) | |
tree | 33eeff4007951527b21d9eb61b8664e9c3685483 | |
parent | 7e16b3e24711969313e856039c4e957bb2f1cf25 (diff) |
hole
-rw-r--r-- | hole.lua | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -12,7 +12,9 @@ while true do local scanned = scanner.scan() local targets = {} for _,s in ipairs(scanned) do - if s.name ~= "minecraft:air" and s.y < 0 and s.y > -5 then + if s.name ~= "minecraft:air" and s.y < 0 and s.y > -5 + and s.z <= 7 and s.z >= -8 + and s.x <= 7 and s.x >= -8 then local should_add = true for i,t in ipairs(targets) do @@ -29,13 +31,9 @@ while true do end end for _,v in ipairs(targets) do - if v.z <= 7 and v.z >= -8 - and v.x <= 7 and v.x >= -8 - then - local yaw,pitch = yaw_pitch(v.x,v.y,v.z) - print(v.x,v.y,v.z,yaw,pitch,v.name) - laser.fire(yaw,pitch,4) - end + local yaw,pitch = yaw_pitch(v.x,v.y,v.z) + print(v.x,v.y,v.z,yaw,pitch,v.name) + laser.fire(yaw,pitch,4) end if #targets == 0 then for i = 1,3 do |