Guest User

break

a guest
May 21st, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. --local chest = peripheral.wrap("bottom")
  2. local jarSide= "top"
  3. local aspect = "herba"
  4. local tSlot = 10
  5. --local cableSide = "bottom"
  6.  
  7. function placeFullJar()
  8.   local placed = false
  9.   while placed == false do
  10.     for slot = 1,16 do
  11.       local content = turtle.getItemDetail(slot)
  12.       if content ~= nil then
  13.         if content.name == "Thaumcraft:BlockJarFilledItem" then
  14.           print("full jar in slot"..slot)
  15.           turtle.select(slot)
  16.           placed = turtle.placeUp()
  17.           print("Full jar placed.")
  18.           return placed
  19.         end
  20.       end
  21.     end
  22.     sleep(8)
  23.   end
  24. end
  25.  
  26. while true do
  27.   if turtle.detectUp() then
  28.     local level = peripheral.call(jarSide,"getAspectCount",aspect)
  29.     if level == 0 then
  30.       print("Jar is empty")
  31.       turtle.select(tSlot)
  32.       turtle.digUp()
  33.       turtle.dropDown(1)
  34.     else
  35.       print("Jar not empty yet...")
  36.       sleep(8)
  37.     end
  38.   else
  39.     print("No jar detected")
  40.     placeFullJar()
  41.   end
  42.  
  43. end
Advertisement
Add Comment
Please, Sign In to add comment