Jump to content

Functions


Caleb09
 Share

Recommended Posts

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
Link to comment
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
Link to comment
Share on other sites

  • Developers

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()

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...