From 9d95dfcdc917ba51cd9a1ba6f533c5edb79a8101 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 2 Jan 2023 23:45:52 +0000 Subject: fish --- fish.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 fish.lua diff --git a/fish.lua b/fish.lua new file mode 100644 index 0000000..8058d41 --- /dev/null +++ b/fish.lua @@ -0,0 +1,24 @@ +os.sleep(3) + +local p=peripheral.wrap"back" +while true do +p.use() +os.sleep(5) +while true do + local es=p.sense() + local ent=nil + for i,e in ipairs(es) do + if e.key == "minecraft:fishing_bobber" then + ent=e + break + end + end + if not ent then error("notfound") end + --print(ent.y) + if ent.y<=-3.7 then p.use() break end + + os.sleep() +end + +os.sleep(1) +end -- cgit v1.2.3