Sign in to follow this  
Followers 0
RyGoTypE

Question about looping.

5 posts in this topic

I am strugglng to figure out how to do a little something, hopefully one of you will be kind enough to help me.

So basically what I am trying to do is, {TAB 7} then send {ENTER}

After that, it will do a few lines of code and then send {BROWSER_BACK 2}

Now we are back to where we started. Except for I want it to tab the initial 7 times PLUS 2 more tabs and then send {ENTER} and do the same few lines of code as the other time, and {BROWSER_BACK 2} so we are back to where we started again.

Then send tab the initial 7 times plus 2 plus 2 more for a total of 4 times... etc.

I want it to go through that process of adding 2 more tabs each time and doing those other few lines of code for a total of 50 times.

After it is finished, MsgBox().

Share this post


Link to post
Share on other sites



you already have almost everythin you need .... you might as well written the script

put what you said in a code send(" {TAB 7} ") is the only difference then each time send(" {TAB 7} ") then send two more

put it in a script and i will help you

you already know what to do

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Well I could do it a very long and hard way... just by adding 50 lines of code all with a 2 digit difference, but I don't want to do that. So I was asking if there was a possible way to loop this by using variables, liek Send("{TAB 7 + $r}") or something. ( I am not sure if that is a valid command or not ) I will share my ideas with you.

For $i = 1 to 50 and $r = $i + 2
    Send("{TAB 7}{ENTER}")
    ; Function hidden.
    Send("{BROWSER_BACK 2}")
    Sleep(250)
    Send("{TAB 7 + $r}{ENTER}")
    ; Function hidden.
    Send("{BROWSER_BACK 2}")
Next
    ; Continue on with script.
    ; Continue on with script.
    ; Continue on with script.
    ; Continue on with script.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ok maybe a little tougher to put into a loop

Dim $count = 5, $t = 0, $timer = 100

While $t <= 50
    
    Sleep($timer)
    $count = $count + 2
    
    For $x = 1 to $count
        Send("{TAB}")
        Sleep($timer)
    Next
    
    Sleep($timer)
    Send("{ENTER}")
    
    Sleep($timer)
; a
; few
; lines
; of 
; code
    
    Sleep($timer)
    Send("{BROWSER_BACK 2}")
    
    $t = $t + 1
WEnd

that should work ( not tested)

you will need to add your message box

8)

Edited by Valuater

NEWHeader1.png

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