Jump to content
Sign in to follow this  
go0b3r

Prt scr - save jpeg?

Recommended Posts

ok well i play a game called warrock alot, and i like to take screen shots, how can i make it so that when i press prt scr it'll auto save a .jpeg or .bmp etc.. file?

Share this post


Link to post
Share on other sites

i did one ... like this

HotKeySet("{F9}", "OnScreenShot")
HotKeySet("{ESC}", "Terminate")

While 1
    Sleep(20)
WEnd


Func OnScreenShot()
    DirCreate ( @scriptdir & "\screenshots" ) 
    If Not FileExists(@scriptdir & "\captplugin.dll") Then FileInstall( "captplugin.dll", @scriptdir & "" ,1)
    $Cwin1 = WinGetHandle(""); gets the handle of the active window
    $Cwin2 = WinGetPos($Cwin1)
    $CaptureDirectory = @ScriptDir & "\Screenshots\"; where to store screen caps
    $CaptureFile = "Dump" & @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & @MIN & "-" & @SEC & ".jpg"
    $hPlugin = PluginOpen(@scriptdir & "\captplugin.dll")
    $Ctest = CaptureRegion($CaptureDirectory & $CaptureFile, $Cwin2[0], $Cwin2[1], $Cwin2[2], $Cwin2[3],  85)
    If $Ctest = 0 then MsgBox(64,"Cature Error!", "The screen was not captured", 4)
    PluginClose($hPlugin)
EndFunc

Func Terminate()
    Exit
EndFunc

*** NOTE ***

requires captplugin.dll

from LazyCat

http://www.autoitscript.com/forum/index.ph...&st=0&p=59242

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

HotKeySet ("{PRINTSCREEN}", "gogoscreenshot")
HotKeySet ("{ESC}", "quitme")

While 1
    Sleep (10)
WEnd


Func gogoscreenshot()
; Capture full screen
; Fist parameter - filename, last - jpeg quality. 
    DllCall("D:\program files\autoit3\include\captdll.dll", "int", "CaptureScreen", "str", @MON & @MDAY & @YEAR & @HOUR & @MIN & @SEC & ".jpg", "int", 85)
EndFunc
Func quitme()
    Exit
EndFunc

Requires beta and captdll.dll from here: http://www.autoitscript.com/forum/index.ph...8377&hl=captdll

"captdll_v2"

Edited by greenmachine

Share this post


Link to post
Share on other sites

should be in ur script director \ screenshots so...

if your script is in "c:\myscript\myscript.au3" then it'll be in "c:\myscript\screenshots" from what i can tell of that

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

i get this error:

Line 29 (file:c:\documents...........\new folder (2)\print screen.au3"):

$Ctest = CaptureRegion($CaptureDirectory & $CaptureFile, $Cwin2[0], $Cwin2[1], $Cwin2[2], $Cwin[3], 85)

$Ctest = ^ ERROR

Error: Unknown Fuction name

That happens when i press f9, this is for the first script given.

Share this post


Link to post
Share on other sites

ok tyvm, that works now. Also, how could i modify this so that instead of pressing print screen, it'd take a pic when i pressed the left mouse button?? Id like to get killshot pics without having to press print screen :o

Share this post


Link to post
Share on other sites

Well you could use _IsPressed in the beta version... that would get the job done, although it's not the same as a hotkey (which would be ideal).

_IsPressed ('01') would do the trick.

Added to my code from above:

#include <misc.au3>
; HotKeySet ("{PRINTSCREEN}", "gogoscreenshot"); turned off hotkey
HotKeySet ("{ESC}", "quitme")

While 1
    If _IsPressed ('01') Then
        gogoscreenshot()
    EndIf
    Sleep (10)
WEnd


Func gogoscreenshot()
; Capture full screen
; Fist parameter - filename, last - jpeg quality.
    DllCall("D:\program files\autoit3\include\captdll.dll", "int", "CaptureScreen", "str", @MON & @MDAY & @YEAR & @HOUR & @MIN & @SEC & ".jpg", "int", 85)
EndFunc
Func quitme()
    Exit
EndFunc
Edited by greenmachine

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...