Advertisement
bigbadtom

placestone

Oct 17th, 2021
1,198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. local slot = 3
  2.  
  3. function checkstock()
  4. turtle.select(slot)
  5. return turtle.getItemCount(slot)
  6. end
  7.  
  8. local stock = checkstock()
  9.  
  10. function nextslot()
  11.     if slot < 8 then
  12.         slot = slot + 1
  13.     elseif slot == 8 then
  14.         slot = 3
  15.     end
  16. end
  17.  
  18. if stock == 0 then
  19.     while stock == 0 do
  20.     nextslot()
  21.     stock = checkstock()
  22.     end
  23. end
  24. print(stock)
  25.  
  26. turtle.forward()
  27. turtle.placeDown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement