Guest User

Untitled

a guest
Apr 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. bind bot - godeauth deauth
  2. proc deauth {frm_bot a msg} {
  3. global db
  4. set nick [lindex $msg 0]
  5. set chan [lindex $msg 1]
  6. set x [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE ircnick='[sql_nick $nick]' AND ircstatus='1'" -list]
  7. set result [::mysql::exec $db "UPDATE ws_49a_user SET ircstatus='0' WHERE ircnick='[sql_nick $nick]' AND ircstatus='1'" ]
  8. }
  9.  
  10. bind bot - goauth goauth
  11. proc goauth {frm_bot a msg} {
  12. global cn
  13. set nick [lindex $msg 1]
  14. set chan [lindex $msg 0]
  15. set cn($nick) $chan
  16. #putlog "whois $nick"
  17. putquick "privmsg Q :whois $nick"
  18. }
  19.  
  20. proc qcheck { nick host handle text dest} {
  21. global colora colorb
  22. if {$nick == "Q"} {
  23. if {[string match -nocase "Can't find user*" $text]} {
  24. return
  25. }
  26. if { [string match -nocase "*is not authed" $text] } {
  27. set xnick [lindex [split $text] 1]
  28. putquick "privmsg $xnick :$colora Não estás identificado na quakenet! $colorb"
  29. return
  30. }
  31.  
  32. if { [string match -nocase "-Information for user*" $text] } {
  33. set xnick [lindex [split $text] 3]
  34. set qauth [string range [lindex [split $text] 6] 0 end-2]
  35. doauth $qauth $xnick
  36. }
  37. }
  38. }
  39.  
  40. proc doauth { qauth nick } {
  41. global colora colorb db
  42. set auth [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE auth='$qauth'" -list]
  43. if { $auth == "" } {
  44. putquick "privmsg $nick :$colora A qauth não se encontra adicionada a nenhuma conta, por favor, verifica as opções no site. $colorb"
  45. return
  46. }
  47. set result [::mysql::exec $db "UPDATE ws_49a_user SET ircstatus='1',ircnick='[sql_nick $nick]' WHERE username='$auth'"]
  48. putquick "privmsg $nick :$colora Estás agora identificado como #$auth $colorb"
  49. }
  50. bind notc - * qcheck
  51.  
  52.  
  53. bind bot - msgwhois msgwhois
  54.  
  55. proc msgwhois {frm_bot a msg} {
  56. global db colora colorb
  57. set r [lindex $msg 0]
  58. set chan [lindex $msg 1]
  59. set qauth [::mysql::sel $db "SELECT auth FROM ws_49a_user WHERE userID='$r'" -list]
  60. if { $qauth == "\{\{\}\}" || $qauth == "" } {
  61. set qauth ""
  62. } else {
  63. set qauth " $colorb$colora Qauth: $qauth"
  64. }
  65. set steamid [::mysql::sel $db "SELECT value FROM ws_49a_user_gameacc WHERE userID='$r' AND type='62'" -list]
  66. if { $steamid == "" || $steamid == "\{\{\}\}" } {
  67. set steamid ""
  68. } else {
  69. set steamid " $colorb$colora SteamID: $steamid"
  70. }
  71. set pontos [::mysql::sel $db "SELECT points FROM ws_49a_user WHERE userID='$r'" -list]
  72. set points "$colorb$colora Pontos: $pontos"
  73. putquick "privmsg $chan :$colora [whoisgetinfo $r]$qauth$steamid $points $colorb"
  74. }
  75.  
  76.  
  77.  
  78. proc whoisgetinfo { userid } {
  79. global gth db
  80. set auth [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE userID='$userid'" -list]
  81. set ircstatus [::mysql::sel $db "SELECT ircstatus FROM ws_49a_user WHERE userID='$userid'" -list]
  82. set ircnick [join [join [::mysql::sel $db "SELECT ircnick FROM ws_49a_user WHERE userID='$userid'" -list] ] ]
  83. if { $ircstatus == 1 } {
  84. return "$ircnick está identificado como 12#$auth"
  85. } else {
  86. if { $ircnick == 0 } {
  87. return "Utilizador: #$auth \(Nunca se logou\)"
  88. } else {
  89. return "User: #$auth \(Último nick\: $ircnick\)"
  90. }
  91. }
  92. }
Add Comment
Please, Sign In to add comment