home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
telix
/
qmailtlx.arc
/
QMAIL.SLT
next >
Wrap
Text File
|
1988-08-06
|
7KB
|
146 lines
//This script, called from the Telix directory entry for Cheers! or RFM,
//will use the Qwikmail door to download a .QWK packet and then to
//upload a .REP packet. It then will return control to the user,
//who may check for new files, etc., before logging off manually.
//It will answer the prompts and questions in any order that they
//are received.
str buf [16], //used by the filefind function;
name [] = "maurice crouse"; //put your name here;
int stat, //what state is the script in?;
upload, //does .REP file exist?;
t1, //t1-t9 track expected strings;
t2,
t3,
t4,
t5,
t6,
t7,
t8,
t9;
int moreyet = 1; //flag to indicate if we're all done;
int cheers = 0; //maybe we'll connect with Cheers!;
int rfm = 0; //or maybe we'll connect with RFM;
main ()
{
clear_scr (); //start with clean screen
set_terminal ("ANSI-BBS"); //use ANSI-BBS emulation
_down_dir = "c:\qmail\"; //set directories to QMAIL
_up_dir = "c:\qmail\"; //while script runs;
t1 = track ("graphics (Enter)=no?",1); //track the prompts that
t2 = track ("first name?",1); //are expected from the
t3 = track ("Password",1); //Main Board level;
t4 = track ("'Last Read' (Enter)=yes?",1);
t5 = track ("to continue?",1);
t6 = track ("Command?",1);
t7 = track ("Cheers!",1);
t8 = track ("Radio Free Memphis",1);
stat = 0; //make sure NO string is being tracked;
while (1) //loop until ready to enter Qwikmail door;
{
terminal (); //process all characters received;
stat = track_hit (0); //see which track (if any) was hit;
if (stat == t1) //question about graphics;
cputs ("y q ns^M"); //get them;
else if (stat == t2) //request for user name;
{
cputs (name); //send name;
cputs ("^M");
}
else if (stat == t3) //request for password;
{
cputs (_entry_pass); //pick up password from directory entry;
cputs ("^M");
}
else if (stat == t4) //request for scanning messages;
cputs ("^M"); //scan them;
else if (stat == t5) //request for continuing;
cputs ("^M"); //why not? why else are we here?;
else if (stat == t6) //request for Main Board Command;
{
if (cheers)
{
upload = filefind ("c:\qmail\cheers.rep",0,buf); //OK to upload?
cputs ("open 7"); //open door (change the number to
} //reflect your board's door number);
else if (rfm)
{
upload = filefind ("c:\qmail\rfm.rep",0,buf);
cputs ("open 1");
}
cputs ("^M");
break; //now we're done with Main Board;
}
else if (stat == t7) //we're connected with Cheers!;
cheers = 1;
else if (stat == t8)
rfm = 1; //we're connected with Radio Free Memphis;
}
track_free (0); //free all track channels;
t1 = track ("download was successful!",1); //track the prompts that
t2 = track ("Starting",1); //are expected in the
t3 = track ("packet (Y or N)?",1); //Qwikmail download
t4 = track ("nothing was found!",1); //module;
t5 = track ("SUCCESSFULLY",1);
t6 = track ("Qwikmail command?",1);
t7 = track ("Ready to receive",1);
stat = 0; //make sure NO string is being tracked;
while (1) //loop until successful download;
{
terminal (); //again, process all characters received;
stat = track_hit (0); //see which track (if any) was hit;
if (stat == t1) //we got the packet OK;
break; //we're done with download;
else if (stat == t2) //Zmodem transfer is ready to start;
receive ('Z',""); //not needed if autodownload is set;
else if (stat == t3) //do we want to get the packet?;
{ //erase old .QWK file--not needed with
if (cheers) //Telix Zmodem, but recommended to prevent
dos ("del \qmail\cheers.qwk"); //having .QW0 file;
else if (rfm)
dos ("del \qmail\rfm.qwk");
cputs ("Y^M"); //of course we want the packet;
}
else if (stat == t4) //no messages -- how can this be?;
break; //anyway, we're done with download;
else if (stat == t6) //request for Qwikmail command;
cputs ("D^M"); //tell Qwikmail to give us a packet;
}
while (1) //loop until succesful upload;
{
terminal (); //process all characters received;
stat = track_hit (0); //see which (if any) track was hit;
if (stat == t5) //the door got our .REP packet,
moreyet = 0; //so we're done;
else if (stat == t7) //door is ready to receive by Zmodem;
{
if (cheers)
send ('Z',"c:\qmail\cheers.rep"); //send the .REP file;
else if (rfm)
send ('Z',"c:\qmail\rfm.rep");
}
else if (stat == t6) //request for Qwikmail command;
{
if (upload && moreyet) //if .REP file exists *and* there's more,
cputs ("U^M"); //request an upload;
else //if either condition fails
{ //there's nothing to do,
cputs ("Q^M"); //so we're ready to quit;
break;
}
}
}
if (upload) //delete old .REP file to
{ //prevent uploading duplicate
if (cheers) //messages on later call
dos ("del c:\qmail\cheers.rep");
else if (rfm)
dos ("del c:\qmail\rfm.rep");
}
track_free (0); //free all track channels;
_down_dir = "c:\up\"; //restore download and upload directories
_up_dir = "c:\up\"; //to their normal settings;
} //END OF SCRIPT