Jump to content

Recommended Posts

Posted

I created a script using while but it didnt work when it came to 2nd script.

$i = 0
$s = 0

Func Action()
    While $i <= 3
    Send("{f}")
    Sleep(1000)
    Send("{1}")
    Sleep(1000)
    Send("{7}")
    Sleep(100)
    Send("{x}")
    Sleep(100)
    $i = $i + 1
WEnd
    While $s = 1
    Send("{9}")
    Sleep(10000)
    $s = $s + 1
WEnd
EndFunc

I want my 1st script to repeat doing the same action for 3 times.

Then, the next script will running for 1 times.

Then, it will continue to repeat the 1st script back and so on.

Which part that i got it wrong?

Posted

I created a script using while but it didnt work when it came to 2nd script.

Which part that i got it wrong?

Second while is never used because of $s is not 1 is declared as 0 so it never reaches your second while.

Posted

Which part that i got it wrong?

$i = 0
$s = 0

Action() ; <-- fix

Func Action()
    While $i <= 3
    Send("{f}")
    Sleep(1000)
    Send("{1}")
    Sleep(1000)
    Send("{7}")
    Sleep(100)
    Send("{x}")
    Sleep(100)
    $i = $i + 1
WEnd
    While $s = 1
    Send("{9}")
    Sleep(10000)
    $s = $s + 1
WEnd
EndFunc

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

$i = 0
$s = 0

Func Action()
    While $i <= 3
    Send("{f}")
    Sleep(1000)
    Send("{1}")
    Sleep(1000)
    Send("{7}")
    Sleep(100)
    Send("{x}")
    Sleep(100)
    $i = $i + 1
WEnd
    While $s <=2
    Send("{9}")
    Sleep(10000)
    $s = $s + 1
WEnd
EndFunc

I've got it.

But right now, the script will End after the 2nd script been executed.

How to jump / repeat the 1st script back?

Or i have to keep copy and paste it?

Posted

While 1
    $i = 0
    Action()
WEnd

Func Action()
    While $i <= 3
        Send("f")
        Sleep(1000)
        Send("1")
        Sleep(1000)
        Send("7")
        Sleep(100)
        Send("x")
        Sleep(100)
        $i = $i + 1
    WEnd
    Send("9")
    Sleep(10000)
EndFunc

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Posted

snowmaker : you are the best bro.. thanks.. :(

MvGulik : thank u so much for the idea.. :)

problem solved, have a nice day. :)

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
×
×
  • Create New...