Jack023 Posted November 10, 2013 Posted November 10, 2013 Hey all, I'm trying almost the whole day to fix the loop. It opens a site using _iecreate and do some stuff then their will be a If statement: If the first if statement is true then restart loop if the Else statement is true then restart loop too. How can i fix this? Thanks in advance !
Jack023 Posted November 10, 2013 Author Posted November 10, 2013 expandcollapse popup#include <IE.au3> #include <Array.au3> ;array read $x = 1 $y = 2 $sString = FileRead(@DesktopDir & "\5faccs.txt") $aData = StringSplit($sString, @CRLF & ":") ; Remove @CR's For $i = 1 To UBound($aData) - 1 $aData[$i] = StringStripCR($aData[$i]) Next Local $abc = $aData[$x] Local $bcd = $aData[$y] ; here is the code that needs to be looped ; here is the code that needs to be looped ; here is the code that needs to be looped ; here is the code that needs to be looped ; here is the code that needs to be looped ; here is the code that needs to be looped ; here is the code that needs to be looped if WinWaitActive("secret") then ProcessClose("iexplore.exe") $testing = FileOpen(@DesktopDir & "\userpas.txt", 1) $x = $x + 2 $y = $y +2 ; so now i want this: if this if statement is true, restart the script , else go ahead to the else statement. Else $x = 0 Do Sleep(25) Send("{TAB}") $x = $x + 1 until $x = 25 Send("{ENTER}") ;send username and pass into txt file $paslist = FileOpen(@DesktopDir & "\test.txt", 1) FileWrite($testing, $aData[$x] & ":" & $aData[$y] & @CRLF) $x = $x + 2 $y = $y +2 ; here the same story ; if this statement is true, restart the script until there are no more arrays to read. EndIf like this
Kidney Posted November 10, 2013 Posted November 10, 2013 its hard to grasp what you r trying to loop. here is what im understanding: if $this = True Then Restart loop Else Restart loop EndIf either way the loops gets restarted.
Rogue5099 Posted November 10, 2013 Posted November 10, 2013 Put your code that you want to be restarted in a Function and call it when you want to restart it. Then put the If...Then checks inside of a While...Wend or a Do...Until loop. My projects: Inventory / Mp3 Inventory, Computer Stats
Jack023 Posted November 10, 2013 Author Posted November 10, 2013 I fixed it using this: made a function Do Call("function") until $i = $countlines works like a charm ! Thanks
jdelaney Posted November 10, 2013 Posted November 10, 2013 Rather, you can do loops where you step twice, but I would suggest a re-write to make a 2d array. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
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