; ;
;   X-Traktor v1.41, Sam Becket
;   Haunebu Software - 1996
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
lab 1
Requestchoice >ENV:xmain "X-Traktor 1.41" "Choose an Option:" UnArc Arc CleanUp Other Quit
IF $xmain EQ 1
   Requestfile >ENV:xfile Work: pattern #?.(LZX|LHA|DMS|LZH|ZOO|ZIP) 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
   Requestfile >ENV:xpath Ram: 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.41[0m - Extracting Archive, [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
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.41[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

IF $xmain EQ 2
   Requestchoice >ENV:xflag "X-Traktor 1.41" "Select an Archive Method:" LZX LHA DMS Cancel
   IF $xflag eq 0
      skip back 1
   ENDIF
   IF $xflag eq 3
      skip 2
   ENDIF
   Requestfile >ENV:xfile multiselect title "Select File(s) to Archive:" positive Okay negative Abort
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.41[0m - Creating Archive, [1m[3mPlease Wait...[0m"
   echo ""
   IF $xflag eq 1
      lzx -3 a "$xtemp" $xfile
   ENDIF
   IF $xflag eq 2
      lha a "$xtemp" $xfile   
   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.41[0m - Packing, [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
ENDIF

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

IF $xmain EQ 4
lab 5
   Requestchoice >ENV:xsub "X-Traktor 1.41" "Choose an Option:" Test View About "<< Back"
   IF $xsub eq 0
      skip back 1
   ENDIF
   IF $xsub eq 1
      Requestfile >ENV:xfile pattern #?.(LZX|LHA|DMS|LZH|ZOO|ZIP) 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.41[0m - Testing Archive, [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 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
      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) 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.41[0m - Viewing Archive, [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
      delete >NIL: ENV:ext
      skip back 5
   ENDIF
   IF $xsub eq 3
      Requestchoice >NIL: "About X-Traktor..." "X-Traktor 1.41*N*NBy Sam Becket*NHaunebu Software - 17/02/96*N*NSee Guide for Instructions*N*Nemail: csc450@cent1.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
