mrkirby153

[TURTLE] Empty

Mar 7th, 2015
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local tArgs = { ... }
  2. local slotWithEnderChest = 16
  3. if #tArgs > 0 then
  4.     slotWithEnderChest = tonumber(tArgs[1])
  5. end
  6. function empty()
  7.     -- Empty the turtle's inventory
  8.    
  9.     currentSlot = turtle.getSelectedSlot()
  10.     -- Check if the ender chest can be placed
  11.         if turtle.detectUp() then
  12.             turtle.digUp()
  13.         end
  14.     -- Place the ender chest
  15.     turtle.select(slotWithEnderChest)
  16.     turtle.placeUp()
  17.    
  18.     chest = peripheral.wrap("up")
  19.     for i=1,16 do
  20.         turtle.select(i)
  21.         turtle.dropUp()
  22.     end
  23.     turtle.select(slotWithEnderChest)
  24.     turtle.digUp()
  25.     turtle.select(currentSlot)
  26. end
  27. empty()
Advertisement
Add Comment
Please, Sign In to add comment