home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / SCRIPTS.ZIP / RMAUPL.T < prev    next >
Encoding:
Text File  |  1992-08-03  |  2.7 KB  |  95 lines

  1.     :: Upload message to RemoteAccess  Rev 7-31-92
  2.     :: First line used is "From : name" (reply) or "To name" (originating)
  3.     ::  -- The absence of a colon after the "To" distinguishes originating
  4.     ::  -- messages from reply messages.
  5.     :: Next 2 lines are searched for "Subject :"
  6.     :: Message body starts on next line
  7.     ::
  8.     if iremote,Local goto  rm
  9.     on !c s;set;goto foonc
  10.     sleep 10
  11. rm:    pat
  12.     pat 24c "<CR> to continue: " "\r"
  13.     open -!tg %item; set s0 ""
  14.     while "t&&!%s0" grab s0        :: read past initial blank lines
  15.     if !t goto foobar
  16.     if "js0,Message" grab s0
  17.     if "js0,Prefix" grab s0
  18.     if "js0,Date" grab s0
  19.     if "js0,To " goto orig        :: Sanity check first non blank line
  20.     if "!js0,From" goto foobar    :: Sanity check first non blank line
  21.     :: parse addressee
  22. orig:    split s0 " :" "" 
  23.     sets s1 "%z1"
  24.     ss s1 "(.*)(           *)"
  25.     while %z2 sets s1 "%z1" ss s1 "(.*)( $)"
  26.     ss s1 "(^:* *)(.*)";  if %z1 sets s1 "%z2"
  27.  
  28.     :: parse subject
  29.     grab s2            :: If to line - ignore
  30.     ss s2 "(R[eE]: *|Subject *: *)(.*)"
  31.     if !%z2 grab s2;  ss s2 "(R[eE]: *|Subject *: *)(.*)"
  32.     if !%z2 grab s2;  ss s2 "(R[eE]: *|Subject *: *)(.*)"
  33.     sets s2 "%z2"
  34.     ss s2 "(R[eE]: *|Subject *: *)(.*)"
  35.     if %z2 ss s2 "(R[eE]: *|Subject *: *)(.*)";  sets s2 "%z2"
  36.     ss s2 "(.*)(           *)"
  37.     while %z2 sets s2 "%z1" ss s2 "(.*)( $)"
  38.     ss s2 "(^ *)(.*)";  if %z1 sets s2 "%z2"
  39.     echoc "TO: <%s1> SUBJECT: <%s2>"
  40.  
  41.     :: parse possible Replies line, discard
  42.     grab s0;  if "js0,Replies" grab s0
  43.     if iremote,Local return        :: for local testing
  44.     if "js2,sysop" echoc "Cannot send echo msg to sysyop"; goto foobar
  45.     if "!%s1" echoc "Null Addressee!!";  goto foobar
  46.     if "!%s2" echoc "Null Subject!!";  goto foobar
  47.     put "e"
  48.     :pat 3c "From    :" "%n1 %n2\r"
  49.     pat 4c "To     " "%s1\r"
  50.     pat 5c "Subject" "%s2\r"
  51.     pat 6c "Change anything <y/N>?" "n"
  52.     pat 7c "a prepared message <y/N>?" "n"
  53.     pat 8c "advance of this call. <y/N>?" "\r"
  54.     pat 9c "<=> non-stop" "="
  55.     set blankfill " - "
  56.     wait -f6
  57.     ena -pt; pq1; pp120; pg:
  58.     if %s0 putv s0; put "\r"
  59.     echoc "Sending file text."
  60.     t -gx; ena -t!p
  61.     echoc "File text sent."
  62.     put "\r"
  63.     pat 7c "Select:" "s\r"
  64.     pat 8i "message to disk"
  65.     pat 9c "<=> non-stop" "="
  66.     wait
  67.     if "!8" goto foobar
  68.      :::... (#7051)
  69.  
  70.  
  71. done:    if !dv "!%mv %item Z%item.tmp"
  72.     if dv "!%rename %item Z%item.tmp"
  73.     echoc "File Uploaded: %item moved to Z%item.tmp"
  74.     ena -gt
  75.     wait -f2
  76.     pat
  77.     return
  78. foonc:    echoc "ramupl.t: Carrier Lost"
  79. foobar:    echoc "ramupl.t: File Not Accpeted"
  80.     nolog closetx
  81.     pat
  82.     off
  83. foox:    echoc "Moving %item to Y%item.tmp"
  84.     if !dv "!%mv %item Y%item.tmp"
  85.     if dv "!%rename %item Y%item.tmp"
  86.     ena -gt
  87.     nolog closetx
  88.     echoc "RMAUPL ABEND"
  89.     pat
  90.     return
  91. unedited:    echoc "rmaupl.t: %item has not been edited!"
  92.     closetx
  93.     pat
  94.     return
  95.