wraith.bx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # wraith authorization script
  2. # By bryan
  3. #
  4. # This expects the md5 executable in $cspath/.BitchX
  5. # $botnick is the current nick of the bot.
  6. # You must /setauth
  7. # If you chat a diff bot, you must do that command first.
  8. # $pass is the DEFPASS setting from your pack.cfg
  9. #change this to your homedir.
  10. assign wpath /home/admin/bryan
  11. #put the 'md5' binary in $HOME/.BitchX/md5
  12. # if ($2 == "") {
  13. # }
  14. alias setauth {
  15. if ([$2] == "") {
  16. ^eval echo /setauth password secpass authkey <botnick>
  17. }
  18. ^assign wpass $0
  19. ^assign wsecpass $1
  20. ^assign wauthkey $2
  21. ^assign wbotnick $3
  22. }
  23. alias auth {
  24. ^assign blah $1$wsecpass$wauthkey
  25. ^exec -name secauth $wpath/.BitchX/md5 "-s$blah"
  26. ^on ^exec "secauth *" {
  27. ^eval echo +Auth $1
  28. }
  29. }
  30. alias secauth {
  31. ^assign blah $1$wsecpass$wauthkey
  32. ^eval echo Returning hash to $0
  33. ^exec -name secauth2 $wpath/.BitchX/md5 "-s$blah"
  34. ^on ^exec "secauth2 *" {
  35. send +Auth $1
  36. }
  37. }
  38. on ^dcc_chat "% -Auth *" {
  39. query =$0
  40. secauth $0 $2
  41. }
  42. on ^msg "% -Auth *" {
  43. query $0
  44. secauth $0 $2
  45. }
  46. ^eval xecho -bwraith Authorization Module Loaded.