#msg GoodLuckhehheh #config scanner=4 ; This configuration does best #config engine=2 #config weapon=3 #config armor=2 #config heatsinks=1 #config mines=0 #def scanarc ; Variables #def speed !setup ; set up vars and ports mov speed, -100 opo 12, 66 !flip mov scanarc, 64 opo 12, 128 opo 14, 1 !scan opo P_ARC, scanarc cmp [0], 0 ; if speed = 0, change dir and accelerate... jne !noAcc neg speed opo 11, speed !noAcc ipo 7, ax ; Look for enemy... cmp ax, 1500 jb !shrink cmp scanarc, 64 ; not found: unless scanarc is 64 jae !flip ; widen it shl scanarc, 1 jmp !scan !shrink ; Found shr scanarc, 1 ; narrow scanarc (halve it) mov bx, scanarc mpy bx, @03 opo 14, bx ; centre enemy or scanarc, 1 ; to make sure that scanarc > 0 !Fire ; otherwise scanarc could be 0 and that's a problem... ipo 2, ax cmp ax, 120 ; check heat ja !scan ; too hot? => don't fire mov ax, 2 ; simple target prediction cmp [6], 128 ; check relative heading of enemy jb !noInv neg ax ; if facing left, negate ax (Shooting Displacement) !noInv add ax, @3 ; add accuracy param to ax opo 15, ax ; Fire! jmp !scan ; jump to Main #END