Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- run = false
- print("**Farming area is meant to be a rectangle**")
- print("**Turtle should start at the bottom left of the farm plot behind first crop**")
- io.write("What is the crop type: ")
- croptype = (tostring(io.read()))
- io.write("How many blocks forward: ")
- blocksforward = (tonumber(io.read()))
- io.write("How many blocks to the right: ")
- blocksright = (tonumber(io.read()))
- x = 0
- y = 0
- z = 0
- if croptype == "hemp" then
- run = true
- else
- print("INVALID")
- end
- while run do
- local event, param = os.pullEvent()
- if event == "key" and param == 28 then
- print("Process terminated")
- break
- elseif turtle.detect() then
- if x < blocksforward then
- turtle.dig()
- turtle.forward()
- x = x + 1
- elseif x == blocksforward then
- turtle.turnRight()
- z = z + 1
- elseif y < blocksright and z = 1 then
- turtle.dig()
- turtle.forward()
- y = y + 1
- else
- print("error")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement