Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bind bot - godeauth deauth
- proc deauth {frm_bot a msg} {
- global db
- set nick [lindex $msg 0]
- set chan [lindex $msg 1]
- set x [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE ircnick='[sql_nick $nick]' AND ircstatus='1'" -list]
- set result [::mysql::exec $db "UPDATE ws_49a_user SET ircstatus='0' WHERE ircnick='[sql_nick $nick]' AND ircstatus='1'" ]
- }
- bind bot - goauth goauth
- proc goauth {frm_bot a msg} {
- global cn
- set nick [lindex $msg 1]
- set chan [lindex $msg 0]
- set cn($nick) $chan
- #putlog "whois $nick"
- putquick "privmsg Q :whois $nick"
- }
- proc qcheck { nick host handle text dest} {
- global colora colorb
- if {$nick == "Q"} {
- if {[string match -nocase "Can't find user*" $text]} {
- return
- }
- if { [string match -nocase "*is not authed" $text] } {
- set xnick [lindex [split $text] 1]
- putquick "privmsg $xnick :$colora Não estás identificado na quakenet! $colorb"
- return
- }
- if { [string match -nocase "-Information for user*" $text] } {
- set xnick [lindex [split $text] 3]
- set qauth [string range [lindex [split $text] 6] 0 end-2]
- doauth $qauth $xnick
- }
- }
- }
- proc doauth { qauth nick } {
- global colora colorb db
- set auth [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE auth='$qauth'" -list]
- if { $auth == "" } {
- putquick "privmsg $nick :$colora A qauth não se encontra adicionada a nenhuma conta, por favor, verifica as opções no site. $colorb"
- return
- }
- set result [::mysql::exec $db "UPDATE ws_49a_user SET ircstatus='1',ircnick='[sql_nick $nick]' WHERE username='$auth'"]
- putquick "privmsg $nick :$colora Estás agora identificado como #$auth $colorb"
- }
- bind notc - * qcheck
- bind bot - msgwhois msgwhois
- proc msgwhois {frm_bot a msg} {
- global db colora colorb
- set r [lindex $msg 0]
- set chan [lindex $msg 1]
- set qauth [::mysql::sel $db "SELECT auth FROM ws_49a_user WHERE userID='$r'" -list]
- if { $qauth == "\{\{\}\}" || $qauth == "" } {
- set qauth ""
- } else {
- set qauth " $colorb$colora Qauth: $qauth"
- }
- set steamid [::mysql::sel $db "SELECT value FROM ws_49a_user_gameacc WHERE userID='$r' AND type='62'" -list]
- if { $steamid == "" || $steamid == "\{\{\}\}" } {
- set steamid ""
- } else {
- set steamid " $colorb$colora SteamID: $steamid"
- }
- set pontos [::mysql::sel $db "SELECT points FROM ws_49a_user WHERE userID='$r'" -list]
- set points "$colorb$colora Pontos: $pontos"
- putquick "privmsg $chan :$colora [whoisgetinfo $r]$qauth$steamid $points $colorb"
- }
- proc whoisgetinfo { userid } {
- global gth db
- set auth [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE userID='$userid'" -list]
- set ircstatus [::mysql::sel $db "SELECT ircstatus FROM ws_49a_user WHERE userID='$userid'" -list]
- set ircnick [join [join [::mysql::sel $db "SELECT ircnick FROM ws_49a_user WHERE userID='$userid'" -list] ] ]
- if { $ircstatus == 1 } {
- return "$ircnick está identificado como 12#$auth"
- } else {
- if { $ircnick == 0 } {
- return "Utilizador: #$auth \(Nunca se logou\)"
- } else {
- return "User: #$auth \(Último nick\: $ircnick\)"
- }
- }
- }
Add Comment
Please, Sign In to add comment