Counter-Strike 2

Counter-Strike 2

Not enough ratings
How to get bots to buy armor/kit in offline/private games
By Monet
Bots can be annoying sometimes, as they just don't understand how to buy armor and defuse kits...
*sigh* at least I found a fix for offline mode.
   
Award
Favorite
Favorited
Unfavorite
botprofile.db, autobuy.txt and knowing where to find them.
These are the 2 files you'll be using for this, botprofile.db being the bot code, and autobuy.txt containing the names of the items.

To find these, simply navigate to your game directory, and open the csgo folder, then open both files with a text editor (I used notepad for autobuy.txt, and notepad++ for botprofile.db).

Once you have those open, you're almost set to go.
Editting botprofile.db
Once you've opened 2 files, you'll notice a paragraph in the autobuy.txt, simply scroll down a small bit to find the list, in the botprofile.db, scroll down a bit until you reach the part where you see WeaponPreference a bunch of times.
In this section, you'll see something like this, which is the default botprofile weapon script.
Template Rifle WeaponPreference = m4a1 WeaponPreference = ak47 WeaponPreference = famas WeaponPreference = galilar WeaponPreference = mp7 End
This section only has weapons in it, meaning bots will ONLY buy armor if they have an m4a4/m4a1
Even if the bot has AK47 on terrorist (Don't worry, there is a terrorist script too, which flips famas/galilar and m4/ak) it is unlikely they'll buy armor.
If you go into autobuy.txt you'll notice that it's scripted like this at the bottom
m4a1 ak47 famas galil mp7 nova primammo secammo defuser vesthelm vest
This pretty much means that the autobuy will attempt to buy weapon first, then ammo (code from source i believe), a defuse kit, then armor.
Another thing you'll notice is whitespace. In the past, people have tried (unsuccessfully) to get bots to buy armour, but with 2 fatal flaws;
a) they typed WeaponPreference = Kevlar,
and b) They didn't utilise whitespace.
Whitespace in gold source pretty much acts as a separator for lists, so lists that looked like this:
Template Rifle WeaponPreference = Kevlar(or vest) WeaponPreference = m4a1 WeaponPreference = ak47 WeaponPreference = famas WeaponPreference = galilar WeaponPreference = mp7 End
would result in the armor being purchased by the bot, but rarely the weapon.

Using whitespace, and autobuy.txt for names, I managed to make a bot buy order that would buy armor first, then weapons, then a defuse kit (which should ALWAYS be on top for Punch and Rifle, as they won't buy it unless they have their weapon of choice), rifle, and additional grenades.

Template Rifle WeaponPreference = vesthelm WeaponPreference = vest WeaponPreference = defuser WeaponPreference = ak47 WeaponPreference = m4a1 WeaponPreference = famas WeaponPreference = galilar WeaponPreference = mp7 WeaponPreference = flashbang WeaponPreference = smokegrenade WeaponPreference = molotov WeaponPreference = incgrenade WeaponPreference = hegrenade End
The whitespace inbetween the grenades allows for more then 1 type of nade to be purchased, with flashbang and smoke taking priority.

You can tinker with the order of the sections to create a support template if you want, it's your botprofile.db
My botprofile.db
Since steam doesn't have a way to shorten text into a spoiler section, I've pasted by botprofile.db weapon buys into a pastebin

It can be found at
pastebin(dot)com/RY0FFBwv

I sincerely hope this guide helped, and it'd be great if this could get noticed by valve and maybe implemented into the MM scene.

Thank you for reading
20 Comments
Patience 14 Dec, 2024 @ 4:36am 
i saw this just now, and im wondering where i can find the folders ur talking about.
im playing on linux but the folders should be the same, yet i cant find the correct one you are talking about. could u help me?
Juontaja 5 Apr, 2021 @ 2:01am 
does this still work?
when 9 Jul, 2018 @ 5:37pm 
LEGEND
Monet  [author] 3 Feb, 2018 @ 6:31pm 
This is long outdated, anyway. Bots got changed over a year ago
フィッシュル 3 Feb, 2018 @ 3:31pm 
Thanks so much, I understood a bit better how editing bots goes. Unfortunately, even copying and pasting from the example above won't make the bots buy defuser kits. Maybe something else needs to be made due an update? Also, the pastebin isn't loading for me, might be their servers, though.
Monet  [author] 17 Jul, 2017 @ 11:48pm 
That's a shame.
雪花沉睡 17 Jul, 2017 @ 9:29pm 
seems like it dosent work now
most of the time the bot will buy ak47 instead of vesthelm+ump45
Dr. LightMare 29 Dec, 2016 @ 2:20pm 
I had a BotProfile earlier that made them do an eco round like that after losing the 1st round but forgot to take a backup copy of it and it got deleted when CS updated.
Monet  [author] 29 Dec, 2016 @ 2:16pm 
No, there's nothing there for it.
Dr. LightMare 29 Dec, 2016 @ 2:15pm 
Do you have any suggestions how to make Bots do a "eco" round after they lose the 1st round, make them buy like vest and p250?