Also would like to beable to get it to work for any channels i set in the script not just one channel
This is the scriptTcl error [joins]: bad option "--": must be -nocase or -length
Code: Select all
package require mysqltcl 
#-> Change the information below to connect to your MySQL database 
set mysqlserver localhost; 
set mysqluser ***; 
set mysqlpwd ***; 
set mysqldb ***; 
#-> Change the chan below for the chan you wish to monitor 
set userChan "#test" 
bind join - * joins 
proc joins {nick host hand chan} {
	global userChan 
	if {[string equal -nocase -- $chan $userChan]} {
		set db_handle [mysqlconnect -h $::mysqlserver -u $::mysqluser -password $::mysqlpwd]; 
		mysqluse $db_handle $::mysqldb 
		set sql "SELECT id FROM users WHERE username='[mysqlescape $nick]'" 
		set result [mysqlsel $db_handle $sql -list] 
	} 
	set result [mysqlsel $db_handle $sql -list] 
	if {$result > 0 } { 
		putserv "NOTICE $userChan $nick :welcome" 
	} else { 
		putserv "kick $userChan $nick :To join this channel you first need to register at http://cwukchat.com/modules/profile/register.php" 
		mysqlclose $db_handle; 
	}
} 
