🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #195105

[Dialog] Ping Paul Blarmy: script

#195105
From: MLC
Date: Thu, 01 Feb 2007 14:51
142 lines
4379 bytes
Hi Paul,
this is the script to plonk with address and with an expire date.
Remember to compile it with Ctrl+F9, in other words don't compile & run it
inside the script window with F9 (the green arrow): from the script window
it wouldn't work. Then give it a button and/or a shortcut to use it.  

I hope it's what you asked, it seems to work but I don't have fully tested
it 'cause lack of time.

Ciao :-)


Program PlonkAddressExpire;  //  1 Febbraio 2007, MLC
uses Forms, StdCtrls;

const
 numM = 1; // number of months you want to plonk (from the current day)
 
var
 myForm: TForm;
 myMemo: TMemo;
 mail: string;

Function EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll stdcall';
Function OpenClipboard(hWndNewOwner: INTEGER):boolean; external 'OpenClipboard@user32.dll stdcall';
Function CloseClipboard:boolean; external 'CloseClipboard@user32.dll stdcall';

function ExpireAfter: string;
 var today, after: TDateTime;
begin
 today:=Now;
 after:=IncMonth(today, numM);
 result:=' Expire:'+(FormatDateTime('yyyymmdd', after));
end;

function ItemCount(s: string; sep: char): integer;
var
 i, r: integer;
 stemp: string;
begin
  stemp:=s;
  r:=0;
  i:=Pos(sep,stemp);
  while i<>0 do
  begin
   r:=r+1;
   delete(stemp, i, 1);
   i:=Pos(sep,stemp);  
  end;
  result:=r;     
end;

function RevStr(s: string ): string;
var
  i: integer;
  s2: string;
begin
  s2 := '';
  for i:=1 to Length(s) do
  begin
    s2:=s[i]+s2;
  end;
  result:=s2;
end;

Procedure ClearClipboard;
Begin
 OpenClipboard(0);
 EmptyClipboard;
 CloseClipboard;
end;

Procedure GetMsgBody;
begin
 ClearClipboard;
 myMemo.Clear;
 ADo('ArticlePane');
 ADo('SelectAll');
 Ado('Copy');
 myMemo.PasteFromClipboard;
end;

Function GetAddress: string;
var 
 i: integer;
 addr: string;
begin
 i:=0;
 addr:='';
 while (i < myMemo.Lines.count-1) do
 begin
  if Pos('From:', myMemo.lines.Strings[i]) = 1 then
  begin
   addr:=myMemo.lines.Strings[i];
   break;
  end
  else i:=i+1;
 end; //while
 i:=ItemCount(addr, '<');
 if (i > 0) then 
 begin
  addr:=RevStr(addr);
  i:=Pos('<',addr);
  addr:=copy(addr, 1, i);
  addr:=RevStr(addr);
 end else addr:='';
 result:=addr;
end;

Procedure BuildContainers;
begin
 myMemo := tMemo.Create(myForm);
 myMemo.Parent := myForm;
 myMemo.Width := Application.Mainform.width;
end;

Begin
  myForm := tForm.Create(nil);
  lockdisplay;
  try
   BuildContainers;
   ADo('ShowHeaders');
   GetMsgBody;
   ADo('ShowHeaders');
   mail:=GetAddress;
   if (mail='') then myMemo.text:=' '+ExpireAfter
    else myMemo.text:=' +"'+mail+'"'+ExpireAfter;
   myMemo.SelectAll;
   myMemo.CopyToClipboard;
   ADoLater('AddPlonkFilter');
   PostKey(35, false, false, false, false, false, false, false, false); //end
   PostKey(86, false, false, true, false, false, false, false, false); //Ctrl+V 
  finally
   unlockdisplay;
   myForm.free;
  end;
End.

-- 
Maria Luisa C - 01/02/2007 15.15.19
The trouble with being punctual is that nobody's there to appreciate it.
Franklin P. Jones
Technical Details
Message-ID: <1j9k3u7824vq9$.dlg@fido.altervista.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!nntp.infostrada.it!area.cu.mi.it!diesel.cu.mi.it!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <1j9k3u7824vq9$.dlg@fido.altervista.org>
Subject: [Dialog] Ping Paul Blarmy: script
Date: Thu, 1 Feb 2007 15:51:22 +0100
From: MLC <MLC_use@replyto.invalid>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!nntp.infostrada.it!area.cu.mi.it!diesel.cu.mi.it!not-for-mail
Newsgroups: news.software.readers
Organization: C.U. srl News Server
Lines: 142
Reply-To: marialuisac@gmail.com
NNTP-Posting-Host: host31-15.pool80180.interbusiness.it
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: tdi.cu.mi.it 1170341482 14233 80.180.15.31 (1 Feb 2007 14:51:22 GMT)
X-Complaints-To: abuse@diesel.cu.mi.it
NNTP-Posting-Date: Thu, 1 Feb 2007 14:51:22 +0000 (UTC)
User-Agent: 40tude_Dialog/2.0.15.84it (77414256.477.506)
X-Face: 2:y|ShUO; ]6<Y.n3|r`Czy7,Gp.*3"L]gPg+`a/as1Ub0IG(H#PrV+z?kdt|;
 wox[MIl>x~ "vjF0*98_NyvfO<(.U)j'S\lpr?Bl&(~9"Hm46@kS*POuXNKzD