wraith.mrc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. ON *:LOAD:{
  2. echo -a Wraith authorization script, for mIRC 5.8 and up, by bryan loaded (MSG/DCC/Psybnc support).
  3. helpauth
  4. }
  5. alias helpauth {
  6. echo -a Type /setauth
  7. echo -a /auth -Auth string <botnick> <- That will return the md5 hash. (use for telnet possibly)
  8. echo -a /showauth [botnick] will show what settings will be used.
  9. }
  10. alias setauth {
  11. if (!$3) {
  12. echo -a usage: /setauth password secpass authkey <botnick>
  13. echo -a <botnick> is optional if the authkey specified is for that bot only...
  14. echo -a Use a . in place of a param if you do not have one set yet. (pass excluded)
  15. }
  16. else {
  17. if ($4) {
  18. set %w.pass. $+ $4 $1
  19. if ($2 != .) {
  20. set %w.secpass. $+ $4 $2
  21. }
  22. else {
  23. set %w.secpass. $+ $4
  24. }
  25. if ($3 != .) {
  26. set %w.authkey. $+ $4 $3
  27. }
  28. else {
  29. set %w.authkey. $+ $4
  30. }
  31. }
  32. else {
  33. set %w.pass $1
  34. if ($2 != .) {
  35. set %w.secpass $2
  36. }
  37. else {
  38. set %w.secpass
  39. }
  40. if ($3 != .) {
  41. set %w.authkey $3
  42. }
  43. else {
  44. set %w.authkey
  45. }
  46. }
  47. echo -a set!
  48. }
  49. }
  50. ALIAS showauth {
  51. if ($1) {
  52. var %s ( $+ $1 $+ )
  53. }
  54. echo -a %s PASS: $wpass($1) :: SECPASS: $wsecpass($1) :: AUTHKEY: $wauthkey($1)
  55. }
  56. ALIAS -l psy {
  57. if ($1 == $chr(40) || $1 == $chr(41)) {
  58. return 1
  59. }
  60. }
  61. ON *:CHAT:*:{
  62. var %c = %auth. [ $+ [ $nick ] ]
  63. if (($1 === -Auth || $1 === ÿû-Auth) && $len($2) == 50) {
  64. msg =$nick +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  65. }
  66. }
  67. ON *:TEXT:auth*:?:{
  68. var %c = %auth. [ $+ [ $nick ] ]
  69. if (!$3) {
  70. ;if this is a MSG not psybnc DCC, and we arent cleared to auth with them, IGNORE.
  71. if (!$psy($left($nick, 1)) && !%c) {
  72. return
  73. }
  74. if ($right($1,1) == . && %c) {
  75. msg $nick auth $wpass($2)
  76. }
  77. elseif ($right($1,1) == ! && %c) {
  78. msg $nick auth $wpass($2) %myuser
  79. }
  80. }
  81. }
  82. ON *:TEXT:*:?:{
  83. var %c = %auth. [ $+ [ $nick ] ]
  84. if (!$psy($left($nick, 1)) && !%c) { return }
  85. if (($1 === -Auth || $1 === ÿû-Auth) && $len($2) == 50) {
  86. msg $nick +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  87. }
  88. }
  89. ALIAS -l wraith {
  90. if ($eval(% $+ $1 $+ . $+ $2,2) || $var($eval(% $+ $1 $+ . $+ $2,1))) {
  91. return $eval(% $+ $1 $+ . $+ $2,2)
  92. }
  93. else {
  94. return $eval(% $+ $1,2)
  95. }
  96. }
  97. alias wauthkey { return $wraith(w.authkey,$1) }
  98. alias wpass { return $wraith(w.pass,$1) }
  99. alias wsecpass { return $wraith(w.secpass,$1) }
  100. alias wmd5 {
  101. if ($version < 5.8) {
  102. echo 8 -a This script will only work for mIRC 5.8 and up.
  103. }
  104. if ($version >= 6.03) {
  105. return $md5($1)
  106. }
  107. else {
  108. if (!$exists($nofile($script) $+ /md5.dll)) {
  109. echo 4 -a You need to place md5.dll in $nofile($script) for this to work.
  110. halt
  111. }
  112. return $dll($nofile($script) $+ /md5.dll,md5,$1)
  113. }
  114. }
  115. ALIAS auth {
  116. ; stupid ircn.
  117. if ($gettok($1-, 0, 160) > $gettok($1-, 0, 32)) {
  118. tokenize 160 $1-
  119. }
  120. if ($1 != -Auth || !$2) {
  121. echo 8 -a Usage: /auth -Auth string botname
  122. echo 8 -a botname is optional.
  123. }
  124. else {
  125. echo +Auth $wmd5($2 $+ $wsecpass($3) $+ $wauthkey($3))
  126. }
  127. }
  128. ALIAS msg {
  129. if ($1 !ischan && $2 === auth? && !$psy($left($1,1))) { set -u30 %auth. $+ $1 1 }
  130. msg $1-
  131. }
  132. ON *:INPUT:?:{ if ($1 === auth? && !$psy($left($target,1))) { set -u30 %auth. $+ $target 1 } }