home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / mmail2.zip / MARKMAIL.XWS
Text File  |  1990-01-23  |  4KB  |  128 lines

  1. /*
  2.         Crosstalk for Windows MarkMail PCBOARD Login Script.
  3.         Version 1.0  January 8th, 1990 3:19 
  4.  
  5.         Copyright (c) 1990 Guy Gallo
  6.  
  7. USAGE
  8.  
  9. This script allows you to completely automate the uploading 
  10. and downloading of message via MarkMail using Crosstalk for Windows.  
  11. (The script should be easily adapted to use Qmail or Qmail 3.0.
  12.  
  13. The script is loaded into the Setup.Session.Script field in the 
  14. following manner:
  15.  
  16. ScriptName parameter1 parameter2 parameter3
  17.  
  18. For Example:
  19.  
  20. MarkMail Mail Open 10
  21.  
  22. Translation:  
  23. Use the MarkMail script with the parameter "Mail", "Open", "10". 
  24.  
  25. The above script entry ("MarkMail Mail Open 10") would tell the 
  26. script that yes, we are going to do mail transfer, and the mail door
  27. is door number 10.
  28.  
  29. If you leave out the Mail keywork as a parameter then the script 
  30. functions as a slightly enhanced PCBoard logon.  
  31. For example, if you entered the script as
  32.  
  33. MarkMail Open 7
  34.  
  35. The script would simply open door number seven.  Or
  36.  
  37. MarkMail N S U
  38.  
  39. The script would simply list the new files on the PCBoard and halt.
  40.  
  41. If you are tranferring mail it happens so:
  42.  
  43. Any reply file, if it exists, is uploaded *and then deleted*.
  44.  
  45. If a message file already exists on disk, it is renamed to 
  46. with "1" as the first character of the board name.  For example,
  47. THUNDER.QWK becomes 1HUNDER.QWK.  If a saved file already exists
  48. it is deleted.
  49.  
  50. Messages are downloaded and you are logged off. 
  51. */
  52.  
  53. STRING RepName, QwkName, DirRep, DirQwk, SaveQwk, MailCmd, Cmd
  54.  
  55. MailCmd is Arg(2) + " " + Arg(3)
  56. Cmd is Arg(1) + " " + Arg(2) + " " + Arg(3)
  57. If UpCase(Arg(1)) is "MAIL" then Mail is True else Mail is False
  58. --WE'RE DOING MAIL
  59.  
  60. RepName is NAME+".REP"
  61. QwkName is NAME+".QWK"
  62. DirRep is DirFil+"\"+RepName
  63. DirQwk is DirFil+"\"+QwkName
  64. SaveQwk is DirFil+"\"+inject(QwkName,"1",1)
  65. --SET UP FILE NAMES
  66.  
  67. reply
  68. wait 10 seconds for '=no?' : If TimeOut then GoTo WatchLoop
  69. reply 'n q'
  70. graphics on
  71.  
  72. --Minimize
  73. --ENABLE THE ABOVE AFTER YOU'VE DETERMINED THAT THE SCRIPT WORKS
  74.  
  75. LABEL WatchLoop
  76. reply
  77. --THE ABOVE REPLY IS SO THAT YOU CAN ACTUALLY RUN THE SCRIPT AFTER
  78. --YOU HAVE LOGGED ONTO A PCBOARD.
  79. while online
  80. watch for
  81.       'first name?'   : wait 5 ticks : reply UserID+ " " + Password
  82.       '=no?',
  83.       'tinue?',
  84.       'tinue:',
  85.       'stop?',
  86.       '(NS)?',
  87.       'More?'         : wait 5 ticks : reply
  88.       '=yes?'  : wait 5 ticks : reply "N"
  89.       '(S)ystem, (Enter)=' : If Mail then Reply MailCmd else reply Cmd:... 
  90.                Alarm : Halt
  91. --FOR THE QUICK LOGON FOUND ON SOME PCBOARDS.
  92.       'Board Command? '  : If Mail then...
  93.                 Reply MailCmd :...
  94.                 Wait 10 Ticks else Reply Cmd : Alarm : Halt
  95. --NORMAL MAIN BOARD COMMAND
  96.       'MarkMail Command?':  Reply "D" : Goto GetPacket
  97. --UPLOAD REPLY FILE IF THERE IS ONE. 
  98. --TELL MARKMAIL TO LOG OFF AFTER TRANSFER.
  99.        QUIET 5 MINUTES : bye : halt
  100.   endwatch
  101.  wend
  102.  
  103. LABEL GetPacket
  104. Watch for
  105.     '[Y]es, [N]o, [G]oodbye When Done? ':  Reply "Y" :...
  106.     Watch for
  107.     '(Ctrl-X) Aborts Transfer' : Gosub DoFiles : Receive QwkName : Alarm :  Wait  for 'Command' : Goto SendFiles
  108.     'Sorry, No Messages Found...' : Wait 10 for 'Command' : Goto SendFiles
  109.     endwatch
  110. endwatch
  111.  
  112. LABEL SendFiles
  113. If exists(DirRep) then{
  114.          Reply "U" 
  115.          Wait 5 ticks 
  116.          Send RepName 
  117.          Delete DirRep
  118.          Message "Deleting reply file..."
  119.         Wait 10 For 'Command' : Reply "G" : Halt
  120.          }
  121. else Reply "G" :  Halt
  122.  
  123. LABEL DoFiles
  124.     If Exists(SaveQwk) then Delete SaveQwk
  125.     If Exists(DirQwk) then Rename DirQwk,SaveQwk 
  126. Return
  127. end
  128.