Hi guys,
Does any has any ideas on how to create a script that can perform an ingame screenshot (simulate print-screen button hit) when char is under PVP attack?
please, move this topic to the right section.
you can make a ProcessCommand("/dump"); it will create zip with logs and screenshot
(10-14-2013 20:44 PM)ClockMan Wrote: [ -> ]you can make a ProcessCommand("/dump"); it will create zip with logs and screenshot
Any other more "elegant" way of forcing game print-screen along with the specific configuration that come with the game itself (format, quality)?
there is a way, but as i remember only for premium users, they have one function to call any games commands like button click
(10-14-2013 22:05 PM)C495 Wrote: [ -> ]there is a way, but as i remember only for premium users, they have one function to call any games commands like button click
I was thinking (by watching user.ini) of something like :
Code:
ClientExec("shot");
, but this aint work for me...
it should work, part of client code
C++ Programming
if ( ParseCommand((const wchar_t **)&a4, L"SHOT") )
{
if ( !LODWORD(GIsEditor) )
{
FMemMark::FMemMark(&v125, GMem);
v26 = 4 * *(_DWORD *)(v4 + 92) / 4;
LODWORD(v127) = v26;
HIDWORD(a4) = sub_200DA030(4, v26 * *(_DWORD *)(v4 + 96));
(*(void (__stdcall **)(int, _DWORD))(**(_DWORD **)(v4 + 68) + 172))(v4 - 56, HIDWORD(a4));
(*(void (__stdcall **)(_DWORD, _DWORD))(*(_DWORD *)GFileManager + 44))(L"../Screenshot", 0);
for ( j = 0; ; ++j )
{
v108 = j;
if ( j >= 65536 )
break;
v78[1] = (const wchar_t *)j;
v78[0] = L"Screenshot";
if ( GL2ScreenShotQuality )
{
LODWORD(v77) = L"../%s/Shot%05i.jpg";
v76 = (signed int)&v84;
}
else
{
LODWORD(v77) = L"../%s/Shot%05i.bmp";
v76 = (signed int)&v84;
}
ClientExec is for premium, so you need to write your own program
The workaround I did was by compiling a code similar to
https://bug414049.bugzilla.mozilla.org/a...?id=360710 and run it with os.execute, but still this aint better than ProcessCommand("/dump") + unzip
In the debug dump you have posted I cannot see the actual method that does the screen shot - this only parses the client command "shot" and determines the quality of the image - am I correct?
Okay, just for those who are searching for a solution to force a screenshot within a script or plugin - here is my suggestion:
1. Download this ZIP archive and unzip shot.exe into your
l2tower folder. 100% virus free - you can check. If you need more info - let me know and I will share the C++ source.
2. In your script/plugin you can call shot.exe by:
LUA Programming
-- Place screenshots inside "Temp" folder under L2Tower
local filename = GetDir() .. "temp\\" .. tostring(os.clock());
os.execute(GetDir() .. "shot -pid " .. GetCurrentProcessId() .. " -o" .. filename .. ".png");
Any questions - shoot :-)