; Bubu 2 made in Brazil by Me (lol). ; e-mail me: dynamycs@hotmail.com ; This robot has been written from scratch and it's very mobile (bubu v1 was moveless). ; It's atack system is independent of it's mobile sys. This means that he doesnt always ; go where the target is. ; ; Some of it's main features are: ; * Keep out of walls ; * Shot correction depending on the distance of target ; * Randon movement. This means that it may vary from match to match ; * Always fire. @3 dont need to be = 0 to ocuur a fire. #msg Brazil is wonderfull!!! #config scanner=3 #config engine=4 #config armor=2 #config heatsinks=1 #config weapon=2 #config mines=0 #config shield=0 #def arc! #def trgt #def heat #def last #def right #def left #def hleft #def hright opo 11 100 ; set throttle opo 22 15 ; lay mine opo 22 15 ; lay mine ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !gotoMIDDLE ; ipo 10 ex ; Get random number and ex 400 ; now it's 0-400 add ex 200 ; now it's 200-600 ipo 10 fx ; Get random number and fx 400 ; now it's 0-400 add fx 200 ; now it's 200-6 int 7 ; find angle to X(ex),Y(fx) mov bx, @1 ; get current desired heading ; (not actual heading) and ax, 255 ; Fix ax into 0-255. sub ax, bx ; get number of degrees to turn. opo 14, ax ; turn! ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !start ; mov arc! 64 ; arc! = 64 opo 12 128 ; flip turret ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !turretARC ; opo 17 arc! ; scanner arc = arc! ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !stealtSCAN ; ; !checkwall! ; This robot have a getoutofwall system (GPS) int 2 ; what is our location (ex = X, fx = Y cord) ; !checkleft ; cmp ex 200 ; compare ex to 200 jae !checkright ; if ex > 200 -> !checkright jb !gotoMIDDLE ; else, -> !gotoMIDDLE ; !checkright ; cmp ex 800 ; compare ex to 800 jb !checktop ; if ex < 800 -> !checktop jae !gotoMIDDLE ; else, -> !gotoMIDDLE ; !checktop ; cmp fx 200 ; compare fx to 200 jae !checkbotton ; if fx > 100 -> !checkbotton jb !gotoMIDDLE ; else, -> !gotoMIDDLE ; !checkbotton ; cmp fx 800 ; compare ex to 800 jae !gotoMIDDLE ; else, -> !gotoMIDDLE ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ipo 7 trgt ; scan, result of scan in trgt cmp trgt 1500 ; anybody in range? ja !nobody ; no damn -> !nobody ;) shr trgt 7 ; divide trgt, results: 0 = near, 1 = still near ; 2 = mediun distance, 3 = little distant, 4 and 5 = far add trgt 2000 ; trgt = trgt + 2000 ;err trgt jle trgt ; jump to label(trgt) ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; this is the improvement for the shot :2000 ; mov left -4 ; left = -4 mov hleft -3 ; hleft = -3 mov right 4 ; right = 4 mov hright 3 ; hright = 3 jle !CorrEctIons ; -> !CorrEctIons ; :2001 ; mov left -4 ; left = -4 mov hleft -3 ; hleft = -3 mov right 4 ; right = 4 mov hright 3 ; hright = 3 jle !CorrEctIons ; -> !CorrEctIons ; :2002 ; mov left -3 ; left = -3 mov hleft -2 ; hleft = -3h mov right 3 ; right = 3 mov hright 2 ; hright = 3 jle !CorrEctIons ; -> !CorrEctIons :2003 ; mov left -3 ; left = -3 mov hleft -2 ; hleft = -2 mov right 3 ; right = 3 mov hright 2 ; hright = 2 jle !CorrEctIons ; -> !CorrEctIons :2004 ; mov left -2 ; left = -2 mov hleft -1 ; hleft = -2 mov right 2 ; right = 2 mov hright 1 ; hright = 2 jle !CorrEctIons ; -> !CorrEctIons :2005 ; mov left -2 ; left = -2 mov hleft -1 ; hleft = -1 mov right 2 ; right = 2 mov hright 1 ; hright = 1 ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !CorrEctIons ; cmp @3 0 ; else, is it straight ahead? je !fire ; yes, fire! ja !right ; if a bit right -> !right ; ;left ; elseif a bit left do code bellow cmp @3 -2 ; how much left is it? jne !hleft ; halfway? then -> !hleft mov last left ; else, last = left mov ax arc! ; ax = arc! neg ax ; ax = 0 - ax opo 12 ax ; turn turrret ax amount je !fire ; -> !fire ; !hleft ; mov last hleft ; last = hleft mov ax arc! ; ax = arc! shr ax 1 ; arc = arc! / 2 neg ax ; ax = 0 - ax