BAMC Advanced Documentation

This document provides a detailed breakdown of the argument types for each action and feature in the BAMC Language.

Actions

add-header
add-header "DNT" "1"
Adds an HTTP Header for the current request.
Arguments:
  • Argument 1 (Header Name): string
    (e.g., "DNT")
  • Argument 2 (Header Value): string
    (e.g., "1")
add-headers
add-headers {"header-name1": "header-value1", ...}
Adds multiple HTTP Headers for the current request via a JSON Object.
Arguments:
  • Argument 1 (Headers): JSON Object
    (Key-value pairs where keys are header names (string) and values are header values (string))
browser
browser "chrome"
Specifies the browser type. This MUST be the first valid line of the file. If not supplied, defaults to a Firefox instance or user agent.
Arguments:
  • Argument 1 (Browser Type): string
    ("chrome" or "firefox")
click
click "selector"
Clicks the specified button element. Supports ID, NAME, TAG NAME, and XPATH selectors.
Arguments:
  • Argument 1 (Selector): string
    (A valid ID, NAME, TAG NAME, or XPATH selector for the element to click)
click-at-position
click-at-position "600" "600"
Clicks at a specific point on screen.
Arguments:
  • Argument 1 (X Coordinate): string
    (The X coordinate position on screen, e.g., "600")
  • Argument 2 (Y Coordinate): string
    (The Y coordinate position on screen, e.g., "600")
click-exp
click-exp 'css-selector.item_element'
Alternative to click; use this if click is causing issues. Supports CSS SELECTOR.
Arguments:
  • Argument 1 (CSS Selector): string
    (A valid CSS selector for the element to click)
close-current-tab
close-current-tab
Closes the current tab and will close the browser if there's only one open tab.
Arguments:
No arguments.
end-javascript
end-javascript
Instructs the parser that the end of a JavaScript code block was reached. An error will be thrown if end-javascript is not found within the file (when a start-javascript is present).
Arguments:
No arguments.
fill-text
fill-text "selector" "Value you want to include"
Assigns the specified value to the selected element.
Arguments:
  • Argument 1 (Selector): string
    (A valid selector for the input element)
  • Argument 2 (Value): string
    (The text value to assign to the element)
fill-text-exp
fill-text-exp "selector" "Value you want to include"
More advanced version of fill-text.
Arguments:
  • Argument 1 (Selector): string
    (A valid selector for the input element)
  • Argument 2 (Value): string
    (The text value to assign to the element)
get-text
get-text "selector"
Gets the text for a specified element. Supports ID, NAME, TAG NAME, and XPATH selectors.
Arguments:
  • Argument 1 (Selector): string
    (A valid ID, NAME, TAG NAME, or XPATH selector for the element)
open-new-tab
open-new-tab "https://google.com" "3"
A new browser tab is opened, the system will then pause for the number of seconds specified, then visits the requested url.
Arguments:
  • Argument 1 (URL): string
    (The URL to visit in the new tab, e.g., "https://google.com")
  • Argument 2 (Wait Time): string
    (The number of seconds to wait before visiting the URL, e.g., "3")
save-as-html
save-as-html "filename.html"
Saves the current page's HTML to a file with the specified name.
Arguments:
  • Argument 1 (File Name): string
    (The path and name of the HTML file to save, e.g., "output.html")
save-as-html-exp
save-as-html-exp "filename.html"
Saves the current page's HTML to a file with the specified name but uses different logic; use this if save-as-html doesn't fit your needs.
Arguments:
  • Argument 1 (File Name): string
    (The path and name of the HTML file to save)
select-option
select-option "selector" 2
Selects an <option> from a <select> dropdown menu. Currently only supports <select><option></option></select>.
Arguments:
  • Argument 1 (Selector): string
    (A valid selector for the <select> element)
  • Argument 2 (Option Number): integer
    (The 0-based or 1-based index of the option to select, depending on implementation details; 2 typically means the 3rd item if 0-based, or 2nd if 1-based. Clarification needed for specific implementation.)
select-element
select-element "selector"
Selects the element associated with the provided selector (if found). This currently works but, there's no logic to access the selected element; this should only be done if you're manually editing the compiled Python script.
Arguments:
  • Argument 1 (Selector): string
    (A valid selector for the element)
set-custom-useragent
set-custom-useragent "Mozilla/5.0 (...)"
Sets a custom user agent at the current point in the script, unlike bamm --set-custom-useragent, which sets this value at startup.
Arguments:
  • Argument 1 (User Agent String): string
    (The full user agent string to set)
start-javascript
start-javascript
Instructs the parser to read all following lines as a .js code block, until end-javascript is found; Will throw an error if end-javascript is not found within the file.
Arguments:
No arguments.
take-screenshot
take-screenshot "filename.png"
Takes a screenshot of the browser after executing the previous line. It's recommended to add a "wait-for-seconds" command before executing this.
Arguments:
  • Argument 1 (File Name): string
    (The path and name of the PNG file to save, e.g., "screenshot.png")
visit
visit "https://url-to-visit.com/page.html"
Visits a specified URL.
Arguments:
  • Argument 1 (URL): string
    (A valid URL string, including protocol like "https://")
wait-for-seconds
wait-for-seconds 1
Waits for the specified number of seconds before continuing. Supports decimals.
Arguments:
  • Argument 1 (Seconds): number
    (The duration to wait, can be an integer or a floating-point number, e.g., 1 or 0.2)
Command Syntax Example Description Argument Types
add-header add-header "DNT" "1" Adds an HTTP Header for the current request.
  • Argument 1 (Header Name): string
    (e.g., "DNT")
  • Argument 2 (Header Value): string
    (e.g., "1")
add-headers add-headers {"header-name1": "header-value1", ...} Adds multiple HTTP Headers for the current request via a JSON Object.
  • Argument 1 (Headers): JSON Object
    (Key-value pairs where keys are header names (string) and values are header values (string))
browser browser "chrome" Specifies the browser type. This MUST be the first valid line of the file. If not supplied, defaults to a Firefox instance or user agent.
  • Argument 1 (Browser Type): string
    ("chrome" or "firefox")
click click "selector" Clicks the specified button element. Supports ID, NAME, TAG NAME, and XPATH selectors.
  • Argument 1 (Selector): string
    (A valid ID, NAME, TAG NAME, or XPATH selector for the element to click)
click-at-position click-at-position "600" "600" Clicks at a specific point on screen.
  • Argument 1 (X Coordinate): string
    (The X coordinate position on screen, e.g., "600")
  • Argument 2 (Y Coordinate): string
    (The Y coordinate position on screen, e.g., "600")
click-exp click-exp 'css-selector.item_element' Alternative to click; use this if click is causing issues. Supports CSS SELECTOR.
  • Argument 1 (CSS Selector): string
    (A valid CSS selector for the element to click)
close-current-tab close-current-tab Closes the current tab and will close the browser if there's only one open tab. No arguments.
end-javascript end-javascript Instructs the parser that the end of a JavaScript code block was reached. An error will be thrown if end-javascript is not found within the file (when a start-javascript is present). No arguments.
fill-text fill-text "selector" "Value you want to include" Assigns the specified value to the selected element.
  • Argument 1 (Selector): string
    (A valid selector for the input element)
  • Argument 2 (Value): string
    (The text value to assign to the element)
fill-text-exp fill-text-exp "selector" "Value you want to include" More advanced version of fill-text.
  • Argument 1 (Selector): string
    (A valid selector for the input element)
  • Argument 2 (Value): string
    (The text value to assign to the element)
get-text get-text "selector" Gets the text for a specified element. Supports ID, NAME, TAG NAME, and XPATH selectors.
  • Argument 1 (Selector): string
    (A valid ID, NAME, TAG NAME, or XPATH selector for the element)
open-new-tab open-new-tab "https://google.com" "3" A new browser tab is opened, the system will then pause for the number of seconds specified, then visits the requested url.
  • Argument 1 (URL): string
    (The URL to visit in the new tab, e.g., "https://google.com")
  • Argument 2 (Wait Time): string
    (The number of seconds to wait before visiting the URL, e.g., "3")
save-as-html save-as-html "filename.html" Saves the current page's HTML to a file with the specified name.
  • Argument 1 (File Name): string
    (The path and name of the HTML file to save, e.g., "output.html")
save-as-html-exp save-as-html-exp "filename.html" Saves the current page's HTML to a file with the specified name but uses different logic; use this if save-as-html doesn't fit your needs.
  • Argument 1 (File Name): string
    (The path and name of the HTML file to save)
select-option select-option "selector" 2 Selects an <option> from a <select> dropdown menu. Currently only supports <select><option></option></select>.
  • Argument 1 (Selector): string
    (A valid selector for the <select> element)
  • Argument 2 (Option Number): integer
    (The 0-based or 1-based index of the option to select, depending on implementation details; 2 typically means the 3rd item if 0-based, or 2nd if 1-based. Clarification needed for specific implementation.)
select-element select-element "selector" Selects the element associated with the provided selector (if found). This currently works but, there's no logic to access the selected element; this should only be done if you're manually editing the compiled Python script.
  • Argument 1 (Selector): string
    (A valid selector for the element)
set-custom-useragent set-custom-useragent "Mozilla/5.0 (...)" Sets a custom user agent at the current point in the script, unlike bamm --set-custom-useragent, which sets this value at startup.
  • Argument 1 (User Agent String): string
    (The full user agent string to set)
start-javascript start-javascript Instructs the parser to read all following lines as a .js code block, until end-javascript is found; Will throw an error if end-javascript is not found within the file. No arguments.
take-screenshot take-screenshot "filename.png" Takes a screenshot of the browser after executing the previous line. It's recommended to add a "wait-for-seconds" command before executing this.
  • Argument 1 (File Name): string
    (The path and name of the PNG file to save, e.g., "screenshot.png")
visit visit "https://url-to-visit.com/page.html" Visits a specified URL.
  • Argument 1 (URL): string
    (A valid URL string, including protocol like "https://")
wait-for-seconds wait-for-seconds 1 Waits for the specified number of seconds before continuing. Supports decimals.
  • Argument 1 (Seconds): number
    (The duration to wait, can be an integer or a floating-point number, e.g., 1 or 0.2)

CLI Arguments

add
bamm add 'path/to/filename.bamc'
Adds a .bamc file to the userScripts directory.
Arguments:
  • Argument 1 (Filename) string
    (e.g., "path/to/filename.bamc")
compile
bamm compile 'path/to/filename.bamc'
Compiles a .bamc file that isn't located in the userScripts directory
Arguments:
  • Argument 1 (Filename) string
    (e.g., "path/to/filename.bamc")
delete
bamm delete 'filename.bamc'
Deletes a .bamc file to the userScripts directory.
Arguments:
  • Argument 1 (Filename) string
    (e.g., "path/to/filename.bamc")
help
bamm help "feature-name"
Displays information about the specified command.
Arguments:
  • Argument 1 (Feature name): string
    (The specified feature you want to learn more about.)
--set-custom-useragent
bamm --set-custom-useragent=="Mozilla/5.0 (...)"
Sets the user agent that the browser uses on start up.
Arguments:
  • Argument 1 (User Agent String): string
    (The full user agent string to set)
--set-timeout
bamm --set-timeout==5
Overrides the timeout for all actions, by default this is 10.
Arguments:
  • Argument 1 (Timeout): integer
    (A valid integer greater than 0)
Command Syntax Example Description Argument Types
add bamm add 'path/to/filename.bamc' Adds a .bamc file to the userScripts directory.
  • Argument 1 (Filename) string
    (e.g., "path/to/filename.bamc")
compile bamm compile 'path/to/filename.bamc' Compiles a .bamc file that isn't located in the userScripts directory
  • Argument 1 (Filename) string
    (e.g., "path/to/filename.bamc")
delete bamm delete 'filename.bamc' Deletes a .bamc file to the userScripts directory.
  • Argument 1 (Filename) string
    (e.g., "filename.bamc")
help bamm help "feature-name" Displays information about the specified command.
  • Argument 1 (Feature name): string
    (The specified feature you want to learn more about.)
--set-custom-useragent bamm --set-custom-useragent=="Mozilla/5.0 (...)" Sets the user agent that the browser uses on start up.
  • Argument 1 (User Agent String): string
    (The full user agent string to set)
--set-timeout bamm --set-timeout==5 Alternative to click; use this if click is causing issues. Supports CSS SELECTOR.
  • Argument 1 (Timeout): integer
    (A valid integer greater than 0)

Features

disable-pycache
feature "disable-pycache"
Instructs the compiler to disable the writing of the __pycache__ directory. This directory is written by Visual Studio Code and contains .pyc files.
Arguments:
No arguments for the feature declaration itself.
disable-ssl
feature "disable-ssl"
Disables SSL certificate authentication for the given session.
Arguments:
No arguments for the feature declaration itself.
use-http-proxy
feature "use-http-proxy" "USER:PASS@IP:PORT"
Uses the entered HTTP proxy for the session. Use "NULL:NULL@IP:PORT" if no user:pass authentication is required.
Arguments:
  • Argument 1 (Proxy String): string
    (Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
use-https-proxy
feature "use-https-proxy" "USER:PASS@IP:PORT"
Uses the entered HTTPS proxy for the session. Use "NULL:NULL@IP:PORT" if no user:pass authentication is required.
Arguments:
  • Argument 1 (Proxy String): string
    (Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
use-socks4-proxy
feature "use-socks4-proxy" "USER:PASS@IP:PORT"
Uses the entered SOCKS4 proxy for the session. Use feature "use-socks4-proxy" "NULL:NULL@IP:PORT" if no user:pass authentication is required.
Arguments:
  • Argument 1 (Proxy String): string
    (Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
use-socks5-proxy
feature "use-socks5-proxy" "USER:PASS@IP:PORT"
Uses the entered SOCKS5 proxy for the session. Use feature "use-socks5-proxy" "NULL:NULL@IP:PORT" if no user:pass authentication is required.
Arguments:
  • Argument 1 (Proxy String): string
    (Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
Command Syntax Example Description Argument Types
disable-pycache feature "disable-pycache" Instructs the compiler to disable the writing of the __pycache__ directory. This directory is written by Visual Studio Code and contains .pyc files. No arguments for the feature declaration itself.
disable-ssl feature "disable-ssl" Disables SSL certificate authentication for the given session. No arguments for the feature declaration itself.
use-http-proxy feature "use-http-proxy" "USER:PASS@IP:PORT" Uses the entered HTTP proxy for the session. Use "NULL:NULL@IP:PORT" if no user:pass authentication is required.
  • Argument 1 (Proxy String): string
    (Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
use-https-proxy feature "use-https-proxy" "USER:PASS@IP:PORT" Uses the entered HTTPS proxy for the session. Use "NULL:NULL@IP:PORT" if no user:pass authentication is required.
  • Argument 1 (Proxy String): string
    (Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
use-socks4-proxy feature "use-socks4-proxy" "USER:PASS@IP:PORT" Uses the entered SOCKS4 proxy for the session. Use feature "use-socks4-proxy" "NULL:NULL@IP:PORT" if no user:pass authentication is required.
  • Argument 1 (Proxy String): string
    (Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)
use-socks5-proxy feature "use-socks5-proxy" "USER:PASS@IP:PORT" Uses the entered SOCKS5 proxy for the session. Use feature "use-socks5-proxy" "NULL:NULL@IP:PORT" if no user:pass authentication is required.
  • Argument 1 (Proxy String): string
    (Format: "USER:PASS@IP:PORT". Use "NULL:NULL@IP:PORT" for no authentication.)

Selectors

For a tutorial on how to find selectors, please click here
ID Selector
Selects an element by its unique id attribute.
Example: "myElementId" (for <div id="myElementId">)
NAME Selector
Selects an element by its name attribute, commonly used for form elements.
Example: "username" (for <input name="username">)
TAG NAME Selector
Selects all elements with a specific HTML tag name.
Example: "button" (for all <button> elements)
XPATH Selector
Selects elements using an XML Path Language (XPath) expression, allowing for complex selections.
Example: "//div[@class='container']/p[2]"
CSS Selector
Selects elements using Cascading Style Sheets (CSS) selectors, offering a flexible way to target elements based on their attributes, classes, IDs, and relationships.
Example: "div.product-item > h3.title"
Selector Type Description Example
ID Selector Selects an element by its unique id attribute. "myElementId" (for <div id="myElementId">)
NAME Selector Selects an element by its name attribute, commonly used for form elements. "username" (for <input name="username">)
TAG NAME Selector Selects all elements with a specific HTML tag name. "button" (for all <button> elements)
XPATH Selector Selects elements using an XML Path Language (XPath) expression, allowing for complex selections. "//div[@class='container']/p[2]"
CSS Selector Selects elements using Cascading Style Sheets (CSS) selectors, offering a flexible way to target elements based on their attributes, classes, IDs, and relationships. "div.product-item > h3.title"

Using SelectorGadget

SelectorGadget is a browser extension that makes it easy to find the correct CSS selector for any element on a web page.

Installation

Step 1: Install the Extension

Chrome Only: Chrome Web Store - SelectorGadget

Step 2: Pin to Toolbar (Optional)

Once installed, you can pin the SelectorGadget extension to your browser's toolbar for easier access. Look for the extension icon and click the pin button.

How to Use SelectorGadget

Step 1: Activate SelectorGadget

Navigate to the web page you want to inspect and click on the SelectorGadget icon in your browser's toolbar. A yellow bar will appear at the bottom of the page indicating that SelectorGadget is active.

Step 2: Select Your Target Element

Click on the element you want to select. The element will be highlighted in green, and SelectorGadget will suggest a CSS selector for it in the bottom bar.

Step 3: Refine Your Selection

If other unwanted elements are also highlighted in green, click on them to exclude them. They will turn red, indicating they're excluded from the selection.

Continue clicking elements to include (green) or exclude (red) until only your desired elements are selected.

Step 4: Copy the Selector

Once you're satisfied with the selection, copy the CSS selector from the yellow bar at the bottom of the page. This is the selector you'll use in your BAMC commands.

Important Note: SelectorGadget generates CSS selectors, but BAMC also supports ID, NAME, TAG NAME, and XPATH selectors. For simple cases, you might be able to use just an ID or name attribute instead of a complex CSS selector.

Alternative Methods for Finding Selectors

Using Browser Developer Tools

Step 1: Right-click on the element you want to select

Step 2: Choose "Inspect" or "Inspect Element" from the context menu

Step 3: In the developer tools, right-click on the highlighted HTML element

Step 4: Choose "Copy" → "Copy selector" or "Copy XPath"

Pro Tip: For form elements, check if they have a name or id attribute first. These are often the most reliable selectors to use and are simpler than complex CSS selectors.

Selector Best Practices

  • Prefer ID selectors when available - they're unique and fast
  • Use name attributes for form elements like inputs and buttons
  • Avoid overly complex selectors that might break if the page structure changes
  • Test your selectors in the browser console using document.querySelector("your-selector")
  • Consider using XPath for complex selections that CSS can't handle easily

Common Selector Examples

ID Selector: "submit-button" (targets <button id="submit-button">)

Name Selector: "email" (targets <input name="email">)

Class Selector: ".btn-primary" (targets elements with class="btn-primary")

Tag Selector: "button" (targets all button elements)

XPath: "//button[contains(text(), 'Submit')]" (targets button containing "Submit" text)

Example BAMC Script

browser "chrome"
feature "disable-ssl"
visit "https://example.com"
wait-for-seconds 2
fill-text "username" "myemail@example.com"
fill-text "password" "mypassword"
click "login-button"
wait-for-seconds 3
take-screenshot "logged-in.png"
save-as-html "page-content.html"
Getting Started: Try creating a simple BAMC script using the commands above. Start with basic actions like visit, wait-for-seconds, and take-screenshot to get familiar with the syntax.

Configuration Tutorial

📁 File Locations

Windows: %appdata%/BrowserAutomationMaster/config/config.ini
MacOS: /Users/your-username/Library/Application Support/BrowserAutomationMaster/config/config.ini
Linux: $HOME/.config/BrowserAutomationMaster/config/config.ini

⚙️ Configuration Properties

[compilation]

auto_copy_path boolean

Automatically copy the project directory after a successful compilation.

true | false
run_on_compile boolean

Automatically run the project after a successful compilation.

true | false

[interface]

theme_type string

Theme used for the application on Windows and MacOS. Linux automatically sets theme based on terminal background color.

dark | light

[messaging]

show_cpu_check boolean

Runs a check on the CPU to determine its number of cores and feature set. Disabling this is only recommended once you've determined your CPU is supported.

true | false
show_memory_check boolean

Runs a check on the RAM to determine total and free system memory. Disabling this is only recommended once you've determined you have adequate RAM.

true | false
show_update_check boolean

Checks if your BAMM version is latest and prompts to update if not. Disabling this is not recommended unless causing major instability.

true | false

[overrides] Advanced Users Only

⚠️ Special Section: The override section is not included by default. This section is ONLY meant for users experienced with HEX, RGB, or XTERM color formats.

Format:
@Override PropertyName = PropertyValue
Accepted PropertyNames:
  • ForegroundColor
  • SuccessColor
  • WarningColor
  • ErrorColor
  • HighlightBackground
  • HighlightForeground
  • AccentColor
PropertyValue Examples:
RGB Format:
RGB(255, 255, 255) White
RGB(0, 0, 0) Black
RGB(175, 220, 237) Coral Blue
HEX Format:
#FFFFFF White
#000000 Black
#AFDCED Coral Blue
XTERM Format:
FFFF/FFFF/FFFF White
0000/0000/0000 Black
5F5F/FFFF/D7D7 Gold