home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / f / fltdir.zip / FLTDIR.TXT < prev    next >
Text File  |  1993-01-09  |  4KB  |  254 lines

  1. ; Fltdir.txt by Art Rutty, 72550,2533
  2. ; A Keyboard program to control the FS4 Auto-pilot.
  3. ; Incorporating Charlie Gulick's T&AMOD and
  4. ; inspired by his Flypal program.
  5.  
  6. keywatch:
  7. if key("0")then
  8.         gosub altlock
  9.         endif
  10. if key("\")then
  11.         gosub climb100
  12.         endif
  13. if key("/")then
  14.         gosub dive100
  15.         endif
  16. if key("a")then
  17.         gosub aglread
  18.         endif
  19. if key("t")then
  20.         gosub trimread
  21.         endif
  22. if key("6")then
  23.         gosub tasread
  24.         endif
  25. if key("e")then
  26.         gosub headhold
  27.         endif
  28. if key("w")then
  29.         gosub turnleft
  30.         endif
  31. if key("r")then
  32.         gosub turnright
  33.         endif
  34. if key("`")then
  35.         gosub adftog
  36.         endif
  37. if key("j")then
  38.         gosub jack
  39.         endif
  40. if key("8")then
  41.         gosub magvar
  42.         endif
  43. if key("9")then
  44.         gosub vor1tog
  45.         endif
  46. goto keywatch
  47.  
  48. altlock:
  49. movevar(altit_lock_var,altmsl)
  50. setvar(a,1)
  51. z := z ^ a
  52. movevar(altit_lock,z)
  53. if varmask(altit_lock,1)
  54. gosub lockon
  55. goto end
  56. endif
  57.  
  58. print "Altitude hold off!"
  59. wait(1)
  60. print ""
  61. setvar(altit_lock,0)
  62. end:
  63. return
  64.  
  65. lockon:
  66. if altitude(0,0)
  67. endif
  68. printvar(result,"Altitude hold at: ")
  69. wait(2)
  70. print""
  71. return
  72.  
  73. climb100:
  74. setvar(a,0)
  75. climb1002:
  76. addvar(a,100)
  77. addvar(altit_lock_var,30)
  78. addvar(altit_lock,1)
  79. printvar(a,"Climbing ")
  80. wait(2)
  81. if key("'")then
  82.         print "Locking on new altitude"
  83.         return
  84.         endif
  85. goto climb1002
  86.  
  87. dive100:
  88. setvar(a,0)
  89. dive1002:
  90. addvar(a,100)
  91. addvar(altit_lock_var,-30)
  92. addvar(altit_lock,1)
  93. printvar(a,"Decending ")
  94. wait(2)
  95. if key("'")then
  96.         print "Locking on new altitude"
  97.         return
  98.         endif
  99. goto dive1002
  100.  
  101. tasread:
  102. if airspeed(0,0)
  103. endif
  104. printvar(result,"True Airspeed: ")
  105. if key("6")then
  106.         print ""
  107.         return
  108.         endif
  109. goto tasread
  110.  
  111. aglread:
  112. if altagl(0,0)
  113. endif
  114. printvar(result,"AGL: ")
  115. if key("a")then
  116.         print ""
  117.         return
  118.         endif
  119. goto aglread
  120.  
  121. trimread:
  122. printvar(elvtrm_ind,"Trim: "
  123. if key("t")then
  124.         print ""
  125.         return
  126.         endif
  127. goto trimread
  128.  
  129. headhold:
  130. setvar(nav1_lock,0)
  131. setvar(a,1)
  132. x := x ^ a
  133. movevar(heading_lock,x)
  134.  
  135. if heading(0,0)
  136. endif
  137. z := result
  138. z := z + v
  139. setvar(c,182)
  140. z := z * c
  141. movevar(head_lock_var,z)
  142.  
  143. if varmask(heading_lock,1)then
  144. if altagl(0,25)
  145. print "Heading Hold On. . . Don't FORGET to tune in Magnetic Variation!"
  146. return
  147. endif
  148. print "Heading Hold On. . ."
  149. return
  150. endif
  151.  
  152. setvar(f,0)
  153. movevar(heading_lock,f)
  154. print "Heading Hold Off"
  155. wait(1)
  156. print ""
  157. return
  158.  
  159.  
  160. adftog:
  161. setvar(h,1)
  162. adf_flag := adf_flag ^ h
  163. print "Now press <esc> . . ."
  164. wait(1)
  165. print ""
  166. return
  167.  
  168. jack:
  169. if altagl(0,100)
  170. setvar(j,254)
  171. plane_height := plane_height + j
  172. if altagl(0,0)
  173. endif
  174. printvar(result,"Plane height: ")
  175. endif
  176. return
  177.  
  178. turnleft:
  179. setvar(a,0)
  180. turnleft2:
  181. addvar(a,-1)
  182. printvar(a,"Turning left ")
  183. addvar(head_lock_var,-182)
  184. if key("x")then
  185.         print "Locking on new course"
  186.         return
  187.         endif
  188. goto turnleft2
  189.  
  190. turnright:
  191. setvar(a,0)
  192. turnright2:
  193. addvar(a,1)
  194. printvar(a,"Turning right: ")
  195. addvar(head_lock_var,182)
  196. if key("x")then
  197.         print "Locking on new course"
  198.         return
  199.         endif
  200. goto turnright2
  201.  
  202. magvar:
  203. setvar(p,1)
  204. setvar(n,-1)
  205. magvar2:
  206. print "Press: 9 for positive var. . . 7 for negative var. . . 8 to stop or end"
  207. wait(1)
  208. if key("9")then
  209.         gosub pos
  210.         endif
  211. if key("7")then
  212.         gosub neg
  213.         endif
  214. if key("8")then
  215.         print ""
  216.         return
  217.         endif
  218. printvar(v,"Magnetic Variation: ")
  219. wait(1)
  220. goto magvar2
  221.  
  222. pos:
  223.         v := v + p
  224.         printvar(v,"Magnetic Variation: ")
  225. if key("8")then
  226.         return
  227.         endif
  228. goto pos
  229.  
  230. neg:
  231.         v := v + n
  232.         printvar(v,"Magnetic Variation: ")
  233. if key("8")then
  234.         return
  235.         endif
  236. goto neg
  237.  
  238. vor1tog:
  239. setvar(heading_lock,0)
  240. setvar(a,1)
  241. y := y ^ a
  242. movevar(nav1_lock,y)
  243. if varmask(nav1_lock,1)then
  244.         print "Vor1 Lock ON"
  245.         wait(1)
  246.         return
  247. endif
  248.         print "Vor1 Lock Off"
  249.         wait(1)
  250.         print ""
  251. return
  252.  
  253.  
  254.