bud_wis_er_420
2013-02-21 05:29:08
I been trying to get these to work. It seems like it works but I can't find any screen shots. I tried editing the path, but that didn't work. If I reading everything right this script should take a screen shot and save it to the simba/Scripts Folder.
program new;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$i ObjectDTM\ObjDTMInclude.simba}
var
x,y,color: integer;
// By Ollybest
Function rs_TakeScreen(s: string): Integer;
var
tpa: TPointArray;
TIA, TIA2, TIA3: TIntegerArray;
w, h: Integer;
atpa: T2DPointArray;
begin
Result := BitmapFromClient(MSX1, MSY1, MSX2, MSY2);
setBitmapSize(Result, 673, 350);
setLength(atpa, 3);
TPAFromBoxWrap(mmBox, atpa[0]);
FilterPointsDist(atpa[0], 0, 76, MMCX, MMCY);
TPAFromBoxWrap(IntToBox(MSCX - 13, MSCY - 20, MSCX + 13, MSCY + 20), ATPA[1]);
TPAFromTextWrap(s, statchars, w, h, atpa[2]);
GetColorsWrap(atpa[0], TIA);
TIA2 := ColorsFromTPA(ATPA[1], clRed);
TIA3 := ColorsFromTPA(ATPA[2], clRed);
OffsetTPA(atpa[0], Point(-35, -6));
OffsetTPA(atpa[2], Point(2, +336))
MergeATPAWrap(ATPA, TPA);
try
fastSetPixels(Result, TPA, TIA+TIA2+TIA3);
except
writeln('rs_TakeScreen: Failed to set pixels, prehaps shutdown reason is too long!');
end;
end;
// By Ollybest
Procedure rs_SaveScreenshot(reason, savePath: string);
var
bmp, x: Integer;
begin
if (not(loggedIn)) then
Exit;
bmp := rs_TakeScreen(reason);
if FileExists(savePath + ' [' + ToStr(x) +']' + '.png') then
while FileExists(savePath + ' [' + ToStr(x) + ']' + '.png') do
Inc(x);
try
SaveBitmap(bmp, savePath + ' [' + ToStr(x) + ']' + '.png');
except
writeln('rs_TakeScreenshot: Failed saving screenshot');
finally
FreeBitmap(bmp);
end;
end;
// By Ollybest
Procedure shutdown(s: string);
var
path, name: string;
begin
path := AppPath + 'Scripts\';
name := 'Shutdown - '+ TheDate(Date_Day)+ ' ';
rs_SaveScreenshot(s, Path + Name);
end;
Begin
SetUpSRL;
//DeclarePlayers;
ObjDTM_Setup;
shutdown('1');
End.