Advertisement
Codetemple

OreGenFromLava.lua v2

Jul 8th, 2020
945
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 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.         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 not data.name == "minecraft:water" or data.name == "minecraft:flowing_water" or data.name == "minecraft:lava" or data.name == "minecraft:flowing_lav" then
  21.             Print("about to dig in not water or lava")
  22.             while true do turtle.dig() ; turtle.suck() end
  23.         end
  24.         sleep(2) --give stone a chance to form
  25.         Print("sleep(2) ..give stone a chance to form")
  26.     end
  27.     -- if full clear inventory
  28.     turtle.select(16)
  29.     if turtle.getItemCount()>0 then
  30.         Print("Items in slot 16, deciding to clear")
  31.         for i = 3,16 do -- clear slots 3 to 16
  32.           turtle.select(i)
  33.           turtle.dropUp()
  34.         end  
  35.     end
  36.     turtle.select(8) -- using second half of inventory
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement