Advertisement
nuggetin

t

Feb 15th, 2024 (edited)
1,070
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. while true do
  2.     turtle.attack()
  3.     local isFull = true
  4.     local itemPresent = false
  5.     for slot = 1, 16 do
  6.         if turtle.getItemCount(slot) > 0 then
  7.             itemPresent = true
  8.         end
  9.         if turtle.getItemCount(slot) == 0 then
  10.             isFull = false
  11.             break
  12.         end
  13.     end
  14.     if itemPresent then
  15.         if isFull or not turtle.detect() then
  16.             for slot = 1, 16 do
  17.                 turtle.select(slot)
  18.                 turtle.drop()
  19.             end
  20.         end
  21.     end
  22.     os.sleep(0.5)  -- to avoid spamming the server
  23. end
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement