SRL Archive - Research & Development Lounge

Auto Responder


Nava2

2008-08-20 15:36:36

I have placed this here so that people will stop asking for one. I need this tested but, in theory, it should work well.

Copy this code into SCAR and hit play.
program WriteAutoResponder;

// By Da Owner... Modded by myself.

var
I : integer;

begin
try
I := RewriteFile(AppPath + 'Includes\SRL\SRL\core\CAutoRespond.scar', false);
WriteFileString(I, GetPage('http://www.geocities.com/nava2@ymail.com/CAutoRespond.txt'));
CloseFile(I);
writeln('File downloaded successfully to ' + AppPath + 'Includes\SRL\SRL\misc\CAutoRespond.scar.');
except
Writeln('Could not download.');
end;
end.

To use, copy the SetupAutoResponder procedure, and fill it in. Also, after SetupSRL, write UseRespond := true; As well, make sure you declare if you are using SMART by setting RespSMART to true.

After Setup, there is no need to call the procedure, SRL does it for us! :). It calls it in FindNormalRandoms.

Enjoy, PLEASE post comments and suggestions.

Nava2

2008-08-21 12:11:58

Added file downloader, to keep up with competition. Also, fixed some errors I found.

dallas574

2008-08-22 13:08:04

I belive it should be


program WriteAutoResponder;

var
FileNum : integer;

begin
try
FileNum := RewriteFile(AppPath + 'Includes\SRL\SRL\core\CAutoRespond.scar', false);
WriteFileString(FileNum, GetPage('http://www.geocities.com/nava2@ymail.com/CAutoRespond.txt'));
CloseFile(I);
writeln('File downloaded successfully to ' + AppPath + 'Includes\SRL\SRL\misc\CAutoRespond.scar.');
except
Writeln('Could not download.');
end;
end.

Da 0wner

2008-08-22 19:05:55

Yes dallas is correct. You did not declare FileNum.

Daniel

2008-08-22 21:42:07

From: Da 0wner
Yes dallas is correct. You did not declare FileNum.

But dallas also didn't declare I ;) Just replace all FileNum's with an I and it will work.

TViYH

2008-08-22 21:52:23

Dallas changed the I to FileNum…Use Dallas's, but change
CloseFile(I);
to
CloseFile(FileNum);

Nava2

2008-08-23 01:42:06

From: TheVoiceInYourHead
Dallas changed the I to FileNum…Use Dallas's, but change
CloseFile(I);
to
CloseFile(FileNum);


Thank you to everyone, but dan was right. I just changed the one filenum to I and it worked. :)

Nava2

2008-08-25 01:06:27

Large Update, included FrOzn SOuls TypeSend2 which creates mistakes etc in typing. Good update IMO! :)

Da 0wner

2008-08-25 19:24:36


// By Da Owner… Modded by myself.


??? :p

Nava2

2008-08-26 00:09:43

From: Da 0wner
??? :p


It was yours, I just fixed it. :D

Da 0wner

2008-08-26 01:47:04

K, there wasn't a problem with it you just improved it :) with a simple try/except.

Nava2

2008-08-26 09:57:49

Good catch on my grammar ;)

Claymore

2008-08-26 19:17:33

Line 13: [Error] (16370:1): Duplicate identifier 'OldMessage' in script C:\Program Files\SCAR 3.15\includes\SRL\SRL\Core\CAutoRespond.scar
Failed when compiling
Line 301: [Error] (9312:21): Unknown identifier 'OldMessage' in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/CAutoRespond.scar
Failed when compiling

i tried removing the OldMessage var in the CAutoRespond but then i get Unknown Identifier, and if i add it back in i get Duplicate. Thats just gay, what the hell is the matter with SCAR.

Da 0wner

2008-08-26 19:22:52

Of course if you remove it it will be an unknown identifier…

Claymore

2008-08-26 22:07:31

Oh nvm, found out i put {.Include SRL\SRL\Core\CAutoRespond.Scar} But SRL.Scar already does that :D

Nava2

2008-08-27 10:43:22

SRL includes the entire core folder ;).

:)

I was worried it was a glitch like the result glitch. Like so:

program new;
var
result : boolean;

begin
end.

Run that, then remove the variable, and run it again.
Oops?

Da 0wner

2008-08-27 16:10:39

Result is already a hidden variable used for functions that you don't need to declare.

Nava2

2008-08-28 10:24:23

Still, its an unknown identifier when you don't put it in. But, when you put it in, its a duplicate. ;).

Just strange :)

Claymore

2008-08-28 12:32:11

No its because i added

program Blah;
{.Include CAutoRespond}
{.Include SRL}

I realized that SRL already provided that include. Therefor if i had 2 CAutoRespond includes, it gets me that funny litte error ;p Duplicate, them Unknown ;p

Nava2

2008-08-28 12:35:53

Oh, I know. That error only happens with result. So either way, the responder does work though? :)