BOT BRAIN MODULES
Make your bot smarter
 
TO USE A BOTBRAIN MODULE:
Highlight and copy or functions from below to your bot code
they fit together in your bots brain to make it modular!
 
Confused?
Highlight and copy below:
 
main:
attack the closest bot
:main

attack the closest bot:
set abot to closest bot
set direction to abot
move

if abot medium range
fire item1
fire item2
endif
return
end
 
Quit highlighting after 'end' above
Hit ctrl-c, go to bot edit page and paste for your bot brain.
update it and watch.
How it works is the botbrain
repeats the code between main: and :main

If you write something that is not a command
(a command is move left, move right...)
It assumes it is a botdrop (function) and searches for
it below the :main

So copy and paste the program above and try it out.
Learn the commands and make your own functions.
You can also write commands inside the main: and :main

Here are 'botdrops' you can highlight
and drop into your bots code.

ATTACK THE CLOSEST BOT

attack the closest bot:
set abot to closest bot
set direction to abot
move

if abot medium range
fire item1
fire item2
endif
return


DON'T SHOOT AT MY OWN BOTS
instead of typing 'fire item1' write 'fire 1'
then add this function to the bottom of your bot code
 

fire 1:
if abots botmaster is YOURNAME
set direction away from abot
move

move
set abot to random bot
else
fire item1

endif
return

 
DON'T FIRE A BULLET EACH TIME
PASSING THIS POINT IN CODE
 

fire but not too much:
v1++

if v1 equals 1
fire item1
end if

if v1 equals 5
set v1 to 0
end if
return

 To make it fire less often increase the 5 to a bigger number

defend if too close:
set abot to closest bot
if abot too close
fire item3
fire item2
fire item1
set direction away from abot
move
move
move
endif
return


follow walls... coming soon
Discuss Botbattle or post your Botdrops here

If many emails come we will have a searchable online database of Botdrops