go0b3r Posted February 18, 2006 Posted February 18, 2006 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?
Valuater Posted February 18, 2006 Posted February 18, 2006 (edited) i did one ... like thisHotKeySet("{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.dllfrom LazyCathttp://www.autoitscript.com/forum/index.ph...&st=0&p=592428) Edited February 18, 2006 by Valuater
greenmachine Posted February 18, 2006 Posted February 18, 2006 (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 EndFuncRequires beta and captdll.dll from here: http://www.autoitscript.com/forum/index.ph...8377&hl=captdll"captdll_v2" Edited February 18, 2006 by greenmachine
rambo3889 Posted February 18, 2006 Posted February 18, 2006 (edited) That not every day i see two person post a answer same minute hehe Edited February 18, 2006 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! youre the best in town Fight!
go0b3r Posted February 19, 2006 Author Posted February 19, 2006 ok well i got them set up, but i cant find where the pics are saved :S
cdkid Posted February 19, 2006 Posted February 19, 2006 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!
go0b3r Posted February 19, 2006 Author Posted February 19, 2006 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.
greenmachine Posted February 19, 2006 Posted February 19, 2006 Try using mine, I know for certain that it works. Just change the location of captdll to your location.
go0b3r Posted February 19, 2006 Author Posted February 19, 2006 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
greenmachine Posted February 19, 2006 Posted February 19, 2006 (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 February 19, 2006 by greenmachine
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now