
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.
Make the + alias for the buy script:
Make the + alias for the buy script:
Make the - alias for the buy script:
Create the bind command, this will assign a key to the script (goes in config.cfg):
Make the + alias for the buy script:
or:
Either way is fine.
Make the + alias for the buy script:
Make the - alias for the buy script:
Create the bind command, this will assign a key to the script (goes in config.cfg):
Make the + alias for the buy script:
Make the + alias for the buy script:
Make the - alias for the buy script:
Create the bind command, this will assign a key to the script (goes in config.cfg):
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
00:04 4/1/2002
[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 ]
00:57 4/1/2002
02:26 4/1/2002
======================================
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 ]
05:03 4/1/2002
08:08 4/1/2002
21:01 4/1/2002
22:21 4/1/2002
14:30 5/1/2002
Read near the top of the Guide to help you understand where to put everything... [ Comment: Report | IP: Logged ]
01:10 21/3/2002
17:57 23/4/2002
Can u make a script for that, or would it have to be bound to 2 different weapons? [ Comment: Report | IP: Logged ]
12:43 4/6/2002
08:06 24/6/2002
16:40 3/7/2002
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 ]
00:11 5/10/2002
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 ]
19:12 11/10/2002
XP [ Comment: Report | IP: Logged ]
19:16 14/11/2002
20:12 22/1/2003
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 ]
21:19 16/3/2003
08:47 27/3/2003
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 ]
08:52 27/3/2003
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 ]
16:36 9/4/2003
23:08 13/4/2003
18:33 19/4/2003
12:01 2/5/2003
and the same with colt...
and would it affect my autoexec file if i had 2 aliases in it? [ Comment: Report | IP: Logged ]
12:19 18/6/2003
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 ]
03:41 28/6/2003
sup wit dat? [ Comment: Report | IP: Logged ]
03:45 28/6/2003
I have say commands bound that work fine so i dont know whats wrong [ Comment: Report | IP: Logged ]
02:48 3/7/2003
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 ]
00:10 15/7/2003
16:03 23/2/2004