zluo
2012-06-16 02:33:57
is there a special function that makes simba take a printscreen of the client and save it to the desktop? need it so i can see what goes wrong in my script, thanks
2012-06-16 02:33:57
2012-06-16 02:42:40
procedure MakeScreenShot(const FilePath : String);
var
fileName : String;
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
if not DirectoryExists(FilePath) then
CreateDirectory(FilePath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example: 2012-3-21 (1).jpg
end;
end;EXAMPLEMakeScreenShot('C:\Simba\Screenshots');
2012-06-16 04:12:05
procedure MakeScreenShot('C:\Simba');
var
fileName : String;
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
if not DirectoryExists(FilePath) then
CreateDirectory(FilePath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example: 2012-3-21 (1).jpg
end;
end; Thank for the help, but I keep getting an identifier error at the start of my script, whats wrong? sorry new to this stuff
2012-06-16 05:23:41
2012-06-16 05:48:19
2012-06-16 05:52:05
procedure MakeScreenShot(fileName, ScreenShotsPath:String);
var
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := fileName + ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example: 2012-3-21 (1).jpg
end;
end;
2012-06-16 05:54:42
Procedure TakePhoto;
begin
TakeScreen('Terminated');
end;
AddOnTerminate('TakePhoto');
2012-06-16 18:21:47
procedure MakeScreenShot(fileName, 'C:\Simba':String);
var
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := fileName + ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example: 2012-3-21 (1).jpg
end;
end;sorry for being stupid, but i seriously cant see whats wrong, thanks if you can help.2012-06-16 18:26:00
2012-06-16 18:27:25
From: FifthDimension
Get Gyazo, or use swiftkit, it has a good screenshot function and lots of other useful tools.
2012-06-16 18:42:45
From: zluo
sorry for being stupid, but i seriously cant see whats wrong, thanks if you can help.procedure MakeScreenShot(fileName, 'C:\Simba':String); // [B]this should JUST be C:\simba\'whatever follows'[/B]
var
Year, Month, Day : Word;
i : Integer;
begin
if TakeScreenShots then
begin
if not DirectoryExists(ScreenShotsPath) then
CreateDirectory(ScreenShotsPath);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
FileName := fileName + ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day) + ' (' + IntToStr(i) + ').jpg';
until not FileExists(FilePath + FileName)
SaveScreenShot(FilePath + FileName); //example: 2012-3-21 (1).jpg
end;
end;
[Error] (2:36): Identifier expected at line 1 happens all the time
2012-06-16 18:56:03
From: Sokkr7
pretty sure that's all that's wrong..
procedure TakeScreenShot;
var
Year, Month, Day : Word;
i : Integer;
Path, Name : String;
begin
Path := AppPath + 'Screenshots\';
if(not DirectoryExists(Path))then
ForceDirectories(Path);
DecodeDate(Date,Year,Month,Day);
i := 0;
repeat
i := i+1;
Name := Name + ToStr(Year) + '-' + ToStr(Month) + '-' + ToStr(Day);
if(i = 0)then
Name := Name + '.jpg'
else
Name := Name + ' (' + IntToStr(i) + ').jpg';
until(not FileExists(Path + Name));
SaveScreenShot(Path + Name); //example: 2012-3-21 (1).jpg
end;