Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- user input
- inputarg = {...}
- if inputarg[1] == "" then
- print "Please enter a valid argument"
- end
- cycle = inputarg[1]
- -- Actions
- function start()
- turtle.dig()
- turtle.forward()
- end
- function column()
- while turtle.digUp() do
- turtle.dig()
- turtle.up()
- end
- while not turtle.detectDown() do
- turtle.down()
- end
- end
- function switch()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- end
- function replant()
- turtle.forward()
- turtle.select(15)
- turtle.place()
- turtle.back()
- turtle.place()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- turtle.place()
- turtle.back()
- turtle.place()
- end
- function grow()
- turtle.select(16)
- while turtle.place() ~= false do
- turtle.place()
- sleep(1)
- end
- end
- -- Chest operations
- function dump()
- turtle.turnLeft()
- turtle.turnLeft()
- for slots = 1,14 do
- turtle.select(slots)
- turtle.drop()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- -- main
- function cutdown()
- start()
- column()
- switch()
- column()
- turtle.back()
- end
- function process()
- replant()
- dump()
- grow()
- end
- function cycleFull()
- cutdown()
- process()
- end
- -- operated
- print "\n\nOperation started"
- for re = 1, cycle do
- cycleFull()
- end
- print "Operation Complete"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement