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

  1. /* 
  2.  
  3.   ICQRexxDemo.rexx - Gives the ARexx interface a test run.
  4.  
  5. */
  6.  
  7. address STRICQ.1
  8.  
  9. status all 'var=statii'  /* Grab the full list of available status' and store to the stem variable 'statii' */
  10.  
  11. offline = statii-1
  12.  
  13. say 'Offline = 'offline'; 'statii.offline
  14.  
  15. status 'set="'statii.0'"'  /* Go Online */
  16.  
  17. status get
  18.  
  19. say icqrc
  20.  
  21. do while icqrc ~= statii.0  /* Wait until server acknowledges the login */
  22.   call delay(50)
  23.   status get
  24.   say icqrc
  25. end
  26.  
  27. do i = 0 to statii-2  /* Cycle through all status' every four seconds */
  28.   say statii.i
  29.   status 'set="'statii.i'"'
  30.   call delay(200)
  31. end
  32.  
  33. status 'set='statii.0  /* Leave the script with the client in normal Online status */
  34.  
  35. getcontact 'uin=8083608' 'var=user'  /* Grab the author's userinfo */
  36.  
  37. if rc = 5 then say "Why don't you have Black Fire in your contact list?"  /* Chastise */
  38. else say '('user.uin') 'user.nick
  39.  
  40. getcontact total 'var=tot_users'  /* How many contacts in the list? */
  41.  
  42. do i = 0 to tot_users-1  /* Loop through all contacts in the list */
  43.   getcontact 'entry='i 'var=user'
  44.   say '('user.uin') 'user.nick' 'user.status
  45.   call delay(10)  /* Delay just a bit to let the client handle any incoming packets */
  46.   if upper(user.status) ~= upper(statii.offline) then do
  47.     sendmessage 'uin='user.uin 'msg="You have just been messaged by STRICQ''s SENDMESSAGE ARexx command."'
  48.     say 'Sent a message to 'user.nick' because he/she is online!'
  49.     call delay(10)
  50.   end
  51. end
  52.