legg0028

diamond_bud

Nov 6th, 2022 (edited)
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. local function checkInventory()
  2.     slot = 0
  3.     repeat
  4.         slot = slot + 1
  5.         turtle.select(slot)
  6.     until (turtle.getItemCount(slot) > 0)
  7.     repeat
  8.         if (turtle.getItemDetail(slot).name ~= "ftbstoneblock:3x_compressed_stone") then
  9.             slot = slot + 1
  10.             turtle.select(slot)
  11.         end
  12.     until (turtle.getItemDetail(slot).name == "ftbstoneblock:3x_compressed_stone")
  13. end
  14.  
  15. local function checkDiamond()
  16.     for x = 1,4 do
  17.         has_block, data = turtle.inspect()
  18.         if has_block then
  19.             if (data.name ~= "ftbstoneblock:3x_compressed_stone") then
  20.                 term.clear()
  21.                 term.setCursorPos(1,1)
  22.                 print("Checking to see if the compressed cobble has turned in to diamond ore.")
  23.                 print("Ooooohhh found some diamond ore!")
  24.                 turtle.dig()
  25.                 turtle.place()
  26.             end
  27.         end
  28.         turtle.turnLeft()
  29.     end
  30.  
  31.     has_block, data = turtle.inspectUp()
  32.     if has_block then
  33.         if (data.name ~= "ftbstoneblock:3x_compressed_stone") then
  34.             term.clear()
  35.             term.setCursorPos(1,1)
  36.             print("Checking to see if the compressed cobble has turned in to diamond ore.")
  37.             print("Ooooohhh found some diamond ore!")
  38.             turtle.digUp()
  39.             turtle.placeUp()
  40.         end
  41.     end
  42. end
  43.  
  44. while true do
  45.     term.clear()
  46.     term.setCursorPos(1,1)
  47.     print("Checking to see if the compressed cobble has turned in to diamond ore.")
  48.     checkInventory()
  49.     checkDiamond()
  50.     sleep(1)
  51. end
Advertisement
Add Comment
Please, Sign In to add comment