Sign in to follow this  
Followers 0
Rizzet

Do 2 loops in on the same time

2 posts in this topic

#1 ·  Posted (edited)

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



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  
Followers 0