Milanezi Posted October 10, 2012 Share Posted October 10, 2012 I recently made a count to switch between FF windows and click somwhere. But i notice my code sometimes skips one window (seems random). Is there a problem in my code that i overlook? $accounts: number of FF windows to switch between. $sites: number of clicks on each window expandcollapse popupLocal $var = WinList("[CLASS:MozillaWindowClass]") Local $accounts = InputBox("Accounts","Aantal") Local $windows[$accounts] local $sites = InputBox("Sites","Aantal") Local $j = 0 For $i = 1 To $var[0][0] If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then $windows[$j] = $var[$i][1] $j += 1 EndIf Next Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc Local $id Local $l = 0 while $l <> $sites Local $k = 0 while $k <> $accounts $id = $windows[$k] WinActivate($id) WinWaitActive($id81.198.119.31:8080) sleep(750) MouseClick("left",1550,78,1,0) $k += 1 WEnd $l +=1 Sleep(Random(40000,45000,1)) WEnd Link to comment Share on other sites More sharing options...
JohnOne Posted October 10, 2012 Share Posted October 10, 2012 Can you explain what you expect from this?WinWaitActive($id81.198.119.31:8080) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Milanezi Posted October 11, 2012 Author Share Posted October 11, 2012 An accidental ctrl + C extra, nothing important expandcollapse popupLocal $var = WinList("[CLASS:MozillaWindowClass]") Local $accounts = InputBox("Accounts","Aantal") Local $windows[$accounts] local $sites = InputBox("Sites","Aantal") Local $j = 0 For $i = 1 To $var[0][0] If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then $windows[$j] = $var[$i][1] $j += 1 EndIf Next Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc Local $id Local $l = 0 while $l <> $sites Local $k = 0 while $k <> $accounts $id = $windows[$k] WinActivate($id) WinWaitActive($id) sleep(750) MouseClick("left",1550,78,1,0) $k += 1 WEnd $l +=1 Sleep(Random(40000,45000,1)) WEnd 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