home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
f
/
finet93a.zip
/
SCRIPTS.ZIP
/
FINET3.SLT
< prev
next >
Wrap
Text File
|
1993-01-01
|
6KB
|
237 lines
// IN DEVELOPMENT>>>>> needs work yet to receive IN.RLY, rest works
// this script needs work. it gets to send the upload packet, it does not
// yet get to receive the in.rly packet... but is the start of a great
// script that does check for how long login, upload and download is
// online, preventing getting stuck online for hours.....
// finet mail script for telix to call Freedom Infonet RBBS************
// must have set rbbs novice/expert menu options to "X" expert!
// for this to work. replace "NODE_ID" with your node id.
str user_name[] = "fname;lastname";
str open_door[] = "D FIHUB /G";
str node_path[] = "C:\TRANSFER\NODE_ID.RLY";
str number_to_dial[] = "29";
int times_to_dial = 5;
str capfile[] = "ON";
str cap_filename[] = "FINET.CAP";
str usefile[] = "ON";
str use_filename[] = "FINET.USE";
int login_limit = 2;
int mail_limit = 6;
str protocol[] = "Z";
// "D" the script will use external DSZ, but ONLY if it is set up
// in Telix to respond to the D key! "Z" is internal zmodem
main()
{
// make backup copy of mail upload packet, "node_id.rly"
dos("copy c:\transfer\node_id.rly c:\transfer\rly.sav",0);
dial_hub();
logon();
}
dial_hub()
{
if (capfile=="ON") capture(cap_filename);
if (usefile=="ON") usagelog(use_filename);
dial(number_to_dial,times_to_dial,1);
if (carrier())
{
return;
}
else
{
status_wind("Unable to connect",50);
hangup();
exittelix();
}
}
logon()
{
int stat;
int t1,
t2,
t3,
t4,
t5,
t6,
t7,
t8,
t9,
t10;
int tmark;
alarm (1);
if (not _entry_pass)
{
status_wind("Sorry, I don't know the password for this BBS!",50);
hangup();
exittelix();
}
t1 = track ("Do you want graphics", 1);
t2 = track ("IRST name?", 1);
t3 = track ("dots echo)?", 1);
t4 = track ("A,J>?", 1);
t5 = track ("Scan message base",1);
t6 = track ("X,4>?",1);
t7 = track ("wapping",1);
t8 = track ("[Y],N)?",1);
t9 = track ("to continue",1);
t10= track ("more?",1);
tmark = timer_start (600*login_limit); // wait up to x minutes for login
status_wind("logging on...",20); // answer any logon questions
while (not time_up (tmark))
{
terminal(); // let Telix process any chars and keys
stat = track_hit (0); // see which (if any) track was hit
if (stat == t1) // say whether we want graphics
{
delay (5);
cputs ("n q ns^M");
}
else if (stat == t2) // send name
{
cputs (user_name);
cputs ("^M");
}
else if (stat == t3) // send password
{
cputs (_entry_pass);
cputs ("^M");
}
else if (stat == t10)
{
cputs("Y");
cputs("^M");
}
else if (stat == t4) // specific to main.nws
{
delay (5);
cputs ("A^M^M");
}
else if (stat == t5)
{
delay(5);
cputs("n^M");
}
else if (stat == t8)
{
delay(4);
cputs("n");
cputs("^M");
}
else if (stat == t9)
{
delay(5);
cputs("^M");
}
else if (stat == t6)
{
status_wind("Login Successful",20);
cputs(open_door);
cputs("^M");
terminal();
}
else if (stat == t7)
{
status_wind("opening mail door!",10);
sendpacket();
recpacket();
status_wind("TEST POINT",60);
hangup();
backup();
exittelix();
}
}
if (time_up (tmark))
{
status_wind("Logon failed!",20);
hangup();
exittelix();
}
timer_free (tmark); // free timer channel
track_free (0); // and all track channels
}
// this is end of program.
sendpacket()
{
int t2,tmark,stat;
track_free(tmark);
t2 = track("fe64",1);
// use "**" instead of "fe64" on generic zmodem....
tmark = timer_start(600*mail_limit);
while (not time_up(tmark))
{
terminal();
stat = track_hit (0);
if (stat == t2)
{
status_wind("Sending Packet",10);
if (protocol == "D" ) send('D',node_path);
else if (protocol == "Z") send('Z',node_path);
return;
}
// return;
}
if (time_up(tmark))
{
status_wind("Timeout Waiting To Send Packet",40);
hangup();
exittelix();
}
return;
}
recpacket()
{
int tmark,t3,stat;
timer_free(tmark);
t3 = track("dd38",1);
tmark= timer_start(600*mail_limit); // wait for reply
status_wind("Waiting for mail...",20);
while (not time_up(tmark))
{
terminal();
stat = track_hit(0);
if (stat == t3)
{
status_wind("Receiving Packet",10);
if (protocol == "D" ) receive('D',"");
else if (protocol == "Z") receive('Z',"");
return;
}
//check for no carrier and timeout here
return;
}
return;
}
backup()
{
// make backup of old in.rly packet, if exists
// we assume that dsz is used and overwrite is enable of new file over
// old file in.rly.
status_wind("making backup of in.rly packets",20);
dos("if exist c:\transfer\in.2 copy c:\transfer\in.2 c:\transfer\in.3",0);
dos("if exist c:\transfer\in.2 del c:\transfer\in.2",0);
dos("if exist c:\transfer\in.1 ren c:\transfer\in.1 c:\transfer\in.2",0);
// make backup of present in.rly packet
dos("copy c:\transfer\in.rly in.1",0);
hangup();
exittelix();
return;
}