All commands sent through private message/query. The code goes in remote scripts (alt + r).
You may need to change the red colored text. I just assume the network you are on uses NickServ, if not then change it as needed.
At the bottom is a commented out skeleton code for adding another command. It should be easy to figure out. Be sure to remove the semi-colons if copying the code.
on *:TEXT:*:?:{
[color:green]; !join #channel / !part #channel[/color]
if ($regex($2,/^#[\S]/)) {
if ($1 == !join) {
if ($me !ison $2) join $2
else .msg $nick I am already on $2
}
if ($1 == !part) {
if ($me ison $2) part $2
else .msg $nick I am not on $2
}
}
[color:green]; !nick <new-nick>[/color]
if ($1 == !nick) {
if ($2 && $regex($2,/^[a-zA-Z\[\]\{\}\\`^]/)) { nick $2 }
else .msg $nick Invalid nick.
}
[color:green]; !identify[/color]
if ($1 == !identify) .msg [color:red]NickServ identify nick pass[/color]
[color:green]; if ($1 == !new-command) {
; do stuff here
; }[/color]
}