Skip to content

AiRule beta ​

Interface of @v12-engine/engine/ai

ts
export interface AiRule

A rule of a brain (when(condition).do(action)): checked each think by the rules() module, its action done as its condition becomes true. Code: given again by the brain's definition, as goals are; what it remembers is data

Members ​

action ​

ts
readonly action: AiAction;

What it does

every ​

ts
readonly every?: number;

Seconds: fired again while its condition holds, at most so often. Left out, it fires as it turns true

id ​

ts
readonly id?: string;

Its name: what the memory, the report and the log know it by. rule 1, rule 2… in the module's list when left out

once ​

ts
readonly once?: boolean;

Whether it fires the first time only, ever

priority ​

ts
readonly priority?: number;

Checked before rules of less: 0 when left out

when ​

ts
readonly when: AiCondition | {
        word: string;
    };

When it fires: a condition, or a word told (when.told)