Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bind pub - .auth qauth
- proc qauth {nick host hand chan txt} {
- global nchan
- set nchan $chan
- fauth $nick
- }
- proc fauth {nick} {
- global botnick db colora colorb
- set x "0"
- putlog "[expr $x + 1]"
- set auth [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE ircnick='[sql_nick $nick]' AND ircstatus='1'" -list]
- putlog "[expr $x + 1]"
- if { $auth == "" } {
- putlog "[expr $x + 1]"
- global relay_bots
- set relay_bot [lindex $relay_bots 0]
- putlog "[expr $x + 1]"
- set relay_bots "[lrange $relay_bots 1 end] [lindex $relay_bots 0]"
- putbot $relay_bot "goauth $::nchan $nick"
- putlog "[expr $x + 1]"
- } else {
- putquick "CNOTICE $nick $::nchan :$colora Tu já estás identificado como #$auth $colorb"
- }
- }
- putlog "script de auth"
- set relay_bots "EST-SenderA EST-SenderB EST-SenderC EST-SenderD"
- proc whoisgetid { txt } {
- global db botnick
- set check [string range $txt 0 0]
- if { $check == "#" } {
- set auth [string range $txt 1 end]
- set userid [::mysql::sel $db "SELECT userID FROM ws_49a_user WHERE username='$auth'" -list]
- if { $userid == "" } {
- return "-1"
- } else {
- return $userid
- }
- } else {
- set auth $txt
- set userid [::mysql::sel $db "SELECT userID FROM ws_49a_user WHERE ircnick='[sql_nick $auth]' AND ircstatus='1'" -list]
- if { $userid == "" } {
- return "-1"
- } else {
- return $userid
- }
- }
- }
- bind pub - !whois whois
- bind pub - !w whois
- proc whois { nick host hand chan txt } {
- global db botnick colora colorb
- if { [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE ircnick='[sql_nick $nick]' AND ircstatus='1'"] != "1" } {
- return 1
- }
- if { $txt == "" } {
- set r [whoisgetid $nick]
- } else {
- set r [whoisgetid $txt]
- }
- if { $r == "-1" } {
- putquick "privmsg $chan :$colora Esse utilizador não está identificado ou não existe $colorb"
- } else {
- global relay_bots
- set relay_bot [lindex $relay_bots 0]
- set relay_bots "[lrange $relay_bots 1 end] [lindex $relay_bots 0]"
- putbot $relay_bot "msgwhois $r $chan"
- }
- }
Add Comment
Please, Sign In to add comment