Advertisement
nauseant

CAAB Basalt coin gen

May 6th, 2024 (edited)
879
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. function voidInv()
  2.     turtle.select(1)
  3.     for i=1,16 do
  4.         turtle.select(i)
  5.         turtle.drop()
  6.     end
  7. end
  8.  
  9. function isBasalt()
  10.     local blockID
  11.     local success, data = turtle.inspectDown()
  12.     if success then
  13.        blockID = data.name
  14.     end
  15.    
  16.     if data.name == "minecraft:basalt" then
  17.         return true
  18.     else
  19.         return false
  20.     end
  21. end
  22.  
  23. function mine()
  24.     turtle.select(1)
  25.     while not isBasalt() do
  26.         turtle.select(1)
  27.     end
  28.     turtle.digDown()
  29. end
  30.  
  31. function craft()
  32.     local inv = {11, 12, 15, 16}
  33.     for i=1,2 do
  34.         turtle.transferTo(inv[1], 1)
  35.         turtle.transferTo(inv[2], 1)
  36.         turtle.transferTo(inv[3], 1)
  37.         turtle.transferTo(inv[4], 1)
  38.         turtle.craft()
  39.     end
  40.    
  41. end
  42.  
  43. function uppies()
  44.     turtle.select(1)
  45.     turtle.dropUp()
  46. end
  47.  
  48. local function main()
  49.     while redstone.getInput("back") do
  50.         for i = 1, 4 do
  51.             mine()
  52.         end
  53.         craft()
  54.         uppies()
  55.     end
  56.     os.pullEvent("redstone")
  57.     voidInv()
  58. end
  59.  
  60. voidInv()
  61. while true do
  62.     main()
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement