List of current automation tasks - Relhax-Modpack-Team/DatabaseAutoUpdateScripts GitHub Wiki
- By default, the automation runner will load and save the database using the location in
AutomationRunnerSettings
at the start and end of a run.
Loads the database from a string path
-
CustomDatabasePath
: The location to thedatabase.xml
file. The other xml files are assumed to be in that same directory. The location can be relative or absolute.
Saves the database from a string path
-
CustomDatabasePath
: The location to save the database xml to. If the file(s) already exist, they will be over-written.
Update a property of a package, like a package's version. The old value is stored in the macro name old_package_property_value
-
PropertyName
: The name of the property to update. -
PropertyValue
: The value to update the property with. -
TargetPackageUID
: The target package to have the property updated on. By default, it is "this", meaning the package that is attached to this sequence. But you can update a property of any package (where that property exists).
Get a property value from a package, or an index of a property array of a package, and save it into a macro for later usage.
-
PropertyName
: The name of the property to update. -
TargetPackageUID
: The target package to have the property updated on. By default, it is "this", meaning the package that is attached to this sequence. But you can update a property of any package (where that property exists). -
MacroSaveName
: The name of the macro to contain the value. If the macro already exists, it will be overwritten. -
PropertyIndex
: If the property to update is an array, the index of the element to retrieve to put into the macro.
- The FTP online folder used for the tasks is the one parsed from the database, in the
database.xml
file
Download the zip file of the package to which the sequence is designed for
-
FilePath
: The location to save the file to. If the directory to the location does not exist, it will be created. If the file already exists, it will be over-written
Upload a new zip file of the package to which the sequence is designed for
-
FilePath
: The location to save the file to. If the directory to the location does not exist, it will be created. If the file already exists, it will be over-written -
ZipFileName
: The name of the zip file to use for the FTP location. If the file already exists, it will create a unique name for the file by adding to the end of the filename (filename_1.zip, filename_2.zip, etc.)
- The
DownloadBrowserTask
uses the embedded internet explorer browser built into your OS. Depending on your OS version, and the selected browser implementation, it could be Microsoft Edge or Internet Explorer. - The
DownloadBrowserTask
takes a while to run. If possible, try first with theDownloadHtmlTask
and see if what you want to parse is located in there.
Download a file from a static URL
-
Url
: The url to download from -
DestinationPath
: The destination of where to download the file to, including the file name. If the path to the file doesn't exist, then it will be created
Download the raw (non-script parsed) html page of the website, and get a download url from an HtmlPath search. Then downloads that file.
- See
download_static
for previous args. -
HtmlPath
: The xpath-like search command for the html document. Note these can be tested/created in the HtmlPath tool.
Use a web browser to navigate to a web page, allow all scripts to run to modify and parse html, then get a download url from an HtmlPath search. Then download that file.
- See
download_html
for previous args. -
WaitTimeMs
: This serves a dual purpose. First purose is to serve as a polling time to check if the document is loaded. The second purpose is to serve as a wait for after the document is loaded. This is because additional scripts may be loading after the page is initially loaded. -
WaitCounts
: Combined withWaitTimeMs
to create a total wait time after document is initially loaded. total time ms =WaitTimeMs
*WaitCounts
- If for some reason you're trying to move a file across physical volumes, the
file_move
command will not work!. At that point, you must use a combination of the file_copy and file_delete tasks. - When an argument has
path
in the name, it is implied that the folder path and file name are to be included into the argument, unless explicitly stated - The tasks are limited to the windows standard 256 character path.
Copy a file from a source to a destination. It will preserve file metadata (access, last modified, etc.)
-
SourceFilePath
: The path to the source file. -
DestinationFilePath
: The path to the destination file.
Move a file on a single volume. It will preserve the file metadata. Can also be used for renaming a file.
-
SourceFilePath
: The path to the source file. -
DestinationFilePath
: The path to the destination file.
Delete a file. Simple as that.
-
SourceFilePath
: The path to the file to delete.
Ensures a given file exists.
-
SourceFilePath
: The path to the file.
Take a guess at what this one does.
-
DirectoryPath
: The path to the directory to create. If parent directories don't exist to the full path, they will also be created.
Searches a directory and returned full file paths in the form of creating macros.
-
DirectoryPath
: The path to the directory to search. -
SearchPattern
: The search pattern to use. Supports some of the standard windows search syntax (wildcards). -
Recursive
: Flag to specify if to search in the top directory, or sub directories. -
MacroPrefix
: The prefix to use for when returning the file results. For example, ifMacroPrefix
is "file_results", then the first file result returned would be in file_result_0.
Copy a directory and all files that match the given pattern to their respective copied directories location.
-
DirectoryPath
: The source directory to copy from. -
SearchPattern
: The search pattern to use. Supports some of the standard windows search syntax (wildcards). -
Recursive
: Flag to specify if to search in the top directory, or sub directories. -
DestinationPath
: The destination directory to copy to.
Move a directory and all files that match the given pattern to their respective moved directories location. Only works when moving files across the same drive (files can't be moved from C:\
to D:\
, for example. That would require the copy task).
-
DirectoryPath
: The source directory to copy from. -
SearchPattern
: The search pattern to use. Supports some of the standard windows search syntax (wildcards). -
Recursive
: Flag to specify if to search in the top directory, or sub directories. -
DestinationPath
: The destination directory to copy to.
Delete a directory and and sub-directories that are empty.
-
DirectoryPath
: The directory to delete from. -
SearchPattern
: The search pattern to use. Supports some of the standard windows search syntax (wildcards). -
Recursive
: Flag to specify if to search in the top directory, or sub directories.
Start a file comparison session. Any previous compare statistics will be over-written.
End a file comparison session. The application will list out all comparisons, their file paths and hashes, for sides an and b. It there are 0 comparisons, it will issue an error.The comparison logic works like this:
- If
file_noMatch_stop
> 1, then stop with thefile_noMatch_stop
exit code - If
file_match
> 1 &&file_noMatch_continue
== 0, then stop with thefile_match
exit code - Else, continue the sequence.
Calculate the MD5 hash values of two files to compare them. If they are equal, the comparison is counted into the file_match
total. If they are different, the comparison is counted into the file_noMatch_continue
total.
-
FileA
: The path to the first file. -
FileB
: The path to the second file.
Calculate the MD5 hash values of two files to compare them. If they are equal, the comparison is counted into the file_match
total. If they are different, the comparison is counted into the file_noMatch_stop
total.
-
FileA
: The path to the first file. -
FileB
: The path to the second file.
Calculate the MD5 hash values of all files searched for in the directory. If the number of files or the names of the files between the folders is different, the process will fail. For each file, a match is counted for the file_match
total, and a difference is counted for the file_noMatch_continue
total.
-
SearchPattern
: The file pattern to use when searching for files. -
Recursive
: Toggle if the search should recursively occur in subfolders. -
DirectoryComparePathA
: The first (usually the source) directory to use for comparison. -
DirectoryComparePathB
: The second (usually the modpack) directory to use for comparison.
Calculate the MD5 hash values of all files searched for in the directory. If the number of files or the names of the files between the folders is different, the process will fail. For each file, a match is counted for the file_match
total, and a difference is counted for the file_noMatch_stop
total.
-
SearchPattern
: The file pattern to use when searching for files. -
Recursive
: Toggle if the search should recursively occur in subfolders. -
DirectoryComparePathA
: The first (usually the source) directory to use for comparison. -
DirectoryComparePathB
: The second (usually the modpack) directory to use for comparison.
Calculate the MD5 hash values of all files searched for in the directory. If the number of files or the names of the files between the folders is different, the process will assume an update is needed. For each file, a match is counted for the file_match
total, and a difference is counted for the file_noMatch_continue
total.
-
SearchPattern
: The file pattern to use when searching for files. -
Recursive
: Toggle if the search should recursively occur in subfolders. -
DirectoryComparePathA
: The first (usually the source) directory to use for comparison. -
DirectoryComparePathB
: The second (usually the modpack) directory to use for comparison.
- Browser session tasks allow cookies and other site data to be transferred between browser tasks to further emulate a human following links on a web page.
- Browser session tasks on average take longer to run then their "download" counterparts.
- Only one browser session can be running at a time.
- Make sure that your request headers are set before you start browser operations.
- Using a web debugging tool like Fiddler (classic) is highly recommended when things don't work.
- There are 4 browser implementations to choose from:
-
WebClient
: Use a derived version of theWebClient
class. Generic (older) client, no JavaScript. -
HttpClient
: Use a derived version of the `HttpClient class. Generic (newer) client, no JavaScript -
WebBrowser
: Use a wrapper interface of theWebBrowser
class. IE/Trident engine (older), JavaScript. -
WebView
: Use a derived version of theWebView
class. EdgeHTML engine (old version), JavaScript. Known to cause application crashes, only used when the IE engine won't work.
-
Start a new browser session. Any previous sessions will be closed.
-
Browser
The browser implementation to use for the browser session.
End a browser session.
Set a request header to use in all future HTTP requests of that session. If the header already exists, it will be overwritten.
-
Name
: The name to the header to set. -
Value
: The value of the header to set.
Remove a request header from all future HTTP requests of that session.
-
Name
: The name to the header to set.
Sends an HTTP GET
request to the given url and optionally uses an HtmlPath to search the response.
-
ParseResult
: Control if the request should parse the result string as an HTML document. -
HtmlPath
: The xpath-like search command for the HTML document. -
WriteHtmlResult
: Control if the task should write the response string to disk as an HTML text document. The name of the file written is<task_id>.html
Sends an HTTP POST
request to the given url and optionally uses an HtmlPath to search the response.
-
ParseResult
: Control if the request should parse the result string as an HTML document. -
HtmlPath
: The xpath-like search command for the HTML document. -
WriteHtmlResult
: Control if the task should write the response string to disk as an HTML text document. The name of the file written is<task_id>.html
-
ContentType
: The type of thePOST
content. -
PostData
: The post data to send in the request.
Downloads a web resource from the given url to a location on disk.
-
DestinationPath
: The path, including the file name, of where to download the resource to. This can use thelast_download_filename
macro. -
Url
: The url to the resource to download.
Creates a macro. If the macro already exists, it will be overwritten.
-
MacroName
: The name of the macro to create.
Deletes a macro.
-
MacroName
: The name of the macro to delete.
Creates a macro by running a string split operation on an input string. See this link
-
SplitCharacters
: The string to use to split the input string into an array of strings. -
Index
: The 0 based index into the array to get the desired split string. -
InputText
: The input string to operate on.
See macro_string_split_macro
. This one bases it on the name of a file. Does not include the directory path to the file.
See macro_string_split_macro
for previous arguments.
-
FilePath
: The complete path to the file to get the filename from.
See macro_string_split_macro
. This one used a webscrape to parse html from an htmlpath to get the string to operation on.
See macro_string_split_macro
for previous arguments.
-
HtmlPath
: The htmlPath search to use in the downloaded webpage. -
Url
: The webpage to download.
See macro_string_split_macro
. This one uses a browser to parse html from an htmlpath to get the string to operate on.
See macro_string_split_html
for previous arguments.
-
WaitTimeMs
: The amount of time, in milliseconds, to wait for each wait cycle. -
WaitCounts
: The number of wait cycles.
Creates a macro by running a substring operation on an input string. See this link
-
StartIndex
: The 0 based string start index into the desired string. -
Length
: Optional, How many character fromStartIndex
to capture into the output string. To use the entire desired string from theStartIndex
(to make this argument optional), supply a-1
-
InputText
: The input string to operate on.
See macro_substring_macro
. This one bases it on the name of a file. Does not include the directory path to the file.
See macro_string_split_macro
for previous arguments.
See macro_substring_macro
. This one used a webscrape to parse html from an htmlpath to get the string to operation on.
See macro_substring_macro
for previous arguments.
-
HtmlPath
: The htmlPath search to use in the downloaded webpage. -
Url
: The webpage to download.
See macro_substring_macro
. This one uses a browser to parse html from an htmlpath to get the string to operate on.
See macro_substring_html
for previous arguments.
-
WaitTimeMs
: The amount of time, in milliseconds, to wait for each wait cycle. -
WaitCounts
: The number of wait cycles.
Creates a macro by using a JsonPath search operation on a parsed json string.
-
Jsonpath
: The Jsonpath search parameter. -
InputMacroName
: The name of the macro to look up and use for the json string.
Import a set of tasks from an xml document stored in this repository, using the root as the start of the url. For example, if you wanted to add tasks from the file sample_task_template.xml
, in the folder Task_templates
in the repo root, then the argument would be Task_templates/sample_task_template.xml
.
-
RepoUrlPath
: The relative path in the repository for downloading and importing the set of tasks. See the description above.
Import a set of macros from an xml document stored in this repository, using the root as the start of the url. For example, if you wanted to add tasks from the file sample_macro_template.xml
, in the folder Macro_templates
in the repo root, then the argument would be Macro_templates/sample_macro_template.xml
.
-
RepoUrlPath
: The relative path in the repository for downloading and importing the set of macros. See the description above.
Execute a command like you are in the cmd prompt. When the task returns, it will require an exit code of 0 to proceed.
-
Wd
: The word directory you want to run the command from. -
Cmd
: The command to execute.