foolove Posted October 8, 2011 Posted October 8, 2011 (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 expandcollapse popup#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 October 8, 2011 by foolove
Developers Jos Posted October 8, 2011 Developers Posted October 8, 2011 Look at For...Next in the Helpfile. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
foolove Posted October 8, 2011 Author Posted October 8, 2011 jos thanks for steering me in the right direction my edits are about script saves files everytime with $i
Ramzes Posted October 8, 2011 Posted October 8, 2011 You can useFor $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]
foolove Posted October 8, 2011 Author Posted October 8, 2011 ramzes you are an autoit god thanks now i know how to accomplish those two things if it arises in the future i will know!!
somdcomputerguy Posted October 8, 2011 Posted October 8, 2011 Ramzes beat me to it with the same idea. I use code like this in one of my scripts. I have 10 images, hourglass1.ico -> hourglass10.ico. For $i = 1 to 10 TraySetIcon("hourglass" & $i & ".ico") Sleep(125) Next - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
foolove Posted October 8, 2011 Author Posted October 8, 2011 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
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