Sign in to follow this  
Followers 0
Caleb09

Functions

4 posts in this topic

#1 ·  Posted (edited)

Hi, I was wanting to know if there's a way to run more then 1 function at the same time.

Ex. Code

Example()
Timer()


Func Example()
;I want the code in this function to run over and over while func timer is going.
EndFunc

Func Timer()
    $begin = TimerInit()
    sleep(3000)
    If $begin > 3000 Then
        Exit
    EndIf
EndFunc

Even if theres a way to combine the time and the function together, I still want to run another function along with those functions at the same time. Any help is appreciated. :)

Thanks,

Caleb

Edited by Caleb09

Share this post


Link to post
Share on other sites



When I use AdlibEnable, it just closes and does that make you able to run more then 1 function at same time?

Heres a Ex. code where I want it to say 1 and press enter over and over. What did I do wrong?

Run("notepad.exe")
Sleep(2000)
AdlibEnable("test1")

Func test1()
Send( "1{ENTER}")
EndFunc

Share this post


Link to post
Share on other sites

First of all: it will always process only one thing at a time.

Now if you want the Test1() to be polled during running of notepad you will have to make sure the script keeps on running ... it currently just ends after adlibenable()


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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