Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------------------------
- -- tomorrow, there'll be a video released with the whole setup used with this code! be sure to keep an eye
- -- out on this channel --> www.youtube.com/user/sythsgod
- -------------------------------------------------------------------------------------------------------------------
- -- functions
- function plant()
- a = turtle.getItemCount(2)
- if a < 4 then
- sapling()
- plantadd()
- else
- plantadd()
- end
- end
- function plantadd()
- turtle.select(2)
- turtle.forward()
- sleep(0.5)
- turtle.place()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- sleep(0.5)
- turtle.place()
- turtle.back()
- sleep(0.5)
- turtle.place()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- sleep(0.5)
- turtle.place()
- sleep(0.2)
- term.clear()
- term.setCursorPos(1,1)
- sleep(0.2)
- textutils.slowPrint("Saplings planted!")
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Done 1!")
- sleep(0.6)
- end
- function sapling()
- do
- turtle.turnRight()
- turtle.back()
- turtle.turnLeft()
- turtle.back()
- turtle.back()
- turtle.up()
- turtle.back()
- turtle.select(2)
- turtle.suckUp()
- turtle.forward()
- turtle.down()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- end
- end
- function grow()
- b = turtle.getItemCount(1)
- if b == 0 then
- bonemeal()
- growadd()
- else
- growadd()
- end
- end
- function growadd()
- turtle.select(1)
- turtle.place()
- sleep(0.5)
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Tree successfully grown!")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Done 1!")
- sleep(0.2)
- textutils.slowPrint("Done 2!")
- textutils.slowPrint("Chopping tree..")
- sleep(0.2)
- turtle.dig()
- turtle.forward()
- turtle.dig()
- end
- function bonemeal()
- do
- turtle.back()
- turtle.back()
- turtle.up()
- turtle.back()
- turtle.select(1)
- turtle.suckUp()
- turtle.forward()
- turtle.down()
- turtle.forward()
- turtle.forward()
- sleep(0.2)
- turtle.place()
- end
- end
- function fellup()
- for c = 1,45 do
- turtle.digUp()
- turtle.up()
- turtle.dig()
- end
- end
- function switch()
- do
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- turtle.dig()
- end
- end
- function felldown()
- for d = 1,45 do
- turtle.digDown()
- turtle.down()
- turtle.dig()
- end
- end
- function store()
- do
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Tree successfully chopped!")
- sleep(1)
- print("Done 1!")
- print("Done 2!")
- sleep(0.2)
- textutils.slowPrint("Done 3!")
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Starting storing event..")
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.forward()
- turtle.up()
- turtle.turnLeft()
- turtle.forward()
- turtle.forward()
- turtle.turnLeft()
- turtle.select(3)
- turtle.dropDown()
- turtle.select(4)
- turtle.dropDown()
- turtle.select(5)
- turtle.dropDown()
- turtle.select(6)
- turtle.dropDown()
- turtle.select(7)
- turtle.dropDown()
- turtle.select(8)
- turtle.dropDown()
- turtle.select(9)
- turtle.dropDown()
- turtle.forward()
- turtle.down()
- turtle.forward()
- turtle.forward()
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Successfully stored all items!")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- print("Done 1!")
- print("Done 2!")
- print("Done 3!")
- sleep(0.2)
- textutils.slowPrint("Done 4!")
- textutils.slowPrint("Waiting for restart of program!")
- end
- end
- -- main program
- print("How many times should the program be repeated?")
- c = tonumber(read())
- for t = 1,c do
- plant()
- sleep(1)
- grow()
- fellup()
- switch()
- felldown()
- store()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement