Advertisement
pson

dropStuff.lua

Aug 11th, 2022 (edited)
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. function refill(slot)
  2.     turtle.select(slot)
  3.     if turtle.getItemCount() < 32 then -- Change 32 if you want to change max
  4.         for i=slot+1,16 do
  5.             if turtle.compareTo(i) then
  6.                 turtle.select(i)
  7.                 turtle.transferTo(slot)
  8.                 if turtle.getItemCount(slot) > 7 then
  9.                     return true
  10.                 end
  11.                 turtle.select(slot)
  12.             end
  13.         end
  14.         return false
  15.     else
  16.         return true
  17.     end
  18. end -- function refill
  19.  
  20. function main ()
  21.     local n = math.min(32, arg[1]) -- Number of items to drop (max 32)
  22.     local s = arg[2] -- Seconds to sleep between drop
  23.  
  24.     if turtle.detectDown() then
  25.         turtle.up()
  26.     end
  27.     while refill(1) do
  28.         turtle.select(1)
  29.         turtle.dropDown(n)
  30.         sleep(s)
  31.     end
  32. end -- function main
  33. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement