summaryrefslogtreecommitdiff
path: root/hole.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-06-28 00:30:48 +0100
committerubq323 <ubq323@ubq323.website>2022-06-28 00:30:48 +0100
commit6983d873e5533297b10972184f129574c53f12e1 (patch)
tree33eeff4007951527b21d9eb61b8664e9c3685483 /hole.lua
parent7e16b3e24711969313e856039c4e957bb2f1cf25 (diff)
hole
Diffstat (limited to 'hole.lua')
-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