Last active
December 2, 2020 03:18
-
-
Save CasualSuperman/d909b5f95d13b030d1a129e6bea9365a to your computer and use it in GitHub Desktop.
Unknown action logger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Module, {dependency} from 'parser/core/Module' | |
import {Data} from 'parser/core/modules/Data' | |
import {Ability, BuffEvent, CastEvent} from '../../../fflogs' | |
export default class AllActionsKnown extends Module { | |
static handle = 'aak' | |
static debug = false | |
@dependency private data!: Data | |
private unknownActions: Map<number, Ability> = new Map() | |
private unknownBuffs: Map<number, Ability> = new Map() | |
protected init() { | |
if (AllActionsKnown.debug) { | |
this.addEventHook('complete', this.onComplete) | |
this.addEventHook('cast', {by: 'player'}, this.onCast) | |
this.addEventHook('begincast', {by: 'player'}, this.onCast) | |
this.addEventHook('applybuff', {by: 'player'}, this.onBuff) | |
this.addEventHook('applydebuff', {by: 'player'}, this.onBuff) | |
} | |
} | |
private onCast(event : CastEvent) { | |
if (!this.data.getAction(event.ability.guid)) { | |
if (!this.unknownActions.has(event.ability.guid)) { | |
this.debug('Found unknown ability ' + event.ability.name, event) | |
this.unknownActions.set(event.ability.guid, event.ability) | |
} | |
} | |
} | |
private onBuff(event : BuffEvent) { | |
if (!this.data.getStatus(event.ability.guid)) { | |
if (!this.unknownBuffs.has(event.ability.guid)) { | |
this.debug('Found unknown buff ' + event.ability.name, event) | |
this.unknownBuffs.set(event.ability.guid, event.ability) | |
} | |
} | |
} | |
// Just using this for the suggestion for now | |
protected onComplete() { | |
if (this.unknownActions.size > 0) { | |
this.debug('Found ' + this.unknownActions.size + ' unknown actions:', this.unknownActions) | |
} | |
if (this.unknownBuffs.size > 0) { | |
this.debug('Found ' + this.unknownBuffs.size + ' unknown buffs:', this.unknownBuffs) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment