#api #api-bindings #database #script #optional #rand #trails

titdb

A simple library to make use of the Trails in the Database API

1 unstable release

0.1.0 May 3, 2024

#45 in #rand

MIT license

12KB
255 lines

TITDB - Trails in the Database

titdb is a library that calls Trails in the Database's API. It also includes a script randomizer as an optional feature.

Randomizer

[dependencies]
titdb = { version = "0.1", features = ["rand"] }

Examples

use titdb::rand::SceneRandomizer;

#[tokio::main]
async fn main() -> Result<()> {
    // Get 500 characters of Trails from Zero
    let characters = get_chr_detail(Some(4), None, None, None, Some(500))
        .await
        .unwrap();
    // Randomize any script from any game with characters from the previous list
    let random_scene: SceneRandomizer = SceneRandomizer::new(Some(characters), None, None);
    let scene = random_scene.randomize().await;
    println!(scene.unwrap());
    Ok(())
}

Dependencies

~4–15MB
~198K SLoC