Sign in to follow this  
Followers 0
botanic

wont loop?

7 posts in this topic

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

Share this post


Link to post
Share on other sites



That'll just loop forever, unless you set $cardnumber to a number higher than or equal to 3938. You don't increment $cardnumber or anything.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

humm it still wont loop even once...

Share this post


Link to post
Share on other sites

nm i got it the win wasnt becoming active...

Share this post


Link to post
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
Sign in to follow this  
Followers 0