home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / hacking / internet / mailfile.irc < prev    next >
Encoding:
Text File  |  2001-02-10  |  1.2 KB  |  54 lines

  1. # This script simply checks for and grabs the address of any nickname and
  2. # mails them a file using Mail.  It is configurable for other mailers.
  3. # Jake [WinterHawk] Khuon, 25 Nov 93
  4. # Special thanks to CyberMage for netcheck and the basis for mailfile
  5. #
  6. #       Usage: /MAILFILE <nick> <file> [<subject>]
  7.  
  8.  
  9. # This checks for and gets the LUSER's address
  10. alias netcheck
  11. {
  12.    userhost $0
  13.    wait
  14.    if (userhost)
  15.    {
  16.       @ function_return = 1
  17.    }
  18.    {
  19.       whowas $0
  20.       wait
  21.       if (userhost)
  22.       {
  23.          @ function_return = 1
  24.       }
  25.       {
  26.          @ function_return = 0
  27.       }
  28.    }
  29. }
  30.  
  31. # Mails the file
  32. alias mailfile
  33. {
  34.    if ([$0])
  35.    {
  36.       @ idctr = 1
  37.       if (netcheck($0))
  38.       {
  39.          if (rmatch($userhost ~%@%))
  40.          {
  41.             echo [MAIL] >>> MAILING $1 TO <$nick!$strip(~ $userhost)> WITH Sub
  42. ject: $2- <<<
  43. # Change the following line to accept your favorite mailer.  Default is Mail.
  44.             exec Mail -s "$2-" $strip(~ $userhost) < $1
  45.             restore
  46.          }
  47.       }
  48.       {
  49.          echo [NETCHECK] >>> <$0> IS NOT CURRENTLY ON THE NET <<<
  50.          restore
  51.       }
  52.    }
  53. }
  54.