Sign in to follow this  
Followers 0
go0b3r

Prt scr - save jpeg?

10 posts in this topic

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



#2 ·  Posted (edited)

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

#3 ·  Posted (edited)

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

#4 ·  Posted (edited)

That not every day i see two person post a answer same minute hehe

Edited by rambo3889

My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! you’re the best in town Fight!

Share this post


Link to post
Share on other sites

ok well i got them set up, but i cant find where the pics are saved :S

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

Try using mine, I know for certain that it works. Just change the location of captdll to your location.

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

#10 ·  Posted (edited)

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  
Followers 0