#config scanner=4 #config weapon=2 #config engine=3 #config armor=2 #config heatsinks=1 mov dx, 64 ;set initial scanarc of 64 mov bx, 5 ;initialize vars for later use opo 17, dx mov ax, 1 int 3 ;keepshift on !flip opo 12, 128 !scan opo 11, 100 ;start moving ipo 7, ax ;scanning stuff cmp ax, 2000 jgr !none mov fx, @3 ;turret turning stuff shl fx, bx opo 12, fx call !move ipo 2, ax cmp ax, 200 ;heat checking and firing stuff jgr !scan opo 15, @3 cmp dx, 4 ;scan arc tightening stuff jeq !scan ;dont tighten if scanarc is 4 sub bx, 1 shr dx, 1 opo 17, dx jmp !scan ;loop !none ;nothing found? cmp dx, 64 jeq !flip ;flip if scanarc is 64 shl dx, 1 ;otherwise widen add bx, 1 opo 17, dx jmp !scan !move opo 11, 100 int 2 cmp ex, 450 jls !mleft cmp ex, 550 jgr !mright cmp fx, 450 jls !mup cmp fx, 550 jgr !mdown je !mclear jne !mclear !mleft ipo 3, ax mov cx, 64 sub cx, ax opo 14, cx ret !mright ipo 3, ax mov cx, 192 sub cx, ax opo 14, cx opo 11, 100 ret !mdown ipo 3, ax mov cx, 0 sub cx, ax opo 14, cx opo 11, 100 ret !mup ipo 3, ax mov cx, 128 sub cx, ax opo 14, cx opo 11, 100 ret !mclear ipo 10, cx and cx, 128 sub cx, 128 opo 14, cx ret