Advertisement
visiongaming43

Untitled

May 19th, 2022
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. local errorMSG = "You inputted an invalid value! Please retry!"
  2.  
  3. -- Fetching GPS Coordinates
  4. print("PROPER STARTING POSITION\n- TURTLE MUST BE AT A CORNER OF THE FARM\n- TURTLE MUST BE ABOVE A CHEST\n- TURTLE MUST BE FACING TOWARDS FARM\n")
  5. print("Please Press Enter To Continue...")
  6. io.read()
  7. local x,y,z = gps.locate()
  8.  
  9. -- Fetching Manual Values For Farm
  10. io.write("Length: ")
  11. local length = io.read()
  12. while (tonumber(length) <= 0) do
  13. print(errorMSG)
  14. io.write("\nLength: ")
  15. length = io.read()
  16. end
  17.  
  18. io.write("Width: ")
  19. local width = io.read()
  20. while (tonumber(width) <= 0) do
  21. print(errorMSG)
  22. io.write("\nWidth: ")
  23. width = io.read()
  24. end
  25.  
  26. io.write("Direction (LEFT or RIGHT): ")
  27. local direction = io.read()
  28. while (direction ~= "LEFT" and direction ~= "RIGHT") do
  29. print(errorMSG)
  30. io.write("\nDirection: ")
  31. end
  32.  
  33. -- Creating file stats (x, y, z, length, width, direction)
  34. local settings = fs.open("Settings", "w")
  35. settings.writeLine(x)
  36. settings.writeLine(y)
  37. settings.writeLine(z)
  38. settings.writeLine(length)
  39. settings.writeLine(width)
  40. settings.writeLine(direction)
  41.  
  42. print("You have successfully set up your farming turtle!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement