RiX
BattleForums Senior Member
- Joined
- Sep 26, 2002
- Messages
- 1,435
- Reaction score
- 0
- Location
- Vancouver, B.C.
- Website
- thelazyshopper.wwdb.biz
Buy Scripts is what everyone needs and usually wants =) so here we go.
IMPORTANT PLEASE READ THROUGH THE WHOLE EFFIN THING BEFORE YOU ASK DUMB QUESTIONS IN WHICH I WILL FLAME YOU FOR!
Lets Go Through Some Vocabulary =)
(Taken From Mr. AzRed From CS Forums Only the Vocab)
Autoexec.cfg: This file, user created, will automatically execute upon entering a CS game.
To create it, go into Notepad. Save the file as "autoexec.cfg" (with the quotes). Make sure you select "All Files (*.*)" in the drop-down menu where it says "Save As".
Config.cfg: This file contains all the binds and settings. It is automatically generated by CS if deleted, with all default settings and binds. Generally, it is not wise to put scripts in this file; however, binds may go in here.
alias: The core of any script. The alias command basically allows the stacking of multiple commands. The following is a use of the alias command to say "Hello World!"
alias hello "say Hello World!" //The alias command combines everything in the quotes into one neat little command, as seen in the next line.
bind "h" "hello"
Bind: A bind is basically mapping your key to perform a command. For instance:
bind "mouse1" "+attack"
This basically says, "When you hit mouse1, it should use command +attack". When you release "mouse1" you'll automaticly execute the "-attack" command, stopping your fire.
wait: A wait, when inserted into script, simply pauses the script for one frame. So in order to wait one second you have to have as many waits as you have Frames Per Second.
slot10: This closes all menus. The waits and slot10s are usually used together to close menus in buyscripts. See my tutorial on buyscripts, coming soon.
developer #: Developer lets the user see information about his game in the top-left corner, without opening the console.
It is normally set to 0, so nothing is shown. When developer is set to 1, you can use the "echo" command (more on that later) to convey information to the user.
developer 1; echo hi; developer 0"
This will activate developer mode, say hi on the top left corner of the screen, and deactivate it. We always make sure to deactivate it so no information other than what we want gets to the user; it would get extremely annoying for most people to see when someone died at the top left, in text.
echo: An echo is used in conjunction with the developer commands. When you use an echo, it will convey information into the console. When developer is activated, the echo will convey information at the top left hand corner of the screen.
Now, different basic methods of scripting:
Aliasing: Aliasing is simply grouping commands together into 1, easy to use command:
alias w00t "say w00t; say w00t!"
This type of script is the core to more complex scripts, as it condenses scripts greatly. If the aliasing method did not exist, it would be a horrible pain in the ass to even bind something!
Toggle: A toggle script consists of three lines: 1 line which will perform a function, 1 line which will perform another function, and 1 last line to do the "toggling". Example:
alias toggle "toggle1"
alias toggle1 "say This is toggle1; alias toggle toggle2"
alias toggle2 "say This is toggle2; alias toggle toggle1"
Confused? Basically, the "toggle" line has another command inserted into it. The "toggle" line, as you should notice, will always perform another command, and is never used to combine commands. Rather, it simply executes the line in quotes.
The line in quotes in this case, toggle1, is executed. The player will say "This is toggle1." Then, there is the alias command again. We have already learned that the alias command is used to group commands; it can also be used to change the functionsof existing commands. In this case, the "toggle" line's new definition is changed to "toggle2".
You can also use toggles for binds, not just aliases:
alias flashon "flashlight"
alias flashlight "bind f impulse 101; alias flashon flashoff"
alias flashoff "unbind f; alias flashon flashlight
If you trigger "flashon", the script will bind F to your flashlight. If you trigger it again, the button will be unbound.
+/-: The +/- script basically has 2 lines. One line will execute when the key is pressed (+); the other line will execute when the key is released (-). Example:
alias +hi "say hello"
alias -hi "say i am scripting!"
bind "h" "+hi"
The + and - MUST BOTH be defined, or the script will not work properly.
When you push and hold H, the first line will be executed. When you release, the second line will be executed.
Cycle: Much like the toggle, the cycle script has an alias that does nothing except use other lines of code. The key difference is that the cycle can use more than 3 lines of coding. The alias command is also used alot.
There is not much different from a toggle script; it's the same principle. You're just not defining the "alias toggle" into the same 2 all the time. There could be 3, 4, or even 20. Take the following example:
alias graph "graph1"
alias graph1 "net_graph 1; alias graph graph2"
alias graph2 "net_graph 2; alias graph graph3"
alias graph3 "net_graph 3; alias graph graph4"
alias graph4 "net_graph 0; alias graph graph1"
bind "v" "graph"
Note that the "alias graph" at the end of each line redefines "graph" to a new alias. It's like an "advanced toggler".
Just like the toggle, you can also use a cycle to bind.
Now we're going to use what we've learned, and make a 3-shot bursting script that can be turned off.
First, let's write the +/- firing script itself:
alias 1shot "+attack; wait; -attack"
alias 3shot "1shot; wait; 1shot; wait; 1shot"
What we've done so far is make a pair of aliases that will shoot 3 times when executed.
alias shoot "shoot1"
alias shoot1 "bind mouse1 3shot; alias shoot shoot2"
alias shoot2 "bind mouse1 +attack; alias shoot shoot1"
We can rebind AND realias using toggles. They're extremely useful little codes to know.
Once you understand the 4 above scripts, the examples, the final 3-shot burst we've created, and how they work, you can go on to some more advanced scripting.
Meta-binds: A meta-bind is a script that binds one or several keys to multiple commands, like the above toggle example. They can be both "+/-" scripts, or toggles, it is up to you to decide what works best in any situation.
Using a meta-bin can be useful if you're trying to save keyboard space, as you can get twice as many commands bound by only using one extra key. Here's an example of the "+/-" variant:
alias +shooter "bind mouse1 +3shot"
alias -shooter "bind mouse1 +attack"
When the button is held (+shooter), the mouse1 key will be rebound to the 3shot script we just made. When the +shooter button is released (-shooter), the mouse1 will be bound to +attack, its normal command.
Meta-binds don't have to be used just for binds. The buyscript I created uses a meta-cfg, where another .cfg file is executed on the pressing of the button. Just remember, a meta-bind is simply a toggle, except it binds.
The .cfg Method: You don't need to keep all your scripts in autoexec.cfg. In fact, I advise against it. It gets too big, unreadable, etc. There will be more about this method towards the end of this guide.
Now, for the actual script. Some cvars, such as names, require quotes to be used (name "I am w00t!"). However, you cannot have more than 1 pair of quotes inside an alias at a time. Then how would you change your name using a cool script?
By using the .cfg method, we can execute a seperate file with the line of code that we want. Look at this example:
//Autoexec.cfg//
alias rename "exec rename.cfg"
//rename.cfg//
name "I am w00t!"
By using the .cfg method, you can save space, organize scripts, and do things you can't do with just 1 script.
These Should All Be Created In Your..
If You Have Half-Life:
Example 1: C:/Program Files/Sierra/Half-Life/CStrike Folder
Example 2: D:/Program Files/Sierra/Half-Life/CStrike Folder
Or Where-Ever Your Directory Is
If You Have CS Retail
Example 1: C:/Program Files/Sierra/Counter-Strike/CStrike Folder
Example 2: D:/Program Files/Sierra/Counter-Strike/CStrike Folder
Step 1: Create a file called autoexec.cfg
- To do go about doing this you must make a new .txt file if you don't know how to do this you shouldn't be here reading this. Go To Save As> and call the .txt file "autoexec.cfg"
Step 2: Create a file called scriptnamehere.cfg
- Basically the same way you do Step 1
- Example "rixscript.cfg"
IMPORTANT Notice!! Remember the " " =)
Step 3: In The autoexec.cfg put exactly > > > exec scriptnamehere.cfg
Step 4: Now onto the buy scripts. Open Up scriptnamehere.cfg and time for the alias's.
- Next is a following of Scripts ONLY BUY The MOST USED Guns
IMPORTANT PLEASE READ THROUGH THE WHOLE EFFIN THING BEFORE YOU ASK DUMB QUESTIONS IN WHICH I WILL FLAME YOU FOR!
Lets Go Through Some Vocabulary =)
(Taken From Mr. AzRed From CS Forums Only the Vocab)
Autoexec.cfg: This file, user created, will automatically execute upon entering a CS game.
To create it, go into Notepad. Save the file as "autoexec.cfg" (with the quotes). Make sure you select "All Files (*.*)" in the drop-down menu where it says "Save As".
Config.cfg: This file contains all the binds and settings. It is automatically generated by CS if deleted, with all default settings and binds. Generally, it is not wise to put scripts in this file; however, binds may go in here.
alias: The core of any script. The alias command basically allows the stacking of multiple commands. The following is a use of the alias command to say "Hello World!"
alias hello "say Hello World!" //The alias command combines everything in the quotes into one neat little command, as seen in the next line.
bind "h" "hello"
Bind: A bind is basically mapping your key to perform a command. For instance:
bind "mouse1" "+attack"
This basically says, "When you hit mouse1, it should use command +attack". When you release "mouse1" you'll automaticly execute the "-attack" command, stopping your fire.
wait: A wait, when inserted into script, simply pauses the script for one frame. So in order to wait one second you have to have as many waits as you have Frames Per Second.
slot10: This closes all menus. The waits and slot10s are usually used together to close menus in buyscripts. See my tutorial on buyscripts, coming soon.
developer #: Developer lets the user see information about his game in the top-left corner, without opening the console.
It is normally set to 0, so nothing is shown. When developer is set to 1, you can use the "echo" command (more on that later) to convey information to the user.
developer 1; echo hi; developer 0"
This will activate developer mode, say hi on the top left corner of the screen, and deactivate it. We always make sure to deactivate it so no information other than what we want gets to the user; it would get extremely annoying for most people to see when someone died at the top left, in text.
echo: An echo is used in conjunction with the developer commands. When you use an echo, it will convey information into the console. When developer is activated, the echo will convey information at the top left hand corner of the screen.
Now, different basic methods of scripting:
Aliasing: Aliasing is simply grouping commands together into 1, easy to use command:
alias w00t "say w00t; say w00t!"
This type of script is the core to more complex scripts, as it condenses scripts greatly. If the aliasing method did not exist, it would be a horrible pain in the ass to even bind something!
Toggle: A toggle script consists of three lines: 1 line which will perform a function, 1 line which will perform another function, and 1 last line to do the "toggling". Example:
alias toggle "toggle1"
alias toggle1 "say This is toggle1; alias toggle toggle2"
alias toggle2 "say This is toggle2; alias toggle toggle1"
Confused? Basically, the "toggle" line has another command inserted into it. The "toggle" line, as you should notice, will always perform another command, and is never used to combine commands. Rather, it simply executes the line in quotes.
The line in quotes in this case, toggle1, is executed. The player will say "This is toggle1." Then, there is the alias command again. We have already learned that the alias command is used to group commands; it can also be used to change the functionsof existing commands. In this case, the "toggle" line's new definition is changed to "toggle2".
You can also use toggles for binds, not just aliases:
alias flashon "flashlight"
alias flashlight "bind f impulse 101; alias flashon flashoff"
alias flashoff "unbind f; alias flashon flashlight
If you trigger "flashon", the script will bind F to your flashlight. If you trigger it again, the button will be unbound.
+/-: The +/- script basically has 2 lines. One line will execute when the key is pressed (+); the other line will execute when the key is released (-). Example:
alias +hi "say hello"
alias -hi "say i am scripting!"
bind "h" "+hi"
The + and - MUST BOTH be defined, or the script will not work properly.
When you push and hold H, the first line will be executed. When you release, the second line will be executed.
Cycle: Much like the toggle, the cycle script has an alias that does nothing except use other lines of code. The key difference is that the cycle can use more than 3 lines of coding. The alias command is also used alot.
There is not much different from a toggle script; it's the same principle. You're just not defining the "alias toggle" into the same 2 all the time. There could be 3, 4, or even 20. Take the following example:
alias graph "graph1"
alias graph1 "net_graph 1; alias graph graph2"
alias graph2 "net_graph 2; alias graph graph3"
alias graph3 "net_graph 3; alias graph graph4"
alias graph4 "net_graph 0; alias graph graph1"
bind "v" "graph"
Note that the "alias graph" at the end of each line redefines "graph" to a new alias. It's like an "advanced toggler".
Just like the toggle, you can also use a cycle to bind.
Now we're going to use what we've learned, and make a 3-shot bursting script that can be turned off.
First, let's write the +/- firing script itself:
alias 1shot "+attack; wait; -attack"
alias 3shot "1shot; wait; 1shot; wait; 1shot"
What we've done so far is make a pair of aliases that will shoot 3 times when executed.
alias shoot "shoot1"
alias shoot1 "bind mouse1 3shot; alias shoot shoot2"
alias shoot2 "bind mouse1 +attack; alias shoot shoot1"
We can rebind AND realias using toggles. They're extremely useful little codes to know.
Once you understand the 4 above scripts, the examples, the final 3-shot burst we've created, and how they work, you can go on to some more advanced scripting.
Meta-binds: A meta-bind is a script that binds one or several keys to multiple commands, like the above toggle example. They can be both "+/-" scripts, or toggles, it is up to you to decide what works best in any situation.
Using a meta-bin can be useful if you're trying to save keyboard space, as you can get twice as many commands bound by only using one extra key. Here's an example of the "+/-" variant:
alias +shooter "bind mouse1 +3shot"
alias -shooter "bind mouse1 +attack"
When the button is held (+shooter), the mouse1 key will be rebound to the 3shot script we just made. When the +shooter button is released (-shooter), the mouse1 will be bound to +attack, its normal command.
Meta-binds don't have to be used just for binds. The buyscript I created uses a meta-cfg, where another .cfg file is executed on the pressing of the button. Just remember, a meta-bind is simply a toggle, except it binds.
The .cfg Method: You don't need to keep all your scripts in autoexec.cfg. In fact, I advise against it. It gets too big, unreadable, etc. There will be more about this method towards the end of this guide.
Now, for the actual script. Some cvars, such as names, require quotes to be used (name "I am w00t!"). However, you cannot have more than 1 pair of quotes inside an alias at a time. Then how would you change your name using a cool script?
By using the .cfg method, we can execute a seperate file with the line of code that we want. Look at this example:
//Autoexec.cfg//
alias rename "exec rename.cfg"
//rename.cfg//
name "I am w00t!"
By using the .cfg method, you can save space, organize scripts, and do things you can't do with just 1 script.
These Should All Be Created In Your..
If You Have Half-Life:
Example 1: C:/Program Files/Sierra/Half-Life/CStrike Folder
Example 2: D:/Program Files/Sierra/Half-Life/CStrike Folder
Or Where-Ever Your Directory Is
If You Have CS Retail
Example 1: C:/Program Files/Sierra/Counter-Strike/CStrike Folder
Example 2: D:/Program Files/Sierra/Counter-Strike/CStrike Folder
Step 1: Create a file called autoexec.cfg
- To do go about doing this you must make a new .txt file if you don't know how to do this you shouldn't be here reading this. Go To Save As> and call the .txt file "autoexec.cfg"
Step 2: Create a file called scriptnamehere.cfg
- Basically the same way you do Step 1
- Example "rixscript.cfg"
IMPORTANT Notice!! Remember the " " =)
Step 3: In The autoexec.cfg put exactly > > > exec scriptnamehere.cfg
Step 4: Now onto the buy scripts. Open Up scriptnamehere.cfg and time for the alias's.
- Next is a following of Scripts ONLY BUY The MOST USED Guns