home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / polminet / marek_jabîoïski / thortilla / thortilla.thor < prev   
Text File  |  1997-07-05  |  4KB  |  149 lines

  1. /*
  2. ** thortilla.thor by Marek Jablonski <mjab2@polbox.com>
  3. */
  4.  
  5. OPTIONS RESULTS
  6. thorport = address()
  7. if left(thorport,5) ~= 'THOR.' then do
  8.     say 'THORtilla must be run from within Thor.'
  9.     end
  10.  
  11. address(thorport)
  12. CURRENTSYSTEM TEM
  13.  
  14. ISSTARTUPWINDOW
  15. if rc = '0' then do
  16. REQUESTNOTIFY TEXT '"Enter the system first!"' BT '"_OK"'
  17. exit
  18. end
  19.  
  20. do i = 0 to 23
  21. z.i = 0
  22. x.i = 0
  23. end
  24. p.0 = '  Sun '
  25. p.1 = '  Mon '
  26. p.2 = '  Tue '
  27. p.3 = '  Wed '
  28. p.4 = '  Thu '
  29. p.5 = '  Fri '
  30. p.6 = '  Sat '
  31. maks = 0
  32. maksw = 0
  33. ile2 = 0
  34.  
  35. bnam = TEM.BBSNAME
  36.  
  37. if ~show('p', 'BBSREAD') then do
  38.  address command
  39.   "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  40.   "WaitForPort BBSREAD"
  41. end
  42.  
  43. address BBSREAD
  44.  
  45. GETCONFLIST bbsname '"'bnam'"' stem conflist
  46. konfy = conflist.count
  47.  
  48. address(thorport)
  49. REQUESTNOTIFY TEXT '"Process given conference or entire system?"' BT '"_CONFERENCE|_SYSTEM"'
  50. if(result = 1) then konfy = 1
  51.  
  52. if konfy = 1 then do
  53. REQUESTLIST instem conflist outstem SELECTED MULTISELECT DRAGSELECT title '"Select conference"'
  54. if(rc ~= 0) then exit
  55. cnam = SELECTED.1
  56. end
  57. /* ---------------------------------------------------------- */
  58. OPENPROGRESS TITLE '"'bnam'"' AT '"_Abort"' PCW 20
  59. if(rc = 0) then
  60. do
  61.     window = result
  62. end
  63. /* ---------------------------------------------------------- */
  64. do cf = 1 to konfy
  65. if konfy ~= 1 then cnam = conflist.cf
  66. address BBSREAD
  67. GETCONFDATA bbsname '"'bnam'"' confname '"'cnam'"' stem CONFDATA
  68. first = CONFDATA.FIRSTMSG
  69. last = CONFDATA.LASTMSG
  70. ile = last - first
  71. if (ile ~= 0) then do
  72. /* -------------------------------------------------------------- */
  73. address(thorport)
  74. UPDATEPROGRESS REQ window TOTAL ile CURRENT 1 PT '"'cnam'"'
  75. /* -------------------------------------------------------------- */
  76. do msgno = first to last
  77. curr = ile - (last - msgno)
  78. /*----------------------------------------------------------------- */
  79. address(thorport)
  80. UPDATEPROGRESS REQ window CURRENT curr
  81. if(rc ~= 0) then do
  82.     CLOSEPROGRESS REQ window
  83.     exit
  84. end
  85. /* ---------------------------------------------------------------- */
  86. address BBSREAD
  87. READBRMESSAGE bbsname '"'bnam'"' confname '"'cnam'"' msgnr msgno headstem HEAD
  88.  
  89. sekundy = HEAD.CREATIONDATE
  90. AMIGA2DATE sekundy XXX
  91. pibi = XXX.HOUR
  92. wibi = XXX.WDAY
  93. z.pibi = z.pibi + 1
  94. x.wibi = x.wibi + 1
  95. if z.pibi > maks then maks = z.pibi
  96. if x.wibi > maksw then maksw = x.wibi
  97. end
  98. ile2 = ile2 + ile
  99. CALL open out,"T:Area.stats",write
  100. ze = '0'
  101. end
  102. end
  103. /* -------------------------------------------------------------- */
  104. address(thorport)
  105. CLOSEPROGRESS REQ window
  106. /* -------------------------------------------------------------- */
  107. if konfy ~= 1 then cnam = 'all conferences'
  108. CALL WRITELN out, '*System:* 'bnam' *Conference:* 'cnam
  109. CALL WRITELN out, '--'
  110. CALL WRITELN out, ' Hours:              number of msgs written:'
  111. CALL WRITELN out, '--'
  112. scal = maks / 60
  113.  
  114. do i = 0 to 23
  115. hasz = '#' /* change it to '' if you want your stat to look good on mailers than does not support styles */
  116. bl = ''
  117. xx = trunc(z.i / scal)
  118. do j = 0 to xx
  119. if j > 0 then bl = bl || '-'
  120. end
  121. zero = i + 1
  122. if zero > 9 then ze = ''
  123. if bl = '' then hasz = ''
  124. if i < 10 then CALL WRITELN out, ' 0'i'-'ze || i+1' 'hasz || bl || hasz z.i
  125. else CALL WRITELN out, ' 'i'-'i+1' 'hasz || bl || hasz z.i
  126. end
  127. CALL WRITELN out, '--'
  128. CALL WRITELN OUT, ' Days:'
  129. CALL WRITELN out, '--'
  130. scal = maksw / 60
  131. do i = 0 to 6
  132. hasz = '#'
  133. bl = ''
  134. xx = trunc(x.i / scal)
  135. do j = 0 to xx
  136. if j > 0 then bl = bl || '-'
  137. end j
  138. if bl = '' then hasz = ''
  139. CALL WRITELN out, p.i hasz || bl || hasz x.i
  140. end i
  141. call writeln out, ''
  142. call writeln out, '--'
  143. call writeln out, ' 'ile2 'messages processed. Only mailto:mjab2@polbox.com makes it possible ;)'
  144. call writeln out, '--'
  145. call close out
  146.  
  147. PUTCLIP FILE 't:area.stats'
  148. SHOWTEXT FILE 't:area.stats'
  149.