testingtest Posted June 15, 2007 Share Posted June 15, 2007 expandcollapse popup#include <GuiConstants.au3> #include <Misc.au3> Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Global $Form1 $Form1 = GUICreate("AForm1", 322, 218, 193, 115) $Edit1 = GUICtrlCreateEdit("", 0, 0, 321, 185) GUICtrlSetData(-1, StringFormat("Picture Taker Beta 1.04v \r\n\r\n* Advantages \r\n- No dll required \r\n\r\n* Disadvantages\r\n- Flickering\r\n- 99.9% chance of working\r\n- Not completely user friendly because of flickering\r\n")) $Button1 = GUICtrlCreateButton("Picture Test", 0, 192, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUISetState(@SW_HIDE) ;hides GUI _Pic() EndSwitch WEnd Func _Pic() BlockInput(1) ;blocks user input Send("{PRINTSCREEN}") ;takes a picture of the screen Run("mspaint") ;runs paint to put the print screen in since you can't put it in the clipboard for example ClipPut(Send("{PRINTSCREEN}")) WinWait("untitled - Paint") ;waits for window WinSetTrans("untitled - Paint" , "" , 0) If Not WinActive("untitled - Paint") Then WinActivate("untitled - Paint") ;activates window WinWaitActive("untitled - Paint") ;waits until active Send("{CTRLDOWN}v{CTRLUP}") ;pastes the image Sleep(500) ;sleeps to wait for the paint window ;you only get this window if the image is bigger then the box If WinExists("Paint") Then ;checks if window exists WinActivate("Paint","The image in the cli") ;activates window WinWaitActive("Paint","The image in the cli") ;waits until active Send("Y") ;hits yes on the message box Send("{ALTDOWN}fs{ALTUP}") ;opens the file menu and hits save EndIf BlockInput(0) ;accepts user input WinWait("Save As","Save as &type:") ;wait for save window If Not WinActive("Save As","Save as &type:") Then WinActivate("Save As","Save as &type:") ;activate save window WinWaitActive("Save As","Save as &type:") ;wait until activated While 1 ;loop If Not WinExists("Save As") Then ProcessClose("mspaint.exe") ;double checking GUISetState(@SW_SHOW) ;shows GUI EndIf ; WinKill("untitled - Paint") ;kill after saved ExitLoop WEnd ;loop end Exit EndFunc will try and make it better Link to comment Share on other sites More sharing options...
Generator Posted June 15, 2007 Share Posted June 15, 2007 expandcollapse popup#include <GuiConstants.au3> #include <Misc.au3> Opt("WinWaitDelay",100) Opt("WinTitleMatchMode",4) Global $Form1 $Form1 = GUICreate("AForm1", 322, 218, 193, 115) $Edit1 = GUICtrlCreateEdit("", 0, 0, 321, 185) GUICtrlSetData(-1, StringFormat("Picture Taker Beta 1.04v \r\n\r\n* Advantages \r\n- No dll required \r\n\r\n* Disadvantages\r\n- Flickering\r\n- 99.9% chance of working\r\n- Not completely user friendly because of flickering\r\n")) $Button1 = GUICtrlCreateButton("Picture Test", 0, 192, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUISetState(@SW_HIDE) ;hides GUI _Pic() EndSwitch WEnd Func _Pic() BlockInput(1) ;blocks user input Send("{PRINTSCREEN}") ;takes a picture of the screen Run("mspaint") ;runs paint to put the print screen in since you can't put it in the clipboard for example ClipPut(Send("{PRINTSCREEN}")) WinWait("untitled - Paint") ;waits for window WinSetTrans("untitled - Paint" , "" , 0) If Not WinActive("untitled - Paint") Then WinActivate("untitled - Paint") ;activates window WinWaitActive("untitled - Paint") ;waits until active Send("{CTRLDOWN}v{CTRLUP}") ;pastes the image Sleep(500) ;sleeps to wait for the paint window ;you only get this window if the image is bigger then the box If WinExists("Paint") Then ;checks if window exists WinActivate("Paint","The image in the cli") ;activates window WinWaitActive("Paint","The image in the cli") ;waits until active Send("Y") ;hits yes on the message box Send("{ALTDOWN}fs{ALTUP}") ;opens the file menu and hits save EndIf BlockInput(0) ;accepts user input WinWait("Save As","Save as &type:") ;wait for save window If Not WinActive("Save As","Save as &type:") Then WinActivate("Save As","Save as &type:") ;activate save window WinWaitActive("Save As","Save as &type:") ;wait until activated While 1 ;loop If Not WinExists("Save As") Then ProcessClose("mspaint.exe") ;double checking GUISetState(@SW_SHOW) ;shows GUI EndIf ; WinKill("untitled - Paint") ;kill after saved ExitLoop WEnd ;loop end Exit EndFunc will try and make it betterIt almost killed me, my OS is in Chinese, winwait doesn't work here. I had to use Ctrl+Alt+Del while testing. Other hand i can't test it, but i think it will be great. Link to comment Share on other sites More sharing options...
PaulIA Posted June 15, 2007 Share Posted June 15, 2007 Using Auto3Lib: #include <A3LScreenCap.au3> Global $hGUI, $iButton, $iCount=1 $hGUI = GUICreate("Picture Taker", 200, 100) $iButton = GUICtrlCreateButton("Take Picture", 64, 72, 75, 25) GUISetState() while 1 Switch GUIGetMsg() case $iButton GUISetState(@SW_HIDE) Sleep(100) _ScreenCap_Capture("C:\Image" & $iCount & ".jpg") GUISetState() $iCount += 1 case $GUI_EVENT_CLOSE Exit EndSwitch wend Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
testingtest Posted June 15, 2007 Author Share Posted June 15, 2007 Using Auto3Lib: #include <A3LScreenCap.au3> Global $hGUI, $iButton, $iCount=1 $hGUI = GUICreate("Picture Taker", 200, 100) $iButton = GUICtrlCreateButton("Take Picture", 64, 72, 75, 25) GUISetState() while 1 Switch GUIGetMsg() case $iButton GUISetState(@SW_HIDE) Sleep(100) _ScreenCap_Capture("C:\Image" & $iCount & ".jpg") GUISetState() $iCount += 1 case $GUI_EVENT_CLOSE Exit EndSwitch wend wow but whats autoit lib...? Link to comment Share on other sites More sharing options...
Helge Posted June 15, 2007 Share Posted June 15, 2007 wow but whats autoit lib...?Link and information in PaulIA's signature...http://www.autoitscript.com/forum/index.php?showtopic=33677 Link to comment Share on other sites More sharing options...
Generator Posted June 15, 2007 Share Posted June 15, 2007 wow but whats autoit lib...?You are late mate, read the sticky lol, great addition to scripting. Link to comment Share on other sites More sharing options...
testingtest Posted June 15, 2007 Author Share Posted June 15, 2007 ==> Error opening the file.: #include <A3LScreenCap.au3> I don't understand is the file missing? Link to comment Share on other sites More sharing options...
James Posted June 15, 2007 Share Posted June 15, 2007 You need to install The PaulIA Lib. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
testingtest Posted June 15, 2007 Author Share Posted June 15, 2007 You need to install The PaulIA Lib.I did hmm Link to comment Share on other sites More sharing options...
James Posted June 15, 2007 Share Posted June 15, 2007 Then there should be no problem. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
PaulIA Posted June 15, 2007 Share Posted June 15, 2007 Then there should be no problem.Amen. I have $100 that says that A3LScreenCap.au3 isn't in the production Include directory. Any takers? Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
James Posted June 15, 2007 Share Posted June 15, 2007 I take that too, I need some money. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Achilles Posted June 16, 2007 Share Posted June 16, 2007 I did hmmMake sure, that if your running beta, the PaulIA's includes go into the beta include directory too My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
SalazarCheats Posted June 16, 2007 Share Posted June 16, 2007 i can't run it... missing the include file... and don't ask if i have lib installed yes i do Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes Link to comment Share on other sites More sharing options...
i542 Posted June 16, 2007 Share Posted June 16, 2007 hmmm download/reinstall latest version of AutoIt Libary @First post: Ok it is good picture taker. Four (* * * *) on the topic I can do signature me. Link to comment Share on other sites More sharing options...
PaulIA Posted June 16, 2007 Share Posted June 16, 2007 i can't run it... missing the include file... and don't ask if i have lib installed yes i doI'll take you up on that $100 bet too. I'm betting you don't have any A3L*.au3 files in your production Include directory or you're not running the script using the latest production release. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
PaulIA Posted June 16, 2007 Share Posted June 16, 2007 Make sure, that if your running beta, the PaulIA's includes go into the beta include directory tooThe Auto3Lib thread, the Auto3Lib download section and the Auto3Lib installer all tell you that Auto3Lib has to be run with the latest production version of AutoIt. In fact, the installer will give you a error message telling you that you need to update your AutoIt version if it's lower than 3.2.4.9 and it won't install. However, I've had a few bright people that have installed the latest version of AutoIt and then switched back to an old beta version of AutoIt before running the scripts. I'm afraid that stupidity is a cancer and I haven't found the cure yet (other than a .50 caliber suppository). Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 16, 2007 Moderators Share Posted June 16, 2007 I'm afraid that stupidity is a cancer and I haven't found the cure yet (other than a .50 caliber suppository). ... Can I be the trigger man? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
PaulIA Posted June 16, 2007 Share Posted June 16, 2007 ... Can I be the trigger man?Take a number... Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
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