Jump to content

2 loops at the same time?


Guest BfarM00
 Share

Recommended Posts

Guest BfarM00

I've been trying to make a script that will do an action repeatedly, but after a certain amount of time it will stop and another action will take place, then after that, repeat the 1st action. This is just an example of what I've tried.

If $abcd = 1 Then

Do

Send("{G}")

$abc = 1;

Until $abc = 1;

Sleep(5000)

Do

Send("{W}")

$abcd = 1;

Until $abcd = 1;

So i want it to send the letter G for 5 seconds, then start to send W once, then after that start sending G for another 5 seconds, and so on and so on.

Or after it has sent G a certain number of times, it will send W, then send G some more.

Any advice would be greatly appreciated.

Edited by BfarM00
Link to comment
Share on other sites

;So i want it to send the letter G for 5 seconds, 
    While 1
        $nTimer = TimerStart()
        While TimerStop($nTimer) < 5000
            Send("g")
            sleep(10); so the CPU doesn't melt;o)
        Wend

;then start to send W once, 
        Send("w")

;then after that start sending G for another 5 seconds, and so on and so on.
    Wend

Edit: fixed indentation

Edited by trids
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...