I've had this problem as well as noticed other people as well, Although it not as detrimental to the workings of SCAR/SRL as other Procedures, I think it could still be useful. We had a bad Storm here and was without power for awhile last night, and All my Scripts were closed last night unexpectedly. I've also noticed the same thing happening to other people, when they have crashes with their computers, for whatever reason. My thoughts were, to somehow save Progress reports periodically to a text file. I find progress reports useful for a number of reasons, Being able to give feedback to the Author's Scripts, but mainly, not having to log into 30+ accounts and try and see where everyone is. This may be able to be accomplished through existing Functions and procedures , but I wasn't sure how, So I thought I would just post it here for now, Thanks, RAM
Pentti
2007-05-07 15:07:17
Function SaveReport(Name, Text:String):Boolean;
var
file:Integer;
begin
file:=ReWriteFile(apppath+Name+'.txt',False)
if(WriteFileString(file,Text))then
begin
CloseFile(file)
Result:=True;
end;
end;
begin
if(SaveReport('My script','Mined: '+inttostr(5+random(20))))then
Writeln('Report saved')
end.
What do you like this? I just made it..
Bobarkinator
2007-05-07 16:55:45
You can ask Fakwai as I think he said somewhere that he has the script save the progress reports to a file.
I know you can save chat logs to a file, but I think they get over written every time, Pentti, looks good, I'm more interested in their locations then actual material or experienced gained, bu I see that won't be hard to change. RAM
Special Ed
2007-05-07 19:41:43
Any ideas on how to make it add a line to the file and / or change / rewrite certain lines? Because if you figured that out it would be nice.
Pentti
2007-05-08 08:14:49
RAM_RUNE, Look in my Multi City Miner & Banker, it writes pretty much same texts in the file that SCAR has in it's debug screen. It also saves player report in the file.
rkroxpunk
2007-05-08 18:55:24
why isn't it just part of the SRL include. As basic as it is it might as well be and SRL should come with a folder that it automatically saves too. Not hard at all and basically useful in any script. Sure that means I can add it myself easily but might as well automatically be there. no reason why it shouldn't be