Advertisement
Codetemple

OreGenFromLava.lua v5

Jul 8th, 2020
1,052
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. #07/07/2020 Basic program to turn stone into ore. Need plenty of power for the AR as well)
  2. print("I operate a Lens of the Miner on an Atomic Reconstructor ")
  3. print("Put a chest above me that I can place ores into, and ")
  4. Print("Set up lava to flow on top of flowing water to generate a stone block in front of me.")
  5. print("I output a redstone pulse on my back to operate the Atomic thing")
  6. print("the AR and its LotMiner can/should be right next to where the stone forms, so water doesn't flow in the ray's path")
  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 success then
  13.         print("success")
  14.         if data.name == "minecraft:stone" then
  15.             print("stone")
  16.             redstone.setOutput("back", true)
  17.             sleep(0.2)
  18.             redstone.setOutput("back", false)
  19.             sleep(0.5) --give time a chance!
  20.         elseif data.name == "minecraft:water"           then print("water")
  21.         elseif data.name == "minecraft:flowing_water"   then print("flowing_water")
  22.         elseif data.name == "minecraft:lava"            then print("lava")
  23.         elseif data.name == "minecraft:flowing_lav"     then print("flowing_lava")  
  24.         else
  25.             print("about to dig in not water or lava")
  26.             turtle.dig() ; turtle.suck()
  27.         end
  28.         sleep(1.2) --give stone a chance to form ESSENTIAL I LOST MY WATER WHEN TOO SHORT
  29.         print("Items in slot 16, deciding to clear")
  30.         for i = 3,16 do -- clear slots 3 to 16
  31.           turtle.select(i)
  32.           turtle.dropUp()
  33.         end
  34.     end
  35.     turtle.select(8) -- using second half of inventory
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement