Code: Select all
proc addbnc {nick host hand chan arg} {
global db
set ident [lindex [split $arg] 0]
if {[string match *.users.quakenet.org* $host]} {
set auth [lindex [split [lindex [split $host @] 1] .] 0]
set getauth [::mysql::sel $db "SELECT id FROM users WHERE auth='$auth'" -list]
if { $getauth != "" } {
putserv "PRIVMSG $chan : You already asked for a bnc! "
} else {
set getident [::mysql::sel $db "SELECT id FROM users WHERE ident='$ident'" -list]
if { $getident != "" } {
putserv "PRIVMSG $chan : Theres already a bouncer with that ident, please choose another."
} else {
if {[string length $ident] > 6} {
putquick "privmsg $chan "Error. The ident is longer as 6 vars."
} else {
set time "Date"
putquick "privmsg $chan :OK, your request has been send. You'll have to wait to know your result(this can take 30 seconds or 30mins). DO NOT RENAME NOW!"
set result [::mysql::exec $db "INSERT INTO users (nick,auth,ident,time,standing,level) VALUES('$nick','$auth','$ident','$time','Waiting','1')"]
set getid [::mysql::sel $db "SELECT id FROM users WHERE auth='$auth'" -list]
putquick "privmsg $chan :New bouncer requested. (ID: $getid). /msg q whois #$auth : to accept: .accept $getid ; to decline .decline $getid"
}
}
}
} else {
putserv "privmsg $chan : You are not \002authed\002 (on Q bot), or have not set \002mode +x\002. (\002//mode \$me +x\002)"
}
}
What is wrong