Advertisement
Kengu

Untitled

Dec 10th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. run = true
  2. print("**Farming area is meant to be a rectangle**")
  3. print("**Turtle should start at the bottom left of the farm plot behind first crop**")
  4.  
  5. io.write("What is the crop type: ")
  6. croptype = (tostring(io.read()))
  7. io.write("How many blocks forward: ")
  8. blocksforward = (tonumber(io.read()))
  9. io.write("How many blocks to the right: ")
  10. blocksright = (tonumber(io.read()))
  11. x = 0
  12. y = 0
  13. z = 0
  14.  
  15.  
  16. while run do
  17. if croptype == "hemp" then
  18. else
  19. print("INVALID")
  20. run = false
  21. end
  22. local event, param = os.pullEvent()
  23. if event == "key" and param == 28 then
  24. print("Process terminated")
  25. break
  26. elseif x < blocksforward then
  27. turtle.dig()
  28. turtle.forward()
  29. x = x + 1
  30. elseif x == blocksforward then
  31. turtle.turnRight()
  32. z = z + 1
  33. elseif y < blocksright and z == 1 then
  34. turtle.dig()
  35. turtle.forward()
  36. y = y + 1
  37. end
  38.  
  39.  
  40.  
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement