Steakbroetchen

Untitled

Oct 25th, 2013
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. shell.run("clear")
  2. rednet.open("right")
  3. local x, y, z = gps.locate(5)
  4. if x == nil then
  5. print("Kein GPS-Signal")
  6. sleep(3)
  7. shell.run("clear")
  8. print("Programm-Abruch")
  9. sleep(3)
  10. error()
  11. end
  12. print("Aktuelle Position: ",x," ",y," ",z)
  13. print("Zielkoordinaten:")
  14. print("X: ")
  15. local xx = read()
  16. print("Y: ")
  17. local yy = read()
  18. print("Z: ")
  19. local zz = read()
  20. local xxx = tonumber(xx)
  21. local yyy = tonumber(yy)
  22. local zzz = tonumber(zz)
  23. shell.run("clear")
  24. print("Aktuelle Position: ",x," ",y," ",z)
  25. print("Zielkoordinaten: ",xxx," ",yyy," ",zzz)
  26. print("Navigation starten? <JA/NEIN>")
  27. if read() == "NEIN" then
  28. shell.run("clear")
  29. print("Programm-Abruch")
  30. sleep(3)
  31. error()
  32. end
  33. while 1 do
  34. local x, y, z = gps.locate(1)
  35. if z < 220 then
  36. print(z)
  37. rs.setBundledOutput("back", colors.purple)
  38. sleep(2.0)
  39. rs.setBundledOutput("back", colors.purple)
  40. sleep(2.0)
  41. rs.setBundledOutput("back", colors.blue)
  42. sleep(2.0)
  43. rs.setBundledOutput("back", colors.blue)
  44. sleep(2.0)
  45. else
  46. error()
  47. end
Advertisement
Add Comment
Please, Sign In to add comment