; ;
;   X-Traktor v1.53, Sam Becket
;   Shark Byte Software - 1996
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
echo >ENV:xpath Ram:
lab 1
Requestchoice >ENV:xmain "X-Traktor 1.53" "X-Traktor 1.53 - Sam Becket, 1996" UnArc Arc CleanUp Other Quit

; UnArc

IF $xmain EQ 1
Requestfile >ENV:xfile Work: pattern #?.(LZX|LHA|DMS|LZH|ZOO|ZIP|ARJ|RAR) noicons title "Select Archive to Extract:" positive Okay negative Abort
   IF not $xfile
      skip back 1
   ENDIF
   echo >ENV:ext $xfile len=3
   IF $ext eq "DMS"
      skip 3
   ENDIF
   echo >ENV:xpathb $xpath
   Requestfile >ENV:xpath "$xpathb" noicons savemode drawersonly title "Select a Destination Path:" positive Okay negative Abort
   IF not $xpath
      skip back 1
   ENDIF
   echo ""
   echo "[1m[2mX-Traktor 1.53[0m - Extracting, [1m[3mPlease Wait...[0m"
   echo ""
   IF $ext eq "LZX"
      IF EXISTS c:unlzx
         unlzx x $xfile $xpath
      ELSE
         lzx x $xfile $xpath
      ENDIF
   ENDIF
   IF $ext eq "LHA"
      lha x $xfile $xpath
   ENDIF
   IF $ext eq "LZH"
      lha x $xfile $xpath
   ENDIF
   IF $ext eq "ZIP"
      unzip $xfile -d $xpath
   ENDIF
   IF $ext eq "ZOO"
      cd $xpath
      zoo x $xfile
   ENDIF
   IF $ext eq "ARJ"
      unarj x $xfile
   ENDIF
   IF $ext eq "RAR"
      unrar x $xfile $xpath
   ENDIF
lab 3
   IF $ext eq "DMS"
      echo ""
      echo "Enter Destination Device (eg. DF0:,DF1:,RAD:) - " noline
      Setenv >NIL: pathname ?
      echo ""
      echo "[1m[2mX-Traktor 1.53[0m - Depacking Disk, [1m[3mPlease Wait...[0m"
      echo ""
      dms write $xfile to $pathname noverify
      Delete >NIL: ENV:pathname
   ENDIF
lab 6
   Delete >NIL: ENV:ext
   echo "[0;0H[J"
   Skip back 1
ENDIF


; Arc

IF $xmain EQ 2
   Requestchoice >ENV:xflag "X-Traktor 1.53" "Select an Archive Method:" LZX LHA DMS UUencode Cancel
   IF $xflag eq 0
      skip back 1
   ENDIF
   IF $xflag eq 3
      skip 2
   ENDIF
   IF $xflag gt 2
      Requestfile >ENV:xfile multiselect title "Select File(s) to UUencode:" positive Okay negative Abort
      skip 2
   ENDIF

   Requestchoice >ENV:xarc "X-Traktor 1.53" "What Shall I Archive?" Directory Select
   IF $xarc eq 0
      Requestfile >ENV:xfile multiselect title "Select File(s) to Archive:" positive Okay negative Abort
   ENDIF
   IF $xarc eq 1
      Requestfile >ENV:xfile noicons title "Go In Directory to Archive:" positive Okay negative Abort
   ENDIF

lab 2
   Requestfile >ENV:xpath Ram: noicons savemode drawersonly title "Select Destination Path:" positive Okay negative Abort
   IF not $xpath
      skip back 1
   ENDIF
   echo ""
   echo "Enter Archive Name : " noline
   Setenv >NIL: pathname ?
   echo >ENV:xtemp $xpath noline
   echo >>ENV:xtemp $pathname
   IF $xflag eq 3
      skip 4
   ENDIF
   echo ""
   echo "[1m[2mX-Traktor 1.53[0m - Creating, [1m[3mPlease Wait...[0m"
   echo ""
   IF $xflag eq 4
      uuencode $xfile TO "$xtemp" 
      skip 4
   ENDIF
   IF $xarc eq 0
      IF $xflag eq 1
         lzx -3 a "$xtemp" $xfile
      ENDIF
      IF $xflag eq 2
         lha -D3 a "$xtemp" $xfile   
      ENDIF
   ENDIF
   IF $xarc eq 1
      cd $xfile
      IF $xflag eq 1
         lzx -3 a "$xtemp" #?
      ENDIF
      IF $xflag eq 2
         lha -D3 a "$xtemp"   
      ENDIF
   ENDIF
 
lab 4
   IF $xflag eq 3
      echo ""
      echo "Enter Device to be Packed (eg. DF0:,DF1:) - " noline
      Setenv >NIL: pathname ?
      echo ""
      echo "[1m[2mX-Traktor 1.53[0m - Packing Disk, [1m[3mPlease Wait...[0m"
      echo ""
      dms read "$xtemp" from $pathname cmode best low 0 high 79
   ENDIF
   Delete >NIL: ENV:pathname
   Delete >NIL: ENV:xtemp
   Delete >NIL: ENV:xarc
   skip back 1
ENDIF


; CleanUp

IF $xmain EQ 3
   if not exists ENV:xpath
      echo >ENV:xpath Ram:
   endif
   requestfile >ENV:xdel $xpath multiselect title "Select file(s) to Delete." positive Delete negative Cancel
   delete >NIL: $xdel quiet
   delete >NIL: ENV:xdel
   skip back 1
ENDIF


; Other

IF $xmain EQ 4
lab 5
   Requestchoice >ENV:xsub "X-Traktor 1.53" "Choose an Option:" Test View UUdecode About "<< Back"
   IF $xsub eq 0
      skip back 1
   ENDIF
   IF $xsub eq 1
      Requestfile >ENV:xfile pattern #?.(LZX|LHA|DMS|LZH|ZOO|ZIP|ARJ|RAR) noicons title "Select Archive to Test:" positive Okay negative Abort
      IF not $xfile
         skip back 5
      ENDIF
      echo >ENV:ext $xfile len=3
      echo ""
      echo "[1m[2mX-Traktor 1.53[0m - Testing, [1m[3mPlease Wait...[0m"
      echo ""
      IF $ext eq "LZX"
         lzx t $xfile
      ENDIF
      IF $ext eq "LHA"
         lha t $xfile
      ENDIF
      IF $ext eq "LZH"
         lha -D3 t $xfile
      ENDIF
      IF $ext eq "DMS"
         dms test $xfile
      ENDIF
      IF $ext eq "ZIP"
         unzip -t $xfile
      ENDIF
      IF $ext eq "ZOO"
         zoo -test $xfile
      ENDIF
      IF $ext eq "ARJ"
         unarj t $xfile
      ENDIF
      IF $ext eq "RAR"
         unrar t $xfile
      ENDIF
      delete >NIL: ENV:ext
      wait 2
      echo "[0;0H[J"
      Skip back 5
   ENDIF
   IF $xsub eq 2
      Requestfile >ENV:xfile pattern #?.(LZX|LHA|DMS|LZH|ZOO|ZIP|ARJ|RAR) noicons title "Select Archive to View:" positive Okay negative Abort
      IF not $xfile
         skip back 5
      ENDIF
      echo >ENV:ext $xfile len=3
      echo ""
      echo "[1m[2mX-Traktor 1.53[0m - Viewing, [1m[3mPlease Wait...[0m"
      echo ""
      IF $ext eq "LZX"
         lzx l $xfile
      ENDIF
      IF $ext eq "LHA"
         lha v $xfile
      ENDIF
      IF $ext eq "LZH"
         lha v $xfile
      ENDIF
      IF $ext eq "DMS"
         dms view $xfile
      ENDIF
      IF $ext eq "ZIP"
         unzip -l $xfile
      ENDIF
      IF $ext eq "ZOO"
         zoo -list $xfile
      ENDIF
      IF $ext eq "ARJ"
         unarj l $xfile
      ENDIF
      IF $ext eq "RAR"
         unrar l $xfile
      ENDIF
      delete >NIL: ENV:ext
      skip back 5
   ENDIF
   IF $xsub eq 3
      Requestfile >ENV:xfile Work: noicons title "Select file to UUdecode:" positive Okay negative Abort
      IF not $xfile
         skip back 5
      ENDIF
      Requestfile >ENV:xpath Ram: noicons savemode drawersonly title "Select a Destination Path:" positive Okay negative Abort
      IF not $xpath
         skip back 5
      ENDIF
      echo ""
      echo "[1m[2mX-Traktor 1.53[0m - UUdecoding File, [1m[3mPlease Wait...[0m"
      echo ""
      uudecode $xfile PATH $xpath 
      skip back 5
   ENDIF
   IF $xsub eq 4
      Requestchoice >NIL: "About X-Traktor..." "X-Traktor 1.53*N~~~~~~~~~~~~~~*NBy Sam Becket*NShark Byte Software - 12/08/96*N*NX-Traktor is FREEWARE.*NSee Guide for Instructions.*N*N*NSend Comments, Donations etc.. to:*N*NSam Becket*N 9 Brogden View,*N  Barnoldswick,*N   Lancs. BB8 5LH*N    England, UK.*N*Nemail: ramsdenj@unix.lancs.ac.uk" Okay!
      skip back 5
   ENDIF
ENDIF

Delete >NIL: ENV:xmain
Delete >NIL: ENV:xsub
Delete >NIL: ENV:xflag
Delete >NIL: ENV:xfile
Delete >NIL: ENV:xpath
Delete >NIL: ENV:xpathb
