Advertisement
Guest User

Untitled

a guest
Oct 15th, 2013
743
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.65 KB | None | 0 0
  1. clearscreen.
  2. sas off.
  3. Set Go to 0.
  4. set tOrbit to apoapsis.
  5. set BurnNow to 0.
  6. set end to 0.
  7. set done to 0.
  8. set inputFlag to 0.
  9. set eccintricity to
  10. (((apoapsis + 600000)-(periapsis + 600000))/((apoapsis + 600000)+(periapsis + 600000))).
  11.  
  12. set printflag to 1.
  13. if ag9 = "True" { toggle ag9. }.
  14. if ag8 = "True" { toggle ag8. }.
  15. if ag7 = "True" { toggle ag7. }.
  16.  
  17. until end = 1
  18. {
  19. if ag9 = "True" { set tOrbit to tOrbit + 10000. set printflag to 1. toggle ag9. }.
  20. if ag8 = "True" { set tOrbit to tOrbit - 10000. set printflag to 1. toggle ag8. }.
  21. if tOrbit < 80000 { set tOrbit to 80000. }.
  22. if torbit > 650000 { set tOrbit to 650000. }.
  23. if ag7 = "True"
  24. {
  25. clearscreen.
  26. print "Your new orbit will be. " + tOrbit + "m" at (0,1).
  27. toggle ag7.
  28. wait 2.
  29. set end to 1.
  30. }.
  31.  
  32. if printflag = 1
  33. {
  34. clearscreen.
  35. print "Select your orbit altitude." at (0,0).
  36. print "--------------------------------" at (0,1).
  37. print "Use action group 9 to add 10Km to orbit alt." at (0,3).
  38. print "Use action group 8 to remove 10Km from orbit alt." at (0,5).
  39. print "Use action group 7 to confirm orbit alt." at (0,7).
  40. print "You have selected " + tOrbit + "m" at (0,9).
  41. set printflag to 0.
  42. }.
  43. }.
  44.  
  45. if tOrbit > apoapsis { set condition to 0. }.
  46. if tOrbit < apoapsis { set condition to 1. }.
  47.  
  48. if eccintricity < 0.002
  49. { set BurnNow to 1. }.
  50.  
  51. if condition = 0
  52. {
  53. lock steering to prograde.
  54. if BurnNow = 1
  55. {
  56. print "Use Action Group 7 to begin the burn.".
  57. print "Use Action Group 9 to Cancel.".
  58. until inputFlag = 1
  59. {
  60. if ag7 = "True" { set inputFlag to 1. toggle ag7. set Go to 1. }.
  61. if ag9 = "True" { toggle ag9. print garbage. }.
  62. }.
  63. }.
  64. if BurnNow = 0
  65. {
  66. print "Wating for Periapsis.".
  67. set warp to 3.
  68. when eta:periapsis < 120 then set warp to 2.
  69. when eta:periapsis < 30 then set warp to 0.
  70. when eta:periapsis < 1 then set Go to 1.
  71. }.
  72. clearscreen.
  73. wait until Go = 1.
  74. print "Burning for " + tOrbit + "m".
  75. lock throttle to 1.
  76. set Go to 0.
  77. when apoapsis > (tOrbit - (tOrbit*.01)) then lock throttle to .05.
  78. when apoapsis > tOrbit then { lock throttle to 0. set Go to 1. }.
  79. wait until Go = 1.
  80. set Gk to 3.5216000*10^12.
  81. set Radius to 600000 + apoapsis.
  82. set sma to 600000 + ((periapsis+apoapsis)/2).
  83. set V1 to (Gk/Radius)^.5.
  84. set V2 to (Gk*((2/Radius)-(1/sma)))^.5.
  85. set dV to abs(V1-V2).
  86. set acceleration to (maxthrust/mass).
  87. set burnTime to (dV/acceleration).
  88. set tTime to (burnTime/2).
  89. set waitTime to eta:apoapsis - tTime.
  90. print "Curcularizing Burn in " + waitTime + "seconds.".
  91. wait 1.
  92. set warp to 3.
  93. when eta:apoapsis < 120 then set warp to 2.
  94. when eta:apoapsis < 30 then { set warp to 0. set tOrbit to apoapsis. }.
  95. when eta:apoapsis < tTime then lock throttle to 1.
  96. when periapsis > (tOrbit - (tOrbit*.01)) then lock throttle to .05.
  97. when periapsis > (tOrbit - 100) then { lock throttle to 0. set done to 1. }.
  98. }.
  99.  
  100.  
  101. if condition = 1
  102. {
  103. lock steering to retrograde.
  104. if BurnNow = 1
  105. {
  106. print "Use Action Group 7 to begin the burn.".
  107. print "Use Action Group 9 to Cancel.".
  108. until inputFlag = 1
  109. {
  110. if ag7 = "True" { set inputFlag to 1. toggle ag7. set Go to 1. }.
  111. if ag9 = "True" { toggle ag9. print garbage. }.
  112. }.
  113. }.
  114. if BurnNow = 0
  115. {
  116. print "Wating for Apoapsis.".
  117. set warp to 3.
  118. when eta:apoapsis < 120 then set warp to 2.
  119. when eta:apoapsis < 30 then set warp to 0.
  120. when eta:apoapsis < 1 then set Go to 1.
  121. }.
  122. clearscreen.
  123. wait until Go = 1.
  124. print "Burning for " + tOrbit + "m Periapsis.".
  125. lock throttle to 1.
  126. set Go to 0.
  127. when periapsis < (tOrbit + (tOrbit*.01)) then lock throttle to .05.
  128. when periapsis < tOrbit then { lock throttle to 0. set Go to 1. }.
  129. wait until Go = 1.
  130. set Gk to 3.5216000*10^12.
  131. set Radius to 600000 + periapsis.
  132. set sma to 600000 + ((periapsis+apoapsis)/2).
  133. set V1 to (Gk/Radius)^.5.
  134. set V2 to (Gk*((2/Radius)-(1/sma)))^.5.
  135. set dV to abs(V1-V2).
  136. set acceleration to (maxthrust/mass).
  137. set burnTime to (dV/acceleration).
  138. set tTime to (burnTime/2).
  139. set waitTime to eta:periapsis - tTime.
  140. print "Curcularizing Burn in " + waitTime + "seconds.".
  141. wait 1.
  142. set warp to 3.
  143. when eta:periapsis < 120 then set warp to 2.
  144. when eta:periapsis < 30 then { set warp to 0. set tOrbit to periapsis. }.
  145. when eta:periapsis < tTime then lock throttle to 1.
  146. when apoapsis < (tOrbit + (tOrbit*.01)) then lock throttle to .05.
  147. when apoapsis < (tOrbit + 100) then { lock throttle to 0. set done to 1. }.
  148. }.
  149.  
  150. wait until done = 1.
  151. sas on.
  152. print " ".
  153. print "Orbital Eccentricity is " +
  154. (((apoapsis + 600000)-(periapsis + 600000))/((apoapsis + 600000)+(periapsis + 600000))).
  155. print " ".
  156. wait 2.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement