Advertisement
QQII

Cobble Harvester V0.1

Apr 5th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. --Cobble Harvester V0.1 by QQII
  2. --Functions
  3. local function clearSlot(slotNumber)            --Attemps to clear the slot slotNumber
  4.     if turtle.getItemCount(slotNumber) ~= 0 then
  5.         turtle.select(slotNumber)
  6.         if not turtle.dropUp() then
  7.             print("ERROR: failure to clear slot number " .. slotNumber)
  8.         end
  9.     end
  10. end
  11.  
  12. local function clearSlots()             --Places all the items into the chest under the turtle
  13.     for i = 1,16 do
  14.         if turtle.getItemCount(i) ~= 0 then
  15.             clearSlot(i)
  16.         end
  17.     end
  18. end
  19.  
  20. --User Inputs
  21. print("The turtle will break blocks infront of it")
  22. print("It will place items in an inventory above it.")
  23.  
  24. --Main Script
  25. while true do
  26.     for i = 1, 64 do
  27.         if turtle.detect() then
  28.             turtle.dig()
  29.         end
  30.     end
  31.     clearSlots()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement