Headings

From Gwen Morse's Wiki
Jump to: navigation, search
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Headings (to fly in a particular direction)
;;;
;;; Using Keypad for directions (type keypad # and then 'enter')
;;;
;;; Original author lost, but, grabbed off a site with Battletech or
;;; other 'mech-type' macros.

;;;;;;;;;;;;;;;;;;;;;
;;  Keypad macros  ;;
;;  NW    N     NE ;;
;;   \    |    /   ;;
;;    7---8---9    ;;
;;    |   |   |    ;;
;;W-- 4---5---6 --E;;
;;    |   |   |    ;;
;;    1---2---3    ;;
;;   /    |    \   ;;
;;  SW    S     SW ;;
;;                 ;;
;;    5 to stop    ;;
;;;;;;;;;;;;;;;;;;;;;

/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^1$' cm_head_sw = heading 20
/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^2$' cm_head_s  = heading 24
/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^3$' cm_head_se = heading 28
/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^4$' cm_head_w  = heading 16
/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^5$' cm_head_5  = stop
/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^6$' cm_head_e  = heading 0
/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^7$' cm_head_nw = heading 12
/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^8$' cm_head_n  = heading 8
/def -T"tiny.mush.cm" -i -mregexp -h'SEND ^9$' cm_head_ne = heading 4

;;; Peter's directions (CM)
/def -T"tiny.mush.cm" -i key_nkp5 = /stop
/def -T"tiny.mush.cm" -i key_nkp1 = /sw
/def -T"tiny.mush.cm" -i key_nkp2 = /s
/def -T"tiny.mush.cm" -i key_nkp3 = /se
/def -T"tiny.mush.cm" -i key_nkp4 = /w
/def -T"tiny.mush.cm" -i key_nkp6 = /e
/def -T"tiny.mush.cm" -i key_nkp7 = /nw
/def -T"tiny.mush.cm" -i key_nkp8 = /n
/def -T"tiny.mush.cm" -i key_nkp9 = /ne

;;; Peter's directions (DIKU/MUD)w
/def -Tdiku -i key_nkp5 = stop
/def -Tdiku -i key_nkp1 = sw
/def -Tdiku -i key_nkp2 = s
/def -Tdiku -i key_nkp3 = se
/def -Tdiku -i key_nkp4 = w
/def -Tdiku -i key_nkp6 = e
/def -Tdiku -i key_nkp7 = nw
/def -Tdiku -i key_nkp8 = n
/def -Tdiku -i key_nkp9 = ne


;;; The remaining flight macros are mine (Gwen Morse)

/def -F -T"tiny.mush.cm" -p7 e = \
   /send heading 0

/def -F -T"tiny.mush.cm" -p7 n = \
   /send heading 8

/def -F -T"tiny.mush.cm" -p7 w = \
   /send heading 16

/def -F -T"tiny.mush.cm" -p7 s = \
   /send heading 24

/def -F -T"tiny.mush.cm" -p7 ne = \
   /send heading 4

/def -F -T"tiny.mush.cm" -p7 nw = \
   /send heading 12

/def -F -T"tiny.mush.cm" -p7 sw = \
   /send heading 20

/def -F -T"tiny.mush.cm" -p7 se = \
   /send heading 28

;;; Stop (to stop the sled)

/def -F -T"tiny.mush.cm" -p7 stop = \
   /send stop

;;; Move (to start flying again)

/def -F -T"tiny.mush.cm" -p7 speed = \
   /if ({#} > 0) \
      /send speed %* %;\
   /else \
      /send speed 1 %;\
   /endif

;;; Level (to level the nose of the sled)

/def -F -T"tiny.mush.cm" -p7 level = \
   /send level