Jump to content

Recommended Posts

Posted (edited)

Instead of having 1,2,3,4,5,6,7,8 for the images how can i assign a variable and have it increment by count 1 each time the variable is called i want to have a while loop with this

Also additionally would like to have the loop exit on say like when count is up to 144 or after it has been call so many times issue ExitLoop

#include <ScreenCapture.au3>
 
;Set the scrip to exit when you press ESC
HotKeySet("{ESC}", "Terminate")
 
Func Terminate()
    Exit 0
EndFunc
 
 
sleep(5000)
 
For $i = 1 to 144 Step 1
MouseMove(76,125,3)
sleep(5000)
_ScreenCapture_Capture(@MyDocumentsDir & "\DDH_$i.jpg", 1030, 61, 1267, 397)
sleep(500)
 
MouseMove(185,125,3)
sleep(500)
_ScreenCapture_Capture(@MyDocumentsDir & "\DDH_$i.jpg", 1030, 61, 1267, 397)
sleep(500)
 
MouseMove(298,125,3)
sleep(500)
_ScreenCapture_Capture(@MyDocumentsDir & "\DDH_$i.jpg", 1030, 61, 1267, 397)
sleep(500)
 
MouseMove(423,125,3)
sleep(500)
_ScreenCapture_Capture(@MyDocumentsDir & "\DDH_$i.jpg", 1030, 61, 1267, 397)
sleep(500)
 
MouseMove(541,125,3)
sleep(500)
_ScreenCapture_Capture(@MyDocumentsDir & "\DDH_$i.jpg", 1030, 61, 1267, 397)
sleep(500)
 
MouseMove(661,125,3)
sleep(500)
_ScreenCapture_Capture(@MyDocumentsDir & "\DDH_$i.jpg", 1030, 61, 1267, 397)
sleep(500)
 
MouseMove(779,125,3)
sleep(500)
_ScreenCapture_Capture(@MyDocumentsDir & "\DDH_$i.jpg", 1030, 61, 1267, 397)
sleep(500)
 
MouseMove(899,125,3)
sleep(500)
_ScreenCapture_Capture(@MyDocumentsDir & "\DDH_$i.jpg", 1030, 61, 1267, 397)
sleep(500)
 
MouseWheel ( "down" )
sleep(500)
Next
Edited by foolove
Posted

You can use

For $i = 1 to 144
;code
Next

without 'Step 1'

To concatenating two strings you should use '&', i. e.:

@MyDocumentsDir & "\DDH_" & $i & ".jpg"

You can also create an array of mouse and screen positions to make your script simpler.

I recommend AutoIt Documentation.

Sorry for my bad English but nobody is perfect. [font=arial, helvetica, sans-serif]Ramzes[/font]

Posted

guys do thanks for the insight the script i have has only captured the screen for 3 images on a run through it i put the for loop at the begging and the next at the very end it does go through the mouse movements

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...