home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / sound / psslib2 / psskey.lst < prev    next >
File List  |  1994-05-08  |  2KB  |  67 lines

  1. ' ************************************************************************
  2. ' **                                                                     *
  3. ' **   PSSKEY - Unlocks the Save feature for PSSLIB patch editor         *
  4. ' **            and registers the program.                               *
  5. ' ************************************************************************
  6. '
  7. DIM b$(10)                  !storage to get code
  8. path$=DIR$(0)               !path is the current directory
  9. count=1                     !initialize count sequence (4 times max)
  10. entercode:                  !Display message, get key code
  11. CLS
  12. PRINT "Use this program to allow Saving your patches to disk."
  13. PRINT ""
  14. INPUT "Enter the key code: ";code$
  15. o=1
  16. p=1                         ! initialize pointers
  17. n=89421                     ! set offset to embedded keycode in app
  18. IF code$="exit" THEN        ! exit program if user types exit
  19.   CLOSE #1
  20.   END
  21. ENDIF
  22. OPEN "i",#1,path$+"\psslib.prg"  ! open PSSLIB
  23. FOR i=1 TO 10                    ! get keycode 1 char at a time
  24.   SEEK #1,n
  25.   x=INP(#1)
  26.   b$(o)=CHR$(x)
  27.   INC n
  28.   INC o
  29. NEXT i
  30. PRINT
  31. filecode$=b$(1)+b$(2)+b$(3)+b$(4)+b$(5)+b$(6)+b$(7)+b$(8)+b$(9)+b$(10)
  32. IF filecode$=code$
  33.   n=89212                   ! set offset to where keycode is to be written
  34.   CLOSE #1
  35.   OPEN "a",#1,path$+"\psslib.prg"  ! reopen PSSLIB
  36.   g=LOF(#1)                        ! point to end-of-file
  37.   offset=g-n                       ! get offset relative to EOF
  38.   RELSEEK #1,-(offset)             ! point to new offset
  39.   FOR i=1 TO 10
  40.     OUT #1,ASC(b$(i))        ! write the correct keycode to register program
  41.   NEXT i
  42. ELSE
  43.   IF count=4
  44.     PRINT "Sorry, you must become registered!  Please pay $7.00 to:"
  45.     PRINT ""
  46.     PRINT "                       Mike Silverstein"
  47.     PRINT "                       555 Rosewood Ave. #306"
  48.     PRINT "                       Camarillo, CA 93010"
  49.     PRINT
  50.     PRINT "If you would like the GFA Source Code, send a self-addressed stamped"
  51.     PRINT "envelope with a blank disk to the above address."
  52.     PRINT
  53.     PRINT "You may also become registered by offering a $10 Gift of Time to"
  54.     PRINT "M.SILVERSTE3 on GEnie"
  55.     PRINT
  56.     PRINT "Press Esc to return to desktop"
  57.     DO
  58.     LOOP UNTIL INKEY$=CHR$(27)
  59.     END
  60.   ENDIF
  61.   CLOSE #1
  62.   INC count
  63.   GOTO entercode
  64. ENDIF
  65. CLOSE #1
  66. END
  67.