summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hole.lua14
1 files changed, 6 insertions, 8 deletions
diff --git a/hole.lua b/hole.lua
index bbdf646..c8b55fa 100644
--- a/hole.lua
+++ b/hole.lua
@@ -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