/*

    JunkSpot Script by Anthony Brice 4th December 1994.

     -+-+-     Version 1.3 - 29th March 1995    -+-+-

    Hate mail to >NIL: Please.. Comments - 2:254/255.0     

    Please read the doc file before using this script!

*/

Configpath="Workbench:spot/configs/junkspot.config" /* Config file path */
TextPath="Workbench:Spot/" /* Text files path for hatemail etc */

/* This is the Moderate option lines. Ammend as nescessary */

line.1='I have just seen that message you left in the SlimeBar:- Quoted below for your'
line.2='information and I feel it is not apropriate for the echo description..........'
line.3='------------------------------------------------------------------------------'
line.4='------------------------------------------------------------------------------'
line.5='        This echo is the Slime Bar and is run by me as the Barman.'
line.6='It is for general chat of a dubious related nature,and is not a hate mail,'
line.7='technical area, or for postings which could be posted in the more suitable'
line.8='other echos instead. Please bear this in mind before future postings.'
line.9='       Any queries on this message must be sent via Netmail ONLY!!'

Ver=1.3 ; CR='0d'X

ADDRESS SPOT
OPTIONS RESULTS

IF ~EXISTS('LIBS:rexxsupport.library') THEN DO
  Say 'RexxSupport.library not found!'
  Exit
  End

CALL ADDLIB('rexxsupport.library',0,-30,0)

IF ~EXISTS('LIBS:rexxreqtools.library') THEN DO
  Say
  Say 'RexxReqTools.library not found!'
  Say
  Exit
  End

CALL ADDLIB('rexxreqtools.library',0,-30,0)

'ismessages'
IF RC~=0 THEN DO
  'requestnotify "Please use only while viewing a message" center'
  Exit
  End

Call ReadConfig

'getfrom'
Name=result
'getfromaddress'
Address = Result
temp='Please select the message subject?'||CR||CR
temp=temp'A.'||title.1||CR
temp=temp'B.'||title.2||CR
temp=temp'C.'||title.3||CR
temp=temp'D.'||title.4||CR
temp=temp'E.'||title.5||CR
'requestresponse TITLE "JunkSpot version '||Ver||' By Anthony Brice" PROMPT "'||TEMP||'" GADGETS "_A  |_B  |_C |_D |_E |_Moderate  |_HateMail  |_Other |_ABORT"'
fl=rc
if fl=0 then do
  exit
  end
filepath=TextPath||junk.fl
if fl=8 then do
  'requeststring TITLE "Selected new message title"
  PROMPT "Please enter a subject"'
  title.8 = strip(result)
  'requestfile TITLE "Select a text file" PATH 'TextPath''
  filepath= strip(result)
  origin.8="JunkSpot Version '||ver||' by Anthony Brice"
  end 
if fl=7 then do
  origin.7='JunkSpot Version '||ver||' by Anthony Brice'
  Title.7='Fool!'
  filepath = TextPath||'HateMail.text'
  'requestresponse TITLE "Random Hate mail Request" PROMPT "Send Random hate mail to '||name||' ?" GADGETS "_Yeah do it|_Standard flame" center'
  if rc=1 then do
    m=random(1,rand,time('S'))
    textpath= textpath||'hate.'||m
    'getareaname'
    Area=result
    'getmessagenum'
    Last=result
    'gotomatrixarea'
    'requeststring TITLE "Selected Hate Mail title" PROMPT "Please enter a subject"'
    title.7 = result
    'write TO "'||name||'" TOADDR "'address'" SUBJECT "'||title.fl||'" FILE "'||textpath||'" REFLOW=ON NOEDIT NOGUI'
    if ok='YES' then do
      'requestnotify PROMPT "Hate mail posted. Feel Better? =)"'
      end
    'gotoarea "'area'"'
    'gotomessage "'last'"'
    exit
    end
  end

If FL=6 then do
  origin.6='JunkSpot Version '||ver||' by Anthony Brice'
  Title.6='Moderation Warning!'
  FilePath='T:moderate'
  Call Open(Temp,FilePath,"W")
  Do I=1 to 3
    Z=WriteLN(Temp,Line.I)
    End
  Call Close(Temp)
  'saveascii TO 'filePath' NOREFLOW NOTEARLINE NOKLUDGES'
  Call Open(Crap,FilePath,"A")
  Z=WriteLn(Crap,CR)
  Do I=4 to 9
    Z=WriteLN(Crap,Line.I)
    End
  Call Close(Crap)
  End 
'requestresponse TITLE "JunkSpot Version '||ver||' by Anthony Brice" PROMPT "Send '||Title.fl||' to '||name||' ?" GADGETS "_Netmail|_Echo|_Everyone|_ABORT" center' 
Select
  when RC=0 then exit
  when RC=3 then CALL All
  when RC=2 then CALL Echo
  when RC=1 then CALL Net
otherwise
  Exit
  End

Net:
'getareaname'
Area=result
'getmessagenum'
Last=result
'gotomatrixarea'
'write TO "'||name||'" TOADDR "'address'" SUBJECT "'||title.fl||'" FILE "'||filepath||'" REFLOW=ON NOSIG NOEDIT NOGUI'
if ok='YES' then do
  'requestnotify PROMPT "It is done Sire. Netmail posted...."'
  end
'gotoarea "'area'"'
'gotomessage "'last'"'
Address Command 'Delete <>NIL: T:Moderate'
exit

All:
name='ALL'
Call Echo
exit

Echo:
'getmessagenum'
Last=result
'write TO "'||name||'" SUBJECT "'||title.fl||'" ORIGIN "'||origin.fl||'" FILE "'||filepath||'" REFLOW=ON NOSIG NOEDIT NOGUI'
if ok='YES' then do
  'requestnotify PROMPT "It is done Sire. Echo message posted...."'
  end
'gotomessage "'last'"'
Address Command 'Delete <>NIL: T:Moderate'
exit

ReadConfig:
Call Open(CFG,ConfigPath,"R")
Do T = 1 to 5
  String = Readln(CFG)
  Parse var String Flag Data
  if flag = 'TITLE' then Do
    Temp = translate(Data,'  ','""')
    title.t = strip(Temp)
    End
  string = readln(CFG)
  parse var string flag data
  if flag = 'ORIGIN' then do
    Temp = translate(Data,'  ','""')
    origin.t = strip(Temp)
    End
  string = readln(CFG)
  parse var string flag data
  if flag = 'FILE' then do 
    Temp = translate(Data,'  ','""')
    junk.t = strip(Temp)
    End
  End
string = readln(CFG)
parse var string flag data
if flag = 'PROMPT' then do
  Temp = translate(Data,'  ','""')
  ok = Strip(Temp)
  end
string = readln(CFG)
parse var string flag data
if flag = 'RAND' then do
  Temp = translate(Data,'  ','""')
  rand = strip(Temp)
  end
Call Close('CFG')
return

