Advertisement
jille_Jr

CC: Dropoff using enderchest

Oct 6th, 2012
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. -- variable 'selection' = current slot
  2. -- ^ is not made in this script ^
  3. -- slot 16 is where the enderchest is
  4.  
  5. -- Note: This needs the ender storage mod
  6. -- to work properly, not the implemented
  7. -- ender chests!
  8.  
  9. function checkInvSpace()
  10.   for i = 1,15 do
  11.     if turtle.getItemSpace(i) > 0 then
  12.       turtle.select(i)
  13.       return true
  14.     end
  15.   end
  16.   if turtle.getItemSpace < 1 then
  17.     return false
  18.   end
  19. end
  20.  
  21. if turtle.getItemSpace(selection) < 1 then
  22.   if not checkInvSpace() then
  23.     turtle.select(16)
  24.     turtle.placeUp()
  25.     for j = 1,15 do
  26.       turtle.select(j)
  27.       turtle.dropUp()
  28.     end
  29.     turtle.select(16)
  30.     turtle.digUp()
  31.     turtle.select(1)
  32.   end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement