home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / telecomm / storm100 / genie.bas < prev    next >
BASIC Source File  |  1993-11-03  |  2KB  |  89 lines

  1. 'GEnie logon script
  2. 'The first time you run it, prompts for account and password
  3. Loop:
  4. FAST ON
  5. acct$ = SET$("STORM","GEnie","Account")
  6. temp$ = SET$("STORM","GEnie","Password")
  7. pwd$ = ""
  8. 'A Basic oddity, FOR loop will always be executed once!
  9. 'So check length first
  10. 'Decrypt it
  11. IF LEN(temp$) > 0 THEN
  12.     FOR x = 1 TO LEN(temp$)
  13.         pwd$ = pwd$ + CHR$( ASC( MID$(temp$,x,1)) XOR 255)
  14.     NEXT x
  15. ENDIF
  16. '
  17. IF LEN(acct$) = 0 OR LEN(pwd$) = 0 THEN
  18.     GOSUB Setup
  19.     IF LEN(acct$) = 0 OR LEN(pwd$) = 0 THEN
  20.         GOTO Loop
  21.     ELSE PRINT "GEnie setup Complete"
  22.         PRINT "Thank you"
  23.         PRINT "========="
  24.         END
  25.      ENDIF
  26. ENDIF
  27. 'Now do actual logon
  28. FAST OFF
  29. TERM OFF
  30. Tries = 1
  31. TOPW 1
  32. 'Uncomment lines below if you have problems with HHH getting
  33. 'recognized and need a brief delay. e.g. high-speed modems.
  34. 'SEND "H";
  35. 'SEND "H";
  36. 'SEND "H";
  37. 'default is single send. Comment this out if you use the 3 lines above.
  38. SEND "HHH";
  39. DUPLEX FULL :'So password doesn't appear on screen
  40. WAIT 20,"U#="
  41. IF WAIT(0) = 0 THEN
  42. Failure:
  43.     TOPW 3
  44.     PRINT "Logon Failed"; CHR$(7)
  45.     TERM ON
  46.     END
  47. ENDIF
  48. Password:
  49. IF Tries >= 3 THEN Failure
  50. SEND acct$ + "," + pwd$
  51. WAIT 5,"REENTER"
  52. IF WAIT(0) = 1 THEN Tries = Tries + 1:GOTO Password:'Got glitched
  53. DUPLEX HALF
  54. TERM ON
  55. END
  56. '
  57. 'Prompt user for GEnie account and password
  58. 'And store information in STORM.INI file, after confirming it.
  59. Setup:
  60. TOPW 3:CLS :PRINT "Welcome to Storm's GEnie Setup Script"
  61. PRINT "==========================================":PRINT
  62. IF LEN(acct$) > 0 THEN GetPassword
  63. RepeatAcct:
  64. PRINT
  65. PRINT "Please enter your account number";
  66. INPUT acct$
  67. IF LEN(acct$) = 0 THEN RepeatAcct
  68. 'Since acct was absent, assume password was as well
  69. GetPassword:
  70. PRINT
  71. PRINT "Please enter your password";
  72. INPUT pwd$
  73. IF LEN(pwd$) = 0 THEN RepeatPassword
  74. temp$ = ""
  75. 'Simple hack to encrypt password into graphics/foreign characters
  76. FOR x = 1 TO LEN(pwd$)
  77.     temp$ = temp$ + CHR$( ASC( MID$(pwd$,x,1)) XOR 255)
  78. NEXT x
  79. PRINT "Your Account is ";acct$
  80. PRINT "Your Password is ";pwd$
  81. PRINT "Is that correct (Y/N)"
  82. INPUT confirm$
  83. confirm$ = UCASE$( LEFT$(confirm$,1))
  84. IF confirm$ <> "Y" THEN RepeatAcct
  85. SET "STORM","GEnie","Password",temp$
  86. SET "STORM","GEnie","Account",acct$
  87. RETURN
  88.  
  89.