//->$.Fax.!Arcfax.Server.CadeDn
// Copyright (c) Tim Nicholson 1994
// From an idea by David Pilling
// Download (private mail) and messages from Arcade
// Version 0.5
// note, id and password are stored in the phone book as
// parameters
//
//


int main(int mode,string & Opt1,string & Opt2)
{
 int code=1;
 if(mode==DATA)
 {
  if(getprompt("new user):",2000))
  {
   sprints(Opt1);       // login
   sputc(13);           // CR to terminate
   if(getprompt("assword",1000))
   {
    sprints(Opt2);      // Password
    sputc(13);          // Cr to terminate
    if(getprompt("key to continue",1000))
    {
     sputc(13);        // this deals with first occurrence
     sputc(13);        // this in case of another (e.g. Today in History)
     sputc(13);        // this in case of Priv mail
     if(getprompt("Main Menu",1000))
     {
      sprints("PPT");   // Public message area, last letter for archive type
      if(getprompt("ancel:",20000)) // give it time to make scratchpad
      {
       sputc('Z');     // Zmodem download
       if(getprompt("load now",1000))
       {
        code=ftpgetfiles();
        if(getprompt("key to continue",1000))
        {
         sputc(13);
         sprints("MG"); // Goto main then logoff menu
         sputc(13);     // In case of priv mail
         sprints("L");  // Logoff
         if(code)
         {
          logreason("Z Failed"); // the transfer failed
         }
        }
       }
      }
     }
    }
   }
  }
 }
 return(code);
}

