ScriptSoundOnReply

From 40tude Dialog Wiki

This one was done by 'Papa' himself, Marcus Mönnig.

> Is there a script out there that works similar to the Reply Notify in Xnews
> ie...Play sound when someone responds to one of my posts...?

Make sure you generate MsgIDs with Dialog that are based on your domain and then use this On Xover event script:

program OnXover;

procedure OnXover(Var XoverData:TXoverData);
begin
if pos('@RonsDomainUsedInHisMsgIDs.uk',xoverdata.references)>0 then beep;
end;

begin
end.

This will make it ding, but you could play a wav file with this:

program OnXover;

function PlaySound( Filename: PChar; Options: LongWord ): Boolean;
         external 'sndPlaySoundA@winmm.dll stdcall';

procedure OnXover(Var XoverData:TXoverData);
begin
if pos('@RonsDomainUsedInHisMsgIDs.uk',xoverdata.references)>0 then
 PlaySound( 'c:\windows\media\tada.wav', 1 );
end;

begin
end.

Compiles up to 2.0.5.51 (I haven't used it on 2.0.5.53 yet)

J.Cifer


Play the sound only if it is a direct reply (not by yourself):

program OnXover;

//change this string to your FQDN (including the '@'!)
const MY_FQDN = '@my.fqdn.org';
const SOUNDFILE = 'c:\windows\media\tada.wav';

function PlaySound( Filename: PChar; Options: LongWord ): Boolean;
         external 'sndPlaySoundA@winmm.dll stdcall';

procedure OnXover(Var XoverData:TXoverData);
begin
  if (copy (xoverdata.references, length(xoverdata.references) - length(MY_FQDN), length(MY_FQDN)) = MY_FQDN) 
  and not (copy (xoverdata.Msgid, length(xoverdata.Msgid) - length(MY_FQDN), length(MY_FQDN)) = MY_FQDN)
   then begin
       PlaySound( SOUNDFILE, 1 );
  end;
end;

begin
end.