Advertisement
mager42

splaunch 1.0

Aug 15th, 2012
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.48 KB | None | 0 0
  1.     -- mager42
  2.     -- splaunch 1.0
  3.  
  4. function PlaneLaunchDriver(attitude)
  5.  
  6.     if (attitude == nil) then
  7.         attitude = 123 -- default attitude 123km
  8.     end
  9.    
  10.     print "Power up Atmosferic Engines. Maunaly please."   
  11.  
  12.     mechjeb.attitudeTo({10,6,0}, "SURFACE_NORTH")
  13.     mechjeb.thrustActivate(100)
  14.    
  15.     -- at 666
  16.     while vessel.altitudeASL < 666 do
  17.         wait(3)
  18.     end
  19.  
  20.     print "."
  21.     mechjeb.attitudeTo({10,7,0}, "SURFACE_NORTH")
  22.    
  23.     while vessel.altitudeASL < 1000 do
  24.         wait(3)
  25.     end
  26.  
  27.     print "."
  28.     mechjeb.attitudeTo({10,8,0}, "SURFACE_NORTH")
  29.    
  30.     while vessel.altitudeASL < 1500 do
  31.         wait(3)
  32.     end
  33.  
  34.     print "."
  35.     mechjeb.attitudeTo({10,9,0}, "SURFACE_NORTH")
  36.  
  37.     while vessel.altitudeASL < 2000 do
  38.         wait(3)
  39.     end
  40.  
  41.     print "."
  42.     mechjeb.attitudeTo({10,10,0}, "SURFACE_NORTH")
  43.  
  44.     while vessel.altitudeASL < 2500 do
  45.         wait(3)
  46.     end
  47.  
  48.     print "."
  49.     mechjeb.attitudeTo({10,11,0}, "SURFACE_NORTH")
  50.  
  51.     while vessel.altitudeASL < 3000 do
  52.         wait(3)
  53.     end
  54.  
  55.     print "."
  56.     mechjeb.attitudeTo({10,12,0}, "SURFACE_NORTH")
  57.  
  58.     while vessel.altitudeASL < 3500 do
  59.         wait(3)
  60.     end
  61.  
  62.     print "."
  63.     mechjeb.attitudeTo({10,13,0}, "SURFACE_NORTH")
  64.  
  65.     while vessel.altitudeASL < 4000 do
  66.         wait(3)
  67.     end
  68.  
  69.     print "."
  70.     mechjeb.attitudeTo({10,14,0}, "SURFACE_NORTH")
  71.  
  72.     while vessel.altitudeASL < 5000 do
  73.         wait(3)
  74.     end
  75.  
  76.     print "."
  77.     mechjeb.attitudeTo({10,15,0}, "SURFACE_NORTH")
  78.    
  79.     while vessel.altitudeASL < 6000 do
  80.         wait(3)
  81.     end
  82.  
  83.     print "."
  84.     mechjeb.attitudeTo({10,16,0}, "SURFACE_NORTH")
  85.  
  86.     while vessel.altitudeASL < 7000 do
  87.         wait(3)
  88.     end
  89.  
  90.     print "."
  91.     mechjeb.attitudeTo({10,17,0}, "SURFACE_NORTH")
  92.  
  93.     while vessel.altitudeASL < 8000 do
  94.         wait(3)
  95.     end
  96.  
  97.     print "."
  98.     mechjeb.attitudeTo({10,18,0}, "SURFACE_NORTH")
  99.            
  100.     -- at 9000
  101.     while vessel.altitudeASL < 9000 do
  102.         wait(3)
  103.     end
  104.  
  105.     print "Big Ascent profile change"
  106.     mechjeb.controlRelease()
  107.     mechjeb.launchTo(attitude * 1000, 0)
  108.  
  109.     -- at 12000
  110.     while vessel.altitudeASL < 12000 do
  111.         wait(3)
  112.     end
  113.     print "Power up main Engines. Manualy please."
  114.     mechjeb.stage()
  115.  
  116.     -- at 15000
  117.     while vessel.altitudeASL < 15000 do
  118.         wait(3)
  119.     end
  120.     print "Shut Down Atmosferic Engines. Manualy please."
  121.    
  122.     wait(mechjeb.free)
  123.     mechjeb.thrustDeactivate()
  124.     mechjeb.controlRelease()
  125.     print "Orbit, hopefuly."
  126. end
  127.  
  128. function Launch(attitude)
  129.     local co = coroutine.create(PlaneLaunchDriver)
  130.     coroutine.resume(co, attitude)
  131. end
  132.  
  133. print "Usage: Launch(<attitude, default 123km>)"
  134. print "Set Ascent A. to start turn at 8km and end staging on stage with atmosferic engines"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement