jacksont123 Posted May 19, 2006 Share Posted May 19, 2006 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 More sharing options...
Paulie Posted May 19, 2006 Share Posted May 19, 2006 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 More sharing options...
Valuater Posted May 19, 2006 Share Posted May 19, 2006 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) Link to comment Share on other sites More sharing options...
jacksont123 Posted May 19, 2006 Author Share Posted May 19, 2006 (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 May 19, 2006 by The Great 'Awesoma-Powa!' Link to comment Share on other sites More sharing options...
jacksont123 Posted May 19, 2006 Author Share Posted May 19, 2006 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 More sharing options...
Moderators SmOke_N Posted May 19, 2006 Moderators Share Posted May 19, 2006 (edited) i've decided to use that, because it worksbut I would also like to know how to stop the script.Use the same concept as what your doing for the _funcool() function. Edited May 19, 2006 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 More sharing options...
ChrisL Posted May 19, 2006 Share Posted May 19, 2006 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) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
jacksont123 Posted May 24, 2006 Author Share Posted May 24, 2006 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. Link to comment Share on other sites More sharing options...
neogia Posted May 24, 2006 Share Posted May 24, 2006 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 More sharing options...
jacksont123 Posted May 26, 2006 Author Share Posted May 26, 2006 thanks. i'll look into it Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now