Simple Buy Scripts

Before reading this guide be sure you have read the Introduction to Scripting (by MuDgE).

This guide will teach you how to make a simple, yet efficient buy script. We will be making the buy scripts using +/- aliases. The + alias will buy the item, and the - alias will close the menu. When you press the button that you have bound to your buy script it will buy the gun, when you release the button it will close the menu.

First off you need to decide what weapon/item you want to make the script buy, then follow the model below, changing the menuselects to the numbers corresponding to the item you want to buy (e.g. Colt M4A1 is menuselect 4; menuselect 3).

Follow the steps below adding each line of code to your autoexec.cfg (default CS directory is C:SIERRAHalf-Lifecstrike). Take note of the 'bind' lines, these are added to your config.cfg file. For this guide we will make a buy script for an AK-47, an HE Grenade and a Kevlar Vest.

The AK-47

Step 1

Make the + alias for the buy script:

alias +ak "buy; menuselect 4; menuselect 1"

Step 2

Make the + alias for the buy script:

alias clz "wait;wait;wait;wait;slot10;wait;wait;wait;wait;slot10"

Step 3

Make the - alias for the buy script:

alias -ak "clz"

Step 4

Create the bind command, this will assign a key to the script (goes in config.cfg):

bind "<key>" "+ak"

The Final Product

alias +ak "buy; menuselect 4; menuselect 1"
alias -ak "clz"
alias clz "wait;wait;wait;wait;slot10;wait;wait;wait;wait;slot10"
bind "?" "+ak"

The HE Grenade

Step 1

Make the + alias for the buy script:

alias +he "buy; menuselect 8; menuselect 4"

or:

alias +he "buyequip; menuselect 4"

Either way is fine.

Step 2

Make the + alias for the buy script:

alias clz "wait;wait;wait;wait;slot10;wait;wait;wait;wait;slot10"

Step 3

Make the - alias for the buy script:

alias -he "clz"

Step 4

Create the bind command, this will assign a key to the script (goes in config.cfg):

bind "<key>" "+he"

The Final Product

alias +he "buyequip; menuselect4"
alias -he "clz"
alias clz "wait;wait;wait;wait;slot10;wait;wait;wait;wait;slot10"
bind "?" "+he"

The Kevlar Vest

Step 1

Make the + alias for the buy script:

alias +vest "buyequip; menuselect 1"

Step 2

Make the + alias for the buy script:

alias clz "wait;wait;wait;wait;slot10;wait;wait;wait;wait;slot10"

Step 3

Make the - alias for the buy script:

alias -vest "clz"

Step 4

Create the bind command, this will assign a key to the script (goes in config.cfg):

bind "<key>" "+vest"

The Final Product

alias +vest "buyequip; menuselect 1"
alias -vest "clz"
alias clz "wait;wait;wait;wait;slot10;wait;wait;wait;wait;slot10"
bind "?" "+vest"

If your menus are not closing, add more waits (wait;) to the 'clz' alias. More waits may be needed for higher pings.

Remember that the majority of these these scripts go into your 'autoexec.cfg'. And the bind lines go in your 'config.cfg'. You can edit these using Notepad, or any text editor. After making changes to your autoexec.cfg and config.cfg files, type 'exec autoexec.cfg' in the console to execute the new changes once in game.

If you have any questions on these basic buy scripts please contact me at gatodog@hotmail.com.

Comments

VespR
00:04 4/1/2002
Personally instead of having a bind for the ak-47 and colt seperately I like my own.

[i]//Buy.cfg

//Menu Clear//
alias mclr "slot10; wait; wait; wait; wait; wait; slot10"

//Common Menu Selects//
alias ms1 "menuselect 1"
alias ms2 "menuselect 2"
alias ms3 "menuselect 3"
alias ms4 "menuselect 4"
alias ms5 "menuselect 5"
alias ms6 "menuselect 6"
alias ms7 "menuselect 7"
alias ms8 "menuselect 8"

//Weapons//
alias ammo1 "buy; ms6; mclr"
alias team-light-rifle "buy; ms4; ms3; buy; ms4; ms1; ammo1; mclr"
bind "t" "team-light-rifle"[/i]

But hey that's just me, nice post m8 :D [ Comment: Report | IP: Logged ]
King*Duck
00:57 4/1/2002
I know what your saying. And that's a good thing. But thos guide is for simple buy scripts. What you are talking about is a bit more advanced, and I will get into that with my next guide. [ Comment: Report | IP: Logged ]
Dark.MenacE
02:26 4/1/2002
here's a script i wrote a long time ago.. not hard to learn scripting..

======================================
developer 1

echo Gun Menu Loaded

developer 0

alias e_on "developer 2"

alias clears "wait;wait;wait;slot10;wait;slot10;wait;slot10"

alias e_off "developer 0"

alias "w2" "clears;wait; wait; slot10"

alias usp "buy;menuselect 1;menuselect 1; wait ; buy ; menuselect 7; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2; e_on; echo [U.S.P. , Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias glock "buy;menuselect 1;menuselect 2;wait ; buy ; menuselect 7; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [Glock, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias de "buy;menuselect 1;menuselect 3;wait ; buy ; menuselect 7; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [Desert Eagle, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias p228 "buy;menuselect 1;menuselect 4;wait; buy ; menuselect 7; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [P228 Pistol, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias elites "buy;menuselect 1; menuselect 5; wait; buy; menuselect 7; wait; clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2; e_on; echo [Dual Barrettas, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias 5-7 "buy;menuselect 1;menuselect 6;wait; buy ; menuselect 7; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [Five-Seven, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias shotgun "buy;menuselect 2; menuselect 1; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [Shotgun, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias autoshotgun "buy;menuselect 2;menuselect 2; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [Automatic Shotgun, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias mp5 "buy;menuselect 3; menuselect 1;wait;buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on;echo [M.P.5, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias tmp "buy;menuselect 3;menuselect 2; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [TMP, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias p90 "buy;menuselect 3;menuselect 3; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [P90, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias mac10 "buy;menuselect 3;menuselect 4; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [Mac 10, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias UMP "buy;menuselect 3; menuselect 5; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [UMP, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias ak47 "buy;menuselect 4; menuselect 1; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [AK47, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias commando "buy;menuselect 4; menuselect 2; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on;echo [Commando, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias colt "buy;menuselect 4; menuselect 3; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [M.4-A.1, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias aug "buy;menuselect 4; menuselect 4; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2; e_on; echo [Stayer Aug, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias scout "buy;menuselect 4; menuselect 5; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [Stayer Scout, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias awp "buy;menuselect 4; menuselect 6; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2; e_on;echo [A.W.M. , Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias g3 "buy;menuselect 4; menuselect 7; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2; e_on;echo [G.3, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias para "buy;menuselect 5; menuselect 1; wait; buy; menuselect 6; wait;clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2;e_on; echo [Para, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias g1 "buy;menuselect 4; menuselect 8; wait; buy; menuselect 6; wait; clears; buy; menuselect 8; menuselect 4; wait; clears; buy; menuselect 8; menuselect 2; e_on; echo [Sig SG-550 Sniper Rifle, Kevlar Vest + Helm and Grenade Purchased]; w2; slot10"

alias kevlar "buy; menuselect 8 ; menuselect 1; e_on;echo [Kevlar Vest Purchased]; w2; slot10"

alias kevlarhelm "buy; menuselect 8; menuselect 2; e_on;echo [Kevlar Vest and Helm. Purchased]; w2; slot10"

alias fb "buy; menuselect 8; menuselect 3; e_on;echo [Flashbang Purchased]; w2; slot10"

alias he "buy; menuselect 8; menuselect 4;e_on;echo [H.E. Grenade Purchased]; w2; slot10"

alias sg "buy; menuselect 8; menuselect 5; e_on;echo [Smoke Grenade Purchased]; w2; slot10"

alias PrimaryAmmo "buy; menuselect 6; e_on; echo [Primary Ammo Purchased]; w2; slot10"

alias SecondaryAmmo "buy; menuselect 7; e_on; echo [Secondary Ammo Purchased]; w2; slot10"

alias kit "buy; menuselect 8; menuselect 6; e_on; echo [Defusal Kit Purchased]; w2; slot10"

alias nvgs "buy; menuselect 8; menuselect 7; e_on; echo [Night Vision Goggles Purchased]; w2; slot10" [ Comment: Report | IP: Logged ]
King*Duck
05:03 4/1/2002
Most of your alias' are too long. The maximum lenght for an alias is 125 chars. Any more then that can cause problems. Shortened menuselect alias' are the way to go for large alias' like yours. [ Comment: Report | IP: Logged ]
dagger
08:08 4/1/2002
alamak got this type of thing onez ar?i bind my p wif mp5 and de! [ Comment: Report | IP: Logged ]
MuDgE
21:01 4/1/2002
It would be better if you posted your *whole* buy script elsewhere, and link to it, its a bit long to put it all in a comment.....Dark Mencae.... [ Comment: Report | IP: Logged ]
Pepe
22:21 4/1/2002
great script long anyway how do i use it and what does it do? [ Comment: Report | IP: Logged ]
MuDgE
14:30 5/1/2002
This is used to buy your weapons easier with just one key.....

Read near the top of the Guide to help you understand where to put everything... [ Comment: Report | IP: Logged ]
Metallicagod
01:10 21/3/2002
Ok, I admit, I'm a moron. I dont get this. What would the alias look like if I wanted to buy a colt, ammo, kevlar and helm? [ Comment: Report | IP: Logged ]
striker
17:57 23/4/2002
I would plz like to know how to get a MP5, a Deagle, HE, Kevlar/Helm, and full ammo for both.
Can u make a script for that, or would it have to be bound to 2 different weapons? [ Comment: Report | IP: Logged ]
silver bullet
12:43 4/6/2002
Great job!But when i wrote exec autoexec.cfg in the console there was Alias name too long...What does mean Alias name too long? [ Comment: Report | IP: Logged ]
Honkus
08:06 24/6/2002
Is there a way to bind the scripts to the keypad numbers as opposed to the horizontal numbers on the keyboard? [ Comment: Report | IP: Logged ]
sKuLLo
16:40 3/7/2002
Writing aliases is very simple. Here is a example:

alias "buybomba" "wait; buyequip; wait; menuselect 3; wait; buyequip; wait; menuselect 3; wait; buyequip; wait; menuselect 4"
alias "buykeles" "wait; buy; wait; menuselect 4; wait; menuselect 1"
alias "buycolt" "wait; buy; wait; menuselect 4; wait; menuselect 3"
alias "buytekli" "wait; buy; wait; menuselect 4; wait; menuselect 6"
alias "buydezirt" "wait; buy; wait; menuselect 1; wait; menuselect 3"
alias "buyusp" "wait; buy; wait; menuselect 1; wait; menuselect 1"
alias "buyammo" "wait; buy; wait; menuselect 6; wait; buy; wait; menuselect 7; wait; impulse 101"
alias "buyhirdavat" "wait; buyequip; wait; menuselect 2"
alias "buydefuse" "wait; buyequip; wait; menuselect 6"

alias "kelesal" "buykeles; buycolt; buyusp; buyhirdavat; buydefuse; buybomba; buyammo"
alias "coltal" "buyusp; buyhirdavat; buydefuse; buybomba; buykeles; buycolt; buyammo"
alias "teklial" "buytekli; buydezirt; buyhirdavat; buydefuse; buybomba; buyammo"

// Binds for game

bind "q" "coltal; wait; slot10; wait; slot10; wait; weapon_knife"
bind "k" "teklial; wait; slot10; wait; slot10; wait; weapon_knife"
bind "v" "buydezirt; buyhirdavat; buydefuse; buybomba; buyammo; wait; slot10; wait; slot10; wait; weapon_knife" [ Comment: Report | IP: Logged ]
[SFD]^Krissam^
00:11 5/10/2002
I don't see the idea with buy scripts
it only take's me 5 secs to buy Ak/volt, 2fb, a he a smoke, a kit and a deagle

so what's the point [ Comment: Report | IP: Logged ]
Overpaid
19:12 11/10/2002
Hey i was wondering if you could give some examples of how to make "creative" scripts...i have mastered the boring ones with no problem...i was wondering if there is anything else you could do with this technique...thanks.

XP [ Comment: Report | IP: Logged ]
TvR
19:16 14/11/2002
thanks Skullo, i like yours [ Comment: Report | IP: Logged ]
|RBG|sc4rius
20:12 22/1/2003
Hey what are your guys talking about look at this:
alias close "wait; wait; wait; slot10; wait; slot10; wait; slot10;"

alias F1 "buy; menuselect 1; menuselect 3; wait; buy; menuselect 7; close;"

alias F2 "buy; menuselect 3; menuselect 1; wait; buy; menuselect 6; close;"

alias F3 "buy; menuselect 3; menuselect 3; wait; buy; menuselect 6; close;"

alias F4 "buy; menuselect 4; menuselect 1; wait; buy; menuselect 4; buy; menuselect 3; buy; menuselect 6; close;"

alias F5 "Buy; menuselect 4; menuselect 2; wait; buy; menuselect 4; menuselect 4; buy; menuselect 6; close;"

alias F6 "buy; menuselect 8; menuselect 2; close;"

alias F7 "buy; menuselect 8; menuselect 3; wait; buy; menuselect 8; menuselect 4; wait; buy; menuselect 8; menuselect 4; wait; buy; menuselect 8; menuselect 5; close;"

alias F8 "buy; menuselect 4; menuselect 5; wait; buy; menuselect 6; close;"

alias F9 "buy; menuselect 3; menuselect 2; wait; buy; menuselect 6; close;"

alias F10 "buy; menuselect 8; menuselect 6; close;"

alias F11 "buy; menuselect 6; wait; buy; menuselect 7; close;"

alias F12 "buy; menuselect 4; menuselect 6; wait; buy; menuselect 6; close; " [ Comment: Report | IP: Logged ]
Sebo
21:19 16/3/2003
Hey, i dont really get this, what do i have to type in the config.cfg file to buy an ak47/colt + deagle (no ammo)?? [ Comment: Report | IP: Logged ]
Comatosis
08:47 27/3/2003
Just look at what people have already posted and go from there. Since you know that the keys for an ak are 4 and 1, do something like (I actually don't use scripts, but it's easy to pick up):

alias akdeagle buy; menuselect 4; menuselect 1; wait; menuselect 1; menuselect 3

btw, I'm not sure on the previous, since I already said I don't use scripts, but you get my drift...

and then you bind your alias to a key, such as:

bind o akdeagle

or something like that... [ Comment: Report | IP: Logged ]
Comatosis
08:52 27/3/2003
Nevermind, I just saw that I made mistakes. It should go something like this:

alias "akdeagle" "buy; menuselect 4; menuselect 1; wait ; buy; menuselect 1; menuselect 3; close"

and then bind it to the key you want.

I'm still not sure on how it's done exactly, but I'm pretty sure I'm not too far off. [ Comment: Report | IP: Logged ]
Hopper
16:36 9/4/2003
Krissham...that 5 second time makes a WHOLE lot of difference! Those 5 seconds could be running to guard the bombsite like in de_dust, or setting up an AWP position in cs_militia! With these scripts it will take you a half second to press ONE button to get what you need and gogo instead of five seconds for five buttons. [ Comment: Report | IP: Logged ]
Dirty F8ality
23:08 13/4/2003
where do u put the scripting if u dont have an autoexec.cfg? r there any other names for the "autoexec.cfg"? [ Comment: Report | IP: Logged ]
TheMickster
18:33 19/4/2003
If you dont have autoexec.cfg just make one [ Comment: Report | IP: Logged ]
Alliance
12:01 2/5/2003
and what is the line if i wanted to buy a ak (and full ammo) and deagle (full ammo)

and the same with colt...
and would it affect my autoexec file if i had 2 aliases in it? [ Comment: Report | IP: Logged ]
Leptest
12:19 18/6/2003
hey, i have a problem with my scripts. I got everything working, but i had to put all my binds in the "config.cfg" like

bind "F1" colt
bind "F2" ak

and so on. But when i but the bind cmd's into my script files, i.e "autoexec.cfg" or "myscript.cfg" they don't work. It jst defaults the keys back to what they should be. In the autoexec i load alll my files fine. "exec myscript.cfg" and stuff. and even when i am in the game i type "exec binds.cfg, or exec myscript.cfg" and it doesn't work. Any help with this would be much apreciated.

Leptest [ Comment: Report | IP: Logged ]
Some dude
03:41 28/6/2003
I tried your simple script and applied it to the weapons i wanted, but on some servers if (bind "a" "+ak";) nothing happens and in console says " unknown command +ak

sup wit dat? [ Comment: Report | IP: Logged ]
some dude
03:45 28/6/2003
btw, I put the binds in the autoexec.cfg and in my config.cfg file it has them listed for the keys I assigned,
I have say commands bound that work fine so i dont know whats wrong [ Comment: Report | IP: Logged ]
Leptest
02:48 3/7/2003
I figured out what was wrong. HL, or should i say CS, has issues when it comes to binding F1 & F2. the way u can fix this is delete GameUI.dll, found in:

C:SIERRAHalf-Lifevalvecl_dlls

i also had to exec my cfg's once in game, but i put the cmd in my menu, so it works for all the people i have given it to. :-D

Leptest [ Comment: Report | IP: Logged ]
King*Duck
00:10 15/7/2003
I can't believe these guides are still here.. man i've been gone a LONG time. [ Comment: Report | IP: Logged ]
eX.zob
16:03 23/2/2004
What about if i want the script to buy my stuffs and then say what i bought..? [ Comment: Report | IP: Logged ]
Add comment

Menu

News
Features
Events
Site
Search UKT:

User



Register here

Shoutbox

Zechs_
*sniff*
04:40 3/9/2008

X
JESUS CHRIST ITS A LION
23:33 27/8/2008

`NWA
lol @ this shoutbox going stron 2 years after the last news item was posted.
02:22 27/8/2008

w1ckedz
I wrote that Culexus comment Myers hahahaha
21:32 25/8/2008

tiz
Stealing is terrible I know! Some ****er even had the cheek to put it on ebay... [ [ expand ]