Crate arcdps

source ·
Expand description

Bindings for ArcDPS plugins.

§Usage

Plugins export information for ArcDPS via the export! macro. To see which fields are supported by it, have a look at SupportedFields.

use std::error::Error;
use arcdps::{Agent, Event, StateChange};

arcdps::export! {
    name: "Example Plugin",
    sig: 0x12345678, // change this to a random number
    init,
    combat: custom_combat_name,
}

fn init() -> Result<(), String> {
    // may return an error to indicate load failure
    Ok(())
}

fn custom_combat_name(
    event: Option<&Event>,
    src: Option<&Agent>,
    dst: Option<&Agent>,
    skill_name: Option<&str>,
    id: u64,
    revision: u64,
) {
    if let Some(event) = event {
        if let StateChange::EnterCombat = event.get_statechange() {
            // source agent has entered combat
        }
    }
}

§Unofficial Extras

Unofficial Extras support is hidden behind the extras feature flag.

use arcdps::extras::{UserInfoIter, UserRole};

arcdps::export! {
    name: "Example Plugin",
    sig: 123,
    extras_squad_update,
}

fn extras_squad_update(users: UserInfoIter) {
    for user in users {
        if let UserRole::SquadLeader | UserRole::Lieutenant = user.role {
            // user can place markers
        }
    }
}

Re-exports§

Modules§

Macros§

  • Creates plugin exports for ArcDPS.

Structs§

Enums§

Functions§