home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / FileMover / Dopus5 / dvn_whu.lha / What / REXX / What.dopus
Encoding:
Text File  |  1995-05-03  |  13.7 KB  |  468 lines

  1. /* 
  2.   $VER: Multi File_Id & Extract For Dopus5 2.1 (2.5.95)
  3.   Written by Pink Floyd Of Divine
  4.   Additional material by Edmund Vermeulen.
  5.   ARexx script for DOpus 5 to unpack arced files with progress indication.
  6.  
  7.   Call as 'REXX:What.dopus {f} FLAGS=Do All Files'.
  8.  
  9. */
  10.  
  11. START:
  12.  
  13. address command 'Delete T:File_Id.Diz'
  14. address command 'Delete T:File_Id.Di'
  15.  
  16. Reg='DIVINE'
  17.  
  18.  
  19. Showme='Im Very Sorry But There Is No File_Id.Diz Availble'
  20. options results
  21. options failat 21
  22. flag=Exists("Libs:rexxreqtools.library")
  23. if flag=0 then do
  24.     say "! ERROR ! Libs:RexxReqTools.Library not found."
  25.     Exit
  26. end
  27. addlib("rexxreqtools.library",0,-30)
  28. lf='0a'x  /* ascii code for linefeed */
  29. signal check
  30.  
  31.  
  32. MAIN:
  33.  
  34. dest='RAM:T/'
  35. address 'DOPUS.1'
  36. parse arg '"' file '"'
  37. address command 'Delete T:File_Id.Diz'
  38. address command 'Delete T:File_Id.Di'
  39. if upper(right(file,4))='.DMS' then signal dms
  40. if upper(right(file,4))='.LHA' then Signal lha
  41. if upper(right(file,4))='.LZH' then Signal lha
  42. if upper(right(file,4))='.LZX' then Signal lzx
  43. if upper(right(file,4))='.NFO' then Signal txt
  44. if upper(right(file,4))='.DOC' then Signal txt
  45. if upper(right(file,4))='.TXT' then Signal txt
  46. if upper(right(file,4))='.EXE' then Signal ex1
  47. if upper(right(ffile,4))~='' then signal no
  48.  
  49.  
  50. No:
  51. Call rtezrequest("Multi View & Extract For Dopus 5 By Pink Floyd Of Divine." lf " " lf "Im Sorry But Only The Following Formats Accepted At THe Moment." lf " *.DMS - *.LHA - *.LZX - *.TXT - *.NFO - *.DOC - *.EXE" lf " " lf " If You Wish To Get The Latest Release Of This Program " lf " " lf " Then Call One Of The Many Divine Sites Through Out The World " lf " And Leave A Message To Me Pink Floyd " lf " " lf " Okay That About Wraps It For Now Catch You Again Soon..","_Quit|_Exit","Multi View & Extract V2.5 ©95 By Pink Floyd Of Divine ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  52.  if RTResult = 1 then signal Quit
  53.  if rtresult = 0 then signal 
  54. exit
  55. end
  56. Quit:
  57. Call rtezrequest(" Before You Go Quick Greets Fly To The Following " lf lf " JB - SARGE - PIXIE - DEMONS - SQUEAKY - CHEM " lf " LAZZER - BOBCAT - EXILE - PURPLE MOTION - HUSTLER " lf " TRONIC - SIR SNOOZE - OI! - CYANIDE " lf " MANIC - MECHANIC - FROSTY - PASCAL - ARCH " lf " LIBRARIAN - HORROR KID - LORE - MEMPHIS " lf " NUMARK - SONIC - ARISTACAT " lf lf " A FEW GROUP GREETS FLY TO " lf " - DIVINE - HELLFIRE - PRESTIGE - LSD - ACCESS - MANIACS -  ","_Quit|_Exit","Multi View & Extract V1.0 ©95 By Pink Floyd - Divine", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1) 
  58. exit
  59. end
  60.  
  61.  
  62. /* Start Windows */
  63.  
  64. /* ----------------------------------------------------------------------- */
  65.  
  66. LHA:
  67.  
  68. cuthere=lastpos('/',file)
  69. if cuthere=0 then
  70.    cuthere=pos(':',file)
  71. lhaname="'"substr(file,cuthere+1)"'"
  72.  
  73.  
  74. fileidl:
  75.  
  76. if exists('T:FILE_ID.DIZ')then address command 'delete T:FILE_ID.DIZ quiet'
  77. ADDRESS command 'lha x > NIL: '||file||' FILE_ID.DIZ T:' 
  78.    if ~exists('T:FILE_ID.DIZ')then Signal Contl
  79. Showme=""
  80. call open('FileID','T:FILE_ID.diz','r')
  81. do until eof('FileID')
  82. Showme=Showme||lf||readln('FileID')
  83. end
  84. contl:
  85.  
  86. rtezrequest(" " showme " ","_Extract|_Copy|_Move|_Delete|_About|_Next","Multi View V2.5 By Pink Floyd Of Divine", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  87.  
  88. if rtresult = 1 then signal lhaw
  89. if rtresult = 2 then signal copy
  90. if rtresult = 3 then signal move
  91. if rtresult = 4 then signal delete
  92. if rtresult = 5 then signal about
  93. if rtresult = 0 then exit
  94.  
  95.  
  96. lhaw:
  97.  
  98. rtezrequest(" Please Select " lf " Ram:T/ Or Select (A Path Desired By You.) ","_Ram:T/|_Select|_Next","Multi View V2.5 By Pink Floyd Of Divine ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  99. if rtresult = 1 then signal lhaw1
  100. if rtresult = 2 then signal select
  101. if rtresult = 0 then exit
  102. select:
  103. dirname = rtfilerequest(, , "Please Pick A Directory",,,
  104. "rtfi_flags = freqf_nofiles rtfi_initialpath=Ram:T/ RT_ReqPos=ReqPos_CenterScr rt_PubScrName = "DOPUS.1) 
  105.  
  106. if rtresult == 0 then signal fail
  107. else
  108. dest=dirname
  109. signal lhaw1
  110. end
  111.  
  112. lhaw1:
  113.  
  114.  
  115. lister new
  116. handle=result
  117.  
  118. lister set handle busy on
  119. lister set handle path dest
  120. lister set handle progress 'Unpacking' lhaname'...' 
  121.  
  122. address command 'C:LHA x -x -M 'file dest
  123.  
  124.        parse var line ' ' line
  125.           lister query handle abort
  126.          if result then do
  127.             address command 'Break' process 'C'
  128.             lister set handle busy off
  129.             lister set handle title 'UnLHA Aborted Or Finished...'
  130.             exit
  131.             end
  132.  
  133. lister set handle busy off
  134. lister read handle dest force
  135.  
  136. exit
  137. end
  138.  
  139. */ ----------------------------------------------------------------------- */
  140.  
  141. LZX:
  142.  
  143. cuthere=lastpos('/',file)
  144. if cuthere=0 then
  145.    cuthere=pos(':',file)
  146. lzxname="'"substr(file,cuthere+1)"'"
  147.  
  148.  
  149. fileidl:
  150.  
  151. if exists('Ram:FILE_ID.DIZ')then address command 'delete Ram:FILE_ID.DIZ quiet'
  152. ADDRESS command 'lzx x > NIL: '||file||' FILE_ID.DIZ RAM:' 
  153.    if ~exists('Ram:FILE_ID.DIZ')then Signal Contx
  154. Showme=""
  155. call open('FileID','Ram:FILE_ID.diz','r')
  156. do until eof('FileID')
  157. Showme=Showme||lf||readln('FileID')
  158. end
  159. contx:
  160.  
  161. rtezrequest(" " showme " "," _Extract|_Copy|_Move|_Delete|_About|_Next","Multi View V2.5 By Pink Floyd Of Divine ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  162.  
  163. if rtresult = 1 then signal lzxw
  164. if rtresult = 2 then signal copy
  165. if rtresult = 3 then signal move
  166. if rtresult = 4 then signal delete
  167. if rtresult = 5 then signal about
  168. if rtresult = 0 then exit
  169.  
  170. lzxw:
  171. rtezrequest(" Please Select " lf " Ram:T/ Or Select (A Path Desired By You.) ","_Ram:T/|_Select|_Next","Multi View V2.5 By Pink Floyd Of Divine ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  172. if rtresult = 1 then signal lzxw1
  173. if rtresult = 2 then signal select
  174. if rtresult = 0 then exit
  175. select:
  176. dirname = rtfilerequest(, , "Please Pick A Directory",,,
  177. "rtfi_flags = freqf_nofiles rtfi_initialpath=Ram:T/ RT_ReqPos=ReqPos_CenterScr rt_PubScrName = "DOPUS.1) 
  178.  
  179. if rtresult == 0 then signal fail
  180. else
  181. dest=dirname
  182. signal lzxw1
  183. end
  184.  
  185. lzxw1:
  186.  
  187. call close('FileID')
  188. address command 'Delete Ram:t/?#.* ALL'
  189.  
  190. lister new
  191. handle=result
  192.  
  193. lister set handle busy on
  194. lister set handle path dest
  195. lister set handle progress 'Unpacking' lzxname'...' 
  196.  
  197. address command 'lzx -x x ' file dest
  198.  
  199.        parse var line ' ' line
  200.           lister query handle abort
  201.          if result then do
  202.             address command 'Break' process 'C'
  203.             lister set handle busy off
  204.             lister set handle title 'UnLzx Aborted Or Finished...'
  205.             exit
  206.             end
  207.  
  208. lister set handle busy off
  209. lister read handle dest force
  210.  
  211. exit
  212. end
  213.  
  214. /* ----------------------------------------------------------------------- */
  215.  
  216. if reg~=left(e,1)
  217. then exit
  218.  
  219. DMS:
  220.  
  221. cuthere=lastpos('/',file)
  222. if cuthere=0 then
  223.    cuthere=pos(':',file)
  224. dmsname="'"substr(file,cuthere+1)"'"
  225.  
  226.  
  227. fileidd:
  228.  
  229. if exists('T:FILE_ID.DIZ')then address command 'delete T:FILE_ID.DIZ quiet'
  230.   ADDRESS command 'dmsdescript > NIL: x T:FILE_ID.diz '||file
  231.    if ~exists('T:FILE_ID.DIZ')then signal Contd
  232. else do
  233. Showme=""
  234. call open('FileID','T:FILE_ID.diz','r')
  235. do until eof('FileID')
  236. Showme=Showme||lf||readln('FileID')
  237. end
  238. Contd:
  239.  
  240. rtezrequest(" " showme " ","_Extract|_Copy|_Move|_Delete|_About|_Next","Multi View V2.5 By Pink Floyd Of Divine ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  241.  
  242. if rtresult = 1 then signal ext
  243. if rtresult = 2 then signal copy
  244. if rtresult = 3 then signal move
  245. if rtresult = 4 then signal delete
  246. if rtresult = 5 then signal about
  247. if rtresult = 0 then exit
  248. end
  249.  
  250.  
  251. EXT:
  252.  
  253.  rtezrequest("Insert disk in drive and then select "lf" destination for" dmsname".","DF0:|DF1:|FF0:|FF1:|FF2:|FF3:|FF4:|RAD:|_Exit","Dms Extraction", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  254.  
  255. if rtresult = 1 then do
  256. Dest='DF0:'
  257. signal dmsw
  258. end
  259. if rtresult = 2 then do
  260. Dest='DF1:'
  261. signal dmsw
  262. end
  263. if rtresult = 3 then do
  264. Dest='FF0:'
  265. signal dmsw
  266. end
  267. if rtresult = 4 then do
  268. Dest='FF1:'
  269. signal dmsw
  270. end
  271. if rtresult = 5 then do
  272. Dest='FF2:'
  273. signal dmsw
  274. end
  275. if rtresult = 6 then do
  276. Dest='FF3:'
  277. signal dmsw
  278. end
  279. if rtresult = 7 then do
  280. Dest='FF4:'
  281. signal dmsw
  282. end
  283. if rtresult = 8 then do
  284. Dest='RAD:'
  285. signal dmsw
  286. end
  287. if rtresult = 0 then
  288. exit
  289. end
  290.  
  291. dmsw:
  292.  
  293.  
  294. lister new
  295. handle=result
  296.  
  297. lister set handle busy on
  298. lister set handle path dest
  299. lister set handle progress 80 'Unpacking' dmsname'...'
  300.  
  301. address command 'C:Mount' dest
  302. address command 'Run >NIL: <NIL: DMS <NIL: >PIPE:dmsout WRITE' file 'TO' dest 'NOVERIFY NOTEXT'
  303. address command 'Status >T:ProcessNo COMMAND DMS'
  304. call open('temp','T:ProcessNo','r')
  305. process=readln('temp')
  306. close('temp')
  307. address command 'Delete >NIL: T:ProcessNo QUIET'
  308.  
  309. nomessage=1
  310. errorreport=''
  311. buffer=''
  312. call open('dmsout','PIPE:dmsout','r')    /* output from DMS comes through PIPE: */
  313.  
  314. do until eof('dmsout')
  315.    buffer=buffer||readch('dmsout',25)    /* read portions of 25 characters */
  316.    here=verify(buffer,'0a0d'x,'m')    /* check for new lines */
  317.    if here>0 then do
  318.       line=left(buffer,here-1)        /* one whole line */
  319.       if nomessage&left(line,7)='No Disk' then do
  320.          lister set handle progress name 'Insert disk in' dest
  321.          nomessage=0
  322.          end
  323.       parse var line ' ' line        /* get rid of some ugly stuff */
  324.       buffer=substr(buffer,here+1)
  325.       if pos('ERROR',upper(line))>0 then do
  326.          errorreport=errorreport||lf||line
  327.          say '07'x            /* beep the display */
  328.          end
  329.       if pos('unPacking',line)>0 then do
  330.          track=right(line,2)
  331.          lister set handle progress count track+1
  332.          lister set handle progress name 'Track' track
  333.          lister query handle abort
  334.          if result then do
  335.             address command 'Break' process 'C'
  336.             lister set handle busy off
  337.             lister set handle title 'UnDMS aborted...'
  338.             exit
  339.             end
  340.          end
  341.       end
  342.    end
  343.  
  344. call close('dmsout')
  345.  
  346. if errorreport~=='' then
  347.    dopus request '"The Error Report For You '||lf||errorreport'" OK'
  348.  
  349. lister set handle busy off
  350. lister read handle dest force
  351. exit
  352. end
  353.  
  354. /* ----------------------------------------------------------------------- */
  355.  
  356. TXT:
  357.  
  358. cuthere=lastpos('/',file)
  359. if cuthere=0 then
  360.    cuthere=pos(':',file)
  361. txtname="'"substr(file,cuthere+1)"'"
  362.  
  363. fileidt:
  364.  
  365. if exists('T:FILE_ID.DIZ')then address command 'delete T:FILE_ID.DIZ quiet'
  366. ADDRESS command 'C:TxtExtract e > NIL: T:FILE_ID.DIZ '||file
  367. if ~exists('T:FILE_ID.DIZ')then signal contt
  368. Showme=""
  369. call open('FileID','T:FILE_ID.diz','r')
  370. do until eof('FileID')
  371. Showme=Showme||lf||readln('FileID')
  372. end
  373. contt:
  374. rtezrequest(" " showme " ","_Read|_Copy|_Move|_Delete|_About|_Next","Multi View V2.5 By Pink Floyd Of Divine ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  375.  
  376. if rtresult = 1 then signal read
  377. if rtresult = 2 then signal copy
  378. if rtresult = 3 then signal move
  379. if rtresult = 4 then signal delete
  380. if rtresult = 5 then signal about
  381. if rtresult = 0 then exit
  382. end
  383.  
  384. read:
  385. address Command 'SYS:Utilities/multiview SCREEN' file
  386. exit
  387. end
  388.  
  389.  
  390. /* ----------------------------------------------------------------------- */
  391.  
  392. EXE:
  393.  
  394. cuthere=lastpos('/',file)
  395. if cuthere=0 then
  396.    cuthere=pos(':',file)
  397. exename="'"substr(file,cuthere+1)"'"
  398.  
  399. if exists('T:FILE_ID.DIZ')then address command 'delete T:FILE_ID.DIZ quiet'
  400. ADDRESS command 'EXEDescript x > NIL: T:FILE_ID.DIZ '||File
  401.    if ~exists('T:FILE_ID.DIZ')then signal ContEx
  402. Showme=""
  403. call open('FileID','T:FILE_ID.diz','r')
  404. do until eof('FileID')
  405. Showme=Showme||lf||readln('FileID')
  406. end
  407. Contex:
  408. rtezrequest(" " showme " ","_Copy|_Move|_Delete|_About|_Next","Multi View V2.5 By Pink Floyd Of Divine ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  409.  
  410. if rtresult = 2 then signal copy
  411. if rtresult = 3 then signal move
  412. if rtresult = 4 then signal delete
  413. if rtresult = 5 then signal about
  414. if rtresult = 0 then exit
  415. end
  416.  
  417.  
  418. Copy:
  419. Dirname = rtfilerequest(, , "Please Pick A Directory",,,
  420. "rtfi_flags = freqf_nofiles rtfi_initialpath=Ram:T/ RT_ReqPos=ReqPos_CenterScr rt_PubScrName = "DOPUS.1) 
  421. if rtresult == 0 then signal fail
  422. else
  423. address command 'Copy' file 'to' dirname
  424. call rtezrequest("The File Has Now Been Copied To"  dirname, "_Ok", ,"RT_ReqPos=ReqPos_CenterScr rt_PubScrName = "DOPUS.1)
  425. exit
  426. end
  427.  
  428. Check:
  429.  
  430. if upper(right(Reg,1))~='E' then signal fake
  431. if upper(left(Reg,1))~='D' then signal fake
  432. signal main
  433. end
  434.  
  435. fake:
  436. rtezrequest("Im Sorry " lf " " lf "But This Version Is Not Registered To You." lf " " lf " This Should Be Registerd To 'DIVINE'" , "_Exit","Unregistered Version" ,"RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr rt_PubScrName = "DOPUS.1)
  437. end
  438.  
  439. Move:
  440. Dirname = rtfilerequest(, , "Please Pick A Directory",,,
  441. "rtfi_flags = freqf_nofiles rtfi_initialpath=Ram:T/ RT_ReqPos=ReqPos_CenterScr rt_PubScrName = "DOPUS.1) 
  442. if rtresult == 0 then signal fail
  443. else
  444. address command 'move' file 'to' dirname
  445. call rtezrequest("The File Has Now Been Moved To"  dirname, "_k", ,"RT_ReqPos=ReqPos_CenterScr rt_PubScrName = "DOPUS.1)
  446. exit
  447. end
  448.  
  449. Delete:
  450. rtezrequest(" Are You Sure ","_Yes|_Cancel","Deleting File ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  451. if rtresult = 1 then address command 'Delete 'file
  452. exit
  453. end
  454.  
  455. Fail:
  456. call rtezrequest("You Failed To Pick A Destination Directory.", "_Exit", ,"RT_ReqPos=ReqPos_CenterScr rt_PubScrName = "DOPUS.1)
  457. exit
  458. end
  459.  
  460. About:
  461.  
  462. call close('FileID')
  463. Call rtezrequest("Multi View & Extract For Dopus 5 By Pink Floyd Of Divine." lf " " lf "This Is The Unregistered Evaluation Copy" lf "  " lf " If You Wish To Get The Latest Registered Version " lf " " lf " Then Call One Of The Many Divine Sites Through Out The World " lf " " lf " And Leave A Message To Me Pink Floyd.","_Quit|_Exit","Multi View & Extract V2.5 ©95 By Pink Floyd Of Divine ", "RTEz_Flags=EZReqF_CenterText RT_ReqPos=ReqPos_CenterScr RT_PubScrName="DOPUS.1)
  464.  if RTResult = 1 then signal start
  465.  if rtresult = 0 then signal start
  466. end
  467.  
  468. /* Eh Up Big In It */