Press alt+r and paste in this script, if there is already stuff in there open a new file with File -> New:
on *:JOIN:[color:green]#channel[/color]:{
[color:green]command to perform[/color]
}
$nick in the command refers to the nickname of the person joining, so you could do
whois $nick to automatically whois the person who joined for example.