Advertisement
Codetemple

OreGenFromLava.lua

Jul 8th, 2020
1,287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. #07/07/2020 Basic program to turn stone into ore. Need plent of power for the AR as well)
  2. print("I operate a Mines Lens on an Atomic Reconstructor ")
  3. print("Put a chest above me that I can place ores into, and ")
  4. print(" a chest below me, with plenty of stone in, ")
  5. print(" which I will help myself to!!")
  6. print("I output a resstone pulse on my right side to operate the Atomic thing")
  7. local box = peripheral.wrap("down")
  8. present = true
  9. while present do
  10.     turtle.select(8) -- using second half of inventory
  11.     local success, data = turtle.inspect()
  12.     if sucess then
  13.         if data.name == "minecraft:stone" then
  14.             redstone.setOutput("back", true)
  15.             sleep(0.2)
  16.             redstone.setOutput("back", false)
  17.             sleep(0.5) --give time a chance!
  18.         else if not data.name == "minecraft:water" or data.name == "minecraft:flowing_water" or data.name == "minecraft:lava" or data.name == "minecraft:flowing_lav" then
  19.             while true turtle.dig() ; turtle.suck() end
  20.         end
  21.         sleep(2) --give stone a chance to form
  22.     end
  23.     -- if full clear inventory
  24.     turtle.select(16)
  25.     if turtle.getItemCount()>0 then
  26.         for i = 3,16 do -- clear slots 3 to 16
  27.           turtle.select(i)
  28.           turtle.dropUp()
  29.         end  
  30.     end
  31.     turtle.select(8) -- using second half of inventory
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement