Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("program to mine obsidian!")
- print("..")
- print("dirt in slot 1")
- print("bucket of water in slot 2")
- print("bucket of lava in slot 3")
- print("redstone in slot 4,5,6")
- print("press ENTER to start program")
- -- sit in a loop untill the ENTER key is pressed
- while true do
- press, key = os.pullEvent()
- if press == "key" and key == 28 then
- break
- end
- end
- -- loop the code 8 times
- for i = 1, 8 do
- print("i is "..tostring(i))
- -- gets into the starting position
- turtle.forward()
- turtle.down()
- -- selects the dirt
- turtle.select(1)
- --places the dirt (7 blocks)
- x = 0
- while x < 7 do
- turtle.placeDown()
- turtle.forward()
- x = x + 1
- end
- -- gets into position to drop the water
- turtle.up()
- y = 0
- while y < 3 do
- turtle.back()
- y = y + 1
- end
- turtle.select(2)
- turtle.placeDown()
- -- wait while the water spreads
- os.sleep( 2 )
- -- move back to the start of the line to start minig the dirt
- y = 0
- while y < 3 do
- turtle.back()
- y = y + 1
- end
- -- mine the dirt
- turtle.down()
- turtle.digDown()
- turtle.down()
- --turtle.digDown()
- y = 0
- while y < 6 do
- turtle.dig()
- turtle.forward()
- y = y + 1
- end
- -- gets into position to drop the redstone
- turtle.up()
- turtle.up()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.down()
- -- places the redstone
- turtle.select(4)
- y = 0
- while y < 7 do
- turtle.placeDown()
- turtle.back()
- y = y + 1
- end
- turtle.up()
- -- gets into position to place the lava
- y = 0
- while y < 2 do
- turtle.forward()
- y = y + 1
- end
- -- drop the lava
- turtle.select(3)
- turtle.place()
- turtle.up()
- -- waits for the lava to spread
- os.sleep(15)
- -- pick the lava back up
- turtle.down()
- turtle.place()
- os.sleep(10)
- -- move back to the start of the line
- y = 0
- while y < 2 do
- turtle.back()
- y = y + 1
- end
- -- mine the obsidian
- turtle.down()
- turtle.digDown()
- turtle.down()
- y = 0
- while y < 6 do
- turtle.dig()
- turtle.forward()
- y = y + 1
- end
- turtle.up()
- turtle.up()
- -- pick the water back up
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.back()
- turtle.back()
- turtle.back()
- turtle.select(2)
- turtle.placeDown()
- turtle.back()
- turtle.back()
- turtle.back()
- turtle.back()
- -- drop the obsidian in the chest
- turtle.up()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.select(8)
- turtle.dropDown()
- -- go back to the starting position
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.down()
- turtle.turnRight()
- -- put the obsidian in the chest
- --turtle.down()
- -- puts the dirt that we have picked up back into slot 1
- turtle.select(7)
- turtle.transferTo(1)
- --print(" ")
- print("finished!!!!!!")
- -- go back to starting position
- y = 0
- while y < 3 do
- -- turtle.back()
- -- y = y + 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement