Skip to content

Custom Name Script Bindings

Victor edited this page May 5, 2020 · 2 revisions

Detected Stats for a Screenshot

@objc public protocol PokemonStatsJSExport: JSExport {
    var cp: Int { get }
    var hp: Int { get }
    var gender: String { get }
    var weight: Double { get }
    var isLucky: Bool { get }
    var options: [PokemonStatsOptionJSExport] { get }
}

Detected Stats Option

@objc public protocol PokemonStatsOptionJSExport: JSExport {
    var name: String { get }
    var form: String { get }
    var level: Double { get }
    var attack: Int { get }
    var defense: Int { get }
    var stamina: Int { get }
    var greatIndex: Int { get }
    var greatRanking: Double { get }
    var ultraIndex: Int { get }
    var ultraRanking: Double { get }
}

Detected Attack Info

@objc public protocol PokemonMoveJSExport: JSExport {
    var type: String { get }
    var name: String { get }
    var energy: Int { get }
}

Script Entry Point

function formatName(stats /* PokemonStatsJSExport */, moves /* array of PokemonMoveJSExport */) {
    return stats.options[0].name;
}
Clone this wiki locally