List of current automation tasks - Relhax-Modpack-Team/DatabaseAutoUpdateScripts GitHub Wiki

Database tasks

Notes

  • By default, the automation runner will load and save the database using the location in AutomationRunnerSettings at the start and end of a run.

load_database

Loads the database from a string path

  • CustomDatabasePath: The location to the database.xml file. The other xml files are assumed to be in that same directory. The location can be relative or absolute.

save_database

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.

Database package property tasks

update_package_property

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

retrieve_package_property

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.

Database package transfer tasks

Notes

  • The FTP online folder used for the tasks is the one parsed from the database, in the database.xml file

package_download

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

package_upload

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

Downloading tasks

Notes

  • 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 the DownloadHtmlTask and see if what you want to parse is located in there.

download_static

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_html

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.

download_browser

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 with WaitTimeMs to create a total wait time after document is initially loaded. total time ms = WaitTimeMs * WaitCounts

File tasks

Notes

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

file_copy

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.

file_move

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.

file_delete

Delete a file. Simple as that.

  • SourceFilePath: The path to the file to delete.

file_exists

Ensures a given file exists.

  • SourceFilePath: The path to the file.

Directory tasks

create_directory

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.

directory_search

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, if MacroPrefix is "file_results", then the first file result returned would be in file_result_0.

directory_copy

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.

directory_move

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.

directory_delete

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.

Compare tasks

compare_start

Start a file comparison session. Any previous compare statistics will be over-written.

compare_end

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 the file_noMatch_stop exit code
  • If file_match > 1 && file_noMatch_continue == 0, then stop with the file_match exit code
  • Else, continue the sequence.

file_compare

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.

file_compare_inverse

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.

directory_compare

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.

directory_compare_inverse

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.

directory_compare_count

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

Notes

  • 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 the WebClient 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 the WebBrowser class. IE/Trident engine (older), JavaScript.
    • WebView: Use a derived version of the WebView class. EdgeHTML engine (old version), JavaScript. Known to cause application crashes, only used when the IE engine won't work.

browser_session_start

Start a new browser session. Any previous sessions will be closed.

  • Browser The browser implementation to use for the browser session.

compare_end

End a browser session.

browser_session_set_header

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.

browser_session_remove_header

Remove a request header from all future HTTP requests of that session.

  • Name: The name to the header to set.

browser_session_get_request

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

browser_session_post_request

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 the POST content.
  • PostData: The post data to send in the request.

browser_session_download_file

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 the last_download_filename macro.
  • Url: The url to the resource to download.

Macro tasks

macro_create

Creates a macro. If the macro already exists, it will be overwritten.

  • MacroName: The name of the macro to create.

macro_delete

Deletes a macro.

  • MacroName: The name of the macro to delete.

macro_string_split_macro

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.

macro_string_split_filename

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.

macro_string_split_html

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.

macro_string_split_browser

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.

macro_substring_macro

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 from StartIndex to capture into the output string. To use the entire desired string from the StartIndex (to make this argument optional), supply a -1
  • InputText: The input string to operate on.

macro_substring_filename

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.

macro_substring_html

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.

macro_substring_browser

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.

macro_string_input_macro_json

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 tasks

import_task

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_macro

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.

Other tasks

shell_exec

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.
⚠️ **GitHub.com Fallback** ⚠️