You will find sample code to a number of simple bots in the bbm/sample_bots directory. I will briefly describe each of these bots here, and leave it to you to compile and play with them.
Before compiling any of the sample bots you have to compile the common library of bot code that they all use. This is in the sample_bots/common directory - just go there and do a "make" before trying to compile any of the bots. The result should be a file called common.lib in the common directory.
To load a bot into CS after compiling and installing it, create a LAN game of CS, bring down the console and give the command "loadbot CLASSNAME" (where CLASSNAME is joinbot, printbot, etc).
Then you can add a bot of that class with the addbot console command.
This bot looks through its message queue for VGUIMenu messages and knows how to interpret them (under CounterStrike) as "Join Team" and "Model Select" messages. For each one, the bot uses the Command() method to send a menuselect console command to select an option.
In all other ways this bot is the same as joinbot.
It continually scans the area in front of it using TraceLines() to see if there is a low obstacle that it can try to jump onto/over.
It is otherwise pretty stupid.
ShowMenu() will fail if there is already a menu open on the listenserver.
When I tried this, I found the following messages:
985434501: Entity 73 team= (weapon_flashbang) () (364.07,2220.37,36.03) is no longer visible 985434504: Entity 75 team= (grenade) () (344.12,2141.32,44.51) is visible 985434506: Entity 73 team= (spark_shower) () (483.93,1864.75,54.97) is visible 985434506: Entity 75 team= (grenade) () (0.00,0.00,0.00) is no longer visible 985434507: Entity 73 team= (spark_shower) () (0.00,0.00,0.00) is no longer visible
You can clearly see when the grenade became visible, and the shower of sparks when it exploded. It is easy to see how your bot could behave "properly" (i.e. be blinded) for a few seconds.