Sign in to follow this  
Followers 0
AutoVee

A script to run other scripts

9 posts in this topic

Hi,

I am new to AutoIt but I have successfully created the script that I need, a script that will start a game server and set up all the necessary options for me so that with one click I can have a server up and running quickly.

So far so good. But now I have a few of these scripts, each starts a different server, and I want to make a "master script", a script that would simply call, one by one, the scripts that start each server. So, this master script would call the script the starts server 1, would wait the script to finish its job, then it would call the script that starts server 2, so on.

How can I do this?

I did some research on the matter but unfortunately I could not find an answer. My scripts are NOT compiled, and I'd like to keep them that way, so what I am looking for is to write a non-compiled master script that would run the other non-compiled individual scripts.

Thanks for any enlightenment.

P.S. - BTW, thanks for AutoIt, a great automation tool.

Share this post


Link to post
Share on other sites



AutoVee,

Welcome to the AutoIt forum. :)

While I am happy for the specific question you have asked to be answered, you should read the Forum rules (there is also a link at bottom right of each page) before you post again as you will need to tread very carefully with any follow-ups. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

That's interesting. So I just read the rules and it says that I should not ask for help with AutoIt scripts, post links to, or start discussion topics on ... automation or script interaction with games or game servers, regardless of the game.

So I guess my post is in violation of the rules.

Then again, I could rephrase the question and just say that I have created a script 1 that starts application 1 and a script 2 that starts application 2 and so on and that now I am trying to find a way to have a script to run those individual scripts, one by one, because this is exactly what I am doing.

The fact that the application is a 14-year old game is irrelevant to my question. It is about running scripts with a script.

Thank you anyway.

Share this post


Link to post
Share on other sites

AutoVee,

 

my question. It is about running scripts with a script

Which is why I posted: ;)

While I am happy for the specific question you have asked to be answered

M23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
... I have created a script 1 that starts application 1 and a script 2 that starts application 2 and so on and that now I am trying to find a way to have a script to run those individual scripts, one by one ...

 

look at Run() / RunWait() and FileFindFirstFile() / FileFindNextFile() in the help file, which you might find useful if all your scrips are in the same directory

or maybe create a little GUI for your script and use it to list and run the scripts you choose to run - you can use koda for that if you wanted, which is in the AutoIt Script Editor package


FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

look at Run() / RunWait() and FileFindFirstFile() / FileFindNextFile() in the help file, which you might find useful if all your scrips are in the same directory

or maybe create a little GUI for your script and use it to list and run the scripts you choose to run - you can use koda for that if you wanted, which is in the AutoIt Script Editor package

 

I had looked at RunWait() but it says that the application should be an EXE, BAT, COM, or PIF file and I wanted to run the scripts directly, as I do if I click "Run Script" in the right-click menu. I do not know what a PIF file is.

Couldn't I just make a script with the lines below?

RunWait(script1.au3)

RunWait(script2.au3)

RunWait(script3.au3)

 
That would be basically what I want, simple. Well, I will test it anyway and see what happens.
 
I will take a look at this koda application too. Thanks.
 
P.S. - my guess is that if RunWait(scriptX.au3) works, it will just call the script editor because this is what happens when I double-click an .au3 file. So another question is how do I change the behaviour of the .au3 file so that when I double-click it it will run and not call the editor?
Edited by AutoVee

Share this post


Link to post
Share on other sites

AutoVee,

I was just about to post a link to that thread - but you found it first. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Problem solved. The command:

ShellExecuteWait('Script1.au3')

does the trick for me. I just had to teach Windows to use AutoIT as the default app to call when double-clicking an AU3 file since I guess when I installed SciTE it took over the task for 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