Jump to content

How Do You


Recommended Posts

I would like to include a script file within a function

so that when the function starts it also starts another au3 file...

Get it? :(

I tried [example]:

HotKeySet ( "^!c",  "funcool")

Func funcool()
#include <talk.au3>;au3 file i'd like to include
send( "hello" )

but it gave errors :)

so how would i "call" an au3 file once a function starts? is that even possible?

thanks in advance.

Link to comment
Share on other sites

I would like to include a script file within a function

so that when the function starts it also starts another au3 file...

Get it? :(

I tried [example]:

HotKeySet ( "^!c",  "funcool")

Func funcool()
#include <talk.au3>;au3 file i'd like to include
send( "hello" )

but it gave errors :)

so how would i "call" an au3 file once a function starts? is that even possible?

thanks in advance.

The way I would do it is compile the talk script and say

Run("Talk.exe")

OR (i don't think this will work, try running the .au3 istelf

Run("talk.au3")
Link to comment
Share on other sites

there are two different things here

talk.au3 is an include

and the function would be like

#include <talk.au3>

HotKeySet ( "^!c",  "funcool")

Func funcool()
_talk("hello")
endfunc

************* example, not tested

the second is to run an au3 in a function

HotKeySet ( "^!c",  "funcool")

Func funcool()
run(@AutoItExe & " test.au3")
endfunc

***** just examples

8)

NEWHeader1.png

Link to comment
Share on other sites

The way I would do it is compile the talk script and say

Run("Talk.exe")

OR (i don't think this will work, try running the .au3 istelf

Run("talk.au3")
i tried compiling it to an exe, but whenever it runs, it runs two processes

thanks anyway

i'm still going to use Valuater's method of running an au3, it works

Edited by The Great 'Awesoma-Powa!'
Link to comment
Share on other sites

the second is to run an au3 in a function

HotKeySet ( "^!c",  "funcool")

Func funcool()
run(@AutoItExe & " test.au3")
endfunc

***** just examples

8)

i've decided to use that, because it works

but I would also like to know how to stop the script.

Link to comment
Share on other sites

  • Moderators

i've decided to use that, because it works

but I would also like to know how to stop the script.

Use the same concept as what your doing for the _funcool() function. Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

i've decided to use that, because it works

but I would also like to know how to stop the script.

$script = run(@AutoItExe & " test.au3")

And then when you want to close the second app

ProcessClose ($script)
Link to comment
Share on other sites

This may be a little late, but you may also want to look into my CoRoutine.au3 library. It contains very useful functions for starting scripts from within other scripts and then takes it further to control those scripts and share variables between the two (or three or three hundred) running scripts, all able to run simultaneously alongside eachother, also offering a pseudo-form of multithreading capability.

[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

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