Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Author: Ferrwolf
- -- This program is designed for user to place lava in two 2x18 areas
- -- A special thanks to HPWebcamAble and Bomb Bloke. Without their help this project would not be possible.
- term.clear()
- term.setCursorPos(1,1)
- print("Welcome to Obsidian generator. To start, Place the turtle at the level you will be making the obsidian facing the area you wish the turtle to make the obsidian. Next place a lava source directly behind and two blocks above the turtle, and place a chest or barrel on the turtles left side at the same level as your lava source. Place 64 lava cells into slot 1, 13 into slot 2, and 1 water cell in slot 3.")
- sleep(10)
- print("If you wish to move or are no longer needing the obsidian, have the turtle make one run, replacing the lava cells with the same number of the block of your choice. Keep the water cell in slot 3.")
- if turtle.getItemCount(1) < 64 then
- term.clear()
- term.setCursorPos(1,5)
- print("Please place 64 lava cells slot 1, 13 lava cells in slot 2, and 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- sleep(1)
- term.setCursorPos(1,5)
- print("Please place 64 lava cells slot 1, 13 lava cells in slot 2, and 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- sleep(1)
- term.setCursorPos(1,5)
- print("Please place 64 lava cells slot 1, 13 lava cells in slot 2, and 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- print("Once you place the items in the correct slots, please start me again.")
- print("Shutting down in 3")
- sleep(2)
- print("2")
- sleep(2)
- print("1")
- sleep(2)
- os.shutdown()
- elseif turtle.getItemCount(2) < 13 then
- term.clear()
- term.setCursorPos(1,5)
- print("Please place 13 lava cells in slot 2, and 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- sleep(1)
- term.setCursorPos(1,5)
- print("Please place 13 lava cells in slot 2, and 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- sleep(1)
- term.setCursorPos(1,5)
- print("Please place 13 lava cells in slot 2, and 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- print("Once you place the items in the correct slots, please start me again.")
- print("Shutting down in 3")
- sleep(2)
- print("2")
- sleep(2)
- print("1")
- sleep(2)
- os.shutdown()
- elseif turtle.getItemCount(3) < 1 then
- term.clear()
- term.setCursorPos(1,5)
- print("Please place 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- sleep(1)
- term.setCursorPos(1,5)
- print("Please place 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- sleep(1)
- term.setCursorPos(1,5)
- print("Please place 1 water cell in slot 3.")
- sleep(2)
- term.clear()
- print("Once you place the items in the correct slots, please start me again.")
- print("Shutting down in 3")
- sleep(2)
- print("2")
- sleep(2)
- print("1")
- sleep(2)
- os.shutdown()
- elseif turtle.getItemCount(3) > 1 then
- term.clear()
- term.setCursorPos(1,5)
- print("Please place only 1 water cell in slot 3. You have too many!")
- sleep(2)
- term.clear()
- sleep(2)
- term.setCursorPos(1,5)
- print("Please place only 1 water cell in slot 3. You have too many!")
- sleep(2)
- term.clear()
- sleep(2)
- term.setCursorPos(1,5)
- print("Please place only 1 water cell in slot 3. You have too many!")
- sleep(2)
- term.clear()
- print("Once you place the item in the correct slot, please start me again.")
- print("Shutting down in 3")
- sleep(2)
- print("2")
- sleep(2)
- print("1")
- sleep(2)
- os.shutdown()
- end
- --Requests number of runs from user
- term.write("How many runs would you like: ")
- local runs = tonumber(read())
- local counter = 0
- -- Turtle mines the first row of obsidian
- while runs > 0 do
- runs=runs-1
- counter=counter+1
- turtle.select(16)
- for i=0,18 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- -- Sets the turtle up to mine the second row
- turtle.turnRight()
- turtle.dig()
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- turtle.turnRight()
- -- Turtle mines the second row
- for i=0,17 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- -- Turtle moves the the second plot and prepares to mine the 3rd row
- turtle.turnLeft()
- turtle.dig()
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- turtle.dig()
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- turtle.turnLeft()
- -- Turtle mines the 3rd row
- for i=0,17 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- -- Turtle prepares to mine 4th row
- turtle.turnRight()
- turtle.dig()
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- turtle.turnRight()
- -- Turtle mines the 4th row
- for i=0,4 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- turtle.select(15)
- for i=0,12 do
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- -- Returns turtle to starting point while placing lava
- turtle.select(1)
- for i=0,17 do
- turtle.back()
- turtle.place()
- end
- turtle.turnLeft()
- turtle.back()
- turtle.place()
- turtle.turnLeft()
- turtle.back()
- turtle.place()
- for i=0,16 do
- turtle.back()
- turtle.place()
- end
- turtle.turnRight()
- turtle.back()
- turtle.place()
- turtle.back()
- turtle.place()
- turtle.turnRight()
- for i=0,17 do
- turtle.back()
- turtle.place()
- end
- turtle.turnLeft()
- turtle.back()
- turtle.place()
- turtle.turnLeft()
- turtle.back()
- turtle.place()
- for i=0,4 do
- turtle.back()
- turtle.place()
- end
- turtle.select(2)
- for i=0,12 do
- turtle.back()
- turtle.place()
- end
- --Placing water to make obsidian
- turtle.select(3)
- turtle.up()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.place()
- sleep(3)
- turtle.place()
- for i=0,9 do
- turtle.forward()
- end
- turtle.place()
- sleep(3)
- turtle.place()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- for i=0,14 do
- turtle.forward()
- end
- turtle.up()
- turtle.select(1)
- turtle.place()
- turtle.select(2)
- turtle.place()
- turtle.select(4)
- while turtle.getItemCount(4) > 1 do
- turtle.place()
- end
- turtle.place()
- turtle.select(5)
- while turtle.getItemCount(5) > 1 do
- turtle.place()
- end
- turtle.place()
- turtle.select(4)
- turtle.transferTo(1)
- turtle.select(5)
- turtle.transferTo(1)
- turtle.select(6)
- turtle.transferTo(1)
- turtle.transferTo(2)
- turtle.select(7)
- turtle.transferTo(2)
- turtle.turnRight()
- turtle.select(16)
- turtle.drop()
- turtle.select(15)
- turtle.drop()
- turtle.turnRight()
- turtle.down()
- turtle.down()
- term.clear()
- term.setCursorPos(1,1)
- print("Run complete!")
- end
- counter = tostring(counter)
- term.write("The turtle has completed ")
- term.write(counter)
- print(" runs!")
Advertisement
Add Comment
Please, Sign In to add comment