Advertisement
visiongaming43

Untitled

May 19th, 2022
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 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. os.queueEvent("randomEvent")
  16. os.pullEvent()
  17. length = io.read()
  18. end
  19.  
  20. io.write("Width: ")
  21. local width = io.read()
  22. while (tonumber(width) <= 0) do
  23. print(errorMSG)
  24. io.write("\nWidth: ")
  25. os.queueEvent("randomEvent")
  26. os.pullEvent()
  27. width = io.read()
  28. end
  29.  
  30. io.write("Direction (LEFT or RIGHT): ")
  31. local direction = io.read()
  32. while (direction ~= "LEFT" and direction ~= "RIGHT") do
  33. print(errorMSG)
  34. os.queueEvent("randomEvent")
  35. os.pullEvent()
  36. io.write("\nDirection: ")
  37. end
  38.  
  39. -- Creating file stats (x, y, z, length, width, direction)
  40. local settings = fs.open("Settings", "w")
  41. settings.writeLine(x)
  42. settings.writeLine(y)
  43. settings.writeLine(z)
  44. settings.writeLine(length)
  45. settings.writeLine(width)
  46. settings.writeLine(direction)
  47.  
  48. print("You have successfully set up your farming turtle!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement