🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #265852

Re: [dialog] Is there a script to empty the outbox at a given system time

#265852
From: Bernd Rose
Date: Mon, 14 Nov 2022 22:21
51 lines
2768 bytes
On Mon, 14th Nov 2022 18:44:44 +0200, Rudolph Rhein wrote:

> Is there any known script that will send all the messages in the dialog
> outbox at a given system time?

Actually, you need 2 scripts. 

One is an Event script, that will send all messages, when a timer triggers. 
Which timer of the two predefined ones you use depends on, which isn't used 
for anything else during the time span, your send-timer runs.

------------------------------------------------------------------------------
Program OnTimer1;
Procedure OnTimer1;
Begin
  ADo('SendAllInOutbox');
  // You probably want to execute SendAll only once
  timer1.enabled := false;
End;
Begin
End.
------------------------------------------------------------------------------

The second script is necessary to initiate and start the timer. It can be
part of a larger script, that executes other tasks, as well. (For instance 
OnStartup.) Or it can be a small Custom script. Question is, how to initiate
the timer: You can hard-code a time-span or a certain time, use a time value
written in a text file, query the value runtime as input,... Some of these
approaches are fairly simple, some quite sophisticated. I'll show the most
simple one, using a hard-coded time span of 2 hours in a Custom script. This
script could be assigned to a button or a hotkey.

------------------------------------------------------------------------------
Program SetSendAllTimer;  
Const  
  TimeHours = 2;  
Begin
  With Timer1 Do  
    Begin
      // Timer expects value in ms
      Interval := 1000 * 60 * 60 * TimeHours;
      Enabled  := True;
    End;
End.
------------------------------------------------------------------------------

If you know, what approach you need, we can discuss changes or alternative
methods.

HTH.
Bernd
Technical Details
Message-ID: <17zx2b0fez0xj$.dlg@b.rose.tmpbox.news.arcor.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <tktr9g$44p$1@gioia.aioe.org>

Show Full Headers
Complete Article Headers
Message-ID: <17zx2b0fez0xj$.dlg@b.rose.tmpbox.news.arcor.de>
Subject: Re: [dialog] Is there a script to empty the outbox at a given system time
Date: Mon, 14 Nov 2022 23:21:59 +0100
From: Bernd Rose <b.rose.tmpbox@arcor.de>
References: <tktr9g$44p$1@gioia.aioe.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.readers
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: solani.org; logging-data="908627"; mail-complaints-to="abuse@news.solani.org"
User-Agent: 40tude_Dialog/2.0.15.41 (1e110686.76.317)
Cancel-Lock: sha1:FPGFJxvTMd7nT0b+qJzdNVTq44c=
X-User-Id: eJwNyckBwCAMA7CVcuCYjENNs/8Irb5Clpe4CrUwGPP2NNsLEi0YTrXd592htGWjUlApNoDyvtGxD/fo3JyX/014gn7Aqw+FYBjS