Advertisement
montana_1

Initiate Mining

Oct 14th, 2014
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. local gpsData = fs.open("GPS_DATA", "w")
  2.  
  3. x,y,z = gps.locate()
  4.  
  5. if(x == nil or y == nil or z == nil) then
  6.     term.clear()
  7.     term.setCursorPos(1,1)
  8.     print("Could not establish GPS signal, please ensure GPS servers are running and try again")
  9.     print("X: ",x)
  10.     print("Y: ",y)
  11.     print("Z: ",z)
  12.     gpsData.close()
  13. else
  14.     repeat
  15.         term.clear()
  16.         term.setCursorPos(1,1)
  17.         print("GPS signal established correctly, your coordinates are X: (",x,") Y: (",y,") Z: (",z,")")
  18.         print("Please enter heading: ")
  19.         heading= read()
  20.     until (heading == 'N' or heading == 'E' or heading == 'S' or heading == 'W' or heading == 'n' or heading == 'e' or heading == 's' or heading == 'w')
  21.  
  22.     gpsData.writeLine(x)
  23.     gpsData.writeLine(y)
  24.     gpsData.writeLine(z)
  25.     gpsData.writeLine(heading)
  26.     gpsData.close()
  27.  
  28.     print("Would you like to start mining now? (y/n)")
  29.  
  30.     if(read() == 'y') then
  31.         shell.run("CMining")
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement