home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / PCLPACK.ZIP / NICE.ZIP / MACS.ZIP / DOWN.CTL < prev    next >
Encoding:
Text File  |  1992-09-02  |  5.2 KB  |  191 lines

  1.         *down
  2. SetActivity(Downloading Files)
  3. Display (Display\DOWN)
  4. setequal(b=)
  5. Enter
  6. Kill(Batch.%NODE%)
  7. if (%local%)=(TRUE) then setequal(b=1)
  8. if (%LOCAL%)=(TRUE) then goto (Pok)
  9. If (/PROTOCOL)=(N) Then Goto (PickProt)
  10. Display(Display\defuse)
  11. SetEqual(b=/:PROTOCOL/)
  12. Goto (pseled)
  13.  
  14.         *PickProt
  15. Display (Display\DN-PROTS)
  16. MenuAsk %MIN1% (&3&Which transfer protocol would you like to use?&11&(or Q to Quit)&12&: &15&*)
  17. Find(%RESP%,\)      ;make sure they didnt stick a backslash in there
  18. NotIf (%ARESP%)=(0) Then Goto (badprot)
  19. BigIf(h:phelp,q:filesback)
  20. SetEqual(b=%RESP%)
  21.         
  22.         *pseled
  23. Seek(protocol\%var%b-D.BT)    ;check to see If protocol exists..
  24. IfTrue(Goto (Pok))
  25.  
  26.         *badprot
  27. loadsub(control\macros\badsel.ctl)
  28. Goto (PickProt)  ;go back and ask again..
  29.         
  30.         *Pok
  31. Seek(tagged.%NODE%)   ;see If there are any tagged files..
  32. IfTrue(Goto (texist))
  33. linefeed(1)
  34. len(%var%b)   ;see If they picked a batch protocol
  35. NotIf(%ARESP%)=(1) Then loadmem(control\BATCH.CTL)
  36.         
  37.         *fname
  38. say(&3&Please enter the name of the file to download&12&: &14&(&F&12)&15&*)
  39. back(13)
  40. menuask%NOCR%%CRON%%LEN12%(*)
  41.   if (%RESP%)=(<CR>) then say()
  42.   if (%RESP%)=(<CR>) then Return
  43.   len(%Resp%)
  44.   back(%Aresp%)
  45. adddef(.%DEFEXT%)  
  46.   say(%Resp%&11&&CR&)
  47. say(Please wait!... We're searching for the file...*)
  48. Seekfall(%RESP%)
  49. If (%ARESP%)=(INVALID) Then Goto (invfn)  ;If invalid filename
  50. If (%ARESP%)=(No) Then Goto (nothere)
  51. If (%ARESP%)=(NOT ENOUGH) Then Goto (notenuf)
  52. If (%RATIO%)=(NOT OK) Then Goto (badratio)  ;If bad ratio...
  53. selFarea(%ARESP%)    ;set file area to where the file is...
  54. size(%FILPATH%%RESP%)
  55. say(Found!&CR&&CR&&14& ───────  &12&Statistics for %RESP% &14& ───────&15&)
  56. say(Free Download: &11&%FREE% &15&*)
  57. If (%FREE%)=(No) Then say( *)
  58. say(        Size: &11&%ARESP% &15&&CR&Dated: *)
  59. fdate(%FILPATH%%RESP%)   ;get file date
  60. say(&11&%ARESP% &15&         Transfer Time: *)
  61. size(%FILPATH%%RESP%)
  62. ttime(%ARESP%)
  63. say(&11&%ARESP%)
  64. cmpval(%TTIM%,/:LEFT/)
  65. If (%ARESP%)=(No) Then If (%FREE%)=(No) Then Goto (notenuftime)
  66. SetEqual(d=%RESP%)
  67. say(&CR&&3&       Would you like to download this file? &9&[   ]&14&*)
  68. back(4)
  69. yesnoask(*)
  70. If (%RESP%)=(No) Then Goto (ex)
  71. say(&3&Would you like us to log you off afterwards? &9&[   ]&14&*)
  72. back(4)
  73. yesnoask(*)
  74. SetEqual(m=%RESP%)
  75. say(&CR&&11&We're sending the file you requested. Please get ready to receive it now.)
  76. If (%LOCAL%)=(TRUE) Then Goto (lcl)
  77. fixfile(protocol\%var%b-d.bt,protocol\%var%b-d.bat)
  78. initclock
  79. exec(protocol\%var%b-d.BAT│)
  80. Kill(protocol\%var%b-d.bat)
  81.  
  82.         *success
  83. setequal(t=)
  84. NotIf (%ARESP%)=(0) Then Goto (aborted)
  85. notif (%LOCAL%)=(FALSE) then setequal(t=TOG)
  86. if (%LOCAL%)=(FALSE) then toglocal
  87. xfertime
  88. SetEqual(e=%ARESP%)
  89. multvar(%XMIN%*60=o)
  90. size(%FILPATH%%var%d)
  91. divvar(%ARESP%/%var%o=g)
  92. cnvtk(%ARESP%)
  93. addvar(%ARESP%+/:KDOWN/=o)
  94. SetEqual(/KDOWN=%var%o)
  95. say(%BEEP%*)
  96. log(--,%var%d Downloaded.)
  97. log(--,Rate: %var%g CPS)
  98. appendto(logs\DOWNLOAD.%NODE%,%var%d downloaded by %NAME% at %TIME% on %DATE%.)
  99. SetEqual(a=/:DOWNLOADS/)
  100. inc(a)
  101. SetEqual(/DOWNLOADS=%var%a)
  102. notif (%var%t)=(TOG) then toglocal
  103. eline(20)
  104. Display (Display\SUCCESS)
  105. If (%FREE%)=(Yes) Then Goto (free)
  106. If (&m)=(Yes) Then Goto (autooff)
  107.         
  108.         *ex
  109. selfarea(/:LASTDOWN/)
  110. linefeed(1)
  111. return
  112.         
  113.         *aborted
  114. eline(20)
  115. log(--,Download of %var%d aborted.)
  116. display(display\aborted)
  117. goto (ex)
  118.  
  119.         *lcl
  120. menuask(&CR&&3&Please specify the path &11&(e.g. C:\DLS\)&3& for this file&12&: &15&*)
  121. setequal(k=10)
  122. initclock
  123. fcopy (%FILPATH%%var%d,%RESP%\%var%d)
  124. notif (%ARESP%)=(0) then goto (aborted)
  125. goto (success)
  126.         
  127.         *badratio
  128. Display(Display\BADRATIO)
  129. selfarea(/:LASTDOWN/)
  130. linefeed(1)
  131. return
  132.  
  133.         *autooff
  134. loadmem(control\AutoOff.ctl)
  135.  
  136.         *free
  137. log(--,Freefile downloaded, time refunded.)
  138. size(%var%d)
  139. ttime(%ARESP%)
  140. addvar(%TTIM%+/:LEFT/=t)
  141. SetEqual(/LEFT=%var%t)
  142. If (&m)=(Yes) Then Goto (autooff)
  143. Goto (ex)
  144.         
  145.         *texist
  146. len(%var%b)
  147. If (%ARESP%)=(1) Then Goto (len1)
  148. say(&CR&&14&Files Currently Tagged:)
  149. lview(tagged.%NODE%,10,7)
  150. say(&CR&&3&Would you like to download the tagged files? &9&[   ]&14&*)
  151. back(4)
  152. yesnoask(*)
  153. say(&14&)
  154. If (%RESP%)=(No) Then loadmem(control\BATCH.CTL,Goto (startbatch))
  155. say(Adding Tagged files to Batch...*)
  156. fcopy(tagged2.%NODE%,batch.%NODE%)
  157. lines(batch.%NODE%)
  158. SetEqual(m=0)
  159. SetEqual(w=%ARESP%)
  160. say(Done!&CR&)
  161. loadmem(control\BATCH.CTL,Goto (fname))
  162.         *len1
  163. say(&10&&CR&You have tagged files but they can only be downloaded with a BATCH)
  164. say(protocol.  Please press &11&Enter&10& now to abort then choose a dIfferent protocol)
  165. say(if you'd like to download your tagged files.&CR&)
  166. Goto (fname)
  167.         *notenuftime
  168. Display(Display\NODLTIME)
  169. return
  170.         *phelp
  171. Display(Display\help\prot,/:SEC/)
  172. Goto (PickProt)
  173.         *invfn
  174. Display(Display\INVALID)
  175. flushout
  176. selfarea(/:LASTDOWN/)
  177. Enter
  178. goto (fname)
  179.         *filesback
  180. return
  181.         *notenuf
  182. Display (Display\fbadsec)
  183. selfarea(/:LASTDOWN/)
  184. return        
  185.         *NotHere
  186. Display(Display\notfnd)
  187. goto (fname)
  188.         *moveerr
  189. say(&CR&&14&The directory you specify is where the file already resides!&CR&)
  190. goto (endmove)
  191.