4
0

auth.tcl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # auth.tcl
  2. #
  3. # This script authenticates the bot with an authentication service when it is
  4. # connected to a server. The code and settings below are quite specific to
  5. # QuakeNet's authentication service provided by Q.
  6. #
  7. # Note: the authentication user name and password are stored in this script in
  8. # plain text. This is not very secure. So, be careful and use this script at
  9. # your own risk!
  10. #
  11. # The !register command for registering an account on the authentication
  12. # service is disabled by default. Uncomment the respective bind line below if
  13. # you really need it. Do not forget to comment it out again as soon as you have
  14. # registered the account.
  15. #
  16. # See https://github.com/hwipl/eggdrop-scripts for the latest version and
  17. # additional information including the license (MIT).
  18. # tested versions, might run on earlier versions
  19. package require Tcl 8.6
  20. package require eggdrop 1.8.4
  21. namespace eval ::auth {
  22. # authentication settings for Q (QuakeNet)
  23. variable serv "Q@CServe.quakenet.org"
  24. variable name "YourQAccountName"
  25. variable pass "YourQAccountPassword"
  26. variable mail "YourMail@Address.com"
  27. }
  28. # authenticate the bot
  29. proc ::auth::auth { type } {
  30. global botnick
  31. variable serv
  32. variable name
  33. variable pass
  34. # authenticate the bot and hide host with +x
  35. putserv "PRIVMSG $serv :AUTH $name $pass"
  36. putserv "MODE $botnick :+x"
  37. putlog "Authenticated $botnick with $name on $serv."
  38. return 0
  39. }
  40. # register the bot with the authentication service
  41. proc ::auth::register {nick host hand chan arg} {
  42. global botnick
  43. variable serv
  44. variable mail
  45. # register current bot nick as account name with the mail address
  46. puthelp "PRIVMSG $nick :Registering $botnick and $mail on $serv."
  47. puthelp "PRIVMSG $serv :HELLO $mail $mail"
  48. putlog "Registered $botnick and $mail on $serv."
  49. return 1
  50. }
  51. namespace eval ::auth {
  52. # bind pub - !register ::auth::register
  53. bind evnt - init-server ::auth::auth
  54. putlog "Loaded auth.tcl"
  55. }