home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / ftp.demon.co.uk-pub-cpm / logmake3.com / LOGMAKER.BAS next >
BASIC Source File  |  1979-11-30  |  5KB  |  131 lines

  1. 1 '          +------------------------------+
  2. 2 '          |                              |
  3. 3 '          |          Log Maker           |
  4. 4 '          |                              |
  5. 5 '          |             v3.0             |
  6. 6 '          |                              |
  7. 7 '          |      September 7, 1991       |
  8. 8 '          |                              |
  9. 9 '          |         John Curtis          |
  10. 10 '         |                              |
  11. 11 '         +------------------------------+
  12. 12 '
  13. 13 '
  14. 14 ON ERROR GOTO 118
  15. 15 GOTO 71
  16. 16 PRINT:PRINT:PRINT "-> Log Maker <-  v3.0  September 7, 1991  John Curtis":PRINT
  17. 17 PRINT "BBS Name     -> ";BBS$
  18. 18 PRINT "Filename     -> ";NME$
  19. 19 PRINT "Phone Number -> ";NMB$
  20. 20 PRINT:PRINT
  21. 21 PRINT "Is this okay? ";
  22. 22 Y$=INKEY$:IF Y$="" THEN 22
  23. 23 IF Y$="Y" OR Y$="y" THEN PRINT "Yes.":GOTO 25
  24. 24 PRINT "No.":END
  25. 25 'WRITE SCRIPT **********************
  26. 26 OPEN "O",#1,NME$
  27. 27 PRINT #1, "!& m 0"
  28. 28 PRINT #1, "!& o 0"
  29. 29 PRINT #1, "!b 2400"
  30. 30 PRINT #1, "!> \r\n\n"
  31. 31 PRINT #1, "!> A 'Log Maker' chat script!\r\n\n"
  32. 32 PRINT #1, "!> Dialing -> "+BBS$+" <-\r\n\n"
  33. 33 PRINT #1, "-at\r-OK\r\n-5-5-"
  34. 34 PRINT #1, "!: again"
  35. 35 PRINT #1, "-atdt"+NMB$+"\r--"
  36. 36 PRINT #1, "![ - 30 .2400.1200.300.BUSY"
  37. 37 PRINT #1, "![ = 2400 `2400"
  38. 38 PRINT #1, "![ = 1200 `1200"
  39. 39 PRINT #1, "![ = 300 `300"
  40. 40 PRINT #1, "![ = NO `NO"
  41. 41 PRINT #1, "!# a = a `again"
  42. 42 PRINT #1, "!: 2400"
  43. 43 PRINT #1, "!b 2400"
  44. 44 PRINT #1, "!# a = a `ready"
  45. 45 PRINT #1, "!: 1200"
  46. 46 PRINT #1, "!b 1200"
  47. 47 PRINT #1, "!# a = a `ready"
  48. 48 PRINT #1, "!: 300"
  49. 49 PRINT #1, "!b 300"
  50. 50 PRINT #1, "!# a = a `ready"
  51. 51 PRINT #1, "!: NO"
  52. 52 PRINT #1, "!> Abort! \7No activity at "+NMB$+"\r\n\n"
  53. 53 PRINT #1, "---"
  54. 54 PRINT #1, "!: ready"
  55. 55 PRINT #1, "!& o 1"
  56. 56 PRINT #1, "!> Connection!\7\r\n\n"
  57. 57 PRINT:PRINT "Dialing sequence installed.":PRINT
  58. 58 PRINT "Would you like to add to the basic script? ";
  59. 59 Y$=INKEY$:IF Y$="" THEN 59
  60. 60 IF Y$="N" OR Y$="n" THEN PRINT "No.":PRINT #1, "---":CLOSE #1:END
  61. 61 PRINT "Yes."
  62. 62 PRINT:PRINT "'@' if you want a NULL string and"
  63. 63 PRINT "'\r' for additional 'returns'.":INPUT "String to SEND: ";SND$
  64. 64 INPUT "EXPECT string: ";EXP$
  65. 65 IF SND$="@" THEN SND$="":PRINT #1, "--"+EXP$+"-":GOTO 69
  66. 66 IF SND$="\r" OR SND$="\r\r" OR SND$="\r\r\r" OR SND$="\r\r\r\r" THEN PRINT #1, "-"+SND$+"-"+EXP$+"-":GOTO 69
  67. 67 IF EXP$="@" THEN EXP$=""
  68. 68 PRINT #1, "-"+SND$+"\r-"+EXP$+"-"
  69. 69 PRINT "Add more? ";
  70. 70 GOTO 59
  71. 71 PRINT
  72. 72 A=&H7F
  73. 73 A=A+&H1
  74. 74 B=PEEK(A)
  75. 75 IF B THEN A=A+&H1:GOTO 77
  76. 76 GOTO 100 '    ************ NO COMMAND LINE PRESENT
  77. 77 A=A+&H1
  78. 78 B=PEEK(A)
  79. 79 IF B THEN CMM$=CMM$+CHR$(B):GOTO 77
  80. 80 '      ************ THE COMMAND IS IN CMM$
  81. 81 L=LEN(CMM$)
  82. 82 FOR T=1 TO L
  83. 83 T$=MID$(CMM$,T,1)
  84. 84 IF T$=" " THEN NTWO=1:T$=""
  85. 85 IF T<5 THEN NME$=NME$+T$
  86. 86 IF NTWO=1 AND T$="-" THEN T$=""
  87. 87 IF NTWO=1 THEN NMB$=NMB$+T$:GOTO 89
  88. 88 BBS$=BBS$+T$
  89. 89 NEXT T
  90. 90 L=LEN(NMB$)
  91. 91 IF L=0 THEN TMCH$="*** The phonenumber field was empty."+CHR$(7):GOTO 100
  92. 92 FOR T=1 TO L
  93. 93 T$=MID$(NMB$,T,1)
  94. 94 IF T$="*" THEN GOTO 96
  95. 95 IF T$<"0" OR T$>"9" THEN TMCH$="*** The character '"+T$+"' is unacceptable in the phonenumber field."+CHR$(7):GOTO 100
  96. 96 NEXT T
  97. 97 OPEN "I",#1,NME$
  98. 98 CLOSE #1
  99. 99 GOTO 125
  100. 100 '
  101. 101 PRINT:PRINT:PRINT:PRINT "-> Log Maker <-  v3.0  September 7, 1991  John Curtis"
  102. 102 PRINT
  103. 103 PRINT "Purpose:  This program will produce a 'chat script' to be used with"
  104. 104 PRINT "          the telecommunication program QTERM and any modem using"
  105. 105 PRINT "          the 'AT' command set."
  106. 106 PRINT
  107. 107 PRINT "Syntax:   LOGMAKER bbsname phonenumber"
  108. 108 PRINT "          -the bbsname must not contain spaces."
  109. 109 PRINT "          -the name of the 'chat script' will be dirived from"
  110. 110 PRINT "           the first four characters of the bbsname so take"
  111. 111 PRINT "           care not to use 'illegal' characters in these "
  112. 112 PRINT "           positions."
  113. 113 PRINT "          -the phonenumber may be entered in the forms"
  114. 114 PRINT "           555-1212 or 5551212."
  115. 115 PRINT "          -if you have call waiting and would like to disable"
  116. 116 PRINT "           it preceed the phonenumber with *70."
  117. 117 PRINT:PRINT TMCH$:END
  118. 118 '
  119. 119 CLOSE #1
  120. 120 IF ERR=61 OR ERR=67 THEN TMCH$="This disk is full!!  Correct this situation before running this program."+CHR$(7):CLOSE #1:RESUME 100
  121. 121 IF ERR=64 THEN TMCH$="'"+NME$+"' is unacceptable as a filename."+CHR$(7):CLOSE #1:RESUME 100
  122. 122 IF ERR=57 THEN TMCH$="A disk I/O error has occured.":CLOSE #1:RESUME 100
  123. 123 IF ERR=53 THEN RESUME 16
  124. 124 PRINT:PRINT "Error ";ERR;" at line ";ERL:END
  125. 125 '
  126. 126 PRINT:PRINT "A file with the name "+NME$+" already exists. "
  127. 127 PRINT "Do you want to write over it?";
  128. 128 Y$=INKEY$:IF Y$="" THEN 128
  129. 129 IF Y$="Y" OR Y$="y" THEN PRINT " Yes.":GOTO 16
  130. 130 PRINT " No.":END
  131.