Guest User

Untitled

a guest
May 14th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. bind pub - .auth qauth
  2.  
  3. proc qauth {nick host hand chan txt} {
  4. global nchan
  5. set nchan $chan
  6. fauth $nick
  7. }
  8.  
  9. proc fauth {nick} {
  10. global botnick db colora colorb
  11. set x "0"
  12. putlog "[expr $x + 1]"
  13. set auth [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE ircnick='[sql_nick $nick]' AND ircstatus='1'" -list]
  14. putlog "[expr $x + 1]"
  15. if { $auth == "" } {
  16. putlog "[expr $x + 1]"
  17. global relay_bots
  18. set relay_bot [lindex $relay_bots 0]
  19. putlog "[expr $x + 1]"
  20. set relay_bots "[lrange $relay_bots 1 end] [lindex $relay_bots 0]"
  21. putbot $relay_bot "goauth $::nchan $nick"
  22. putlog "[expr $x + 1]"
  23. } else {
  24. putquick "CNOTICE $nick $::nchan :$colora Tu já estás identificado como #$auth $colorb"
  25. }
  26. }
  27. putlog "script de auth"
  28.  
  29. set relay_bots "EST-SenderA EST-SenderB EST-SenderC EST-SenderD"
  30.  
  31. proc whoisgetid { txt } {
  32. global db botnick
  33. set check [string range $txt 0 0]
  34. if { $check == "#" } {
  35. set auth [string range $txt 1 end]
  36. set userid [::mysql::sel $db "SELECT userID FROM ws_49a_user WHERE username='$auth'" -list]
  37. if { $userid == "" } {
  38. return "-1"
  39. } else {
  40. return $userid
  41. }
  42. } else {
  43. set auth $txt
  44. set userid [::mysql::sel $db "SELECT userID FROM ws_49a_user WHERE ircnick='[sql_nick $auth]' AND ircstatus='1'" -list]
  45. if { $userid == "" } {
  46. return "-1"
  47. } else {
  48. return $userid
  49. }
  50. }
  51. }
  52.  
  53. bind pub - !whois whois
  54. bind pub - !w whois
  55.  
  56. proc whois { nick host hand chan txt } {
  57. global db botnick colora colorb
  58. if { [::mysql::sel $db "SELECT username FROM ws_49a_user WHERE ircnick='[sql_nick $nick]' AND ircstatus='1'"] != "1" } {
  59. return 1
  60. }
  61. if { $txt == "" } {
  62. set r [whoisgetid $nick]
  63. } else {
  64. set r [whoisgetid $txt]
  65. }
  66. if { $r == "-1" } {
  67. putquick "privmsg $chan :$colora Esse utilizador não está identificado ou não existe $colorb"
  68. } else {
  69. global relay_bots
  70. set relay_bot [lindex $relay_bots 0]
  71. set relay_bots "[lrange $relay_bots 1 end] [lindex $relay_bots 0]"
  72. putbot $relay_bot "msgwhois $r $chan"
  73. }
  74. }
Add Comment
Please, Sign In to add comment