wraith.mrc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. echo -a Use a . in place of a param if you do not have one set yet. (pass excluded)
  11. }
  12. else {
  13. if ($4) {
  14. set %w.pass. $+ $4 $1
  15. if ($2 != .) {
  16. set %w.secpass. $+ $4 $2
  17. }
  18. else {
  19. set %w.secpass. $+ $4
  20. }
  21. if ($3 != .) {
  22. set %w.authkey. $+ $4 $3
  23. }
  24. else {
  25. set %w.authkey. $+ $4
  26. }
  27. }
  28. else {
  29. set %w.pass $1
  30. if ($2 != .) {
  31. set %w.secpass $2
  32. }
  33. else {
  34. set %w.secpass
  35. }
  36. if ($3 != .) {
  37. set %w.authkey $3
  38. }
  39. else {
  40. set %w.authkey
  41. }
  42. }
  43. echo -a set!
  44. }
  45. }
  46. ALIAS -l psy {
  47. if ($1 == $chr(40) || $1 == $chr(41)) {
  48. return 1
  49. }
  50. }
  51. ON *:CHAT:*:{
  52. var %c = %auth. [ $+ [ $nick ] ]
  53. if (($1 === -Auth || $1 === ÿû-Auth) && $len($2) == 50) {
  54. msg =$nick +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  55. }
  56. }
  57. ON *:TEXT:auth*:?:{
  58. var %c = %auth. [ $+ [ $nick ] ]
  59. if (!$3) {
  60. ;if this is a MSG not psybnc DCC, and we arent cleared to auth with them, IGNORE.
  61. if (!$psy($left($nick, 1)) && !%c) {
  62. return
  63. }
  64. if ($right($1,1) == . && %c) {
  65. msg $nick auth $wpass($2)
  66. }
  67. elseif ($right($1,1) == ! && %c) {
  68. msg $nick auth $wpass($2) %myuser
  69. }
  70. }
  71. }
  72. ON *:TEXT:*:?:{
  73. var %c = %auth. [ $+ [ $nick ] ]
  74. if (!$psy($left($nick, 1)) && !%c) { return }
  75. if (($1 === -Auth || $1 === ÿû-Auth) && $len($2) == 50) {
  76. msg $nick +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  77. }
  78. }
  79. ALIAS -l wraith {
  80. if ($eval(% $+ $1 $+ . $+ $2,2) || $var($eval(% $+ $1 $+ . $+ $2,1))) {
  81. return $eval(% $+ $1 $+ . $+ $2,2)
  82. }
  83. else {
  84. return $eval(% $+ $1,2)
  85. }
  86. }
  87. alias -l wauthkey { return $wraith(w.authkey,$1) }
  88. alias -l wpass { return $wraith(w.pass,$1) }
  89. alias -l wsecpass { return $wraith(w.secpass,$1) }
  90. alias -l wmd5 {
  91. if ($version < 5.8) {
  92. echo 8 -a This script will only work for mIRC 5.8 and up.
  93. }
  94. if ($version >= 6.03) {
  95. return $md5($1)
  96. }
  97. else {
  98. if (!$exists($nofile($script) $+ /md5.dll)) {
  99. echo 4 -a You need to place md5.dll in $nofile($script) for this to work.
  100. halt
  101. }
  102. return $dll($nofile($script) $+ /md5.dll,md5,$1)
  103. }
  104. }
  105. ALIAS auth {
  106. if ($1 != -Auth || !$2) {
  107. echo 8 -a Usage: /auth -Auth string botname
  108. echo 8 -a botname is optional.
  109. }
  110. else {
  111. echo +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  112. }
  113. }
  114. ALIAS msg {
  115. if ($1 !ischan && $2 === auth? && !$psy($left($1,1))) { set -u30 %auth. $+ $1 1 }
  116. msg $1-
  117. }
  118. ON *:INPUT:?:{ if ($1 === auth? && !$psy($left($target,1))) { set -u30 %auth. $+ $target 1 } }