/* $VER: FILE_ID.DIZ.dopus 1.2 (28.8.94) ARexx script for Directory Opus to show your file_id.diz from archives. Requires: LhA, LzX, Directory Opus, MultiView, ReqTools.library and RexxReqTools.library , DMSDescript , TXTExtract , ExEDescript, UNZip GIFDescript DelBBSAds.dopus will also use locale.library to adapt to different languages, provided there is a catalog. */ busy on /* switch busy mouse pointer on */ signal on syntax /* intercept syntax errors */ options results /* need results from DOpus */ options failat 21 /* external commands are allowed returncode 20 */ lf='a'x /* ascii code for linefeed */ flag=0 /* something deleted? flag */ call initlocale /* initialize local strings */ query updateflags follow=bittst(d2c(result),1) /* scroll window to follow operations? */ query font 8 /* which font should requesters use? */ fonttag='rt_font='result query screenname if result=0 then /* for compatibility with old DOpus */ screenname=address() else screenname=result status 3 /* get active window */ window=result status 9 window /* get number of selected entries */ entries=result if entries=0 then call quitit msg.1 if ~show('l','rexxreqtools.library') then call addlib('rexxreqtools.library',0,-30,0) eztags='rt_reqpos=reqpos_centerscr rt_pubscrname='screenname 'rtez_flags=ezreqf_centertext' fonttag eztags1='rt_reqpos=reqpos_centerscr rt_pubscrname='screenname fonttag checkabort /* reset abort flag */ status 13 window /* get directory name */ drawer=result do entries getnextselected filename=result if follow then scrolltoshow '"'filename'"' call insstr(filename,msg.5) toptext msgstring ext=upper(right(filename,4)) arcfile=ext='.LHA'|ext='.LZH'|ext='.RUN'|ext='.DMS'|ext='.TXT'|ext='.DOC'|ext='.NFO'|ext='.DOK'|ext='.EXE'|ext='.GIF'|ext='.ZIP'|ext='.LZX' fileinfo '"'filename'" /' parse var result . '/' . '/' . '/' filetype '/' if filetype>0|~arcfile then call skipask msg.6 if rtresult=2 then call stopit msg.4 else rtresult=1 then do toptext msg.11 select when ext='.LHA' then address command 'LhA x "'drawer||filename'" file_id.diz t:' when ext='.LZH' then address command 'LhA x "'drawer||filename'" file_id.diz t:' when ext='.RUN' then address command 'LhA x "'drawer||filename'" file_id.diz t:' when ext='.LZX' then address command 'LZX x "'drawer||filename'" file_id.diz t:' when ext='.DMS' then address command 'dmsdescript x T:file_id.diz "'drawer||filename'"' when ext='.TXT' then address command 'TxtExtract e T:file_id.diz "'drawer||filename'"' when ext='.doc' then address command 'TxtExtract e T:file_id.diz "'drawer||filename'"' when ext='.dok' then address command 'TxtExtract e T:file_id.diz "'drawer||filename'"' when ext='.NFO' then address command 'TxtExtract e T:file_id.diz "'drawer||filename'"' when ext='.EXE' then address command 'EXEDescript x T:file_id.diz "'drawer||filename'"' when ext='.ZIP' then Call ZIP when ext='.GiF' then address command 'GifDescript e T:file_id.diz "'drawer||filename'"' otherwise end THISFILE="T:FILE_ID.DIZ" /* address command viewer 'PUBSCREEN' screenname thisfile */ if ~exists("t:file_id.diz") then call no_id else OPEN(FileID,'T:FILE_ID.diz','R') zeile1 = READLN(FileID) zeile2 = READLN(FileID) zeile3 = READLN(FileID) zeile4 = READLN(FileID) zeile5 = READLN(FileID) zeile6 = READLN(FileID) zeile7 = READLN(FileID) zeile8 = READLN(FileID) zeile9 = READLN(FileID) zeile10 = READLN(FileID) zeile11 = READLN(FileID) END CLOSE(FileID) view: call rtezrequest(msg.9||msg.14||msg.17||filename||msg.14||msg.16||zeile1||msg.14||zeile2||msg.14||zeile3||msg.14||zeile4||msg.14||zeile5||msg.14||zeile6||msg.14||zeile7||msg.14||zeile8||msg.14||zeile9||msg.14||zeile10||msg.14||zeile11||msg.14||msg.16,,,eztags1) delete thisfile call stopit no_id: beep busy on call insstr(viewer,msg.13) call rtezrequest(msgstring,,,eztags) selectfile filename 0 1 /* deselect the processed file */ checkabort /* did the user press both mouse buttons? */ call stopit skipask: parse arg reason beep busy on call rtezrequest(reason||lf||msg.18,msg.19,,eztags) if ~rtresult then call stopit insstr: parse arg replace,msgstring if pos('%s',msgstring)>0 then do parse var msgstring fore '%s' aft msgstring=fore||replace||aft end return syntax: ERR: call quitit "Syntax Error" rc"," errortext(rc) "in line" sigl"." stopit: parse arg topline call quitit topline quitit: selectfile filename 0 1 /* deselect the processed file */ parse arg topline if topline~=="" then toptext topline if pos(msg.7,upper(topline))>0 then beep /* an error occurred */ restore /* restore config settings */ busy off /* switch to normal pointer */ exit /* stop script here */ initlocale: /* These are the English default strings. */ msg.1="Nothing selected!" msg.2="File_Id.DiZ-Viewer by Piwi/$ceptic \n Support *.DmS, *.ExE, *.LhA, *.TxT, *.Zip, *.Gif \n How do you want to view the\nFile_Id.DiZ from Archive?" msg.3="_View|A_bort" msg.4="Aborted..." msg.5="Processing '%s'..." msg.6="Sorry, I can only support \n *.DmS, *.ExE, *.LhA, *.TxT, *.Zip, *.Gif archives!" msg.7="ERROR" msg.8="Welcome to File_ID.DiZ Viewer from PIWI/$ceptic V1.1" msg.9=" File_Id.DiZ-Viewer V1.¹\n by Piwi/$ceptic `94 \n Support *.DmS, *.ExE, *.LhA, *.TxT, *.Zip, *.Gif, *.LzX \n" msg.10="_View|_Quit" msg.11="Extracting File_ID.DIZ...." msg.12="Error while extracting." msg.13="Sorry, no File_ID.Diz in archive" msg.14="\n" msg.15="_Yes|_No" msg.16="[------------------------------------------]\n" msg.17="Archivename: " msg.18="Exit...." msg.19="S_top" msg.20="Syntax Error %s, %s in line %s." msgno=20 /* number of locale strings */ ok=show(l,'locale.library') if ~ok then ok=addlib('locale.library',0,-30) if ok then do catalog=opencatalog('file_id.catalog','',0) if catalog~=0 then do i=1 to msgno msg.i=getcatalogstr(catalog,i,msg.i) end call closecatalog(catalog); end do i=1 to msgno /* Convert \n into real linefeeds. */ if pos('\n',msg.i)>0 then do parse var msg.i fore '\n' aft msg.i=fore||'a'x||aft i=i-1 end end return ZIP: /*address command 'cd t:'*/ /*address command 'unzip -e "'drawer||filename'" FILE_ID.DIZ'*/ address command 'c:execute rexx:zipDepack "'drawer||filename'" t:' return