🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by Rudolph Rhein Mon, 14 Nov 2022 16:44
[dialog] Is there a script to empty the outbox at a given system time
#265855
Author: Rudolph Rhein
Date: Mon, 14 Nov 2022 16:44
7 lines
1090 bytes
Sometimes I want to send articles at a certain time, such as timed
announcements. 

I have to set an alarm on my phone to remember to send them.

Is there any known script that will send all the messages in the dialog
outbox at a given system time?
Re: [dialog] Is there a script to empty the outbox at a given system time
#265852
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads