CS:S Buy-Script How-to Guide

Cerpin Taxt

Lifer
Feb 23, 2005
11,940
542
126
I wrote this guide on the forums associated with the CS:S servers I play on. I'm just copying and pasting it here. Feel free to ask questions, and enjoy!

A.) AUTOEXEC.CFG and CONFIG.CFG

1.) Find the following folder on your hard drive:

C:\Program Files\Valve\Steam\SteamApps\(your username)\counter-strike source\cstrike\cfg

2.) Find the files named "autoexec.cfg" and "config.cfg" in that folder. We'll deal with autoexec.cfg first.
3.) If autoexec.cfg does not exist in that folder, you must create it:
-- Right-click anywhere in the folder, not on an icon
-- Click "New" on the pop-up menu
-- Select "Text Document" on the 2nd pop-up menu
-- Rename the new text document with the filename "autoexec.cfg"
4.) Open the file named "autoexec.cfg"
Note: You computer might not know what program to open the file with. In that case, right-click the file and select "Open with..." The program you want to open autoexec.cfg with is Notepad.

B.) Aliases & Binds

1.) Aliases are a method of grouping a series of commands together so that they can be executed at once by executing the alias.
2.) You create an alias by typing it on a line in the autoexec.cfg file while it is open in Notepad. The generic form is:

alias name "command; command"

A specific example would be:

alias rifles "buy ak47; buy m4a1; Buy primammo"
//This script will buy you a rifle with full ammo (M4 or AK depends on CT or T)

3.) When you string a series of commands together, you separate them with a semi-colon. No semi-colon is necessary at the end, just the quotation marks.
4.) Once an alias is entered and saved in your "autoexec.cfg" file, you can bind the alias's name to any key you want.
5.) Your key-binds are recorded in the file named "config.cfg" and you can alter your binds by editing this file in Notepad, also.
6.) Plenty of examples of the input format should already exist in this file. A few things to remember:
-- Put each bind on it's own line
-- The generic format is:

bind "KEY" "NAME"

...where "KEY" is the key you're binding and "NAME" is the name of your alias.
7.) When you enter a new bind in config.cfg, carefully review your existing binds to make sure that the key you're binding isn't already bound to something else. If it is, you must either delete or overwrite that bind to avoid double-binding the key.

C.) Weapons Nicknames

1.) Below is a list of the nicknames you must use when you construct your binds. For example:

alias nade "buy nade" .... is incorrect
alias nade "buy hegrenade" .... is correct


Nickname is on the left, Description is on the right

galil - IDF Defender
ak47 - CV-47
scout - Schmidt Scout
sg552 - Krieg 552
awp - Magnum Sniper Rifle
g3sg1 - D3/AU1
famas - Clarion 5.56
m4a1 - Maverick M4A1 Carbine
aug - Bullpup
sg550 - Krieg 550 Commando
glock - 9x19mm Sidearm
usp - KM .45 Tactical
p228 - 228 Compact
deagle - Night Hawk .50C
elite - .40 Dual Elites
fiveseven - ES Five-Seven
m3 - Leone 12 Gauge Super
xm1014 - Leone YG1265 Auto Shotgun
mac10 - Ingram MAC-10
tmp - Schmidt Machine Pistol
mp5navy - KM Sub-Machine Gun
ump45 - KM UMP45
p90 - ES C90
m249 - M249
primammo - Primary Ammo
secammo - Secondary Ammo
vest - Kevlar
vesthelm - Kevlar+Helmet
flashbang - Flashbang
hegrenade - HE Grenade
smokegrenade - Smoke Grenade
nvgs - Nightvision
defuser - Defusal Kit

D.) CERPIN'S UBER-L337 JUGGERNAUT BINDS, BITCH!


1.) If you want, you can copy & paste the following in your autoexec.cfg. They're my aliases.

alias hello "say Goodbye world!; wait; wait; kill"
alias ngon "net_graph 3; bind / ngoff"
alias ngoff "net_graph 0; bind / ngon"
alias rifles "buy ak47; buy m4a1; Buy primammo"
alias armor "buy vesthelm; buy vest"
alias nades "buy hegrenade"
alias flash "buy flashbang"
alias shotty "buy m3; buy primammo"
alias sub "buy mp5navy; buy primammo"
alias deagle "buy deagle; buy secammo"
alias tmp "buy tmp; buy mac10; buy primammo"
alias famas "buy famas; buy galil; buy primammo"
alias p90 "buy p90; buy primammo"
alias smoke "buy smokegrenade"
alias p228 "buy p228; buy secammo"
alias nightvis "buy nvgs"
alias defuse "buy defuser"
alias aug "buy aug; buy sg552; buy primammo"
alias scout "buy scout; buy primammo"
alias awp "buy awp; buy primammo"
alias para "buy m249; buy primammo"
alias -pset "bind F1 rifles; bind F2 armor; bind F3 nades; bind F4 shotty; bind F5 sub; bind F6 p90; bind F7 flash; bind F8 defuse"
alias +pset "bind F1 aug; bind F2 scout; bind F3 awp; bind F4 famas; bind F5 tmp; bind f6 para; bind F7 smoke; bind F8 nightvis"


2.) And here are the binds I use for those:

bind "ALT" "+pset"
bind "F1" "rifles"
bind "F2" "armor"
bind "F3" "nades"
bind "F4" "shotty"
bind "F5" "sub"
bind "F6" "p90"
bind "F7" "flash"
bind "F8" "defuse"
bind "F10" "say I'm sure lucky I re-bound my F10 key"
bind "/" ngon
bind "\" "hello"



Cerpin's Uber-l337 skillz revealed:

Notice that I have a lot LESS binds than I do aliases. Due to a little trick in my scripts, I can actually double-bind two aliases to one key and use another key to decide which one I want to execute. Basically, I use the "ALT" button in a similar fashion as one uses the "SHIFT" key to type capital letters. For example:

Pressing F1 buys me an M4 or AK, but holding ALT and pressing F1 buys me an Aug or SG552.
Pressing F2 buys me Kevlar + Helmet, but holding ALT and pressing F2 buys me a Scout.
Pressing F3 buys me an HE Grenade, but holding ALT and pressing F3 buys me an AWP.

Does that make sense? I do this so that I can achieve maximum flexibility with my binds while still using exclusively the F-keys. Only a few of the weapons aren't represented in my binds -- the autosniper, the UMP, the autoshottie... Basically I can pick a custom equipment inventory every round, and prioritize when money is tight.

Though it may not look like it at first, my binds are laid out in a somewhat-logical order. I can press F1, F2, and F3 at the same time and get an M4 or an AK, full ammo, Kevlar+Helment, and an HE Grenade instantaneously. I use that most often. ALT --> Scoped rifles on F1 thru F3. SMGs/Shotty/Deagle are all on the F3 thru F5 keys (some using ALT). Flash/Defuse/Smoke/Nightvision are all on F7 and F8. They take SOME getting used to, but they're pretty easy after you get the hang of it.

Anyway, that's about it. Feel free to ask me any questions. I really want to encourage every player to use buy scripts. Very few things frustrate me more than getting blocked in spawn by another player still trying to figure out what he wants to buy.
 

Cerpin Taxt

Lifer
Feb 23, 2005
11,940
542
126
It is also worth noting that I opened up my config.cfg file today with Notepad, and it looked very different than the last time I opened it.

Instead of giving each bind it's own line, all of my binds were strung together on the same line, and separated by what looked like a square-like symbol which I can only imagine is supposed to represent carriage returns. I was able to open the file in Word and it broke each bind out onto its own line. I didn't save any changes to it though, so it's probably still FUBAR'd.

My scripts still work, though. I'm just pointing this out so if a user ALSO has this problem, he'll understand that it isn't really SUPPOSED to be that way.
 

Cerpin Taxt

Lifer
Feb 23, 2005
11,940
542
126
Originally posted by: linkgoron
b43.
OMG that was so hard...
Trust me, it's easier to press F1, F2, and F3 at the same time, than it is to press b, 4, 3, b, 6, b, 7, 1, b.....

But thanks for thread-crapping.
 

linkgoron

Platinum Member
Mar 9, 2005
2,576
1,231
136
Originally posted by: Garth
Originally posted by: linkgoron
b43.
OMG that was so hard...
Trust me, it's easier to press F1, F2, and F3 at the same time, than it is to press b, 4, 3, b, 6, b, 7, 1, b.....

But thanks for thread-crapping.

Meh, it's automatic...
 

Cerpin Taxt

Lifer
Feb 23, 2005
11,940
542
126
Something else it occured to me to mention: If you bind your aliases like I did to your F-keys, you'll lose the default binds that are already there. I don't really remember them very well because I never used them in the first place, but I do know that the "Take Screenshot" key used to be up there.

Like I said, I never used it, so I don't miss it. If you don't want to lose that feature, you must either re-bind it to another available key, or bind your buy scripts somewhere else. Before I had my scripts bound to my F-keys, I had them bound to keys on my number pad and it worked alright. Since then, I've moved them up to the F-keys, and I build a set of radio messages onto the number pad keys (i.e. "Enemy spotted," "Need backup," "Hold this position," etc...)
 

cw42

Diamond Member
Jan 15, 2004
4,227
0
76
meh, scripts are bad becuz if u go somewhere to play like a LAN you won't be able to use it.
 

Special K

Diamond Member
Jun 18, 2000
7,098
0
76
Thanks for the info, although I don't really think I'm good enough yet to benefit from buy scripts.
 

0roo0roo

No Lifer
Sep 21, 2002
64,795
84
91
?

isn't this old fashioned? you can download autobuy script addons that let you bind keys in the cs source options keyboard menu. it just scrolls way down further heh.

i just bind a bunch to the number pad.