home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / PCLPACK.ZIP / COMP.ZIP / DOWN.CTL < prev    next >
Encoding:
Text File  |  1993-04-08  |  8.1 KB  |  336 lines

  1.         *down
  2. SetActivity(Downloading Files)
  3. If(^:1^)=() then Display (Display\DOWN)
  4. setequal(b=)
  5. If(^:1^)=() then Enter
  6. NotIf(%LOCAL%)=(TRUE) then 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. Jump(ST_Check)
  16. Display (Display\DN-PROTS)
  17. MenuAsk %MIN1% (&3&Which transfer protocol would you like to use?&11&(or Q to Quit)&12&: &15&*)
  18. *COMMAND
  19. Find(%RESP%,\)      ;make sure they didnt stick a backslash in there
  20. NotIf (%ARESP%)=(0) Then Goto (badprot)
  21. BigIf(h:phelp,q:filesback)
  22. SetEqual(b=%RESP%)
  23.  
  24.         
  25.         *pseled
  26. Seek(protocol\%var%b-D.BT)    ;check to see If protocol exists..
  27. IfTrue(Goto (Pok))
  28.  
  29.         *badprot
  30. loadsub(control\macros\badsel.ctl)
  31. Goto (PickProt)  ;go back and ask again..
  32.         
  33.         *Pok
  34. Seek(tagged.%NODE%)   ;see If there are any tagged files..
  35. ;IfTrue(Goto (texist))
  36. IfTrue(LoadSub(control\macros\ltagged.ctl))
  37. linefeed(1)
  38. len(%var%b)   ;see If they picked a batch protocol
  39. NotIf(%ARESP%)=(1) Then loadmem(control\BATCH.CTL)
  40. If(%BAUD%)=(LOCAL) then Loadmem(control\LBATCH.CTL)
  41.         
  42.         *fname
  43. Jump(ST_Check2)
  44. say(&3&Please enter the name of the file to download&12&: &14&(&F&12)&15&*)
  45. back(13)
  46. menuask%NOCR%%CRON%%LEN12%(*)
  47.   *COMMAND2
  48.   if (%RESP%)=(<CR>) then say()
  49.   if (%RESP%)=(<CR>) then Return
  50.   len(%Resp%)
  51.   back(%Aresp%)
  52. adddef(.%DEFEXT%)  
  53.   say(%Resp%&11&&CR&)
  54. say(Please wait!... We're searching for the file...*)
  55. Seekfall(%RESP%)
  56. If (%ARESP%)=(INVALID) Then Goto (invfn)  ;If invalid filename
  57. If (%ARESP%)=(No) Then Goto (nothere)
  58. If (%ARESP%)=(NOT ENOUGH) Then Goto (notenuf)
  59. If (%RATIO%)=(NOT OK) Then Goto (badratio)  ;If bad ratio...
  60. selFarea(%ARESP%)    ;set file area to where the file is...
  61. size(%FILPATH%%RESP%)
  62. say(Found!&CR&&CR&&14& ───────  &12&Statistics for %RESP% &14& ───────&15&)
  63. say(Free Download: &11&%FREE% &15&*)
  64. If (%FREE%)=(No) Then say( *)
  65. say(        Size: &11&%ARESP% &15&&CR&Dated: *)
  66. fdate(%FILPATH%%RESP%)   ;get file date
  67. say(&11&%ARESP% &15&         Transfer Time: *)
  68. size(%FILPATH%%RESP%)
  69. ttime(%ARESP%)
  70. say(&11&%ARESP%)
  71. cmpval(%TTIM%,/:LEFT/)
  72. If (%ARESP%)=(No) Then If (%FREE%)=(No) Then Goto (notenuftime)
  73. SetEqual(d=%RESP%)
  74. Jump(ST_Check3)
  75. *Question1
  76. say(&CR&&3&       Would you like to download this file? &9&[   ]&14&*)
  77. back(4)
  78. yesnoask(*)
  79. *COMMAND3
  80. If (%RESP%)=(No) Then Goto (ex)
  81. Jump(ST_Check4)
  82. *Question2
  83. say(&3&Would you like us to log you off afterwards? &9&[   ]&14&*)
  84. back(4)
  85. yesnoask(*)
  86. *COMMAND4
  87. SetEqual(m=%RESP%)
  88. say(&CR&&11&We're sending the file you requested. Please get ready to receive it now.)
  89. If (%LOCAL%)=(TRUE) Then Goto (lcl)
  90. fixfile(protocol\%var%b-d.bt,protocol\%var%b-d.bat)
  91. initclock
  92. exec(protocol\%var%b-d.BAT│)
  93. Kill(protocol\%var%b-d.bat)
  94.  
  95.         *success
  96. setequal(t=)
  97. NotIf (%ARESP%)=(0) Then Goto (aborted)
  98. notif (%LOCAL%)=(FALSE) then setequal(t=TOG)
  99. if (%LOCAL%)=(FALSE) then toglocal
  100. xfertime
  101. SetEqual(e=%ARESP%)
  102. multvar(%XMIN%*60=o)
  103. size(%FILPATH%%var%d)
  104. divvar(%ARESP%/%var%o=g)
  105. cnvtk(%ARESP%)
  106. addvar(%ARESP%+/:KDOWN/=o)
  107. SetEqual(/KDOWN=%var%o)
  108. say(%BEEP%*)
  109. log(--,%var%d Downloaded.)
  110. log(--,Rate: %var%g CPS)
  111. appendto(logs\DOWNLOAD.%NODE%,%var%d downloaded by %NAME% at %TIME% on %DATE%.)
  112. SetEqual(a=/:DOWNLOADS/)
  113. inc(a)
  114. SetEqual(/DOWNLOADS=%var%a)
  115. notif (%var%t)=(TOG) then toglocal
  116. eline(20)
  117. Display (Display\SUCCESS)
  118. If (%FREE%)=(Yes) Then Goto (free)
  119. If (&m)=(Yes) Then Goto (autooff)
  120.         
  121.         *ex
  122. selfarea(/:LASTDOWN/)
  123. linefeed(1)
  124. return
  125.         
  126.         *aborted
  127. eline(20)
  128. log(--,Download of %var%d aborted.)
  129. display(display\aborted)
  130. goto (ex)
  131.  
  132.         *lcl
  133. menuask(&CR&&3&Please specify the path &11&(e.g. C:\DLS\)&3& for this file&12&: &15&*)
  134. setequal(k=10)
  135. initclock
  136. fcopy (%FILPATH%%var%d,%RESP%\%var%d)
  137. notif (%ARESP%)=(0) then goto (aborted)
  138. goto (success)
  139.         
  140.         *badratio
  141. Display(Display\BADRATIO)
  142. selfarea(/:LASTDOWN/)
  143. linefeed(1)
  144. return
  145.  
  146.         *autooff
  147. loadmem(control\AutoOff.ctl)
  148.  
  149.         *free
  150. log(--,Freefile downloaded, time refunded.)
  151. size(%var%d)
  152. ttime(%ARESP%)
  153. addvar(%TTIM%+/:LEFT/=t)
  154. SetEqual(/LEFT=%var%t)
  155. If (&m)=(Yes) Then Goto (autooff)
  156. Goto (ex)
  157.         
  158.         *texist
  159. len(%var%b)
  160. If (%ARESP%)=(1) Then Goto (len1)
  161. say(&CR&&14&Files Currently Tagged:)
  162. lview(tagged.%NODE%,10,7)
  163. Jump(ST_Check5)
  164. *Question3
  165. say(&CR&&3&Would you like to download the tagged files? &9&[   ]&14&*)
  166. back(4)
  167. yesnoask(*)
  168. say(&14&)
  169. *COMMAND5
  170. If (%RESP%)=(No) Then loadmem(control\BATCH.CTL,Goto (startbatch))
  171. say(Adding Tagged files to Batch...*)
  172. fcopy(tagged2.%NODE%,batch.%NODE%)
  173. lines(batch.%NODE%)
  174. SetEqual(m=0)
  175. SetEqual(w=%ARESP%)
  176. say(Done!&CR&)
  177. loadmem(control\BATCH.CTL,Goto (fname))
  178.         *len1
  179. say(&10&&CR&You have tagged files but they can only be downloaded with a BATCH)
  180. say(protocol.  Please press &11&Enter&10& now to abort then choose a dIfferent protocol)
  181. say(if you'd like to download your tagged files.&CR&)
  182. Goto (fname)
  183.         *notenuftime
  184. Display(Display\NODLTIME)
  185. return
  186.         *phelp
  187. Display(Display\help\prot,/:SEC/)
  188. Goto (PickProt)
  189.         *invfn
  190. Display(Display\INVALID)
  191. flushout
  192. selfarea(/:LASTDOWN/)
  193. Enter
  194. goto (fname)
  195.         *filesback
  196. return
  197.         *notenuf
  198. Display (Display\fbadsec)
  199. selfarea(/:LASTDOWN/)
  200. return        
  201.         *NotHere
  202. Display(Display\notfnd)
  203. goto (fname)
  204.         *moveerr
  205. say(&CR&&14&The directory you specify is where the file already resides!&CR&)
  206. goto (endmove)
  207.  
  208. *C_CHECK
  209. SetEqual(z=;)
  210. ;Z will be search character (' ' or ';')
  211. Find(%RESP%,;)
  212. If (%ARESP%)=(0) Then 
  213.  Find(%RESP%, )
  214.  If(%ARESP%)=(0) then Ret
  215.  SetEqual(z= )
  216. endif
  217. ;SetEqual(/nvz=%RESP%)
  218. SetEqual(^1=%RESP%)
  219. *ST_CHECK
  220. ;SetEqual(a=%NV%Z)
  221. SetEqual(a=^:1^)
  222. If(%VAR%A)=() then Ret
  223. Find(%VAR%A,%VAR%Z)
  224. If(%ARESP%)=(0) then Goto(NoMoreCommands)
  225. AddVar(%ARESP%+-1=b)
  226. Get(%VAR%A,1,%VAR%B)
  227. SetEqual(/resp=%ARESP%)
  228. *Cont
  229. If (%RESP%)=() Then Ret
  230. AddVar(%VAR%B+2=b)
  231. Get(%VAR%A,%VAR%B,100)
  232. ;SetEqual(/nvz=%ARESP%)
  233. SetEqual(^1=%ARESP%)
  234. Goto(COMMAND)
  235. Ret
  236.  
  237. *NoMoreCommands
  238.  SetEqual(/resp=^:1^)
  239.  SetEqual(^1=)
  240.  If (%RESP%)=() Then Ret
  241.  Goto(command)
  242.  
  243. *ST_CHECK2
  244. ;SetEqual(a=%NV%Z)
  245. SetEqual(a=^:1^)
  246. If(%VAR%A)=() then Ret
  247. Find(%VAR%A,%VAR%Z)
  248. If(%ARESP%)=(0) then Goto(NoMoreCommands2)
  249. AddVar(%ARESP%+-1=b)
  250. Get(%VAR%A,1,%VAR%B)
  251. SetEqual(/resp=%ARESP%)
  252. *Cont2
  253. If (%RESP%)=() Then Ret
  254. AddVar(%VAR%B+2=b)
  255. Get(%VAR%A,%VAR%B,100)
  256. ;SetEqual(/nvz=%ARESP%)
  257. SetEqual(^1=%ARESP%)
  258. Goto(COMMAND2)
  259. Ret
  260.  
  261. *NoMoreCommands2
  262.  SetEqual(/resp=^:1^)
  263.  SetEqual(^1=)
  264.  If (%RESP%)=() Then Ret
  265.  Goto(command2)
  266.  
  267. *Cont3
  268. If (%RESP%)=() Then Ret
  269. AddVar(%VAR%B+2=b)
  270. Get(%VAR%A,%VAR%B,100)
  271. ;SetEqual(/nvz=%ARESP%)
  272. SetEqual(^1=%ARESP%)
  273. Goto(COMMAND4)
  274. Ret
  275.  
  276. *ST_CHECK3
  277. ;SetEqual(a=%NV%Z)
  278. SetEqual(a=^:1^)
  279. Find(%VAR%A,%VAR%Z)
  280. If(%ARESP%)=(0) then Goto(NoMoreCommands3)
  281. AddVar(%ARESP%+-1=b)
  282. Get(%VAR%A,1,%VAR%B)
  283. MenuEqual(/resp=%ARESP%)
  284. *YNRespChecks
  285. If(%RESP%)=(Y) then SetEqual(/RESP=Yes)
  286. If(%RESP%)=(N) then SetEqual(/RESP=No)
  287. ;SetEqual(/resp=%ARESP%)
  288. NotIf(%RESP%)=(Yes) then NotIf(%RESP%)=(No) then Goto(Question1)
  289. Goto(Cont3)
  290.  
  291. *NoMoreCommands3
  292.  MenuEqual(/resp=^:1^)
  293.  SetEqual(^1=)
  294.  Goto(YNRespChecks)
  295.  
  296. *ST_CHECK4
  297. ;SetEqual(a=%NV%Z)
  298. SetEqual(a=^:1^)
  299. Find(%VAR%A,%VAR%Z)
  300. If(%ARESP%)=(0) then Goto(NoMoreCommands4)
  301. AddVar(%ARESP%+-1=b)
  302. Get(%VAR%A,1,%VAR%B)
  303. MenuEqual(/resp=%ARESP%)
  304. *YNRespChecks2
  305. If(%RESP%)=(Y) then SetEqual(/RESP=Yes)
  306. If(%RESP%)=(N) then SetEqual(/RESP=No)
  307. ;SetEqual(/resp=%ARESP%)
  308. NotIf(%RESP%)=(Yes) then NotIf(%RESP%)=(No) then Goto(Question2)
  309. Goto(Cont4)
  310.  
  311. *NoMoreCommands4
  312.  MenuEqual(/resp=^:1^)
  313.  SetEqual(^1=)
  314.  Goto(YNRespChecks2)
  315.  
  316. *ST_CHECK5
  317. ;SetEqual(a=%NV%Z)
  318. SetEqual(a=^:1^)
  319. Find(%VAR%A,%VAR%Z)
  320. If(%ARESP%)=(0) then Goto(NoMoreCommands4)
  321. AddVar(%ARESP%+-1=b)
  322. Get(%VAR%A,1,%VAR%B)
  323. MenuEqual(/resp=%ARESP%)
  324. *YNRespChecks3
  325. If(%RESP%)=(Y) then SetEqual(/RESP=Yes)
  326. If(%RESP%)=(N) then SetEqual(/RESP=No)
  327. ;SetEqual(/resp=%ARESP%)
  328. NotIf(%RESP%)=(Yes) then NotIf(%RESP%)=(No) then Goto(Question3)
  329. Goto(Cont5)
  330.  
  331. *NoMoreCommands4
  332.  MenuEqual(/resp=^:1^)
  333.  SetEqual(^1=)
  334.  Goto(YNRespChecks3)
  335.  
  336.