im trying to make a script so the eggdrop checks against a mysql db
if a user that is not in the database tries to enter the room he/she is kicked
ive been trying to modify a script all is good except when it comes to executing the kick ,or welcoming a member into the room.
Code: Select all
package require mysqltcl
###### Set Site address ###########################
set site_add "http://www.******"
###### Setup Your database info here ##############
set dbuser "****"
set dbpassword "****"
set name "****"
set portno "3306"
##### Set site channels ##########################
set chanmember "#test"
set memberclassno "1"
##################################################
# Connect to Database #
##################################################
set db_handle [mysqlconnect -host localhost -port $portno -user $dbuser -password $dbpassword -db $name]
##################################################
# #
##################################################
global db_handle chanmember
set sql "SELECT id FROM users WHERE username='[mysqlescape $nick]'"
set result [mysqlsel $db_handle $sql -list]
if {$result > 1} {
putserv "NOTICE $nick :welcome to $nick to the members IRC-Channel!"
} else {
}
if {$result < 1} {
putserv "MODE +k $nick"
putserv "NOTICE KICK $nick :your names not down your not comming in"
mysqlendquery $db_handle
}