I think this works better and is pretty easy.....
on $*:text:/^[.!@]join/:#:{
;; Your the only one that can use the command
if ($nick != $me) { return }
;; If your on the channel you want to join you cant join it again!
elseif ($nick ison $2-) { notice $nick Im already on that channel! | return }
;; You join the channel if everything is fine.
else { join $2- | halt }
}
on $*:text:/^[.!@]part/:#:{
;; Your the only one that can use the command
if ($nick != $me) { return }
;; If your not on the channel you want to part you cant part it!
if ($nick !ison $2-) { notice $nick Im not on this channel
;; You part the channel if everything is fine.
else { msg # $nick just left the channel. | part # $nick | halt }