Jump to content
Sign in to follow this  
Rizzet

Do 2 loops in on the same time

Recommended Posts

Rizzet

This is realy i noob thing:P my second day programming (already did a simple bot) and well i cant get 2 things to work on the same time. Couldnt find anything about how to do it and its probably becouse its so easy (i hope)

For example..i would like to do this

Func _Play()
While 1
    While Not $Paused
     $PixelColor = PixelGetColor(800,750)
     If $PixelColor = 9198082 then
     Else
        Send("{Q}")
        Sleep(1000)
        Send("{Q}")
        Sleep(1000)
        Send("{Q}")
    EndIF
     $current_colour = GUICtrlCreateLabel("", 6, 10, 87, 79)
    WEnd
WEnd
Endfunc

At the same time as this

Func _Go()
    While 1
     While Not $Paused
        Send("{, down}")
        Sleep(500)
        Send("{, up}")
        Send("{. down}")
        Sleep(500)
        Send("{. up}")
        If $Exit = 1 Then ExitLoop
     Wend
    Wend
Endfunc
Edited by Rizzet

Share this post


Link to post
Share on other sites
FuryCell

You need to either create two scripts that run at the same time or need to comibine the loop. ATM Autoit does not support multi threading.


HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.