;=========================================== ;Big Red Bot ;VER - 1.0 ;Jeff Puchalski : E-mail (jpp13@cornell.edu) ;http://www.people.cornell.edu/pages/jpp13 ;=========================================== #msg me > you #config weapon=3 ;+1 weapon #config scanner=4 ;-1 scanner #def tur #def rad mov tur, 6 ;sets turret rotation speed ;=========================================== ;general procedure ;=========================================== !init mov rad, 12 opo 17, rad ;sets scan arc opo 12, tur ;rotates turret opo 11, 60 ;sets throttle ipo 7, ax ;scan cmp ax, 1000 ;check if in range jls !fire ipo 10, ax ;no target found cmp ax, 0 ;make random turn jgr !rt ;right jmp !lt ;left ;=========================================== ;attack procedure ;=========================================== !fire ipo 2, bx ;checks for overheat cmp bx, 200 jgr 21 ;skip firing if overheated opo 15, @3 ;fire using accuracy :21 opo 12, @3 ;turn turret using accuracy ipo 7, ax ;scan cmp ax, 1000 ;check if in range jgr 22 ;no target? skip ahead cmp ax, 100 ;is target really close? jls 540 ;if so then get distance sub rad, 2 ;lock on tighter opo 17, rad ;sets scan arc jmp !fire ;repeat firing procedure :22 cmp @3, 0 ;are we locked on? je 23 ;if so then skip ahead mov tur, @3 ;else realign turret mov bx, tur ;multiplication in 3 cycles! shl tur, 1 ; " " add tur, bx ; " " :23 jmp !init ;return ;=========================================== ;turning routine ;=========================================== !lt opo 14, -12 ;turn left jmp !init ;return !rt opo 14, 12 ;turn right jmp !init ;return :540 mov cx 10 :5401 ipo 2, bx ;checks for overheat cmp bx, 280 jgr !init ;skip thrust if overheated opo 18, 1 opo 11, 100 loop 5401 opo 18, 0 jmp !init