Sign in to follow this  
Followers 0
jacksont123

How Do You

10 posts in this topic

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.


Share this post


Link to post
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")

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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!'

Share this post


Link to post
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.


Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

thanks most definately for your help guys/gals!

i ended up compiling the script to an exe, and I used a hotkey to end it.


Share this post


Link to post
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

Share this post


Link to post
Share on other sites

thanks. i'll look into it


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