largeNumberGoeshere

turtleMisc

Apr 20th, 2021 (edited)
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. function isPlacable(slot)
  2.     -- make sure there's nothing in the way
  3.     if turtle.detect() then return "failed test" end
  4.    
  5.     turtle.select(slot)
  6.     turtle.place()
  7.     isThere = turtle.detect()
  8.     turtle.dig()
  9.    
  10.     return(isThere)
  11. end
  12.  
  13. function isSlotFull(slot,maxItems)
  14.     turtle.select(slot)
  15.     local count = turtle.getItemCount()
  16.     local isF = maxItems >= count
  17. end
  18.  
  19.  
  20. function isBlock
  21.     local fwd = turtle.detect()
  22.     local up turtle.detectUp()
  23.     if fwd then return fwd end
  24.     if up then return up end
  25. end
  26.  
  27. function isFull(maxFull)
  28.     local slotsFull = 0
  29.     for i = 1,16 do
  30.         turtle.select()
  31.         if turtle.getItemCount() > 0 then
  32.             slotsFull = slotsFull + 1
  33.         end
  34.     end
  35.    
  36.     if slotsFull > maxFull then
  37.         return slotsFull
  38.     else
  39.         return false
  40.     end
  41. end
  42.  
  43.    
  44.  
Add Comment
Please, Sign In to add comment