ciskuzzo Posted April 12, 2010 Share Posted April 12, 2010 Hello guys, really new here. I think this forum section is the correct one for my issue. My goal is building a bot to get screenshot of desktop or even better of single windows at fixed hours...let's say every two hours. Is it possible with AutoIt? If yes, any suggestions? Thank you very much. Francesco Link to comment Share on other sites More sharing options...
Negative1 Posted April 12, 2010 Share Posted April 12, 2010 Hello guys, really new here. I think this forum section is the correct one for my issue. My goal is building a bot to get screenshot of desktop or even better of single windows at fixed hours...let's say every two hours. Is it possible with AutoIt? If yes, any suggestions? Thank you very much. Francesco Hi Francesco, Welcome to the forums and Autoit. I recommend you go to the help file index and look up _ScreenCapture_Capture _ScreenCapture_Capture -------------------------------------------------------------------------------- Captures a region of the screen #Include <ScreenCapture.au3> _ScreenCapture_Capture([$sFileName = ""[, $iLeft = 0[, $iTop = 0[, $iRight = -1[, $iBottom = -1[, $fCursor = True]]]]]]) Parameters $sFileName Full path and extension of the image file $iLeft X coordinate of the upper left corner of the rectangle $iTop Y coordinate of the upper left corner of the rectangle $iRight X coordinate of the lower right corner of the rectangle. If this is -1, the current screen width will be used. $iBottom Y coordinate of the lower right corner of the rectangle. If this is -1, the current screen height will be used. $fCursor If True the cursor will be captured with the image What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world. Link to comment Share on other sites More sharing options...
ciskuzzo Posted April 12, 2010 Author Share Posted April 12, 2010 Yes i found them, thank you. Is there any other command to let it repeat every 2 hours? Link to comment Share on other sites More sharing options...
Negative1 Posted April 12, 2010 Share Posted April 12, 2010 Yes i found them, thank you. Is there any other command to let it repeat every 2 hours? while 1 _ScreenCapture_Capture() sleep(7200000) ;7.2million milliseconds = 2 hours wend This is seudocode but i think you can figure it out from here -1 What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world. Link to comment Share on other sites More sharing options...
ciskuzzo Posted April 12, 2010 Author Share Posted April 12, 2010 Cool, i already run it and works, but i figured out that it write the screenshot file on the previous one. While i need a list of screenshot. Link to comment Share on other sites More sharing options...
Negative1 Posted April 12, 2010 Share Posted April 12, 2010 You will need to put a variable in the file name that you write to. "Screenshot" & $x $x = $x + 1 autoit will treat Screenshot & $x as: Screenshot1 Screenshot2 Screenshot3 What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world. Link to comment Share on other sites More sharing options...
ciskuzzo Posted April 12, 2010 Author Share Posted April 12, 2010 #include <ScreenCapture.au3> ; Capture region _ScreenCapture_Capture([$sFileName = "Screenshot" & $x $x = $x + 1] & $x @MyDocumentsDir & "\Screenshot.jpg", 0, 0, 796, 596) while 1 _ScreenCapture_Capture() sleep(7200000) ;7.2million milliseconds = 2 hours wend I think now i did some errors... lol Link to comment Share on other sites More sharing options...
Negative1 Posted April 12, 2010 Share Posted April 12, 2010 #include <ScreenCapture.au3> $x = 0 while 1 $x = $x + 1 _ScreenCapture_Capture(@MyDocumentsDir & "\Screenshot" & $x & ".jpg" , 0, 0, 796, 596) sleep(7200000) ;7.2million milliseconds = 2 hours wend It's untested but give it a try What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world. Link to comment Share on other sites More sharing options...
darkjohn20 Posted April 12, 2010 Share Posted April 12, 2010 (edited) Why not use AdlibRegister (in Beta) or AdlibEnable (in regular)? I believe that's better than a big sleep? Edited April 12, 2010 by darkjohn20 Link to comment Share on other sites More sharing options...
ciskuzzo Posted April 12, 2010 Author Share Posted April 12, 2010 Amazing it worked! I tried it with time range 2 seconds and worked fine! I'm very thankful for your effort! PS! Since i'm using AC Tool software just to refresh the window i need to screen capture, are you able to add at that Autoit script the refresh option every 2hours? This is the logic: Take the screenshot first and then refresh. Time range is always 2 hours for taking screenshot and for refreshing but taking screenshot must comes 1 second earlier than refresh. If it is hard i could continue using that other sfotware. Thanks in any case!! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 12, 2010 Moderators Share Posted April 12, 2010 darkjohn20,AdlibRegister (in Beta) or AdlibEnable (in regular)Time for you to update! The current "Release" (v3.3.6.0) uses AdlibRegister - the previous release (v3.3.4.0) dispatched "AdlibEnable" to the great Recycle Bin in the sky..... And we have no "Beta" at the moment.M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
darkjohn20 Posted April 12, 2010 Share Posted April 12, 2010 Oh my...I guess it is time. Link to comment Share on other sites More sharing options...
ciskuzzo Posted April 12, 2010 Author Share Posted April 12, 2010 This is the logic: Take the screenshot first and then refresh. Time range is always 2 hours for taking screenshot and for refreshing but taking screenshot must comes 1 second earlier than refresh.If it is hard i could continue using that other sfotware.Thanks in any case!!Anyone can help me on this? Link to comment Share on other sites More sharing options...
Negative1 Posted April 12, 2010 Share Posted April 12, 2010 Anyone can help me on this? I'm not familar with the software you are using to "refresh" the window. However if you are click a button to refresh the window start autoit window info tool (included with the autoit download package) and hover the mouse over the button. Press Ctrl+Alt+F to freeze the window info tool. Then click the tab "Control Info" if there is a number beside "control ID" you can use the command controlclick() to click the button using autoit.good luck-1 What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world. 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