Sign in to follow this  
Followers 0
foolove

screen capture program refining my code to be better :)

2 posts in this topic

#1 ·  Posted (edited)

I have a screen capture program below the mouse moves inside my program over a small image then captures a larger image displayed.....After the capture it moves to the next coordinate. When the program scrolls to the very bottom the remaining images on the screen have different coordinates than the previous screen captures. What I am trying to figure out is will $i after exiting the loop keep counting starting in the example below with 145 also could i put the remaining code in a loop and it exit the loop once $i is say 150 or something and not grab the remaining coordinates

:D

#include <ScreenCapture.au3>
 
;Set the scrip to exit when you press ESC
HotKeySet("{ESC}", "Terminate")
 
Func Terminate()
    Exit 0
EndFunc
 
sleep(5000)
 
$set = "ISD"
 
Dim $coords[8] = [76, 185, 298, 423, 541, 661, 779, 899];
 
Func capture_image($i, $x)
     For $n = 0 To 7
         MouseMove($x[$n],125,3)
         sleep(1000)
         _ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
         sleep(1000)
 
         MouseWheel ( "down" )
         sleep(1000)
 
         Next
     EndFunc
 
     For $i = 1 To 144
         capture_image($i, $coord)
     Next
          
    
MouseMove(63,274,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(183,274,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(303,274,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(424,274,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(541,274,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(660,274,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(778,274,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(897,274,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(63,444,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(183,444,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(303,444,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(424,444,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(541,444,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(660,444,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(778,444,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(897,444,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(63,610,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(183,610,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(303,610,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(424,610,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(541,610,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(660,610,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(778,610,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
 
MouseMove(897,610,3)
sleep(1000)
_ScreenCapture_Capture(@MyDocumentsDir & "\mtgo_images\" & $set & "\" & $set & "_" & $i &".jpg", 1030, 61, 1267, 397)
sleep(1000)
Edited by foolove

Share this post


Link to post
Share on other sites



What I am trying to figure out is will $i after exiting the loop keep counting starting in the example below with 145

also could i put the remaining code in a loop and it exit the loop once $i is say 150 or something and not grab the remaining coordinates

1. No. $i exists only inside that loop

2. Yes you could put it in a loop, exactly the same way you have your existing loop.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

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