conman9 Posted March 1, 2008 Share Posted March 1, 2008 trying to get the mouseclick to repeat without coping 100 of these:MouseClick ( "left" ,$relistwindowx,$relistwindowy,1,1 ) Sleep(1000) MouseClick ( "left" ,$relistbuttonx,$relistbuttony,1,1 ) Sleep(1000) is there a command to repeat just this string?codeGlobal $PausedHotKeySet("{ESC}", "Terminate")Opt("MouseClickDragDelay", 100)Sleep("100")#include <Misc.au3> SplashTextOn("Auto Relist Setup", "Please Click on the first Item in the relist window (red)", 400, 100, -1, -1, 1, "Ariel", 15)While 1 Sleep ( 100 ) If _IsPressed("01") Then $getpos = MouseGetPos() ExitLoop EndIfWEndSplashOff()$relistwindowx = $getpos[0]$relistwindowy = $getpos[1]Sleep ( 1000 )SplashTextOn("Auto Relist Setup", "Please Click on the relist button tab (blue)", 400, 100, -1, -1, 1, "Ariel", 15)While 1 Sleep ( 100 ) If _IsPressed("01") Then $pos = MouseGetPos() ExitLoop EndIfWEndSplashOff()$relistbuttonx = $getpos[0]$relistbuttony = $getpos[1]Sleep ( 1000 )while 1MouseClick ( "left" ,$relistwindowx,$relistwindowy,1,1 ) Sleep(1000) MouseClick ( "left" ,$relistbuttonx,$relistbuttony,1,1 ) Sleep(1000) WEndFunc Terminate() Exit 0 EndFunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 1, 2008 Moderators Share Posted March 1, 2008 For $i = 1 To 100 MouseClick ( "left" ,$relistwindowx,$relistwindowy,1,1 ) Sleep(1000) MouseClick ( "left" ,$relistbuttonx,$relistbuttony,1,1 ) Sleep(1000) NextIt's called a loop (you have a some (loops ie... For/Next|While/WEnd|Do/Until) already in your script...). You may also want to look at adding code tags ([ code]code here[ /code] or [ AutoIt]code here[ /AutoIt] (without spaces)) to your code when posting. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
conman9 Posted March 1, 2008 Author Share Posted March 1, 2008 For $i = 1 To 100 MouseClick ( "left" ,$relistwindowx,$relistwindowy,1,1 ) Sleep(1000) MouseClick ( "left" ,$relistbuttonx,$relistbuttony,1,1 ) Sleep(1000) NextIt's called a loop (you have a some (loops ie... For/Next|While/WEnd|Do/Until) already in your script...). You may also want to look at adding code tags ([ code]code here[ /code] or [ AutoIt]code here[ /AutoIt] (without spaces)) to your code when posting. tks got it to work 8P just wondering what $i is,and does Next bring it back to For? Link to comment Share on other sites More sharing options...
stampy Posted March 1, 2008 Share Posted March 1, 2008 In the case of a FOR loop, the loop starts with the For statement and sets a variable (in this case $i, but can be another variable) then it will repeat from the next back up to the for. It will continue until the max setting is reached. A While loop will repeat while a condition is true. A Do loop will repeat until a condition is true. Loops are a wonderful thing to learn in programing and enable it to be more powerful. For details, try out the samples in the help file. Good luck. 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