Skip to main content

API

Inisght affliction tracking package.

currentAffs

Returns an array of afflictions on current target.

insight.currentAffs(); // ['asthma', 'paralysis', 'clumsiness'];

currentAffDisplay

Returns an array of afflictions on current target in string format including probability.

insight.currentAffDisplay(); // ['asthma: 0.5', 'clumsiness: 0.5', 'paralysis: 1'];

currentAffDisplayHTML

Returns an HTML friendly display of the current affs, including probability.

insight.currentAffDisplayHTML(); // ['asthma: 0.5', 'clumsiness: 0.5', 'paralysis: 1'];

hasAff({id, probability = 0})

Returns a boolean for affliction on target meeting a provided probability from 0 - 1.

//Target afflictions ['asthma: 0.5', 'clumsiness: 0.5', 'paralysis: 1'];
insight.hasAff({ id: "asthma" }); // true

insight.hasAff({ id: "asthma", probability: 0.75 }); //false

insight.hasAff({ id: "asthma", probability: 0.25 }); // true

hasAnAff({ids, player, probability = 0})

Returns a boolean for the presence of any aff listed in the array meeting a provided probability from 0 - 1 for the current target.

//Target afflictions ['asthma: 0.5', 'clumsiness: 0.5', 'paralysis: 1'];
insight.hasAnAff({ ids: ["asthma", "clumsiness"] }); // true

insight.hasAnAff({ ids: ["nausea", "slickness"] }); // false

insight.hasAnAff({ ids: ["asthma", "paralysis"], probability: 0.75 }); // true

insight.hasAnAff({ ids: ["asthma", "clumsiness"], probability: 1 }); // false

hasAffs({ids, player, probability = 0})

Returns a boolean for the presence of all affs listed in the array meeting a provided probability from 0 - 1 for the current target.

//Target afflictions ['asthma: 0.5', 'clumsiness: 0.5', 'paralysis: 1'];
insight.hasAffs({ ids: ["asthma", "clumsiness"] }); // true

insight.hasAffs({ ids: ["asthma", "slickness"] }); // false

insight.hasAffs({ ids: ["asthma", "paralysis"], probability: 1 }); // false

insight.hasAffs({ ids: ["asthma", "clumsiness"], probability: 0.5 }); // true

hasDef({id, player})

Returns a boolean for the state of a tracked defense on the target.

//Target defense rebounding = true, shield = false;
insight.hasDef({ id: "rebounding" }); // true

insight.hasDef({ id: "shield" }); // false

getStatus({id, player})

Returns the stored value of any status variable tracked by insight on the current target.

//Target health = 5000, mana = 4500
insight.getStatus({ id: "hp" }); // 5000

addAff({id, player})

removeAff({id, player})

confirmAff({id, state, player})

Used to confirm if a tracked aff is either 1.0 or no longer present; e.g. A target with tacked asthma smoking.

//Target afflictions ['asthma: 0.5', 'clumsiness: 0.5', 'paralysis: 1'];
insight.confirmAff({ id: "asthma", state: true });
//Target afflictions ['asthma: 1', 'clumsiness: 0.5', 'paralysis: 1'];
insight.confirmAff({ id: "paralysis", state: false });
//Target afflictions ['asthma: 1', 'clumsiness: 0.5''];

confirmAffs({ids, state, player})

randomAffs({ids, player})

smartAffs({ids, player, ordered = false})

convertAff({id, to, player})

usedCure({id, player})

//Target afflictions: ['asthma: 1', 'clumsiness: 1'];
insight.usedCure({ id: "kelp", player: "Khaseem" });
//Target afflictions: ['asthma: 0.5', 'clumsiness: 0.5'];

hasDef({id, player})

addDef({id, player})

removeDef({id, player})

setStatus({id, value, player})

getStatus({id, player})

hasBal({id, player})

lostBal({id, player})

balRemaining({id, player})

setTarget(player)

reset()