home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / bbs / femnet93.zip / FEMNET.SCR < prev    next >
Text File  |  1993-04-11  |  8KB  |  335 lines

  1. ;  Script Date:  4/10/93
  2. ;
  3. ;  - This script is designed for a hub to retrieve a QWK packet from The
  4. ;    Land of the Unicorns BBS in Bronxville, NY (A Wildcat 3.6 system) to
  5. ;    get the Femnet echo's.
  6. ;
  7. ;  - If you have ANY ideas or questions about the script please drop me a
  8. ;    note.
  9. ;
  10. ;  - YOU MUST HAVE HOT KEYS TURNED ON FOR THIS SCRIPT TO WORK!
  11. ;
  12. ;  - If you are going to use it on a system other than
  13. ;    The Land of the Unicorns you MUST change line 41 to
  14. ;    reflect new packet name!
  15.  
  16. TurnON   8_BIT
  17. TurnOFF  LINEFEED
  18. TurnOFF  NOISE
  19. TurnOFF  MUSIC
  20. TurnOFF  SCROLL
  21. TurnOFF  PRINT
  22. TurnOFF  SPLIT
  23. TurnOFF  DOORWAY
  24. GRAPHICS ANSI
  25.  
  26. COLORBG 0
  27. COLORFG 14
  28. CLRSCR
  29.  
  30. STRING NAME
  31. STRING PACKET
  32. STRING PHONE
  33. STRING PREFIX
  34. STRING INIT
  35. STRING MAX_REDIAL
  36. STRING LOGIN_NAME
  37. STRING PWORD,ANSWER
  38. ASSIGN 0 1                ; Redial counter.
  39. ASSIGN 1 5                ; Number of Init tries.
  40. ASSIGN 3 "INITIALIZED"    ; Fill variable with initial value.
  41. ASSIGN PACKET LOTU     ; Assign first 8 chars of the QWK packet here.
  42.  
  43. EXIST $PACKET.CFG GO
  44. QUES1:
  45.   ATWRITE 1,1,11,"Enter the name of the system you are calling:"
  46.   GOTOXY 1 2
  47.   DISPLAYLN "[───────────────────────────────]"
  48.   GOTOXY 2 3
  49.    GETN NAME 30
  50. QUES2:
  51.   ATWRITE 1,4,11,"Enter the name that you call to get mail with (DON'T ADD A !)"
  52.   GOTOXY 1 5
  53.   DISPLAYLN "[───────────────────────────────]"
  54.   GOTOXY 2 6
  55.    GETN LOGIN_NAME 30
  56. QUES3:
  57.   ATWRITE 1,7,11,"Enter the password (14 chars max):
  58.   GOTOXY 1,8
  59.   DISPLAYLN "[──────────────]"
  60.   GOTOXY 2 9
  61.    GETN PWORD 14
  62. QUES4:
  63.   ATWRITE 1,10,11,"Enter The phone number to dial (Default: 1-914-961-0398):
  64.   ATWRITE 1,11,11,"MAKE SURE TO ADD THE 1- if you are calling long distance!!"
  65.   GOTOXY 1 12
  66.   DISPLAYLN "[──────────────]"
  67.   GOTOXY 2 13
  68.    GETN PHONE 12
  69.     IF "$PHONE" = "" LOAD_DEFAULT_NUMBER
  70. QUES5:
  71.   ATWRITE 1,14,11,"Enter the max NUMBER of redial attempts to this system (Max 999):
  72.   GOTOXY 1 15
  73.   DISPLAYLN "[───]"
  74.   GOTOXY 2 16
  75.    GETN MAX_REDIAL 3
  76. QUES6:
  77.   ATWRITE 1,17,11,"Enter your custom initialization string here (Default: ATZ):
  78.   GOTOXY 1 18
  79.   DISPLAYLN "[────────────────────────────────────────]"
  80.   GOTOXY 2 19
  81.    GETN INIT 40
  82.    IF "$INIT" = "" LOAD_DEFAULT_INIT
  83. QUES7:
  84.     COLORFG 11
  85.     GOTOXY 1 20
  86.     DISPLAY "Do you have [T]one or [P]ulse dialing (Default: Tone)(T/P)? "
  87.     GETN PREFIX 1
  88.      IF "$PREFIX" = "P" ASSIGN_PULSE
  89.      IF "$PREFIX" = "T" ASSIGN_TONE
  90.      IF "$PREFIX" = "" ASSIGN_TONE
  91. QUES8:
  92.   CLRSCR
  93.   ATWRITE 1,1,11,"Do you want this script to pick up the line and"
  94.   ATWRITE 1,2,11,"send a message to a use who is trying to call the BBS"
  95.   GOTOXY 1 3
  96.   DISPLAY "telling them to call back later Y/n? "
  97.   GETN ANSWER 1
  98.      IF "$ANSWER" = "Y" ASSIGN_Y
  99.      IF "$ANSWER" = "N" ASSIGN_N
  100.      IF "$ANSWER" = "" ASSIGN_Y
  101. WRITE_INFO:
  102.   OPENFILE $PACKET.CFG REWRITE
  103.    WRITEFILE "$NAME"
  104.    WRITEFILE "!$LOGIN_NAME"
  105.    WRITEFILE "$PWORD"
  106.    WRITEFILE "$PHONE"
  107.    WRITEFILE "$MAX_REDIAL"
  108.    WRITEFILE "$INIT"
  109.    WRITEFILE "$PREFIX"
  110.    WRITEFILE "$ANSWER"
  111.   CLOSEFILE
  112.   GOTO GO
  113.  
  114. LOAD_DEFAULT_NUMBER:
  115.   ASSIGN PHONE 1-914-961-0398
  116. GOTO QUES5
  117.  
  118. LOAD_DEFAULT_INIT:
  119.   ASSIGN INIT ATZ
  120. GOTO QUES7
  121.  
  122. ASSIGN_TONE:
  123.   ASSIGN PREFIX T
  124. GOTO QUES8
  125.  
  126. ASSIGN_PULSE:
  127.   ASSIGN PREFIX P
  128. GOTO QUES8
  129.  
  130. ASSIGN_Y:
  131.   ASSIGN ANSWER Y
  132. GOTO WRITE_INFO
  133.  
  134. ASSIGN_N:
  135.   ASSIGN ANSWER N
  136. GOTO WRITE_INFO
  137.  
  138. SEND_MESSAGE:
  139.  WHEN               ; Clear WHEN's
  140.  TimeOut 10 START
  141.  Waitfor "RING"
  142.  IF "$ANSWER" = "N" WAIT_4_SILENCE
  143.  TimeOut 60 REINIT
  144.    Waitfor "RING"
  145.    Delay 500
  146.    Send "ATA^M"
  147.    Waitfor "CONNECT"
  148.    Delay 3000
  149.    Send "The system is currently attempting to make an outgoing call.^M^J"
  150.    Send "Please hang up and try back later."
  151.    Delay 2000
  152.  HANGUP
  153. GOTO REINIT
  154.  
  155. WAIT_4_SILENCE:
  156.  CLRSCR
  157.   FLUSH ALL          ;  Flush the buffers to make sure of no stray RING's
  158.   TimeOut 15 INCREMENT
  159.   Waitfor "RING" WAIT_4_SILENCE
  160.  
  161. GO:          ;  Begin Main body of script
  162.  
  163. ;   Fill variables with preferences
  164.  
  165.   OPENFILE $PACKET.CFG READ
  166.     READFILE NAME        ; Read System name
  167.     READFILE LOGIN_NAME  ; Read in login name
  168.     READFILE PWORD       ; Read in password
  169.     READFILE PHONE       ; Read phone number
  170.     READFILE MAX_REDIAL  ; Read max redial attempts
  171.     READFILE INIT        ; Read init string.
  172.     READFILE PREFIX      ; Read in dialing prefix
  173.     READFILE ANSWER      ; Read in call collision preference
  174.   CLOSEFILE
  175.  
  176. LOG $PACKET.LOG          ; Turn on logging.
  177. CAPTURE $PACKET.CAP      ; Turn on session capture.
  178.  
  179. ASSIGN 6 1  ; Current number of tries
  180. REINIT:
  181.  TimeOut 10 REINIT
  182.  CLRSCR
  183.  COLORFG 0
  184.  COLORBG 0
  185.  IF "$6" = "$1" NO_MODEM_RESPONSE
  186.   ATWRITE 1,1,11,"Modem Init Attempt Number $6 of $1"
  187.   GOTOXY 5 5
  188.   SEND "$INIT^M"
  189.   INCR 6
  190.   WAITFOR "OK"           ; Get modem response.
  191.   PAUSE 3000
  192.   SEND "ATX4E0M0^M"      ; HST's and HST/DS's needs X4 to run this script!
  193.   WAITFOR "OK"           ; Get modem response.
  194.  
  195.  TimeOut 60 START
  196. START:
  197.  CLRSCR
  198.   WHEN
  199.   WHEN "RING" SEND_MESSAGE
  200.   WHEN "BUSY" INCREMENT
  201.   WHEN "NO DIAL" INCREMENT
  202.   WHEN "NO CARRIER" START
  203.   COLOR 30
  204.   BOX 10,5,65,15
  205.  CLRSCR
  206.    GOTOXY 4 1
  207.   DISPLAY " Dialing $NAME at $TIME"
  208.    GOTOXY 17 3
  209.   DISPLAY "Try Number $0 of $MAX_REDIAL"
  210.    GOTOXY 12 5
  211.   DISPLAY "Message From Modem: "
  212.   WINDOW 42 10 55 12
  213.   COLORFG 11
  214.  
  215.  TIMEOUT 30 START ; Increase/Decrease as needed to match S7 register in modem.
  216.   DELAY 3000
  217.   SEND "ATD$PREFIX$PHONE^M"
  218.    GOTOXY 1 1
  219.   WAITFOR "CONNECT"
  220.   DELAY 1000
  221.   IF $ONLINE SKIP
  222.    INCREMENT:
  223.     IF "$0" = "$MAX_REDIAL" END
  224.     INCR 0
  225.     Delay 9000    ;  Delay for 9 seconds before next attempt.
  226.   GOTO START
  227.  
  228. SKIP:
  229.  COLORBG 0
  230.  TimeOut 30 FIRST_NAME
  231.   WINDOW 1,1,80,24
  232.  CLRSCR
  233.   WHEN                   ; Clear Above WHEN "BUSY" setting
  234.   WHEN "[C]ont" "^M"     ; Watch for long prelog screen
  235.   WHEN "CAUTION!" "^M"
  236.   WHEN "[y/N]" "^M"
  237.   WHEN "correctly" "^M"
  238.   WHEN "first name" SEND_NAME
  239.   WHEN "-PAUSE-" "^M"
  240.   WHEN "[S]top" "^M"
  241.   WHEN "NO CARRIER" START
  242.  
  243. FIRST_NAME:
  244.   Waitfor "your first name"
  245.   Delay   100
  246. SEND_NAME:
  247.   Send "$LOGIN_NAME^M"
  248.   PAUSE 1000
  249.   Send "^M"
  250.   Waitfor "Password?"
  251.   Send "$PWORD"
  252.   TimeOut 30 TOMCAT_MENU
  253.   WHEN                   ; Clear above WHEN's
  254.   WHEN "first name" SKIP
  255.   WHEN "PACKER MENU" SELECT_PACKER
  256.   WHEN "PROTOCOL MENU" SELECT_PROTOCOL
  257.   WHEN "NO CARRIER" START
  258.  GOTO TOMCAT_MENU
  259.  
  260. SELECT_PACKER:
  261.  Send "Z"
  262.  GOTO DOWNQWK
  263.  
  264. SELECT_PROTOCOL:
  265.   Send "Z"
  266.  GOTO DOWNQWK
  267.  
  268. TOMCAT_MENU:
  269.   Send "^M"
  270.   Waitfor "TOMCAT MENU"  ; Tomcat Main Menu Prompt
  271.   Delay   300
  272.   When "load!" TEST_FOR_REP
  273.   Send    "D"
  274.  
  275. DOWNQWK:
  276.  TimeOut 900 TOMCAT_MENU
  277.   Waitfor "done?"
  278.   Delay   100
  279.   Send    "Y"
  280.   Waitfor "now"
  281.   Download Z $DLPATH
  282.   IF $FAIL TOMCAT_MENU
  283.   WHEN
  284.  
  285. TEST_FOR_REP:
  286.    EXIST $ULPATH$PACKET.REP UPLOAD_REP  ; Test for existence of reply packet
  287.  GOTO END
  288.  
  289. SELECT_PACKER_UPLOAD:
  290.  Send "Z"
  291.  GOTO CONTINUE_REP_UPLOAD
  292.  
  293. SELECT_PROTOCOL_UPLOAD:
  294.   Send "Z"
  295.  GOTO CONTINUE_REP_UPLOAD
  296.  
  297. UPLOAD_REP:              ; Subroutine for uploading reply packet
  298.  TimeOut 30 UPLOAD_REP
  299.   WHEN
  300.   WHEN "PACKER MENU" SELECT_PACKER_UPLOAD
  301.   WHEN "PROTOCOL MENU" SELECT_PROTOCOL_UPLOAD
  302.   Send     "^M"
  303.   Waitfor  "TOMCAT MENU"
  304.   Delay    300                 ; Once a reply packet is uploaded successfully
  305.   Send     "U"                 ; You may hang up. Tomcat will continue to
  306. CONTINUE_REP_UPLOAD:
  307.   Waitfor  "now"               ; insert your messages and the board will
  308.   UPLOAD Z $ULPATH$PACKET.REP  ; recycle when Tomcat is done. This script hangs
  309.   Waitfor  "ing reply packet"  ; up as soon as the reply packet is uploaded.
  310.   IF $SUCCESS DELETE_REP_PACKET
  311.   GOTO UPLOAD_REP              ; It failed, try upload again.
  312. DELETE_REP_PACKET:
  313.   DOS "DEL $ULPATH$PACKET.REP"
  314.  GOTO END
  315.  
  316. END:
  317.  WHEN
  318.  HANGUP
  319.  TimeOut 10 END
  320.   Send "ATM0H1^M"
  321.   Waitfor "OK"
  322.  TURNOFF LOG
  323.  TURNOFF CAPTURE
  324.  SYSTEM X
  325.  
  326. NO_MODEM_RESPONSE:
  327.  OPENFILE $PACKET.ERR REWRITE
  328.   WRITEFILE **********************
  329.   WRITEFILE "No Modem Response given on $DATE at $TIME after $6 Tries"
  330.  CLOSEFILE
  331.   STAMP ********************
  332.   STAMP Failed to init the modem on $DATE at $TIME after $6 tries.
  333.  GOTO END
  334.  
  335.