Scripts work like any command in the game, only they are in a series. You can place a .cfg file in the folder of the mod you want to use them in, and then use
/bind X exec your_script.cfg to execute it. You can do things like automatic rocketjump scripts (which look down, jump and shoot at the same time, and then reset your view), or even automatic strafejump scripts. These are considered cheating by most, and are usually prohibited in competitions. I've tried them before, but it also doesn't place nicely for me. I'm not going to give you instructions to create these scripts, you can probably find more resources than you need with a little bit of searching.
The scripts can also be used for other purposes, mostly for server administration. For example most servers use a maps.cfg file (or it's in their server.cfg) which initiates a map rotation. In these files it says something like this:
set map1 "map oasago2; set nextmap vstr map2;"
set map2 "map ps37ctf; set nextmap vstr map3;"
set map3 "map pul1ctf; set nextmap vstr map1;"
vstr map1"
vstr" means "execute this series of commands". The commands work like in a script, only are written between quotes ("") and, as far as I know, need to be written on a single line. Each command is separated by a semi-colon (;
). When you do "
vstr map1", it will execute "
map oasago2; set nextmap vstr map2". So it changes the map to oasago2, and when the game needs to go to the next map (either by callvote, when the game ends, or when you manually do "
/rcon vstr nextmap"), it will execute the string "vstr map2", which will change the map and set the nextmap to "
vstr map3"... Then map 3 goes to map1 again, etc.
Another purpose would be to do a series of things you would usually have to do yourself. One example is changing the mouse sensitivity per weapon. You could do this in a script:
changeToRocketlauncher.cfg:
weapon 5sensitivity 3(Well I think weapon 5 is the rocket launcher, I might be wrong.)
Then ingame:
/bind r exec changeToRocketlauncher.cfgWhen you press the R now, it will execute that script.
Alternatively, you can do this all ingame by vstr without any script:
/bind r vstr "weapon 5; sensitivity 3;"But if a series of commands gets very long it's harder to do this. Also a script is really a file, something you can easily copy. Any binds you make like this are saved to q3config.cfg, which often gets overwritten or reset if you play a bugging mod or server.
You can do many more with this like spamming the chat, changing your name rapidly 100 times a second, cheat by automatically rocketjumping, but none of these are really recommendable. You'll just end up being banned from servers and nobody will like you or permit you to join their clan. (Well, any self-respecting clan. LoL might still take you.)
Any questions? ^^