View Full Version : Any way to "Auto save proggy"?
Mjordan
04-28-2007, 03:03 AM
So recently I've heard various people talking about their parents shutting off the scripts and not letting them run it, and so on with problems like this. Well I have also been having these problems, just not as bad as some. So that is the reason I have decided to ask this.
I have been wondering if there is a way to "auto save progress report" to a file like a chat log or something every so minutes(or every time it prints out in the debug it will save to the log too). And every time it saves it will overwrite the previous one. There has been many times when I have ran a script for 20+ hours but come to the computer and realize my parents shut it off before I could get the progress report.
And I was thinking about making something where you say 'auto for x hours then stop whatever the script is doing after x hours and close the RS window and then minimize SCAR to tray and somehow terminate script or just let it lay idle in the tray'. Would this work?
Any help/comments is appreciated :)
Mr.Klean
04-28-2007, 03:20 AM
Hmm, i remember in Ejiman's account creator there is where it saves the usernames and passwords into a text file. Maybe you include a procedure and ever about 15 minutes it saves a progress report into a Text file, then every 15 minutes it overwrites the file each time. Just an idea.
Maybe check out kanes keylogger because that writes the text typed, and saves it to a document. You could probably do the same thing with saving the progress report as a text file the same way too (I'd think).
WhiteShadow
04-28-2007, 05:08 AM
Pretty easy, use GetDebugText and WriteFileString..
king vash
04-28-2007, 05:12 AM
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- ยป save all text --//
//-----------------------------------------------------------------//
// * procedure SaveText(Location:string); // * by King Vash
// * function Date(year, month, day, hour, min, sec, msec:word): string; // * by King Vash
//************************************************** **************************//
{************************************************* ******************************
procedure SaveText(Location:string);
By: King Vash
Description: Save's SRL Randoms Report and all text in degub box to a text file
in the folder defined in location (don't include a final "\")
Location: the location to save file
************************************************** *****************************}
procedure SaveText(Location:string);
var
Time, CurrentSRLText, CurrentDebugText: String;
Year, Month, Day, Hour, Mins, Sec, MSec: Word;
Filenumber: Integer;
Begin
if GetDebugLineCount < 150 then
begin;
status('only ' + IntToStr(getdebuglinecount) + ' lines');
exit;
end;
CurrentDebugText := GetDebugText;
DecodeDate(Now, Year, Month, Day);
DecodeTime(Now, Hour, Mins, Sec, MSec);
Time:= (IntToStr(month) + '_' + IntToStr(day) + '_' + IntToStr(year) + ' ' + IntToStr(Hour) + '_' + IntToStr(Mins))
location :=(location + '\' + 'debug on ' + Time +'.txt');
writeln('Saved to ' +location);
Filenumber := RewriteFile(Location, False)
if Filenumber <= -1 then
begin
status('openfile at ' + location + ' failed');
end else
begin
repeat
DeleteDebugLine(1);
until GetDebugLineCount < random(5)
// if (not WriteFileString(Filenumber, LastScriptReport)) then writeln('Save text failed');'
if (not WriteFileString(Filenumber, CurrentDebugtext)) then writeln('Save text failed again');
CloseFile(Filenumber);
end;
end;
this is something i've been working on but i can't get it to save srl reports i looked in the manual but half the procedure that are listed don't really exist.
PwNZoRNooB
04-28-2007, 09:38 AM
I haven't the prob that someone shuts off the computer.
We all have own computers and I'm going to slaughter the one if someone shuts my computer for nothing :stirthepot:
Sumilion
04-28-2007, 09:45 AM
Easy, have this in your progress report procedure,
SLSeconds := (GetSystemTime - ST) div 1000;
if(LoadSetting('VYC', 'LongestTime') = '')or
(SLSeconds > StrToIntDef(LoadSetting('VYC', 'LongestTime'), 0))then
begin
DebugMe('Saved Proggie!', 1);
SaveSetting('VYC', 'LongestTime', IntToStr(SLSeconds));
SaveSetting('VYC', 'BestTime', TimeRunning);
SaveSetting('VYC', 'BestLogs', IntToStr(LogsChopped));
SaveSetting('VYC', 'BestBanks', IntToStr(Loads));
end;
and this when you want to show it :
procedure BestProgressReport;
begin
if(LoadSetting('VYC', 'LongestTime') = '')then
begin
Writeln('--');
Writeln('Currently unavailable.');
Exit;
end;
Writeln('--');
Writeln('//=========== SL VYC ===========\\');
Writeln('\\====== -Best- Progress Report ========//');
Writeln('/===============================\');
Writeln('| Worked for '+ LoadSetting('VYC', 'BestTime'));
Writeln('| Chopped '+ LoadSetting('VYC', 'BestLogs')+(' logs.'));
Writeln('| Banked '+ LoadSetting('VYC', 'BestBanks')+(' times.'));
Writeln('\===============================/');
end;
Pentti
04-28-2007, 09:54 AM
If you want to write text in the file, like your progress report this is really easy and good way:
procedure New;
var
File:Integer;
begin
File:=RewriteFile(apppath+'My File.txt',False)
if(WriteFileString(File,'My text'))then //You could add GetDebugText in the 'My Text'
CloseFile(File)
end;
RudeBoiAlex
04-28-2007, 10:14 AM
Easy, have this in your progress report procedure,
SLSeconds := (GetSystemTime - ST) div 1000;
if(LoadSetting('VYC', 'LongestTime') = '')or
(SLSeconds > StrToIntDef(LoadSetting('VYC', 'LongestTime'), 0))then
begin
DebugMe('Saved Proggie!', 1);
SaveSetting('VYC', 'LongestTime', IntToStr(SLSeconds));
SaveSetting('VYC', 'BestTime', TimeRunning);
SaveSetting('VYC', 'BestLogs', IntToStr(LogsChopped));
SaveSetting('VYC', 'BestBanks', IntToStr(Loads));
end;
and this when you want to show it :
procedure BestProgressReport;
begin
if(LoadSetting('VYC', 'LongestTime') = '')then
begin
Writeln('--');
Writeln('Currently unavailable.');
Exit;
end;
Writeln('--');
Writeln('//=========== SL VYC ===========\\');
Writeln('\\====== -Best- Progress Report ========//');
Writeln('/===============================\');
Writeln('| Worked for '+ LoadSetting('VYC', 'BestTime'));
Writeln('| Chopped '+ LoadSetting('VYC', 'BestLogs')+(' logs.'));
Writeln('| Banked '+ LoadSetting('VYC', 'BestBanks')+(' times.'));
Writeln('\===============================/');
end;
w00t i found some of ur yew chopper code lol the proggie report u could also makeit take a picture of the randoms but i dunno about the time section of the report cause normmaly u have to scroll up
Mjordan
04-29-2007, 02:45 AM
Ok thanks guys. I just got back from a Joan Jett concert(W00T!) and I'm really tired, so I'll try what you guys said out.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.