Advertisement
Guest User

KOS RT2 boot

a guest
Jul 28th, 2015
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. print " ".
  2. CORE:PART:GETMODULE("kOSProcessor"):DOEVENT("Open Terminal").
  3. clearscreen.
  4. print "Checking for Connection ...".
  5. print " ".
  6. wait 2.
  7. set KSC to ADDONS:RT:HASCONNECTION(SHIP).
  8.  
  9.  
  10. SET p TO SHIP:PARTSDUBBED("dish")[0].
  11. SET m to p:GETMODULE("ModuleRTAntenna").
  12.  
  13. // Do we have an active antenna
  14. if KSC <> True
  15. {
  16. print "Checking for a dish and activating".
  17. if m:getfield("status") = "Off"
  18. { m:DOEVENT("activate").}
  19. }
  20.  
  21. // Finding targets
  22. set TargListgd to list().
  23. LIST TARGETS IN TargList.
  24. // make list of only valid targets
  25. For Targ in TargList
  26. { if Targ:type <> "SpaceObject"
  27. { if Targ:type <> "EVA"
  28. { if Targ:type <> "Debris"
  29. {TargListgd:add (Targ).}
  30. }
  31. }
  32. }
  33. print "all Targets".
  34. print TargList.
  35. print " ".
  36. print " Good Targets".
  37. TargListgd:add ("mission-control").
  38. print TargListgd.
  39. print " ".
  40.  
  41. // LOOP Pointing dish
  42. set link to "no-target". // default target
  43. lock KSCON to ADDONS:RT:HASKSCCONNECTION(SHIP).
  44. lock CON to ADDONS:RT:HASCONNECTION(SHIP).
  45. set x to 0.
  46. set y to TargListgd:length.
  47. //
  48. until KSC = true {
  49. print " ".
  50. HUDTEXT("Searching", 2, 2, 55, red,true).
  51. set targ to TargListgd[x].
  52. print " ".
  53. print "moving to " + Targ.
  54. m:SETFIELD("target",Targ).
  55. wait 3.
  56. print Targ + " is KSCconnected " + KSCON.
  57. print Targ + " is CONconnected " + CON.
  58. if CON = true or KSCON = true { set link to Targ. set KSC to true.}
  59. if x < y-1 {set x to x+1.} else {set x to 0.}
  60. wait 1.
  61. }
  62. //
  63. print " ".
  64. print "Trying to connect".
  65. print " ".
  66. if not KSC {m:SETFIELD("target",link).}
  67. wait 1.
  68. print " ".
  69. set ESTB to m:getfield("target").
  70. print "Connection Established to " + ESTB.
  71. HUDTEXT("Connection Established to " + ESTB, 5, 2, 55, red, false).
  72. print " ".
  73. print "Ready ".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement