; ###################################################################### # ; # # ; # After many tests and tests with older versions of Bubu, i've finished Stealt. Took me # ; # hous of my life so I hope you can learn things from it. Also it come with new features # ; # such as: # ; # /1/ Donīt shoot if arc too wide - In very rare cases you hit somebody when your arc # ; # setting is too wide # ; # /2/ Target lock - After it scans a target it locks and trys to surround it so "it can run but # ; # can't hide" :) # ; # /3/ Agility - Hes nervous at some curves # ; # /4/ NoWall - He don't get itself on a wall, even when game just started it will turn # ; # precisely to the middle of the arena and start running # ; # /5/ Team Play! - Yes, you read rightly. It is capable of detecting if a bot is from his # ; # team or not. It is disabled by defalt. To enable, remove the first ";" of the lines 34, 95, 96 # ; # # ; # Any questions about the code or about me, email me. Sorry if it is not perfectly comented # ; # Stealt by Bruno. A. Blank Cassol = dynamycs@hotmail.com # ; # # ; ###################################################################### # #config scanner=2 #config engine=4 #config armor=2 #config heatsinks=1 #config weapon=3 #config mines=0 #config shield=0 #def arc! #def trgt #def heat #def last ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; GPS opo 22 15 ; lay mine opo 11 100 ; set throttle ; opo 19 257 ; set ID for team play mov ax 100 ; ax = 100 int 3 ; keep-shift on opo 22 15 ; lay mine !gotoMIDDLE mov ex 500 ; ex = 500 mov fx 500 ; ex = 500 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! ; !turnMORE ; ipo 3 ax ; check our heading cmp ax @1 ; compare to our desired heading. jne !turnMORE ; wait for turn to complete opo 11 100 ; set throttle ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !start ; mov arc! 64 ; arc! = 64 opo 12 128 ; flip turret ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !turretARC ; opo 17 arc! ; scanner arc = arc! ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !checkwall ; int 2 ; what is our location (ex = X, fx = Y cord) ; !checkleft ; cmp ex 100 ; compare ex to 50 jae !checkright ; if ex > 200 -> 2012 jb !gotoMIDDLE ; else, -> !gotoMIDDLE ; !checkright ; cmp ex 900 ; compare ex to 850 jb !checktop ; if ex < 800 -> !checktop jae !gotoMIDDLE ; else, -> !gotoMIDDLE ; !checktop ; cmp fx 100 ; compare fx to 150 jae !checkbotton ; if fx > 100 -> !checkbotton jb !gotoMIDDLE ; else, -> !gotoMIDDLE ; !checkbotton ; cmp fx 900 ; compare ex to 850 jae !gotoMIDDLE ; else, -> !gotoMIDDLE ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !scan ; ipo 7 trgt ; scan, result of scan in [trgt] cmp trgt 1500 ; anybody in range? ja !nobody ; no -> !nobody ; cmp @5 257 ; else, is it our freind? ; je !nobody ; yes -> !nobody 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 arc! ; last = arc! neg last ; ax = 0 - ax opo 12 last ; turn turrret [ax] amount je !fire ; -> !fire ; !hleft ; mov last arc! ; ax = arc! shr last 1 ; arc = arc / 2 neg last ; ax = 0 - ax opo 12 last ; turn left [ax] amount jne !fire ; -> !fire ; !right ; cmp @3 2 ; how much right is it? jne !hright ; halway? then -> hright opo 12 arc! ; turn right [arc!] amount mov last arc! ; last = arc! je !fire ; -> !fire ; !hright ; mov last arc! ; ax = arc! shr last 1 ; arc = arc / 2 opo 12 last ; turn left [ax] amount ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; shoot rotine !fire ; jnz arc! ; jump to label #arc! jz arc! ; jump to label #arc! :1 ; :4 ; :16 ; ipo 2 heat ; check heat cmp heat 180 ; campare heat to 180 ja 64 ; if too hot, skip shooting opo 15 last ; else, fire!!! :64 ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !finished ; cmp arc! 2 ; compare arc! to 2 jle !TracK ; if arc <= 2, then skip shrinking it shr arc! 2 ; cut our arc to 1/4 size opo 17 arc! ; set arc seting = arc! value ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !TracK ; seek > surround rotine. I cmp @2 42 ; This code compares our turret offset and turns our bot based on our turret offset ja !JS_1 ; opo 14 -32 ; jle !scan ; !JS_1 ; cmp @2 64 ; ja !JS_2 ; opo 14 16 ; jle !scan ; !JS_2 ; cmp @2 96 ; ja !JS_3 ; opo 14 32 ; jle !scan ; !JS_3 ; cmp @2 128 ; ja !JS_4 ; opo 14 -64 ; jle !scan ; !JS_4 ; cmp @2 160 ; ja !JS_5 ; opo 14 64 ; jle !scan ; !JS_5 ; cmp @2 192 ; ja !JS_6 ; opo 14 -32 ; jle !scan ; !JS_6 ; cmp @2 224 ; ja !JS_7 ; opo 14 -16 ; jle !scan ; !JS_7 ; cmp @2 255 ; ja !scan ; opo 14 32 ; jle !scan ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; !nobody ; if nobody was found cmp arc! 64 ; what is our arc setting? jae !start ; if too wide, move to another wall. shl arc! 2 ; otherwise widen the arc jb !turretARC ; scan ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #EnD Decimal ATR navigation: 0 (256) | 224| 32 \ | / 192 ----- + ----- 64 / | \ 160 | 96 128