[Release] Black Box Screen Capture

06/22/2016 19:24 Tenshi07#1
This is me just before dying in Ark Survival Evolved:

[Only registered and activated users can see links. Click Here To Register...]

And this is me after I found my dead body to get my stuff back quickly:

[Only registered and activated users can see links. Click Here To Register...]

I found my stuff really quickly and effortlessly, because I had this application running with the game Ark Survival Evolved.

Hate to die and lose your gear? Want it back but find it hard to figure out where you died and left it? This is the app for you.

This app will save compressed pictures to a directory created in the same location that you have the script running from. For an example, see the picture below.

[Only registered and activated users can see links. Click Here To Register...]

From there you can easily scroll through and find the saved picture of your death, and the pictures leading up to that death. Thus you can easily figure out how to get back and save your stuff. Easy right? :D

The pictures save every 1.5 seconds, although you could edit that frequency to whatever you want. The source code is available to you below. A typical picture saves as a size of about 70 KB give or take, as a compressed *.JPG.

*Important to know* To exit the application, you need to move your mouse over the [EXIT] text and then mouse click the left and right buttons to close it. The [EXIT] button is typically located up the top left corner of your main monitor. That's easy right? :D

You will need autoit to use this script:

Code:
#include <Date.au3>
$time = @Year & "y." & @Mon & "m." & @Mday & "d." & @Hour & "." & @Min & "." & @Sec
if(DirGetSize ( @ScriptDir & "\bb_" & $time & "\" ) <> -1) Then ;check to see if the directory already exists
	Beep(200,100)
	Exit
EndIf
If(DirCreate ( @ScriptDir & "\bb_" & $time & "\" ) = 0) Then ;create the directory and then check to see if it exists
	Beep(700,100)
	Exit
EndIf

#include <Misc.au3>
#include <AutoItConstants.au3>
#include <ScreenCapture.au3>

Local Const $iW = @DesktopWidth, $iH = @DesktopHeight

$dll = DllOpen("user32.dll")
Opt("TrayIconHide", 1)

$cnt = 0
$cnt2 = 0
$esc = 0
Dim $alcon[5]
Do ;loop
	$mouse = MouseGetPos()
	If($mouse[0] < 38) and ($mouse[1] < 20) and _IsPressed("01", $dll) and _IsPressed("02", $dll) Then ;exit
		DllClose($dll)
		Exit
	EndIf
	ToolTip("[EXIT] Screen Capture! [" & $cnt2 & "] " & @Hour & ":" & @Min & ":" & @Sec, 0, 0)
	Sleep(250)
	$cnt = $cnt + 1
	If($cnt = 6) Then
		$cnt = 0
		$cnt2 = $cnt2 + 1
		_GDIPlus_Startup()
		Local $hHBmp = _ScreenCapture_Capture("", 0, 0, $iW, $iH) ;create a GDI bitmap by capturing full screen of the desktop
		Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap
		_WinAPI_DeleteObject($hHBmp) ;release GDI bitmap resource because not needed anymore

		Local $hBitmap_Scaled = _GDIPlus_ImageResize($hBitmap, $iW / 2, $iH / 2) ;resize image
		
		_GDIPlus_ImageSaveToFile($hBitmap_Scaled, @ScriptDir & "\bb_" & $time & "\" & $cnt2 & "_" & @Hour & "." & @Min & "." & @Sec & ".jpg")
		_GDIPlus_Shutdown()
	EndIf
Until $esc = 1
08/02/2016 12:39 Tenshi07#2
Updated the script.
08/02/2016 14:58 Devsome#3
Title changed from "Black Box Screen Capture" to "[Release] Black Box Screen Capture" as requested.
08/02/2016 18:02 Tenshi07#4
Thanks a bunch. :)