API
insight exposes a global insight object. The API is grouped into target management, afflictions, defences, balances, limbs, and stats.
Target management
| Function | Description |
|---|---|
setTarget(player) | Set the active target. |
reset() | Reset the active target state. |
reset("all") | Reset all tracked players. |
currentAffs() | List afflictions on the current target. |
currentAffDisplay() | Return afflictions with probabilities. |
currentAffDisplayHTML() | Return formatted affliction display. |
Afflictions
| Function | Description |
|---|---|
addAff({ id, player }) | Add an affliction. |
removeAff({ id, player }) | Remove an affliction. |
confirmAff({ id, state, player }) | Confirm or deny an affliction. |
confirmAffs({ ids, state, player }) | Confirm or deny multiple affs. |
randomAffs({ ids, player }) | Randomly apply a list of affs. |
smartAffs({ ids, player, ordered }) | Smart or ordered aff application. |
convertAff({ id, to, player }) | Convert one aff to another. |
countAffs({ ids, player }) | Count how many of the list are present. |
hasAff({ id, player, probability }) | Check if an aff is present. |
hasAffs({ ids, player, probability }) | Check if all affs are present. |
hasAnAff({ ids, player, probability }) | Check if any aff is present. |
Defences
| Function | Description |
|---|---|
addDef({ id, player }) | Add a defence. |
removeDef({ id, player }) | Remove a defence. |
hasDef({ id, player }) | Check if a defence is active. |
Balances
| Function | Description |
|---|---|
hasBal({ id, player }) | Check if a balance is available. |
lostBal({ id, player }) | Mark a balance as used. |
balRemaining({ id, player }) | Time remaining on a balance. |
Limbs
| Function | Description |
|---|---|
getLimb({ id, player }) | Retrieve a limb object. |
hitLimb({ id, player, value }) | Apply limb damage. |
resetLimb({ id, player }) | Reset limb damage. |
breakLimb({ id, player }) | Mark limb as broken. |
Stats
| Function | Description |
|---|---|
getStat({ id, player }) | Get a stat object. |
adjustHp({ id, value, player }) | Adjust HP values. |
adjustMana({ id, value, player }) | Adjust mana values. |
setState({ id, value, player }) | Set a tracked state value. |
Cures
| Function | Description |
|---|---|
usedCure({ id, player }) | Register a cure use and update state. |
Helpers
| Function | Description |
|---|---|
checkBlock(pattern) | Check the current output block for a match. |
nextLine(pattern) | Check the next line for a match. |
venomToAff | Map venom IDs to afflictions. |
Example
insight.setTarget("enemy");
insight.addAff({ id: "asthma" });
insight.hasAff({ id: "asthma", probability: 0.5 });