Getting started

Getting Started with FireflyAIO Custom Checkers

FireflyAIO's Lua API provides a robust and flexible interface for creating "Custom Checkers," enabling advanced customization and automation within the FireflyAIO environment. This API allows developers to script complex logic for checkers to validate, process, or analyze data according to specific criteria. With easy-to-use Lua scripting capabilities, users can define their custom rules, perform intricate operations, and seamlessly integrate these checkers into their workflows. The API is designed to be intuitive for beginners while offering powerful features for experienced programmers, making FireflyAIO an adaptable solution for a wide range of applications.

Setting Up a New Checker

To create a new checker, follow these steps:

  1. Create a New Lua File:

    • Navigate to the "Custom Checkers" folder in your FireflyAIO installation directory.

    • Create a new .lua file for your checker.

  2. Define the Checker Function:

    • The Checker function is the default entry point for your custom checkers and is automatically invoked by FireflyAIO.

    • Implement your validation or processing logic inside this function, using the provided username and password parameters.

Here is a template for your custom checker function:

function Checker(username, password)
    -- Your custom logic here
end

Example

function Checker(username, password)
    local response = Post("https://example.com/api/login", "username=" .. username .. "&password=" .. password, "application/x-www-form-urlencoded")

    if string.find(response, "access_token") then
        return "Hit"
    elseif string.find(response, "invalid credentials") then
        return "Fail"
    else
        return "Retry"
    end
end

Tips for Custom Checkers

  • Debugging: Use Debug function to print information to the console. Ensure Debug mode is enabled using IsDebugEnabled().

  • Error Handling: Implement proper error handling to manage invalid accounts ("Fail") and request failures ("Retry").

  • Capturing Additional Data: For valid accounts, you can capture additional information by returning "Hit:Capture".

By following these guidelines, you ensure that FireflyAIO correctly handles the results of your custom checkers, leading to efficient and accurate account validation.

Last updated