Skip to content
Snippets Groups Projects
Commit aac64d70 authored by rswindell's avatar rswindell
Browse files

Removed (very) obsolete files.

parent 7d159a61
Branches
Tags
No related merge requests found
// Main QWK Networking SALT script for calling Synchronet QWK Network Hub(s)
main()
{
// These two paths need to point to your SBBS\DATA directory
copystr("C:\SBBS\DATA",_down_dir,0,40);
copystr("C:\SBBS\DATA",_up_dir,0,40);
// Add additional call lines for other systems
// the first parameter must be sbbsqnet, the second is the HUB's system ID,
// the third is phone number list, the fourth is your logon name (should be
// same as your system's QWKID), the fifth is your password, and the sixth is
// the maximum retry count
// The phone number list can either contain a list of dialing directory
// entries, or a manual phone number preceeded by an 'M'.
// Example; both of the following are valid phone number lists:
// "1 2 3" and "m1-714-529-9525"
// You can only have one number per hub using the manual dial method.
call("sbbsqnet","VERT","m1-714-529-9721","QWKID","password","3");
cputs_tr("~~ATM0H1^M");
exittelix(0,0);
}
# qnet.src
# $Id$
# @format.tab-size 8, @format.use-tabs true
###############################################################################
# Baja module for performing QWKnet call-outs #
# Requires Synchronet v2.3 and Baja v2.10 #
# Copyright 1996 Digital Dynamics #
###############################################################################
# Usage: *QNET HUBID PHONE PASSWORD ATTEMPTS
# Example: *QNET VERT 1-714-529-9721 YOURPASS 100
# You may use the QNET.BIN module INSTEAD of your normal terminal/script
# QWKnet call-out routine. You can do this by changing
#
# SCFG->Networks->QWK->Hubs->VERT->Call-out Command Line to:
#
# *QNET VERT 1-714-529-9721 YOURPASS 100
#
# The asterisk is important! 100 is the number of dial attempts, YOURPASS is
# your QWKnet password here on Vertrauen. Remove 1-714 if you're in the 714
# area code.
#
# No modification or recompilation of this module should be necessary.
!include sbbsdefs.inc
!include file_io.inc
# Constants (change for your preferences)
!define INIT_ATTEMPTS 5
!define MAX_INACTIVITY 30 # 30 seconds of host inactivity
# Must be FIRST function call (or module will immediately terminate)
set _online ON_LOCAL
# print_local "QNET.SRC\r\n"
# Force DCD to be assumed HIGH and user online and NO screen pausing
or _sys_status SS_DCDHIGH|SS_USERON|SS_PAUSEOFF
# Turn off the ^C status flag
not _sys_status SS_ABORT
# Set console for Local Input/Output only
set _console CON_L_INPUT|CON_L_ECHO
# Make sure there is a COM port configured
compare _DTE_RATE 0
if_equal
print "BAJAQNET: No COM port configured.\7\r\n\r\n"
pause
return
end_if
# Variables
int i start connect end logfile argc argv attempt result
str tmp rep qwk log hubid phone password attempts
# Mark beginning time
time start
set connect 0
# Process command line arguments
set hubid ""
set phone ""
set password ""
set attempts ""
set _lncntr 0
cls
strupr str
# Display command line
print "BAJAQNET: %s\r\n"
set argc 0
:process_args
compare_str ""
if_true
goto end_args
end_if
sprintf tmp "%.1s" str
shift_str 1
compare tmp " "
if_true
add argc 1
goto process_args
end_if
switch argc
case 0
strcat hubid tmp
end_case
case 1
strcat phone tmp
end_case
case 2
strcat password tmp
end_case
case 3
strcat attempts tmp
end_case
default
goto usage
end_switch
goto process_args
:usage
crlf
print "Usage: QNET hubid phone password attempts\r\n\r\n"
print "Example: QNET VERT 1-714-529-9721 YOURPASS 100\r\n\r\n\7"
pause
return
:end_args
compare hubid ""
if_true
goto usage
end_if
compare phone ""
if_true
goto usage
end_if
compare password ""
if_true
goto usage
end_if
compare attempts ""
if_true
goto usage
end_if
sprintf log "%%j/%s.log" hubid
sprintf rep "%%j/%s.rep" hubid
sprintf qwk "%%j/%s.qwk" hubid
chkfile qwk
if_true
printf "\7BAJAQNET: %s already exists!\r\n" qwk
set i 0
:check_qwk
sprintf qwk "%%j%s.QW%ld" hubid i
chkfile qwk
if_true
printf "\7BAJAQNET: %s already exists!\r\n" qwk
add i 1
compare i 10
if_equal
goto exit
end_if
goto check_qwk
end_if
end_if
fopen logfile O_WRONLY|O_APPEND|O_CREAT log
if_false
printf "\7BAJAQNET: Error (%d) opening %s\r\n" _errno log
goto exit
end_if
time_str str start
fprintf logfile "BAJAQNET: Launched: %s\r\n" str
# Required for receiving responses from modem
set _online ON_REMOTE
or _console CON_R_INPUT
set attempt 0
:init
call flush_input
add attempt 1
compare attempt INIT_ATTEMPTS
if_greater
setstr "BAJAQNET: Modem initialization failed!\r\n"
print str
fwrite logfile str
goto exit
end_if
print "BAJAQNET: Initializing modem\r\n"
print_remote "ATX4E0H0M0V0\r"
getstr str 80 K_NOECHO
if_false
print "BAJAQNET: No response\r\n"
goto exit
end_if
compare_str "0"
if_false
print "BAJAQNET: Modem returned %s\r\n"
goto init
end_if
set attempt 0
:dial
add attempt 1
compare attempt attempts
if_greater
fprintf logfile "BAJAQNET: No connect after %s attempts\r\n" attempts
goto exit
end_if
printf "BAJAQNET: Dialing %s at %s (Attempt: %ld of %s)\r\n" hubid phone attempt attempts
mswait 1000
copy str phone
print_remote "ATDT%s\r"
getstr str 80 K_NOECHO
if_false
goto exit
end_if
print "BAJAQNET: "
copy result str
switch result
case 0
print "Modem responded with '%s'\r\n"
fprintf logfile "BAJAQNET: Modem repsoned with '%s'\r\n" str
goto dial
case 2
print "RING\r\n"
goto dial
case 3
print "NO CARRIER\r\n"
goto dial
case 4
print "ERROR\r\n"
goto dial
case 6
print "NO DIALTONE\r\n"
goto dial
case 7
print "BUSY\r\n"
goto dial
case 8
print "NO ANSWER\r\n"
goto dial
default
print "Connection established (Result Code: %s)\r\n"
time connect
ftime_str str "%X" connect
fprintf logfile "BAJAQNET: Connected: %s\r\n" str
end_switch
# Normal use of DCD
not _sys_status SS_DCDHIGH
# Wait a second
mswait 1000
# Send ESC ESC for front-end mailers
print_remote "\x1b\x1b"
# Wait for NN: prompt
print "BAJAQNET: Waiting for NN: prompt "
setstr "NN:"
call waitfor
print " \r\n"
# Notify Hub of Script Type and Version
print_remote "Baja Qnet Version 1.10"
mswait 2000
# Send our QWK ID
print_remote "\24%q\r"
# Wait for PW: prompt
print "BAJAQNET: Waiting for PW: prompt "
setstr "PW:"
call waitfor
print " \r\n"
# Send our PASSWORD
copy str password
print_remote "%s\r"
# Wait for QWK: prompt
print "BAJAQNET: Waiting for QWK: prompt "
setstr "QWK:"
call waitfor
print " \r\n"
chkfile rep
if_true
###################
# Send REP packet #
###################
print "BAJAQNET: Sending REP packet\r\n"
print_remote "UZN"
mswait 1000
call flush_input
send_file_via Z rep
get_file_length i rep
sprintf str "BAJAQNET: Upload of REP packet (%lu bytes) " i
print str
fwrite logfile str
if_true
print "successful\r\n"
fprintf logfile "successful\r\n"
remove_file rep
else
print "\7UNSUCCESSFUL!\r\n"
fprintf logfile "UNSUCCESSFUL!\r\n"
end_if
#mswait 1000
#call flush_input
# Wait for QWK: prompt
print "BAJAQNET: Waiting for QWK: prompt "
setstr "QWK:"
call waitfor
print " \r\n"
end_if
#######################
# Download QWK packet #
#######################
print "BAJAQNET: Scanning for new messages "
int sm nm ss
print_remote "DL"
setstr "PROTOCOL OR "
call waitfor
print " \r\n"
if_false
setstr "BAJAQNET: No new messages.\r\n"
print str
fwrite logfile str
print_remote "Q"
goto exit
end_if
print "BAJAQNET: Receiving QWK packet\r\n"
print_remote "ZN"
mswait 1000
call flush_input
receive_file_via Z qwk
sprintf str "BAJAQNET: Download of QWK packet "
print_local "%s"
fwrite logfile str
chkfile qwk
if_true
get_file_length i qwk
sprintf str "(%lu bytes) successful\r\n" i
else
setstr "UNSUCCESSFUL!\r\n"
end_if
print_local "%s"
fwrite logfile str
mswait 2000
copy _sys_misc sm
copy _node_misc nm
print_remote "Q"
goto exit
###############################################################################
# Wait for a specific text string (contained in current command string) #
# Automatically hits ENTER for HIT A KEY prompts #
# Times-out after 30 seconds of host inactivity #
# Sets logic state to TRUE if the string is located and returns #
# Sets logic state to FALSE if QWK: is found before the string and returns #
###############################################################################
:waitfor
str waitforstr waitforbuf
int cursor t1 t2
copy waitforstr str
:waitfor_reset
set waitforbuf ""
:waitfor_nextchar
time t1
:waitfor_checkinput
inkey
if_false
time t2
sub t2 t1
compare t2 MAX_INACTIVITY
if_greater
goto timeout
end_if
goto waitfor_checkinput
end_if
# Control key?
compare_keys "^M^J^L^G^H"
if_true
:spin_cursor
and cursor 3
switch cursor
case 0
print_local "-"
end_case
case 1
print_local "\\"
end_case
case 2
print_local "|"
end_case
case 3
print_local "/"
end_case
end_switch
print_local "\b"
add cursor 1
# Clear input buffer and continue
goto waitfor_reset
end_if
ungetkey
:waitfor_additional
inkey
if_true
compare_keys "^M^J^L^G^H"
if_true
# Clear ungetkey buffer
setstr "\r"
ungetstr
getstr str 0 K_NOECHO
goto spin_cursor
end_if
ungetkey
goto waitfor_additional
end_if
setstr "\r"
ungetstr
getstr str 128 K_NOECHO
if_false
fprintf logfile "getstr returned FALSE\r\n"
setlogic FALSE
return
end_if
strcat waitforbuf str
# Handle Pause Prompt
compare_substr waitforbuf "HIT A KEY"
if_true
fprintf logfile "received hit a key prompt\r\n"
print_remote "\r"
goto waitfor_reset
end_if
# Handle ANSI Cursor Position Request
compare_substr waitforbuf "[6n"
if_true
print_remote "\r"
goto waitfor_reset
end_if
# Return TRUE if string found
compare_substr waitforbuf waitforstr
if_true
setlogic TRUE
return
end_if
# Return FALSE if QWK: prompt found instead
compare waitforbuf "QWK: "
if_true
setlogic FALSE
return
end_if
goto waitfor_nextchar
#####################################################################
# Flush (remove, do not process) any characters in the input buffer #
#####################################################################
:flush_input
inkey
if_true # Flush input buffer
goto flush_input
end_if
return
###################################################
# Timeout routine (falls-through to Exit routine) #
###################################################
:timeout
print_local "\r\nBAJAQNET: \7Time-out!\7\r\n"
fprintf logfile "BAJAQNET: Time-out\r\n"
#################
# Exit routine #
#################
:exit
print_local "BAJAQNET: Exiting...\r\n"
# Mark ending time
time end
time_str str end
fprintf logfile "BAJAQNET: Terminated: %s\r\n" str
compare connect 0
if_not_equal
copy i end
sub i connect
second_str tmp i
fprintf logfile "BAJAQNET: Time online: %s\r\n" tmp
end_if
hangup
not _sys_status SS_DCDHIGH
mswait 2000
return
# End of QNET.SRC
 S y n c h r o n e t L o c a l K e y b o a r d C o m m a n d s                      (*
t
o
g
g
l
e
)                      *A
l
t
-
N
Lock This Node                               *A
l
t
-
R
Rerun This Node After Logoff                  A
l
t
-
H
Hang up on User Immediately                  *A
l
t
-
I
Interrupt (Hang up) User with Message        *A
l
t
-
A
Alert Sysop After Logoff                     *A
l
t
-
Q
Disable/Enable Remote Keyboard (Quiet User)   A
l
t
-
U
User Editor (Display [WAIT] Remotely)        *A
l
t
-
E
Local I/O Only (Display [WAIT] Remotely)     *A
l
t
-
T
Temporary Sysop Status                        A
l
t
-
D
Shell to DOS (Display [WAIT] Remotely)       *A
l
t
-
L
Turn Local Text/ANSI Capture On/Off          *A
l
t
-
C
Pop User in and out of Local Sysop Chat      *A
l
t
-
G
Pop User in and out of Local Guru Chat        A
l
t
-
P
Turn Chat Page Off                           *A
l
t
-
X
Exit to DOS After Logoff (Down Node)          A
l
t
-
+
Add 5 Minutes to User's Time                  A
l
t
-
-
Subtract 5 Minutes from User's Time           A
l
t
-
0
through A
l
t
-
9
Quick Validation                P
a
g
e
U
p
ASCII Upload                                C
t
r
l
-
U
p
,
D
n
,
H
o
m
e
,
a
n
d
E
n
d
to Scroll Status Line   *S
c
r
o
l
l
-
l
o
c
k
On if Sysop is Available for Chat     
\ No newline at end of file
; Synchronet QWK Network Robocom Script
;
; User account must have 'Q' restriction on host system
;
; If path to Synchronet data dir is incorrect, change it
TITLE "Synchronet QWK Network Packet Exchange"
WHEN "Hit a key" SEND "^M" ; if pause, hit enter
WHEN "No new messages" GOTO END ; if no new messages
WAITFOR "NN:" FAILURE GOTO END ; wait for NN: prompt
SEND "%BBS13%^M" ; send login name
WAITFOR "PW:" FAILURE GOTO END ; wait for PW: prompt
SEND "%BBS7%^M" ; send password
IF NOT EXIST "%REPDIR%%ID%.REP" GOTO DOWNLOAD
WAITFOR "QWK: " FAILURE GOTO END ; QWK prompt
SEND "U" ; Upload
WAITFOR "Protocol" FAILURE GOTO END
SEND "ZN" ; Zmodem, don't hang up
UPLOAD "%REPDIR%%ID%.REP"
ERASE "%REPDIR%%ID%.REP"
:DOWNLOAD
WAITFOR "QWK: " FAILURE GOTO END ; QWK prompt
SEND "DL" ; Download, leave codes in
TIMEOUT 300
WAITFOR "Protocol" FAILURE GOTO END
SEND "ZN" ; Zmodem, don't hang up
DOWNLOAD "%QWKDIR%%ID%.QWK"
:END
SEND "Q" ; Logoff
DELAY 5
HANGUP
EXIT
;Logon to Synchronet and transfer QWK packets using Zmodem
;This script file is for use with Qmodem!
GRAPHICS ANSI
TURNOFF NOISE
STRING SYSNAME PHONE ACCOUNT PASS RETRY DATADIR REP QWK INFO
ASSIGN SYSNAME "XXXX" ; System being called
ASSIGN PHONE "XXXXXXX^M" ; System phone number
ASSIGN ACCOUNT "XXXXXX^M" ; Account on system
ASSIGN PASS "XXXXXXXX^M" ; Password
ASSIGN RETRY "20" ; # of times to retry
ASSIGN DATADIR "\SYNCHRO\DATA" ; Download directory
ASSIGN REP "$DATADIR\$SYSNAME.REP" ; REP is the name of the REPLY packet
ASSIGN QWK "$DATADIR\$SYSNAME.QWK" ; QWK is the name of the QWK packet
ASSIGN INFO "$DATADIR\$SYSNAME.LOG" ; INFO is the name of the LOG file
CLRSCR ; Clear the screen
LOG $INFO ; Open the log file
STAMP Qmodem QWK log opened
DISPLAYLN "SBBSQNET: Initialized " ; Display this line
DISPLAYLN "SBBSQNET: Calling $SYSNAME" ; Information line
STAMP Calling $SYSNAME
DISPLAYLN "SBBSQNET: Dialing $PHONE" ; Information line
DELAY 1000
SEND "ATM0^M"
WHEN "BUSY" LOOP
WHEN "NO DIAL TONE" LOOP
TIMEOUT 45 LOOP
LOOP:
DECR RETRY
IF "$RETRY" = "0" ENDQWK
DELAY 1000
SEND "ATDT $PHONE"
WAITFOR "CONNECT"
DELAY 2000
IF $ONLINE DONE
GOTO LOOP
DONE:
TIMEOUT 600 ENDQWK ; wait up to 10 minutes for sucess
WHEN "HIT A KEY" "^M"
WAITFOR "NN:"
SEND "^M"
WAITFOR "NN:"
SEND "$ACCOUNT"
DELAY 100
WAITFOR "PW:"
SEND "$PASS"
WAITFOR "QWK:"
EXIST $REP UPREP ; If the reply exists, send it
RECEIVE:
STAMP Download QWK packet
DELAY 1000
SEND "DL"
WHEN "No New Messages" ENDQWK
WAITFOR "PROTOCOL"
SEND "ZN"
DOWNLOAD Z $QWK
WAITFOR "QWK:"
SEND "Q"
ENDQWK:
SEND "Q"
HANGUP
STAMP Qmodem QWK log closed
TURNOFF LOG
SYSTEM X
UPREP:
STAMP Upload REPly packet
DELAY 1000
SEND "UZN"
WAITFOR "Start Transfer Now"
UPLOAD Z $REP
IF $SUCCESS DELREP
GOTO RECEIVE
DELREP:
DOS "del $REP^M"
WAITFOR "QWK:"
GOTO RECEIVE
// Logon to Synchronet and transfer QWK packets using Zmodem
// Version 2.00 (updated 09/17/95)
// This script should need no modification for most Synchronet hubs.
// The 'login name' node account must have the 'Q' restriction set on
// the hub (call-out to) system.
// arg1=system id
// arg2=dial list
// arg3=login name
// arg4=password
// arg5=retry count
main(str arg1, str arg2, str arg3, str arg4, str arg5)
{
str path[128],tmp[128];
int t,tmark,tstat,nn,pw,pause,qwk,prot,qwkcnt=0;
_zmod_auto=0; // Disable auto-zmodem (causing problems for many Qnet sysops)
_zmod_rcrash=0; // Disable zmodem receive crash recovery (resume)
clear_scr();
printsc("SBBSQNET: Initialized ");
t=curtime();
date(t,tmp);
printsc(tmp);
printsc(" ");
time(t,tmp);
prints(tmp);
copystr(_up_dir,path,0,80);
strcat(path,"\");
strcat(path,arg1);
strcat(path,".LOG");
printsc("SBBSQNET: ");
if(usagelog(path)==-1)
printsc("ERROR OPENING ");
else
printsc("Opened ");
prints(path);
copystr(_up_dir,path,0,80);
strcat(path,"\");
strcat(path,arg1);
strcat(path,".REP");
if(filesize(path)>0) {
printsc("SBBSQNET: Attempting to send ");
prints(path); }
printsc("SBBSQNET: ");
copystr("Calling ",tmp,0,80);
strcat(tmp,arg1);
prints(tmp);
ustamp(tmp,1,1);
printsc("SBBSQNET: Dialing ");
prints(arg2);
if(redial(arg2,stoi(arg5),1)==-1) { // Dialing error
ustamp("Dial error.",1,1);
return; }
if(not carrier()) {
ustamp("No answer.",1,1);
return; }
nn=track("NN:",0);
pw=track("PW:",0);
qwk=track("QWK:",0);
prot=track("PROTOCOL OR ",1);
pause=track("HIT A KEY",1);
tmark=timer_start(18000); // wait up to 30 minutes for sucess
while(not time_up(tmark)) {
if(not carrier()) {
ustamp("No carrier.",1,1);
break; }
terminal();
tstat=track_hit(0); // check for track hit
if(tstat==nn) { // NN: prompt
// Show hub that we're a script
cputs("Telix Qnet Version 2.00");
delay(10); // one second
cputs("^X"); // clear any garbage
cputs(arg3); // send login name
cputs("^M"); }
else if(tstat==pw) { // PW: prompt
delay(1);
cputs(arg4); // send password
cputs("^M"); }
else if(tstat==pause) // Hit a key
cputs("^M");
else if(tstat==qwk) { // QWK prompt
delay(1);
qwkcnt=qwkcnt+1;
if(qwkcnt==1) {
if(filesize(path)>0) {
cputs("UZN");
delay(10);
terminal();
flushbuf();
if(send('Z',path)>=0) { // successful
copystr("DEL ",tmp,0,4);
strcat(tmp,path);
dos(tmp,0); } } // delete REP
else qwkcnt=2; }
if(qwkcnt==2) {
cputs("DL");
while(not time_up(tmark)) {
if(not carrier())
break;
terminal();
tstat=track_hit(0);
if(tstat==qwk) {
qwkcnt=3;
break; }
if(tstat==prot) {
cputs("ZN");
delay(10);
terminal();
flushbuf();
receive('Z',"");
break; } } }
if(qwkcnt==3) {
cputs("Q");
break; } } }
delay(10);
terminal();
if(time_up(tmark)) {
prints("SBBSQNET: Timeout.");
ustamp("Timeout.",1,1); }
hangup();
timer_free(tmark); // free timer channel
track_free(0); // free track channels
usagelog("*CLOSE*"); // close log file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment