
set bsx(access) 0
set bsx(channel) "#somechan"

#onchan <nickname> [channel]
if {[onchan $nick $bsx(channel)]} { 
	set bsx(access) 1
}

bind msg -|- test bsx(tester)
proc bsx(tester) { nick uhand handle chan } {
	global bsx

	if {$bsx(access) == 0} { 
		putquick "privmsg $nick :$nick, you are not in the chan"
	}
	if {$bsx(access) == 1} {	
		putquick "privmsg $chan : this is the msg...."
	}
}
