wraith.mrc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. ON *:LOAD:{ echo -a Wraith authorization script, for mIRC 5.8 and up, by bryan loaded (MSG/DCC/Psybnc support). type /setauth }
  2. alias helpauth {
  3. echo -a Type /setauth
  4. echo -a /auth -Auth string <botnick> <- That will return the md5 hash. (use for telnet possibly)
  5. }
  6. alias setauth {
  7. if (!$3) {
  8. echo -a usage: /setauth password secpass authkey <botnick>
  9. echo -a <botnick> is optional if the authkey specified is for that bot only...
  10. }
  11. else {
  12. if ($4) {
  13. set %w.pass. $+ $4 $1
  14. set %w.secpass. $+ $4 $2
  15. set %w.authkey. $+ $4 $3
  16. }
  17. else {
  18. set %w.pass $1
  19. set %w.secpass $2
  20. set %w.authkey $3
  21. }
  22. echo -a set!
  23. }
  24. }
  25. ALIAS -l psy {
  26. if ($1 == $chr(40) || $1 == $chr(41)) {
  27. return 1
  28. }
  29. }
  30. ON *:CHAT:*:{
  31. var %c = %auth. [ $+ [ $nick ] ]
  32. if (($1 === -Auth || $1 === ÿû-Auth) && $len($2) == 50) {
  33. msg =$nick +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  34. }
  35. }
  36. ON *:TEXT:auth*:?:{
  37. var %c = %auth. [ $+ [ $nick ] ]
  38. if (!$3) {
  39. ;if this is a MSG not psybnc DCC, and we arent cleared to auth with them, IGNORE.
  40. if (!$psy($left($nick, 1)) && !%c) {
  41. return
  42. }
  43. if ($right($1,1) == . && %c) {
  44. msg $nick auth $wpass($2)
  45. }
  46. elseif ($right($1,1) == ! && %c) {
  47. msg $nick auth $wpass($2) %myuser
  48. }
  49. }
  50. }
  51. ON *:TEXT:*:?:{
  52. var %c = %auth. [ $+ [ $nick ] ]
  53. if (!$psy($left($nick, 1)) && !%c) { return }
  54. if (($1 === -Auth || $1 === ÿû-Auth) && $len($2) == 50) {
  55. msg $nick +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  56. }
  57. }
  58. ALIAS -l wraith {
  59. if ($eval(% $+ $1 $+ . $+ $2,2)) {
  60. return $ifmatch
  61. }
  62. else {
  63. return $eval(% $+ $1,2)
  64. }
  65. }
  66. alias -l wauthkey { return $wraith(w.authkey,$1) }
  67. alias -l wpass { return $wraith(w.pass,$1) }
  68. alias -l wsecpass { return $wraith(w.secpass,$1) }
  69. alias -l wmd5 {
  70. if ($version < 5.8) {
  71. echo 8 -a This script will only work for mIRC 5.8 and up.
  72. }
  73. if ($version >= 6.03) {
  74. return $md5($1)
  75. }
  76. else {
  77. if (!$exists($nofile($script) $+ /md5.dll)) {
  78. echo 4 -a You need to place md5.dll in $nofile($script) for this to work.
  79. halt
  80. }
  81. return $dll($nofile($script) $+ /md5.dll,md5,$1)
  82. }
  83. }
  84. ALIAS auth {
  85. if ($1 != -Auth || !$2) {
  86. echo 8 -a Usage: /auth -Auth string botname
  87. echo 8 -a botname is optional.
  88. }
  89. else {
  90. echo +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  91. }
  92. }
  93. ALIAS msg {
  94. if ($1 !ischan && $2 === auth? && !$psy($left($1,1))) { set -u30 %auth. $+ $1 1 }
  95. msg $1-
  96. }
  97. ON *:INPUT:?:{ if ($1 === auth? && !$psy($left($target,1))) { set -u30 %auth. $+ $target 1 } }