First, you need to ensure that the interpreter for your desired scripting language is present on the system. For gaming scripts this will likely be Python or Lua. You will not be scripting in C; C is a compiled language and scripts are interpreted by definition, though the C and Bourne shells have similar syntax.
Once you know that the correct interpreter is present, you can go find a good tutorial on the Web. There are good Python references and tutorials available, I can’t speak for Lua.
If you use Windows, you will want to install and learn either Powershell or MINGW. MINGW is Minimal GNU for Windows and will give you useful tools. Both Macintosh and Linux come with powerful scripting environments by default. I don’t know any Applescript so I won’t address it here.
The most commonly used shell in Linux/UNIX these days is bash. Bash is both the command-line environment and the script interpreter. It’s powerful and flexible.
To write a script, just fire up your favorite text editor. Scripts are just plain old text files.
At the beginning of the script you will write a header. In UNIX this looks something like:
#! /bin/bash
The “hash bang” at the beginning tells the shell that the file is, in fact, a script. The following path tells the shell where to find the correct interpreter to run the script (in this case, bash- but it could just as easily be ”#! /usr/bin/python” or something).
After the header comes the code. Every time you make a change, you need to save the file in order to see it work. You can keep the file open while debugging though.
In order to see your script in action, just type “sh [filename]” where [filename] is whatever you called the script.
It worked similarly in DOS and probably also in the Windows command line. The interpreter is called “command.com”, the scripts are called “batchfiles” and given the suffix .bat. You don’t need to add the header in .bat files AFAIK.
*.exe files are generally compiled binaries and not scripts. It may be possible to give a script that suffix and get it to work but I doubt it.
The interpreter for Javascript is just your friendly neighborhood web browser. Javascript can be embedded in webpages or written separately and included in webpages using <script src=“foo”>. You need to know HTML to use Javascript effectively.
The interpreter for PHP is a web server. If you don’t have a web server installed, PHP is not very useful. There is a command line interpreter for PHP, and it works, but I would not recommend its use in this way.