Advertisement
Codetemple

OreGenFromLava.lua v3

Jul 8th, 2020
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 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 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.             while true do turtle.dig() ; turtle.suck() end
  27.         end
  28.         sleep(2) --give stone a chance to form
  29.         print("sleep(2) ..give stone a chance to form")
  30.     end
  31.     -- if full clear inventory
  32.     turtle.select(16)
  33.     if turtle.getItemCount()>0 then
  34.         print("Items in slot 16, deciding to clear")
  35.         for i = 3,16 do -- clear slots 3 to 16
  36.           turtle.select(i)
  37.           turtle.dropUp()
  38.         end  
  39.     end
  40.     turtle.select(8) -- using second half of inventory
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement