Skaruts

ComputerCraft getSnow Program [wip]

Jan 1st, 2013
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local tArgs = {...}
  2.  
  3. local slotNum
  4. local slotItemCount
  5. local fullItemCount
  6.  
  7. local function returnSupplies()
  8.     print( "Returning snow..." )
  9.     turtle.left()
  10.     turtle.left()
  11.     for n=1, 16 do
  12.         turtle.select(n)
  13.         turtle.drop()
  14.     end
  15.    
  16.     turtle.select(1)
  17. end
  18.  
  19. local function collect()   
  20.     local iFull = true
  21.    
  22.     for n=1,16 do
  23.         local nCount = turtle.getItemCount(n)
  24.         if nCount ~= 16 then
  25.             iFull = false
  26.         end
  27.     end
  28.    
  29.     if iFull then
  30.         print( "No storage space left." )
  31.         return false
  32.     end
  33.     return true
  34. end
  35.  
  36. local function dig()
  37.     while collect() do
  38.         turtle.dig()
  39.     end
  40. end
  41.  
  42. dig()
Advertisement
Add Comment
Please, Sign In to add comment