home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1999 July / www_07_1999.iso / prez / amiga / stricq_1371.lha / stricq / rexx / ICQFileServer.rexx < prev    next >
OS/2 REXX Batch file  |  1999-04-25  |  1KB  |  59 lines

  1. /*
  2.  
  3.   ICQFileServer.rexx - A simple example of how to use STRICQ as a file server
  4.  
  5.   $VER: ICQFileServer.rexx v1.2 09.04.99 Copyright (C) 1999 Douglas F. McLaughlin
  6.  
  7.   Written By: Douglas F. McLaughlin 
  8.  
  9.   Note: Permission is granted to use this script in any form or make any modifications
  10.         as necessary.
  11.  
  12. */
  13.  
  14.  
  15. in = 'in'
  16.  
  17. path = 'DH0:STRICQ/Downloads/'
  18.  
  19. parse arg uin type file .
  20.  
  21. address STRICQ.1
  22.  
  23. getcontact 'UIN='uin 'VAR=USER'
  24.  
  25. if ~open(in,file,'r') then exit(10)
  26.  
  27. line = readln(in)
  28.  
  29. call close(in)
  30.  
  31. call delete(file)
  32.  
  33. if type ~= 1 then exit(0)
  34.  
  35. if upper(word(line,1)) = 'LIST' | upper(word(line,1)) = 'GET' then do
  36.   if user.ip = '0.0.0.0' then do
  37.     sendmessage 'UIN='uin 'MSG="Sorry, you are either not in my Contact List or are currently offline.  Your filerequest has been cancelled."'
  38.     exit(0)
  39.   end
  40. end
  41.  
  42. if upper(word(line,1)) = 'LIST' then do
  43.   address command 'list >T:FileList 'path' FILES LFORMAT="%-24N %7L %C"'
  44.   addfile 'FILE=T:FileList'
  45.   filedirect 'UIN='uin 'SPEED=100' 'DESC="Current Files Available"'
  46.   exit(0)
  47. end
  48.  
  49. if upper(word(line,1)) = 'GET' then do
  50.   file = path || subword(line,2)
  51.   addfile CLEAR
  52.   addfile 'FILE='file
  53.   desc = 'Here is the file you requested: 'subword(line,2)
  54.   filedirect 'UIN='uin 'SPEED=95' 'DESC="'desc'"'
  55.   exit(0)
  56. end
  57.  
  58. exit(0)
  59.