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

  1. /* this will calculate a cost of call so far price by asking 4D what the */
  2. /* time left of the user is, what thier time-per-call is, and subtarcting */
  3. /* two two. Then multplying by a defined cost. */
  4.  
  5. /* call this script from 4d like:    t:c A Rexx:4DCost.Rexx    */
  6.  
  7. options results
  8.  
  9. COST_PER_MINUTE=.75
  10.  
  11. /* lets make sure 4D is running.... :) */
  12.  
  13.  
  14. if ~show(p, '4D-BBS0') then
  15.     do
  16.     say '4D-BBS ARexx Port Not Found...'
  17.     exit
  18.     end
  19.  
  20.  
  21. /* send all our commands by default to 4D */
  22.  
  23. address '4D-BBS0'
  24.  
  25. /* get the info that we need. */
  26. /* note: Most arexx commands return the info in RESULT. I made these */
  27. /* special.  use same parameter with 'systeminfo' command to get results */
  28. /* in the RESULT string as a STRING, not numeric. */
  29.  
  30. 'userinfo' 'n'
  31. usertime=RC
  32. say RESULT
  33.  
  34. 'message' 'You Are allowed' usertime 'minutes per call.'
  35.  
  36. 'userinfo' 'm'
  37. timeleft=RC
  38. say RESULT
  39.  
  40. 'message' 'You Have' usertime 'minutes left this call.'
  41.  
  42. timesofar=usertime-timeleft
  43.  
  44. 'message' 'You have been on-line for ' usertime 'minutes.'
  45.  
  46. cost=timesofar*COST_PER_MINUTE
  47.  
  48. 'message' ' '
  49. 'message' ' '
  50. 'message' ' '
  51.  
  52. 'message' 'This Call so Far Will Cost $' cost
  53.  
  54. 'message' ' '
  55. 'message' ' '
  56.  
  57.  
  58. /* tell 4D we're done */
  59.  
  60. 'exit'
  61.  
  62. exit
  63.  
  64.