Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local errorMSG = "You inputted an invalid value! Please retry!"
- -- Fetching GPS Coordinates
- 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")
- print("Please Press Enter To Continue...")
- io.read()
- local x,y,z = gps.locate()
- -- Fetching Manual Values For Farm
- io.write("Length: ")
- local length = io.read()
- while (tonumber(length) <= 0) do
- print(errorMSG)
- io.write("\nLength: ")
- length = io.read()
- end
- io.write("Width: ")
- local width = io.read()
- while (tonumber(width) <= 0) do
- print(errorMSG)
- io.write("\nWidth: ")
- width = io.read()
- end
- io.write("Direction (LEFT or RIGHT): ")
- local direction = io.read()
- while (direction ~= "LEFT" and direction ~= "RIGHT") do
- print(errorMSG)
- io.write("\nDirection: ")
- direction = io.read()
- end
- -- Creating file stats (x, y, z, length, width, direction)
- local settings = fs.open("Settings", "w")
- settings.writeLine(x)
- settings.writeLine(y)
- settings.writeLine(z)
- settings.writeLine(length)
- settings.writeLine(width)
- settings.writeLine(direction)
- print("You have successfully set up your farming turtle!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement