home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -readerstuff- / richard_burke / scripts / dmsmakerenk_v2.0 < prev    next >
Text File  |  1998-05-02  |  8KB  |  252 lines

  1. Resident >NIL: C:RequestChoice PURE
  2. Resident >NIL: C:RequestFile PURE
  3. Resident >NIL: C:RequestString PURE
  4.  
  5. ; $VER: DMSMakerEnk v2.0 (9.7.97) Richard Burke
  6.  
  7. lab Start
  8. unset pas
  9. unset pass
  10. unset pass1
  11. unset pas1
  12.  
  13. if EXISTS ENV:Choice
  14.         delete ENV:Choice >NIL:
  15. endif
  16.  
  17. if EXISTS ENV:Tst
  18.         delete ENV:Tst >NIL:
  19. endif
  20.  
  21. if EXISTS ENV:V
  22.         delete ENV:V >NIL:
  23. endif
  24.  
  25. if EXISTS ENV:Re
  26.         delete ENV:Re >NIL:
  27. endif
  28.  
  29. if EXISTS ENV:DMS
  30.         delete ENV:DMS >NIL:
  31. endif
  32.  
  33. if EXISTS ENV:De
  34.         delete ENV:De >NIL:
  35. endif
  36.  
  37. if EXISTS ENV:DeDev
  38.         delete ENV:DeVol >NIL:
  39. endif
  40.  
  41. if EXISTS ENV:Cr
  42.         delete ENV:Cr >NIL:
  43. endif
  44.  
  45. if EXISTS ENV:CrSv
  46.         delete ENV:CrSv  >NIL:
  47. endif
  48.  
  49. if EXISTS ENV:Mode
  50.         delete ENV:Mode >NIL:
  51. endif
  52.  
  53. if EXISTS ENV:Mode1
  54.         delete ENV:Mode1 >NIL:
  55. endif
  56.  
  57. which DMS all >ENV:DMS
  58.  
  59. RequestChoice >ENV:Choice "Welcome!" "Welcome to the DMSMaker! Choose an action" "Crunch" "Decrunch" "Repack" "View" "Test" "Quit"
  60.  
  61. if $Choice EQ 1
  62.         lab Dev
  63.         RequestFile >ENV:Cr DRAWERSONLY TITLE "Choose DEVICE to crunch" POSITIVE "Crunch" NEGATIVE "Return to menu"
  64.                 if WARN
  65.                         skip Start BACK
  66.                 endif
  67.                 if NOT EXISTS $Cr
  68.                         echo "DEVICE does not exist! Choose again!"
  69.                         delete >nil: env:cr
  70.                         skip Dev BACK
  71.                 endif
  72.         RequestChoice >ENV:Mode1 "Crunch Mode" "Choose degree of crunching" "Best" "None" "Heavy1" "Heavy2" "Return to menu"
  73.                 if $Mode1 EQ 0
  74.             skip Start BACK
  75.                 endif
  76.                 if $Mode1 EQ 1
  77.                         echo "BEST" >ENV:Mode
  78.                 endif
  79.                 if $Mode1 EQ 2
  80.                         echo "NONE" >ENV:Mode
  81.                 endif
  82.                 if $Mode1 EQ 3
  83.                         echo "HEAVY1" >ENV:Mode
  84.                 endif
  85.                 if $Mode1 EQ 4
  86.                         echo "HEAVY2" >ENV:Mode
  87.                 endif
  88.         RequestFile >ENV:CrSv TITLE "Save crunched file as..." ACCEPTPATTERN "#?.dms" FILE ".dms" POSITIVE "Save" NEGATIVE "Return to menu"
  89.                 if WARN
  90.                         skip Start BACK
  91.                 endif
  92.     lab enk
  93.         RequestChoice >ENV:En "Encryption" "Do you wish to encrypt the FILE when saving?" "Yes" "No" "Return to menu"
  94.                 if $En EQ 1
  95.             lab pa
  96.                         set pass `RequestString "" "Type password:" INVISIBLE`
  97.             if "$pass" EQ "*$pass"        ;Cancel was pressed
  98.                 skip NoEnk
  99.             endif
  100.             set pass1 `RequestString "" "Verify password:" INVISIBLE`
  101.             if $pass1 EQ $pass
  102.                 $DMS read $CrSv FROM $Cr CMODE $Mode ENCRYPT $Pass
  103.                 if NOT ERROR
  104.                                 echo "File encrypted and crunched!"
  105.                 endif
  106.             else
  107.                 echo "Password incorrect!*nTry again!"
  108.                 skip pa back
  109.                     endif
  110.         endif
  111.                 if $En EQ 0
  112.                         skip Start BACK
  113.                 endif
  114.  
  115.         lab NoEnk
  116.                 if $En EQ 2
  117.                         $DMS read $CrSv FROM $Cr CMODE $Mode
  118.                 endif
  119. endif
  120.  
  121. if $Choice EQ 2
  122.         lab Dec
  123.         RequestFile >ENV:De TITLE "Choose FILE to decrunch" ACCEPTPATTERN "#?.dms" POSITIVE "Decrunch" NEGATIVE "Return to menu"
  124.                 if WARN
  125.                         skip Start BACK
  126.                 endif
  127.                 if NOT EXISTS $De
  128.                         echo "FILE does not exist! Choose again!"
  129.                         delete >nil: env:de
  130.                         skip Dec BACK
  131.                 endif
  132.         lab DecDev
  133.         RequestFile >ENV:DeDev TITLE "Choose DEVICE to decrunch TO" DRAWERSONLY POSITIVE "Write" NEGATIVE "Return to menu"
  134.                 if WARN
  135.                         skip Start BACK
  136.                 endif
  137.                 if NOT EXISTS $DeDev
  138.                         echo "DEVICE does not exist! Choose again!"
  139.                         delete >nil: env:dedev
  140.                         skip DecDev BACK
  141.                 endif
  142.         lab DeEnk
  143.         RequestChoice >ENV:DeEnc "De-Encrypt" "Was FILE encrypted when saved? If unsure, read General Info on View -*nif it says ENCRYPTED, it's encrypted. If it doesn't, it's not." "Yes" "No" "View" "Return to menu"
  144.                 if $DeEnc EQ 0
  145.                         skip Start BACK
  146.                 endif
  147.                 if $DeEnc EQ 1
  148.             lab pa1
  149.                         set pas `RequestString "" "Type password:" INVISIBLE`
  150.             if "$pas" EQ "*$pas"
  151.                 skip DeEnk back
  152.             endif
  153.             set pas1 `RequestString "" "Verify password:" INVISIBLE`
  154.             if $pas1 EQ $pas
  155.                 echo "Password verified!"
  156.                 $DMS write $De TO $DeDev DECRYPT $Pas
  157.                 if NOT ERROR
  158.                                 echo "File decrypted and decrunched!"
  159.                 else
  160.                     echo "Incorrect password!*nTry again!"
  161.                     skip pa1 back
  162.                 endif
  163.             else
  164.                 echo "Password incorrect!*nTry again!"
  165.                 skip pa1 back
  166.                     endif
  167.         endif
  168.                 if $DeEnc EQ 2
  169.                         $DMS write $De TO $DeDev
  170.                 endif
  171.                 if $DeEnc EQ 3
  172.                         $DMS view $De
  173.                         skip DeEnk BACK
  174.                 endif
  175. endif
  176.  
  177. if $Choice EQ 3
  178.         lab Rep
  179.         RequestFile >ENV:Re TITLE "Choose FILE to repack" ACCEPTPATTERN "#?.dms" POSITIVE "Repack" NEGATIVE "Return to menu" FILE ".dms"
  180.                 if WARN
  181.                         skip Start BACK
  182.                 endif
  183.                 if NOT EXISTS $Re
  184.                         echo "File does not exist! Choose again!"
  185.                         delete >nil: env:re
  186.                         skip Rep BACK
  187.                 endif
  188.         RequestChoice >ENV:Mode1 "Crunch Mode" "Choose degree of crunching" "Best" "None" "Heavy1" "Heavy2" "Return to menu"
  189.                 if WARN
  190.                         skip Start BACK
  191.                 endif
  192.                 if $Mode1 EQ 1
  193.                         echo "BEST" >ENV:Mode
  194.                 endif
  195.                 if $Mode1 EQ 2
  196.                         echo "NONE" >ENV:Mode
  197.                 endif
  198.                 if $Mode1 EQ 3
  199.                         echo "HEAVY1" >ENV:Mode
  200.                 endif
  201.                 if $Mode1 EQ 4
  202.                         echo "HEAVY2" >ENV:Mode
  203.                 endif
  204.         RequestFile >ENV:CrSv TITLE "Save repacked file as..." ACCEPTPATTERN "#?.dms" FILE ".dms" POSITIVE "Save" NEGATIVE "Return to menu"
  205.                 if WARN
  206.                         skip Start BACK
  207.                 endif
  208.         $DMS repack $Re TO $CrSv CMODE $Mode
  209. endif
  210.  
  211. if $Choice EQ 4
  212.         lab View
  213.         RequestFile >ENV:V TITLE "Choose DMS FILE to view" POSITIVE "View" NEGATIVE "Return to menu" ACCEPTPATTERN "#?.dms" FILE ".dms"
  214.                 if WARN
  215.                         skip Start BACK
  216.                 endif
  217.                 if NOT EXISTS $V
  218.                         echo "FILE does not exist! Choose again!"
  219.                         delete >nil: env:v
  220.                         skip View BACK
  221.                 endif
  222.                 $DMS view $V
  223. endif
  224.  
  225. if $Choice EQ 5
  226.         lab Test
  227.         RequestFile >ENV:Tst TITLE "Choose FILE to test" ACCEPTPATTERN "#?.DMS" POSITIVE "Test" NEGATIVE "Return to menu" FILE ".dms"
  228.                 if WARN
  229.                         skip Start BACK
  230.                 endif
  231.                 if NOT EXISTS $Tst
  232.                         echo "FILE does not exist! Choose again!"
  233.                         delete >nil: env:tst
  234.                         skip Test BACK
  235.                 endif
  236.                 $DMS test $Tst
  237. endif
  238.  
  239. if $Choice EQ 0
  240.         skip End
  241. endif
  242.  
  243. skip Start BACK
  244.  
  245. lab End
  246. if EXISTS ENV:Choice
  247.         delete ENV:Choice >NIL:
  248. endif
  249. if EXISTS ENV:DMS
  250.         delete ENV:DMS >NIL:
  251. endif
  252. quit