Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gpsData = fs.open("GPS_DATA", "w")
- x,y,z = gps.locate()
- if(x == nil or y == nil or z == nil) then
- term.clear()
- term.setCursorPos(1,1)
- print("Could not establish GPS signal, please ensure GPS servers are running and try again")
- print("X: ",x)
- print("Y: ",y)
- print("Z: ",z)
- gpsData.close()
- else
- repeat
- term.clear()
- term.setCursorPos(1,1)
- print("GPS signal established correctly, your coordinates are X: (",x,") Y: (",y,") Z: (",z,")")
- print("Please enter heading: ")
- heading= read()
- until (heading == 'N' or heading == 'E' or heading == 'S' or heading == 'W' or heading == 'n' or heading == 'e' or heading == 's' or heading == 'w')
- gpsData.writeLine(x)
- gpsData.writeLine(y)
- gpsData.writeLine(z)
- gpsData.writeLine(heading)
- gpsData.close()
- print("Would you like to start mining now? (y/n)")
- if(read() == 'y') then
- shell.run("CMining")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement