how can i get the below script to do the follwing
When a user types !regnick is sendt a code, the code is then used on a external php site where the user insert the pass the bot gav a person. and then when they join the chan they vil get auto +v before they can talk in the chan
Code: Select all
bind pub "-|-" !regnick reg:user
proc reg:user {nick uhost hand channel arg} {
global db_handle error_ chan_
set chan [string tolower $channel]
if {[channel get $chan UserSearch]} {
if {[mysqlping $db_handle] != 1} {
putserv "PRIVMSG $chan : $error_(mysqllost)"
return 0
}
set regpassword [md5 [random]]
set sqlnick "SELECT userid, regkode FROM nicks WHERE nick='[mysqlescape $nick]'"
set resultnick [mysqlquery $db_handle $sqlnick]
set nicki 0
while {[set record [mysqlnext $resultnick]] != ""} {
set userid [lindex $record 0]
incr nicki
}
if { $nicki != 0 } {
if { $userid == "" } {
set sqlnick "SELECT regkode FROM nicks WHERE nick='[mysqlescape $nick]'"
set resultkode [mysqlquery $db_handle $sqlnick]
while {[set record [mysqlnext $resultkode]] != ""} {
set regkode [lindex $record 0]
}
puthelp "NOTICE $nick : $error_(forgotpassword)"
puthelp "NOTICE $nick : $regkode"
return 0
}
puthelp "NOTICE $nick : $error_(userregged)"
}
if { $nicki == 0 } {
set sqlinsert "INSERT INTO nicks VALUES ( NULL , '[mysqlescape $nick]', '[mysqlescape $regpassword]', NULL, 'englsih' )"
set result [mysqlexec $db_handle $sqlinsert]
puthelp "NOTICE $nick : $error_(addnick1)"
puthelp "NOTICE $nick : $regpassword"
puthelp "NOTICE $nick : $error_(addnick2)"
}
}
}