SRL Archive - SRL Suggestions

SRL Chat log saver


Shuttleu

2010-09-08 08:56:16

well i made this for http://villavu.com/forum/showthread.php?t=58863 and thought it might do well in SRL

var
FileName, LastMessage, LastName: string;

procedure SaveRSChatLog;
var
TheFile, i: Integer;
TheString: string;
LinesMessage, LinesName: array of string;
begin
if (FileName = '') then
FileName:= IncludePath+'SRL\Logs\RSChatlog'+IntToStr(GetSystemTime);
TheFile:= AppendFile(ScriptPath+FileName);
LinesMessage:= ChatBoxTextArray(clChat);
LinesName:= ChatBoxTextArray(clMessage);
for i:=1 to 8 do
if LinesMessage[i]=LastMessage then
if LinesName[i]=LastName then
break;
if (not(i=1)) then
for i:= i-1 downto 1 do
TheString:= TheString+LinesName[i]+''+LinesMessage[i]+Chr(13);
LastMessage:= LinesMessage[1];
LastName:= LinesName[1];
WriteFileString(TheFile, TheString);
CloseFile(TheFile);
end;

~shut

Markus

2010-09-08 11:11:32

SRL already saves log? SRLLog.scar in /core/, and it should be saved on every call of FindNormalRandoms..

Shuttleu

2010-09-08 11:36:11

but this is to save the chatlog of RS

~shut

Markus

2010-09-08 11:41:47

It saves the chatlog of RS? Unless Runescape added a new one in the past two years or so?

Shuttleu

2010-09-08 11:48:28

well my SRLLog files never have anything to do with the RS chat

~shut

Markus

2010-09-08 12:51:34

Turn the boolean on which saves chat ;)

Bonfield

2010-09-09 03:36:36

Where is the Boolean, i haven't got srl on this computer thankyou markus I knew there was a simple way if doing this

And shuttle wouldn't your function write a new file each time it gets called, not add on to the old one?

Shuttleu

2010-09-09 10:34:44

From: Bonfield
Where is the Boolean, i haven't got srl on this computer thankyou markus I knew there was a simple way if doing this

And shuttle wouldn't your function write a new file each time it gets called, not add on to the old one?

it will create a new file evrytime the script is run, but it will add to the old one

so you run the script and a file is run, everytime it is called it will write to that file

you run the script again and it makes another file

~shut