EXEdir="C:";C1='RAKE.100';C2='SQSH.100';C3='MASH.50';C4='SHRI.100';NL='0a'x;signal on halt;signal on error;call addlib("rexxreqtools.library",0,-30,0);call rtfreefilebuffer;ARG Op AK DirPth Xtype;SELECT;When Op='A' then;do;Call Compress;End;When Op='X' then;do;Call Extract;End;When Op='' then;do;Call ReqShit;End;OTHERWISE;Call ouch;END;EXIT;CHECK:;IF AK="" then;DO;Call ouch;EXIT;END;IF DirPth="" then;DO;call ouch;EXIT;END;If Right(dirpath,1) ~='/' then;DO;If Right(dirpath,1) ~=':' then;DO;Dirpath= Dirpath'/';END;END;IF Xtype="" then;DO;Xtype="MASH.50";END;Call ModAK;Return;COMPRESS:;Call check;say "";say "Mat's XLHA Archiver V1.93";say "";say "Stashing...";Address COMMAND;EXEdir'LHA a -r -z -q "'AK'" "'DirPth'"';say "";Address COMMAND;EXEdir'XPK -m "'Xtype'" "'AK'"';say "";say "Done.";say "";Return;EXTRACT:;Call check;say "";say "Mat's XLHA Extractor V1.93";say "";Address COMMAND;EXEdir'Copy >NIL: "'AK'" TO "'DirPth'Temp.XLHA"';EXEdir'XPK -e "'DirPth'Temp.XLHA"';say "";say "Un-Stashing...";Address COMMAND EXEdir'LHA x "'DirPth'Temp.XLHA" * "'DirPth'"';Address COMMAND EXEdir'Delete >NIL: "'DirPth'Temp.XLHA"';say "";say "Done.";say "";Return;Reqshit:;CALL rtezrequest("Welcome to Mat's XLHA 1.93!"||NL||""||NL||"Which operation would you like to perform?","Create Archive|Extract Archive|Chicken out","XLHA 1.93","rtez_defaultresponse = 0 rtgs_flags = gsreqf_centertext|gsreqf_highlighttext");WotOp=rtresult;SELECT;When WotOp='1' then;do;Call GuiAd;End;When WotOp='2' then;do;Call GuiEx;End;When WotOp='0' then;do;Call Pussy;End;END;EXIT;END;GuiAd:;AK=rtfilerequest(,".XLHA","Archive name to be created?",,"rtfi_buffer = true rtfi_height = 250");If AK="" then;do;call pussy;EXIT;END;Call ArcSplit;XLib=rtezrequest("Which XPK Library?"||NL||""||NL||"1 - LHA 'Squared'"||NL||"2 - xpkRAKE"||NL||"3 - xpkSQSH"||NL||"4 - xpkMASH"||NL||"5 - xpkSHRI"||NL||"6 - Other xpk","1|2|3|4|5|6","XLHA 1.93","rtez_defaultresponse = 1");lhatemp='';SELECT;When Xlib=1 then;do;tempfile='XLHA.temp';END;When Xlib=2 then;do;XTYPE=C1;END;When Xlib=3 then;do;XTYPE=C2;END;When Xlib=4 then;do;XTYPE=C3;END;When Xlib=5 then;do;XTYPE=C4;END;OTHERWISE;Call OtherXPKlib;END;Call Modarchive;call rtfilerequest(,,"Files to Archive?",,"rtfi_flags=freqf_multiselect|freqf_selectdirs",files);IF files==1 then;do;say "";say "Mat's XLHA Archiver V1.93";say "";say "Stashing " files.count "files and/or dirs...";do i=1 to files.count;Address COMMAND;EXEdir'LHA a -r -z -q "'AK'" "'files.i'"';end;end;ELSE;do;call rtezrequest("You picked no files."," No ");call pussy;EXIT;END;say "";If xlib ~='1' then;Do;Address COMMAND;EXEdir'XPK -m "'Xtype'" "'AK'"';say "";say "XLHA Done.";say "";EXIT;END;Address COMMAND;EXEdir'Rename >NIL: "'AK'" TO "'ArcDir'XLHA.temp"';EXEdir'LHA a "'AK'" "'ArcDir'XLHA.temp"';EXEdir'Delete >NIL: "'ArcDir'XLHA.temp"';say "";say "XLHA Done.";say "";EXIT;GuiEx:;AK=rtfilerequest(,,"Archive name to be Extracted?",,"rtfi_height = 250");If AK="" then;do;call pussy;EXIT;END;If right(AK,4) ~='XLHA' then;do;Say 'Not an XLHA file! Either that or its got no .XLHA postfix!';EXIT;END;Call ArcSplit;Call Open('tf',AK,"R");Arctest=READCH('tf',7);Call Close('tf');Arctest=Right(arctest,5);Arctest=Overlay('x',Arctest,4);If Arctest='-lhx-' then;DO;Arctype='LHA';END;DEST=rtfilerequest(,,"Destination?",,"rtfi_height = 250 rtfi_flags=freqf_nofiles");If DEST="" then;do;call pussy;EXIT;END;say "";say "Mat's XLHA Extractor V1.93";say "";If Arctype='LHA' then;DO;Address COMMAND;EXEdir'LHA x "'AK'" "'DEST'"';EXEdir'LHA x "'DEST'XLHA.temp" "'DEST'"';EXEdir'DELETE >NIL: "'DEST'XLHA.temp"';say "";Say "Done.";say "";EXIT;END;Address COMMAND;EXEdir'Copy >NIL: "'AK'" TO "'DEST'Temp.XLHA"';EXEdir'XPK -e "'DEST'Temp.XLHA"';EXEdir'LHA x "'DEST'Temp.XLHA" * "'DEST'"';EXEdir'Delete >NIL: "'DEST'Temp.XLHA"';say "";say "Done.";say "";EXIT;OtherXPKLib:;RawXpkFile=rtfilerequest('Libs:Compressors/','xpkSHRI.library',"XPK library?");If RawXpkFile="" then;do;call rtezrequest("You picked no file."," No ");call pussy;EXIT;END;XTYPE=RIGHT(RawXpkFile,12);XTYPE=LEFT(XTYPE,4);Xmode=rtgetlong(,'Enter the Mode (0-100)?',,,'rtgl_min = 0 rtgl_max = 100');XTYPE=XTYPE'.'Xmode;RETURN;Modarchive:;If RIGHT(AK,5) ~='.XLHA' then;DO;AK=AK||'.XLHA';END;Return;ArcSplit:;AF=Translate(AK,"  ",":/");AF=WORD(AF,WORDS(AF));ArcDir=Left(AK,Length(AK)-Length(AF));Return;Pussy:;Call rtezrequest("Wowser or What?!!","Yeah I'm a Wowser <SOB>","XLHA 1.93");RETURN;HALT:;say 'Break';EXIT;ERROR:;say 'Error...';EXIT;ouch:;say "";say "XLHA by Xenolink Alliance Mat Bettinson 20-Nov-94 Ver 1.93";say "Comments to: Fidonet 2:254/205 or mat@darkside.demon.co.uk";say "";say "USAGE: XLHA COMMAND [ARCHIVE] [DIR] [XPK Lib]";say "       COMMAND: A = Compress, X = Extract, Empty = GUI";say "       ARCHIVE: Full path of Archive (A + E modes only)";say "       XPK.lib: XPK.library to use.  (A + E modes only)";say "                Default MASH";say "";say "Example: XLHA A OldKitBag.XLHA BBS:Files/Troubles SHRI.100";say "";retur
  