Advertisement
visiongaming43

Untitled

May 21st, 2022
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 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 AND ONE BLOCK BEHIND\n- TURTLE MUST BE ABOVE A CHEST\n- TURTLE MUST BE FACING TOWARDS FARM\n")
  5. print("* * * *\n* * * *\n* * * *\nx\n")
  6. print("Please Press Enter To Continue...")
  7. io.read()
  8. local x,y,z = gps.locate()
  9.  
  10. -- Fetching Manual Values For Farm
  11. io.write("Length: ")
  12. local length = io.read()
  13. while (tonumber(length) <= 0) do
  14. print(errorMSG)
  15. io.write("\nLength: ")
  16. length = io.read()
  17. end
  18.  
  19. io.write("Width: ")
  20. local width = io.read()
  21. while (tonumber(width) <= 0) do
  22. print(errorMSG)
  23. io.write("\nWidth: ")
  24. width = io.read()
  25. end
  26.  
  27. io.write("Direction (LEFT or RIGHT): ")
  28. local direction = io.read()
  29. while (direction ~= "LEFT" and direction ~= "RIGHT") do
  30. print(errorMSG)
  31. io.write("\nDirection: ")
  32. direction = io.read()
  33. end
  34.  
  35. -- Creating Info Array
  36. local info = {x, y, z, length, width, direction}
  37.  
  38. -- Creating file stats (x, y, z, length, width, direction)
  39. local settings = fs.open("Settings", "w")
  40. for line in ipairs(info) do
  41. settings.writeLine(line)
  42. end
  43. print("You have successfully set up your farming turtle!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement