home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
SCRIPTS.ZIP
/
CISUPL.T
< prev
next >
Wrap
Text File
|
1995-01-26
|
4KB
|
149 lines
echoc "cisupl.t Rev 10-27-91 File: %item"
set s3 ""
pattern
wait -f2 : in case of spurious Function?
pat 1v "essage ready"
pat 2 "unction"
pat 3 " character maximum"
pat 4l "an't find that"
pat 5l "Enter message." : Check for new forum s/w
pat 6c "Message:" "%z1\r"
pat 7 "Enter reply."
pat 8 "Forum !"
open -!tg %item; grab s0
while "t&&!%s0" grab s0
set ifs " /S" : split on space or slash
split s0
if "!iz0,#:" goto orig
echoc "Reply Format Message"
put "\025re %z1\r"
wait -f40
if 8||2||3 goto foox
sets s4 "%z2" : save section #
set s1 "post" : Default post command
grab s0 : Either date line of old message or,
if "!ps0, " sets s1 %s0 : if no leading SP, post action
if !1&&!5&&!7 goto notfnd
grab s0 : discard subject
grab s0 : discard from
goto sendit
notfnd: grab s0 : get subject line for real
split s0 " " ""
sets s2 "%z1"
ss s2 "(.*[0-9][0-9]*-)(.*)"
if %z2 sets s2 "%z2"; echoc "Fixed Sb %s2"
if "%s2>24" goto subbad
subok: grab s0 : Get Fm: line
set ifs ":"
split s0
sets s0 "%z1" : Name and PPN
if "%s0>44" goto tokbad : Too long - get PPN only
took: put "\025l\r"
wait -f20
if "!1&&!5&&!7" goto foobar
sendit: if !t echoc "%item Short file! "; goto foobar
grab s3 : Get possible To: line
if ps3,To: goto unedited
pat 6 ""
if !dP ena -p; pq1; pp120; pg10
if dP ena -r
wait -f2
putv s3; put "\r"
t -gx!G; wait -f1; ena -tG!p
put "\025/exit\r";
pat 5 " action"
wait -f40
put "\025%s1\r"
echoc "File %item To: %s0 Cmd: %s1"
pat 1 "posted"
pat 3c "Section # Required" "\025%s4\r"
pat 4 "Files busy"
pat 5c "Subject:" "\025%s2\r"
pat 6c "Post for (Name and/or User ID" "\025%s0\r"
pat 7c "Is this correct (Y or N)?" "y\r"
wait -f20
if n put "\025%s1\r"; wait -f40
while 4 echo "Get on with it already." wait -f30
if !1&&!2&&!8 goto foobar
if !dv "!%mv %item Z%item.tmp"
if dv "!%rename %item Z%item.tmp"
echoc "File Uploaded: %item moved to Z%item.tmp"
if !2&&!8 wait -f10
ena -gt
return
foobar: echoc "File Not Accpeted"
nolog closetx
put \3
pat 1 "Option:"
pat 6 "Choice:"
wait -f10
put "\0253\r"
wait -f10
if 5 put "a\ry\r"; wait -f10
if !2&&!8 purgek; kbdlock 0;set s5 ""
echoc "Moving %item to Y%item.tmp"
if !dv "!%mv %item Y%item.tmp"
if dv "!%rename %item Y%item.tmp"
ena -gt
fail
foox: echoc "Moving %item to Y%item.tmp"
if !dv "!%mv %item Y%item.tmp"
if dv "!%rename %item Y%item.tmp"
ena -gt
nolog closetx
echoc "CISUPL ABEND"
return
orig: set ifs ";" : split on ; or slash
echoc "Originating Format"
:: Originiating format is: to ; subject; sect #; post command
:: post command is optional field
split s0
sets s0 "%z1"
sets s2 "%z2"
sets s4 "%z3"
if "!%s4" set s4 "1" :: guess if no sect # field
sets s1 "%z4"
if "!%s1" set s1 "post"
echoc "File %item To: %s0 Cmd: %s1"
put "\025l\r"
wait -f40
if 2||4 goto foox
if "!1&&!5&&!7" goto foobar
goto sendit
: name/ppn too long, isolate ppn which begins with digit 1 or 7
tokbad: echoc "Name/PPN Too long %s0"
ss s0 "(7[0-9][0-9][0-9][0-9],[0-9][0-9]*)"
if %z1 sets s0 "%z1"; echoc "TO SPLIT OK"; goto took
set ifs " "
split s0
if pz0,7 sets s0 "%z0"; goto took
if pz0,1 sets s0 "%z0"; goto took
if pz1,7 sets s0 "%z1"; goto took
if pz1,1 sets s0 "%z1"; goto took
if pz2,7 sets s0 "%z2"; goto took
if pz2,1 sets s0 "%z2"; goto took
if pz3,7 sets s0 "%z3"; goto took
if pz3,1 sets s0 "%z3"; goto took
if pz4,7 sets s0 "%z4"; goto took
if pz4,1 sets s0 "%z4"; goto took
if pz5,7 sets s0 "%z5"; goto took
if pz5,1 sets s0 "%z5"; goto took
if pz6,7 sets s0 "%z6"; goto took
if pz6,1 sets s0 "%z6"; goto took
if pz7,7 sets s0 "%z7"; goto took
if pz7,1 sets s0 "%z7"; goto took
echoc "Can't parse Fm: Line to PPN"; goto foobar
subbad: echoc "Subject <%s2> Too Long"
if "!ps2,#" echoc "Can't reparse"; goto foobar
split s2 "-" ""
sets s2 "%z1"
echoc "New Subject Line %s2"
goto subok
unedited: echoc "cisupl: %item has not been edited!"
closetx
pat 5c "Do you wish to cancel" "\025y\r"
pat 6c "Post action !" "\25cancel\r"
put "\025/exit\r";
wait -f20
return