Harry
2011-11-26 04:30:46
{*******************************************************************************
procedure TakeScreen(reason: String);
by: Mutant Squirrle edit yakman
Description: Takes a screenshot if the global Screenshots is true,
Adds +TimeRunning+ to the path, so no screenshots will overwrite each other.
Adds '.bmp' to the end, will not crash the script if it goes wrong.
Todo: Make PNG when Simba supports it properly.
*******************************************************************************}
procedure TakeScreen(Reason: string);
begin
if(not Screenshots)then Exit;
try
if FileExists(SRLSavePath + reason + ' ' + Players[CurrentPlayer].Name + '.bmp') then
SaveScreenshot(SRLSavePath + reason + ' ' + Players[CurrentPlayer].Name + ' ' + TimeRunning + '.bmp')
else
SaveScreenshot(SRLSavePath + reason + ' ' + Players[CurrentPlayer].Name + '.bmp');
WriteLn('Screenshot of: ' + reason + ' ' + TimeRunning);
except
Writeln('Failed to save screenshot of: ' + reason);
end
end;I spiced it up a bit. Before it was sorta useless.
Now it appends your login username onto the bitmap, and only adds TimeRunning if a file with same filename exists.
Todo: make it save as lossless pngs, using a lot less space than bitmaps. Simba "should" be able to save as pngs, but it appears to be broken to me as it saves as a corrupt 1kb png.