It all depends how you define your "proc" command for the script.
In a pub command script, the proc would look somthing like
proc command {1 2 3 4 5} {
the 1 to 5 do not have to be a set name, but rather what you want to refer the data passed to them as, in the script.
1 would be the nick
2 would be the user@host
3 would be the handle
4 would be the channel
5 would be the rest of the test sent to the command on IRC
In this case, where you see $chan in many scripts, is because some1 has used "chan" in place of the number 4 in the above example.