Jump to content

wont loop?


botanic
 Share

Recommended Posts

i am trying to get this to loop but when it gets to the end the script just stops...

every part of it works but that 1...

CODE
While $cardnumber < 3938

WinWaitActive("Microsoft Internet Explorer")

sleep(1000)

WinActivate("Microsoft Excel - .xls")

sleep(300)

WinWaitActive("Microsoft Excel - .xls")

Sleep(300)

send("^f")

sleep(300)

WinActivate("Find")

sleep(300)

WinWaitActive("Find")

sleep(300)

send($cardnumber + 1)

sleep(300)

send("{enter}")

sleep(300)

WinClose("Find")

sleep(300)

WinActivate("Microsoft Excel - .xls")

sleep(300)

WinWaitActive("Microsoft Excel - .xls")

sleep(300)

MouseClick( "left", 125, 416)

sleep(300)

send("^c")

sleep(300)

WinActivate("Microsoft Internet Explorer")

sleep(300)

MouseClick( "left", 82, 447)

sleep(300)

$name = ClipGet()

sleep(300)

send("^v")

sleep(500)

send("{enter}")

sleep(800)

;wait for page to load

do

if PixelGetColor( 472, 475) <> 8654089 then

sleep(500)

EndIf

Until PixelGetColor( 472, 475) = 8654089

sleep(300)

MouseClickDrag( "left", 809, 498, 755, 497)

sleep(300)

send("^c")

sleep(300)

WinActivate("Microsoft Excel - .xls")

sleep(300)

WinWaitActive("Microsoft Excel - .xls")

sleep(300)

MouseClick( "left", 307, 417)

sleep(300)

send("^v")

sleep(300)

send("^a")

sleep(300)

send("^f")

sleep(300)

WinActivate("Find")

sleep(300)

WinWaitActive("Find")

sleep(300)

send("thisisthebegining")

sleep(300)

send("{enter}")

sleep(300)

WinClose("Find")

sleep(300)

WinActivate("Microsoft Excel - .xls")

sleep(300)

WinWaitActive("Microsoft Excel - .xls")

sleep(300)

send("^s")

sleep(300)

WEnd

Link to comment
Share on other sites

i made

$cardnumber = 2037

the problem is that it wont loop.... and i need it to... it just stops at the wend

does this fix the problem you saw tho?

sleep(300)

send($cardnumber + 1)

sleep(300)

Global $cardnumber = $cardnumber + 1

sleep(300)

send("{enter}")

Edited by botanic
Link to comment
Share on other sites

I think you want this:

While $cardnumber < 3938
    WinWaitActive("Microsoft Internet Explorer")
    Sleep(1000)
    WinActivate("Microsoft Excel - .xls")
    Sleep(300)
    WinWaitActive("Microsoft Excel - .xls")
    Sleep(300)
    Send("^f")
    Sleep(300)
    WinActivate("Find")
    Sleep(300)
    WinWaitActive("Find")
    Sleep(300)
    Send($cardnumber)
    Sleep(300)
    Send("{enter}")
    Sleep(300)
    WinClose("Find")
    Sleep(300)
    WinActivate("Microsoft Excel - .xls")
    Sleep(300)
    WinWaitActive("Microsoft Excel - .xls")
    Sleep(300)
    MouseClick("left", 125, 416)
    Sleep(300)
    Send("^c")
    Sleep(300)
    WinActivate("Microsoft Internet Explorer")
    Sleep(300)
    MouseClick("left", 82, 447)
    Sleep(300)
    $name = ClipGet()
    Sleep(300)
    Send("^v")
    Sleep(500)
    Send("{enter}")
    Sleep(800)
    ;wait for page to load
    Do
        If PixelGetColor(472, 475) <> 8654089 Then
            Sleep(500)
        EndIf
    Until PixelGetColor(472, 475) = 8654089
    Sleep(300)
    MouseClickDrag("left", 809, 498, 755, 497)
    Sleep(300)
    Send("^c")
    Sleep(300)
    WinActivate("Microsoft Excel - .xls")
    Sleep(300)
    WinWaitActive("Microsoft Excel - .xls")
    Sleep(300)
    MouseClick("left", 307, 417)
    Sleep(300)
    Send("^v")
    Sleep(300)
    Send("^a")
    Sleep(300)
    Send("^f")
    Sleep(300)
    WinActivate("Find")
    Sleep(300)
    WinWaitActive("Find")
    Sleep(300)
    Send("thisisthebegining")
    Sleep(300)
    Send("{enter}")
    Sleep(300)
    WinClose("Find")
    Sleep(300)
    WinActivate("Microsoft Excel - .xls")
    Sleep(300)
    WinWaitActive("Microsoft Excel - .xls")
    Sleep(300)
    Send("^s")
    Sleep(300)
    $cardnumber +=1
WEnd
Edited by The Kandie Man

"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...