/* $VER: RePostEN.thor 3.2 (8.11.97) * * Originally: RePostEN.thor 3.1 (02.09.1994) * * Arexx script to repost messages from a BBS to conferences on another. * * Script by: Eivind Nordseth, Ultima Thule Software. * * Script fixed by: Gary Evans, 1997 */ options results /* trace results */ if(substr(address(),1,4) ~= "THOR") then do parse arg thorport if~(show(p, thorport)) then do if ~(show(p, "THOR.01")) then do say "No THOR port found!" exit end else thorport = "THOR.01" end end else thorport = address() if ~show('p', 'BBSREAD') then do address command "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead" "WaitForPort BBSREAD" end address(thorport) CURRENTMSG stem MSG if(rc ~= 0) then do REQUESTNOTIFY TEXT '"No current message."' BT '"_Ok"' exit end address BBSREAD GETBBSLIST stem BBSLIST if(rc ~= 0) then do address(thorport) REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"' exit end REQUESTLIST instem BBSLIST outstem TOBBS title '"Select BBS to repost to"' if(rc ~= 0) then do if(rc ~= 5) then address(thorport) REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"' exit end dobbs = result address BBSREAD GETCONFLIST bbsname '"'dobbs'"' stem CONFLIST if(rc ~= 0) then do address(thorport) REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"' exit end REQUESTLIST instem CONFLIST outstem TOCONF title '"Select Conference"' if(rc ~= 0) then do if(rc ~= 5) then address(thorport) REQUESTNOTIFY TEXT '"'THOR.LASTERROR BT'"' '"_Ok"' exit end doconf = result address BBSREAD drop FILE. UNIQUEMSGFILE bbsname '"'dobbs'"' stem FILE if(rc ~= 0) then do address(thorport) REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"' exit end READBRMESSAGE bbsname '"'MSG.BBSNAME'"' confname '"'MSG.CONFNAME'"' msgnr MSG.MSGNR headstem HEADTAGS textstem TEXTTAGS datastem DATATAGS if(rc ~= 0) then do address(thorport) REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"' exit end if(~open('data',FILE.NAME,A)) then do address(thorport) REQUESTNOTIFY TEXT '"Unable to open file:"' FILE.NAME '"' BT '"_Ok"' exit end msgfrom = HEADTAGS.FROMNAME if symbol("HEADTAGS.FROMADDR") = "VAR" then msgfrom = msgfrom || ' <' || HEADTAGS.FROMADDR || '>' if(MSG.CONFNAME ~= doconf) then do call writeln('data', 'Message crossposted from: ' || MSG.CONFNAME) end call writeln('data', 'Originally written by: ' || msgfrom || '0a'x) call writeln('data', 'Subject: ' || HEADTAGS.SUBJECT || '0a'x) do n=1 to TEXTTAGS.TEXT.COUNT call writeln('data', TEXTTAGS.TEXT.n) end call close('data') if(HEADTAGS.TONAME = 'HEADTAGS.TONAME') then HEADTAGS.TONAME = 'All' if(HEADTAGS.TOADDR = 'HEADTAGS.TOADDR') then HEADTAGS.TOADDR = '' drop EVENT. EVENT.TONAME = HEADTAGS.TONAME EVENT.TOADDR = HEADTAGS.TOADDR EVENT.SUBJECT = HEADTAGS.SUBJECT EVENT.CONFERENCE = doconf EVENT.REFNR = HEADTAGS.REFNR EVENT.MSGFILE = FILE.FILEPART WRITEBREVENT bbsname '"'dobbs'"' event 0 stem EVENT if(rc ~= 0) then do address(thorport) REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"' address command 'Delete >nil: '||'"'||FILE.NAME||'"' exit end