Looney 0 Posted October 22, 2010 Hello, I am very new to scripting, And i have a question about repeating a section of a script. I want to repeat this section of my script 11 times, But i dont know how.... Sleep (30000) MouseClick("left", 341, 614, 1) Sleep (30000) MouseClick("left", 341, 614, 1) Share this post Link to post Share on other sites
Realm 18 Posted October 22, 2010 (edited) Hello Looney, First, Welcome to the AutoIt Forums Read the Help File about Loops, you can make it work in just about any look, While, Do, For. This one is the simplest for your posted needs: For $i=1 to 11 Sleep (30000) MouseClick("left", 341, 614, 1) Sleep (30000) MouseClick("left", 341, 614, 1) Next Realm Edit: Fixed typos Edited October 22, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Share this post Link to post Share on other sites
Looney 0 Posted October 22, 2010 Thank you it is working ! Share this post Link to post Share on other sites
cembry90 2 Posted October 22, 2010 Hello Looney, First, Welcome to the AutoIt Forums Read the Help File about Loops, you can make it work in just about any look, While, Do, For. This one is the simplest for your posted needs: [size=2]For $i=1 to 11[/size] Sleep (30000) MouseClick("left", 341, 614, 1) Sleep (30000) MouseClick("left", 341, 614, 1) [size=2]Next[/size] Realm Nice tags! Thank you it is working ! Welcome to the realm of AutoIt. Please enjoy your stay. AutoIt Stuff: UDFs: {Grow} Share this post Link to post Share on other sites
Realm 18 Posted October 22, 2010 (edited) Nice tags! I have recently decided to give Google Chrome a try, and for some reason, it keeps messing with my posts, and I forgot to double check for that! Thank you it is working ! My Pleasure, I had the time Edit: Fixed Chrome garbage additions Edited October 22, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Share this post Link to post Share on other sites
Mison 1 Posted October 25, 2010 Hi OP, You can also use Function. Call it whenever you want to. FuncName() ; call it once For $i=1 to 11 ; call it 11 times FuncName() Next Func FuncName() Sleep (30000) MouseClick("left", 341, 614, 1) Sleep (30000) MouseClick("left", 341, 614, 1) EndFunc Hi ;) Share this post Link to post Share on other sites