home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / comm / bbs / 4d-bbsdemo / arexx / 4dwhoson.rexx < prev   
OS/2 REXX Batch file  |  1993-12-28  |  4KB  |  177 lines

  1. /*    WhosOn4D.Rexx                  Copyright 1993 © CornerStone Software
  2.  *                                   Written By Dale E. Reed Jr.
  3.  *                                   All Rights Reserved
  4.  *
  5.  *  This program simply shows who is on the other lines of 4D.
  6.  *  It does this by checking for port names from the base name to
  7.  *  the base name +"16".
  8.  *
  9.  */
  10.  
  11. options results
  12.  
  13. ARG port stdio
  14.  
  15. IF length(port)=0 THEN
  16.     port = '4D-BBS0'
  17.  
  18. basename=port
  19. users=0
  20.  
  21. if datatype( right(basename,1)) = NUM then
  22.     basename=left(basename, length(basename)-1)
  23.  
  24. if datatype( right(basename,1)) = NUM then
  25.     basename=left(basename, length(basename)-1)
  26.  
  27.  
  28. address VALUE port
  29.  
  30. call sas( ' ')
  31. call sas( 'Node      User Name            Baud    Status' )
  32. call sas( '--------  -------------------  ------  -------------------------------' )
  33.  
  34.  
  35. if show(p, "TrapDoor") then
  36.     do
  37.     
  38.     address VALUE port
  39.     if ~show(p, "4D-BBS0") then 
  40.         call sas( 'TrapDoor                       57600   Waiting for a call')
  41.         
  42.     else
  43.         call sas( 'TrapDoor                       57600   Spawning 4D-BBS Node 0')
  44.         
  45.     end
  46.  
  47. do numb=0 to 9
  48.     
  49.     portname=basename||numb
  50.  
  51.     if show(p, portname) then
  52.         do
  53.         address VALUE portname
  54.  
  55.         first = ' '
  56.         if portname = port then
  57.             do
  58.             first = '*'
  59.             st=254 
  60.             end
  61.         else do
  62.             'systemstatus' 0
  63.             st=RESULT
  64.             end
  65.             
  66.         'userinfo' 'A'
  67.         name=RESULT
  68.  
  69.         'baud' '0'
  70.         ubaud=RESULT
  71.         if ubaud = 0 then
  72.             ubaud='LOCAL'
  73.  
  74.         call getdo(st)
  75.         whatdo = RESULT
  76.  
  77.         bigstr = left(portname, 9, ' ') || first || left(name, 21, ' ') || left(ubaud, 8, ' ') || whatdo
  78.  
  79.         address VALUE port
  80.         call sas( bigstr )
  81.         if  st ~=8 then
  82.             users=users+1
  83.         end
  84.     
  85.     end
  86.  
  87.  
  88. call sas( ' ' )
  89.  
  90. if(users~=0) then
  91.     bigstr = ' Users On-line: ' users
  92. else
  93.     bigstr = ' There is no users on-line'
  94.  
  95. call sas (bigstr)
  96. call sas( ' ' )
  97.  
  98. IF stdio = '' then
  99.     shutdown
  100. exit
  101.  
  102.  
  103. getdo:
  104.  
  105. parse arg s
  106.  
  107. select
  108.  
  109.     when s=0    then t='Just starting up'
  110.     when s=1    then t='Posting a Message'
  111.     when s=2    then t='Reading a Message'
  112.     when s=3    then t='In CHAT with sysop'
  113.     when s=4    then t='Adding BBS to list'
  114.     when s=5    then t='Running standard Door'
  115.     when s=6    then t='Running Editor Via Door'
  116.     when s=7    then t='Viewing Bulletins'
  117.     when s=8    then t='Waiting for a call'
  118.     when s=9    then t='Full Logon'
  119.     when s=10 then t='Shutting down the system'
  120.     when s=11 then t='At Menu Prompt'
  121.     when s=12 then t='Viewing Userlist'
  122.     when s=13 then t='Searching for a user'
  123.     when s=14 then t='Executing Dos Command'
  124.     when s=15 then t='Running a FIFO Door'
  125.     when s=16 then t='Logging Off of BBS'
  126.     when s=17 then t='Running an Arexx Program'
  127.     when s=18 then t='Reading Personal Mail'
  128.     when s=19 then t='Uploading'
  129.     when s=20 then t='Downloading'
  130.     when s=21 then t='Listing Download Sections'
  131.     when s=22 then t='Viewing File Lists'
  132.     when s=23 then t='No Logon Yet, BUT connected'
  133.     when s=24 then t='Registering as a New User'
  134.     when s=25 then t='Editing User Options'
  135.     when s=26 then t='Reading Internet Mail'
  136.     when s=27 then t='Running an Editor'
  137.     when s=28 then t='Listing Message Base Boards'
  138.     when s=29 then t='Changing MBase Area'
  139.     when s=30 then t='Changing File Transfer Area'
  140.     when s=31 then t='Reading a Message'
  141.     when s=32 then t='Posting a Message'
  142.     when s=33 then t='Scanning Messages'
  143.     when s=34 then t='Paging the Sysop'
  144.     when s=35 then t='Editing Macros'
  145.     when s=36 then t='Editing Masks'
  146.     when s=37 then t='Entering a File Description'
  147.     when s=38 then t='Entering File Name to Download'
  148.  
  149.  
  150.     when s=80 then t='Multi User Chatting'
  151.  
  152.     /* this ISN'T a 4D option, and only used here */
  153.  
  154.     when s=254 then t='Spying on Other Users'
  155.  
  156.     otherwise t='Nothing...Just Sitting There!'
  157.     end
  158.  
  159. return t
  160.  
  161.  
  162. /* this routine will handle printing to either the arexx port or */
  163. /* to this local stdio if the port name was "STDIO" */
  164.  
  165.  
  166. sas:
  167.  
  168. parse arg op
  169.  
  170. IF stdio ~= '' then
  171.     say op
  172.  
  173. else
  174.     transmit op
  175.  
  176. return
  177.