Creating Counter-Strike Buy Scripts
by: Chris "Boo" Noel
First we need to make our configuration file. Right click your desktop and click new, text document. This will bring up Notepad which is just fine for writting the code in. Put this file in your cstrike folder, give it a name, and open the new file... Now, when you bind an action to a key, that action is called an alias. Examples would be firing your gun (the attack command), moving forward, crouching, etc. Those actions are all called alias's and can be bound to a single button. To be able to make a script and bind it to a button, you first have to have an alias to bind. Let's say we want to buy an MP5 and buy full ammo all with one button. First, we need to make the alias. We will call this alias "buymp5". To make the alias, simply type the following:
alias buymp5 "buy; menuselect 3; menuselect 1; buy; menuselect 6"
As you can see, we type alias first, to let the game know that we are making a new alias, then we name it so the game knows what it's called (buymp5), then we enter in the commands in quotes for what we want it to do, seperating each command with a semi-collon (;), except the last command. As you can see, the first command is "buy", which is just like if you were to press the "b" button in game to bring up the list of gun types. next is the "menuselect 3" which, as you know, would select the sub-machine guns catagory of the buy menu. Next, we use "menuselect 1", which, as we all know selects the MP5 Navy, sub machine gun. Lastly, we use "buy" again, followed with "menuselect 6" which is the command in game for filling up on your primary gun's ammo clips. As you can see, this alias, buymp5, does all of the button pressing for you. It would be just like if you pressed B, 3, 1, B, 6, but instead you will only have to press one button. Now, all you have to do is bind it to a key buy doing the following:
bind "F3" "buymp5"
Now, your F3 button is bound to the buymp5 alias, and when you are in game, after you load your configuration file (explained farther down), you will buy an mp5 and full ammo just by pressing the F3 button. Ok, now that you have a basic idea of what you're doing, I get to screw you all up (I'm a lowsy teacher, and chances are you're even more confused now then you were to begin with)... Sometimes the buy screen wont go away after you use a buy script, so I'm going to have you add some alias's I made up to cause the client to pause and clear the menu (and even with these, sometimes you'll have to clear the buy menu manually), so, at the top of your file type the following...
alias w "wait"
alias wlng "w; w; slot10; slot10; w; w; slot10; slot10"
alias clrmnu "wlng; slot10; w; w; slot10; w; slot10"
Now, at the end of all your alias's add the command "clrmnu", twice. So, now your alias should look like this:
alias buymp5 "buy; menuselect 3; menuselect 1; buy; menuselect 6; clrmnu; clrmnu"
Ok! We've done it! Now you know how to write your own scripts. You can use this info to make alias's and binds for anything you want to buy. A couple more examples would be to buy 2 flashbangs and an HE by just pressing one button (which is what I use to buy my nades), which could be done by doing this:
alias nades "buy; menuselect 8; menuselect 4; buy; menuselect 8; menuselect 3; buy; menuselect 8; menuselect 3; clrmnu; clrmnu"
bind "f10" "nades"
You can also make binds to do things like buy an AK-47 if you're on the T side, or an M4A1 if you're on the CT side by doing this:
alias akm4 "buy; menuselect 4; menuselect 3; buy; menuselect 6; w; w; buy; menuselect 4; menuselect 1; buy; menuselect 6; clrmnu; clrmnu"
bind "f4" "akm4"
Since you can't get an AK47 if you're CT, and you can't get an M4 if you're T, it will try to buy both, but only end up getting the one for which team you're on. Pretty neat, eh? :) At the very bottom, I will paste my full buy script file so you guys can use it as an full example and guide. Now, let's just skip ahead and pretend your file is complete and ready to be used. First, we need to change your file into a .cfg file (right now it's a .txt text file). I'm sure there is a way to do it through windows, but I like command prompts so it's the only way I know how to do it. I think with some earlier versions of windows, you can just right click the file and click rename, then type in the file name with .cfg after it (ie. myfile.cfg) and it will convert the file for you, but I'm not entirely sure. Windows 2000 just changes the name of the file to myfile.cfg.txt when you do that, so I will explain how to do it using DOS/Command Prompt. Bring up your MS-DOS prompt, or your Command Prompt window (depending on which version of windows you use or are stuck with, personally I'm a Windows 2000 Pro fan). Next direct yourself to the cstrike folder by typing in the command "cd C:\SIERRA\Half-Life\cstrike" (without the quotes). If you're game is installed in a different directory, you'll have to change it accordingly. Now, just type in "rename myfile.txt myfile.cfg" (without the quotes again, and where myfile is the name of your actual script file), and it will convert the file to cfg form for you. That's it, you can close your MS-DOS/Command Prompt and the file is good to go. Now, all you have to do to use those scripts is, when you get into a game, bring down the console and type "exec myfile.cfg" (without quotes, of course) and the client will load your scripts and binds, and you're ready to roll! Enjoy and have fun! :)
My .cfg File
name "[LK]Boo"
//-- Common Alias
alias w "wait"
alias wlng "w; w; slot10; slot10; w; w; slot10; slot10"
alias clrmnu "wlng; slot10; w; w; slot10; w; slot10"
//-- Weapon Alias
alias akcolt "buy; menuselect 4; menuselect 3; buy; menuselect 6; w; w; buy; menuselect 4; menuselect 1; buy; menuselect 6; clrmnu; clrmnu"
alias sigaug "buy; menuselect 4; menuselect 4; buy; menuselect 6; w; w; buy; menuselect 4; menuselect 2; buy; menuselect 6; clrmnu; clrmnu"
alias awp "buy; menuselect 4; menuselect 6; buy; menuselect 6; clrmnu; clrmnu"
alias glock "buy; menuselect 1; menuselect 2; buy; menuselect 7; clrmnu; clrmnu"
alias scout "buy; menuselect 4; menuselect 5; buy; menuselect 6; clrmnu; clrmnu"
alias usp "buy; menuselect 1; menuselect 1; buy; menuselect 7; clrmnu; clrmnu"
alias deagle "buy; menuselect 1; menuselect 3; buy; menuselect 7; clrmnu; clrmnu"
alias helmetkev "buy; menuselect 8; menuselect 2; clrmnu; clrmnu"
alias kev "buy; menuselect 8; menuselect 1; clrmnu; clrmnu"
alias nades "buy; menuselect 8; menuselect 4; buy; menuselect 8; menuselect 3; buy; menuselect 8; menuselect 3; clrmnu; clrmnu"
alias defuse "buy; menuselect 8; menuselect 6; clrmnu; clrmnu"
alias mp5 "buy; menuselect 3; menuselect 1; buy; menuselect 6; clrmnu; clrmnu"
//-- Binds -- Weapon
bind "f3" "mp5"
bind "f4" "akcolt"
bind "f5" "sigaug"
bind "f6" "awp"
bind "f7" "deagle"
bind "f8" "usp"
bind "f12" "kev"
bind "f9" "helmetkev"
bind "f10" "nades"
bind "f11" "defuse"
//-- Radio Alias
alias roger "radio3; menuselect 1; clrmnu; clrmnu"
alias neg "radio3; menuselect 8; clrmnu; clrmnu"
alias down "radio3; menuselect 9; clrmnu; clrmnu"
alias underfire "radio1; menuselect 6; clrmnu; clrmnu"
alias cover "radio1; menuselect 1; clrmnu; clrmnu"
alias follow "radio1; menuselect 5; clrmnu; clrmnu"
//-- Binds -- Radio
bind "-" "neg"
bind "=" "roger"
bind "f" "follow"
bind "q" "underfire"
bind "c" "cover"
bind "v" "down"