Fork me on GitHub


Easier Scripting for TF2 & Other Valve Games

SourceScript is a small and simple programming language that aims to simplifiy programming configurations for Valve's games based on the Source Engine.

It introduces boolean variables, conditional statements, enumerations, functions and a more readable syntax for commands and best of all: It's fully backwards-compatible with your old scripts!

If you find some bugs or have questions, just leave a ticket on Github.

Try it yourself in the editor! Oh, it's open source too!


Simpler Syntax

SourceScript introduces a simpler syntax to declare aliases and binds. You don't have to write all commands in one line anymore, instead just group the commands in braces. It also generates helper aliases for you when using multiple commands in a nested alias or in a bind.

alias "combo" {

bind "MOUSE4" {
  say_team "using combo!"
alias combo "+attack; +forward"
alias +_bind_0 "combo; say_team "using combo!""
bind MOUSE4 +_bind_0


Enumerations allow you to easily create aliases that enumerate through blocks of commands. This especially comes in handy if you're writing a lot of code.

See this example: This creates a new alias called next that loops through all 3 slots. After slot3, it begins with slot1 or next_0 again.

enum next {
alias next next_0
alias next_0 "slot1; alias next next_1"
alias next_1 "slot2; alias next next_2"
alias next_2 "slot3; alias next next_0"

Variables and Conditional Statements

Variables allow you to store yes (true) / no (false) values in aliases. They can be used in Conditional Statements to check their value.

isCompetitive = true
if isCompetitive {
} else {

# or use negations
if !isCompetitive {
alias var_0_isCompetitive TrueHook
alias TrueHook aimbotOff
alias FalseHook aimbotOn

// or use negations
alias TrueHook ""
alias FalseHook aimbotOn

Variable Scope

SourceScript has variable block scope. This means that if you define a variable within a block, say in an if-clause, it will be only accessible in there.

Also, if you are using multiple files in your project, like in the editor below, variables are only accessible within the current file. If you want to create a variable that you can access in every file, add a dollar sign ($) before the variable name, for example like this: $isCompetitive.


Now functions are here for you guys who want to create large libraries: Functions will only be included in your code if you use them.

That means you could create a large library of tens of functions and use only some of them without bloating the output with unused functions.

function +Pyro::Panic() {
  cl_yawspeed 3000

function -Pyro::Panic() {
   cl_yawspeed 210

bind "MOUSE4" {
alias +func_Pyro__Panic "cl_yawspeed 3000; +left; +attack"
alias -func_Pyro__Panic "-attack; -left; cl_yawspeed 210"
alias +_bind_0 +func_Pyro__Panic
bind MOUSE4 +_bind_0

As you can see in the example, when using functions in binds functions beginning with a + are automatically replaced so that the - function is also called, just like you were using aliases.


To use functions from other files of your project, it is needed to include them. This is done with the include statement. For example, use include to allow usage of the functions of in the current file.

Try it yourself!

I started with a basic config framework for TF2 for you <3


28th January, 2013

Here's the complete list of changes on Github.

14th December, 2012

Initial release