diff --git a/resources/user_config.ts b/resources/user_config.ts index b1e66172a6..40d73463f0 100644 --- a/resources/user_config.ts +++ b/resources/user_config.ts @@ -19,9 +19,8 @@ import _Conditions from './conditions'; const Conditions = _Conditions; import _ContentType from './content_type'; const ContentType = _ContentType; -import _NetRegexes, { gameLogCodes as _gameLogCodes } from './netregexes'; +import _NetRegexes from './netregexes'; const NetRegexes = _NetRegexes; -const gameLogCodes = _gameLogCodes; import _Regexes from './regexes'; const Regexes = _Regexes; import { Responses as _Responses } from './responses'; @@ -41,7 +40,6 @@ const ZoneInfo = _ZoneInfo; console.assert(Conditions); console.assert(ContentType); console.assert(NetRegexes); -console.assert(gameLogCodes); console.assert(Regexes); console.assert(Responses); console.assert(Outputs); diff --git a/resources/util.ts b/resources/util.ts index 906f93fc0a..745b4a1a6b 100644 --- a/resources/util.ts +++ b/resources/util.ts @@ -7,6 +7,7 @@ import { Job, Role } from '../types/job'; import { NetMatches } from '../types/net_matches'; import { OutputStrings } from '../types/trigger'; +import { gameLogCodes } from './netregexes'; import Outputs from './outputs'; import { callOverlayHandler } from './overlay_plugin_api'; @@ -414,6 +415,7 @@ const Util = { watchCombatantOverride = watchFunc; clearCombatantsOverride = clearFunc; }, + gameLogCodes: gameLogCodes, } as const; export default Util; diff --git a/ui/raidboss/data/00-misc/test.ts b/ui/raidboss/data/00-misc/test.ts index d42d7560a7..cfd3f5e865 100644 --- a/ui/raidboss/data/00-misc/test.ts +++ b/ui/raidboss/data/00-misc/test.ts @@ -1,4 +1,3 @@ -import NetRegexes, { gameLogCodes } from '../../../../resources/netregexes'; import outputs from '../../../../resources/outputs'; import { ConfigValue } from '../../../../resources/user_config'; import Util from '../../../../resources/util'; @@ -237,7 +236,7 @@ const triggerSet: TriggerSet = { id: 'Test Lang', type: 'GameLog', // In game: /echo cactbot lang - netRegex: { line: 'cactbot lang.*?', code: gameLogCodes.echo, capture: false }, + netRegex: { line: 'cactbot lang.*?', code: Util.gameLogCodes.echo, capture: false }, infoText: (data, _matches, output) => output.text!({ lang: data.parserLang }), outputStrings: { text: { @@ -253,7 +252,7 @@ const triggerSet: TriggerSet = { { id: 'Test Response', type: 'GameLog', - netRegex: { line: 'cactbot test response.*?', code: gameLogCodes.echo, capture: false }, + netRegex: { line: 'cactbot test response.*?', code: Util.gameLogCodes.echo, capture: false }, response: (_data, _matches, output) => { // cactbot-builtin-response output.responseOutputStrings = { @@ -273,7 +272,7 @@ const triggerSet: TriggerSet = { { id: 'Test Watch', type: 'GameLog', - netRegex: { line: 'cactbot test watch.*?', code: gameLogCodes.echo, capture: false }, + netRegex: { line: 'cactbot test watch.*?', code: Util.gameLogCodes.echo, capture: false }, promise: (data) => Util.watchCombatant({ names: [ @@ -315,7 +314,7 @@ const triggerSet: TriggerSet = { { id: 'Test Config', type: 'GameLog', - netRegex: { line: 'cactbot test config.*?', code: gameLogCodes.echo, capture: false }, + netRegex: { line: 'cactbot test config.*?', code: Util.gameLogCodes.echo, capture: false }, alertText: (data, _matches, output) => { return output.text!({ value: data.triggerSetConfig.testTriggerOutput.toString() }); }, @@ -331,7 +330,11 @@ const triggerSet: TriggerSet = { { id: 'Test Combatant Cast Enable', type: 'GameLog', - netRegex: { line: 'cactbot test combatant cast.*?', code: gameLogCodes.echo, capture: false }, + netRegex: { + line: 'cactbot test combatant cast.*?', + code: Util.gameLogCodes.echo, + capture: false, + }, run: (data) => { data.watchingForCast = true; }, diff --git a/ui/raidboss/data/02-arr/dungeon/haukke_manor.ts b/ui/raidboss/data/02-arr/dungeon/haukke_manor.ts index aeb399d9ee..5d8c5ffff1 100644 --- a/ui/raidboss/data/02-arr/dungeon/haukke_manor.ts +++ b/ui/raidboss/data/02-arr/dungeon/haukke_manor.ts @@ -1,6 +1,6 @@ import Conditions from '../../../../../resources/conditions'; -import { gameLogCodes } from '../../../../../resources/netregexes'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -54,7 +54,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The void lamps have begun emitting an eerie glow', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, infoText: (_data, _matches, output) => output.text!(), diff --git a/ui/raidboss/data/02-arr/raid/t1.ts b/ui/raidboss/data/02-arr/raid/t1.ts index a0f71e0ede..c8401f2c40 100644 --- a/ui/raidboss/data/02-arr/raid/t1.ts +++ b/ui/raidboss/data/02-arr/raid/t1.ts @@ -1,6 +1,6 @@ import Conditions from '../../../../../resources/conditions'; -import { gameLogCodes } from '../../../../../resources/netregexes'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -91,7 +91,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The Allagan megastructure will be sealed off.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, delaySeconds: 35, diff --git a/ui/raidboss/data/02-arr/raid/t8.ts b/ui/raidboss/data/02-arr/raid/t8.ts index fd7efb0ec2..6428685fff 100644 --- a/ui/raidboss/data/02-arr/raid/t8.ts +++ b/ui/raidboss/data/02-arr/raid/t8.ts @@ -1,5 +1,5 @@ -import { gameLogCodes } from '../../../../../resources/netregexes'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -29,7 +29,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Landmines have been scattered.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, alertText: (_data, _matches, output) => output.text!(), diff --git a/ui/raidboss/data/03-hw/alliance/dun_scaith.ts b/ui/raidboss/data/03-hw/alliance/dun_scaith.ts index 415ae4298b..d75edafc21 100644 --- a/ui/raidboss/data/03-hw/alliance/dun_scaith.ts +++ b/ui/raidboss/data/03-hw/alliance/dun_scaith.ts @@ -1,6 +1,6 @@ import Conditions from '../../../../../resources/conditions'; -import { gameLogCodes } from '../../../../../resources/netregexes'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -458,7 +458,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Shadows gather on the floor.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, suppressSeconds: 5, diff --git a/ui/raidboss/data/03-hw/alliance/weeping_city.ts b/ui/raidboss/data/03-hw/alliance/weeping_city.ts index 2386d0d5b4..e00d881200 100644 --- a/ui/raidboss/data/03-hw/alliance/weeping_city.ts +++ b/ui/raidboss/data/03-hw/alliance/weeping_city.ts @@ -1,6 +1,6 @@ import Conditions from '../../../../../resources/conditions'; -import { gameLogCodes } from '../../../../../resources/netregexes'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -86,7 +86,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The Queen\'s Room will be sealed off.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, run: (data) => data.arachneStarted = true, @@ -96,7 +96,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The Gloriole will be sealed off.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, run: (data) => { @@ -109,7 +109,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The Tomb Of The Nullstone will be sealed off.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, run: (data) => { diff --git a/ui/raidboss/data/04-sb/eureka/eureka_hydatos.ts b/ui/raidboss/data/04-sb/eureka/eureka_hydatos.ts index e2d7917d84..f5cba04907 100644 --- a/ui/raidboss/data/04-sb/eureka/eureka_hydatos.ts +++ b/ui/raidboss/data/04-sb/eureka/eureka_hydatos.ts @@ -1,5 +1,5 @@ -import NetRegexes, { gameLogCodes } from '../../../../../resources/netregexes'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -92,13 +92,21 @@ const triggerSet: TriggerSet = { { id: 'BA Seal', type: 'GameLog', - netRegex: { line: '.* will be sealed off.*?', code: gameLogCodes.message, capture: false }, + netRegex: { + line: '.* will be sealed off.*?', + code: Util.gameLogCodes.message, + capture: false, + }, run: (data) => data.sealed = true, }, { id: 'BA Clear Data', type: 'GameLog', - netRegex: { line: '.*is no longer sealed.*?', code: gameLogCodes.message, capture: false }, + netRegex: { + line: '.*is no longer sealed.*?', + code: Util.gameLogCodes.message, + capture: false, + }, run: (data) => { delete data.side; delete data.mythcall; @@ -252,7 +260,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: '[^:]*:Munderg, turn flesh to ash.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, condition: (data) => data.side === 'east', @@ -282,7 +290,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: '[^:]*:Munderg, turn blood to ice.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, condition: (data) => data.side === 'east', diff --git a/ui/raidboss/data/04-sb/trial/byakko-ex.ts b/ui/raidboss/data/04-sb/trial/byakko-ex.ts index 6627b6f8c0..9d20ec03ec 100644 --- a/ui/raidboss/data/04-sb/trial/byakko-ex.ts +++ b/ui/raidboss/data/04-sb/trial/byakko-ex.ts @@ -1,6 +1,6 @@ import Conditions from '../../../../../resources/conditions'; -import { gameLogCodes } from '../../../../../resources/netregexes'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -195,7 +195,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: '[^:]*:Twofold is my wrath, twice-cursed my foes!.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, condition: (data) => data.role === 'tank', diff --git a/ui/raidboss/data/04-sb/trial/tsukuyomi-ex.ts b/ui/raidboss/data/04-sb/trial/tsukuyomi-ex.ts index 044469a362..8df979a82c 100644 --- a/ui/raidboss/data/04-sb/trial/tsukuyomi-ex.ts +++ b/ui/raidboss/data/04-sb/trial/tsukuyomi-ex.ts @@ -1,7 +1,7 @@ import Conditions from '../../../../../resources/conditions'; -import { gameLogCodes } from '../../../../../resources/netregexes'; import Outputs from '../../../../../resources/outputs'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -163,7 +163,7 @@ const triggerSet: TriggerSet = { // then this could push unexpectedly earlier (or paired with buster). netRegex: { line: '[^:]*:No\. No\.\.\. Not yet\. Not\. Yet\..*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, response: Responses.aoe(), diff --git a/ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts b/ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts index 6886333e32..1b7f0647f8 100644 --- a/ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts +++ b/ui/raidboss/data/04-sb/ultimate/unending_coil_ultimate.ts @@ -1,5 +1,4 @@ import Conditions from '../../../../../resources/conditions'; -import { gameLogCodes } from '../../../../../resources/netregexes'; import Outputs from '../../../../../resources/outputs'; import { callOverlayHandler } from '../../../../../resources/overlay_plugin_api'; import { Responses } from '../../../../../resources/responses'; @@ -463,7 +462,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'From on high I descend, the hallowed moon to call.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, durationSeconds: 6, @@ -485,7 +484,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'From on high I descend, the iron path to walk.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, durationSeconds: 6, @@ -507,7 +506,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Take fire, O hallowed moon.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, durationSeconds: 6, @@ -529,7 +528,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Blazing path, lead me to iron rule.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, infoText: (_data, _matches, output) => output.text!(), @@ -550,7 +549,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'O hallowed moon, take fire and scorch my foes.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, infoText: (_data, _matches, output) => output.text!(), @@ -571,7 +570,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'O hallowed moon, shine you the iron path.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, infoText: (_data, _matches, output) => output.text!(), @@ -592,7 +591,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Fleeting light! \'Neath the red moon, scorch you the earth.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, delaySeconds: 4, @@ -616,7 +615,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Fleeting light! Amid a rain of stars, exalt you the red moon.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, delaySeconds: 4, @@ -640,7 +639,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'From on high I descend, the moon and stars to bring.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, durationSeconds: 9, @@ -662,7 +661,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'From hallowed moon I descend, a rain of stars to bring.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, durationSeconds: 9, @@ -684,7 +683,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'From hallowed moon I bare iron, in my descent to wield.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, durationSeconds: 9, @@ -727,7 +726,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Unbending iron, take fire and descend.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, durationSeconds: 9, @@ -749,7 +748,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Unbending iron, descend with fiery edge.*?', - code: gameLogCodes.dialog, + code: Util.gameLogCodes.dialog, capture: false, }, durationSeconds: 9, diff --git a/ui/raidboss/data/05-shb/alliance/the_copied_factory.ts b/ui/raidboss/data/05-shb/alliance/the_copied_factory.ts index 1f74fe78f3..2a89fa11d7 100644 --- a/ui/raidboss/data/05-shb/alliance/the_copied_factory.ts +++ b/ui/raidboss/data/05-shb/alliance/the_copied_factory.ts @@ -1,6 +1,6 @@ import Conditions from '../../../../../resources/conditions'; -import { gameLogCodes } from '../../../../../resources/netregexes'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -126,7 +126,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The wall-mounted right arm begins to move.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, infoText: (_data, _matches, output) => output.text!(), @@ -148,7 +148,7 @@ const triggerSet: TriggerSet = { netRegex: { line: 'The wall-mounted flamethrowers activate\..*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, alertText: (_data, _matches, output) => output.text!(), @@ -169,7 +169,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The wall-mounted left arm begins to move.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, durationSeconds: 6, @@ -181,7 +181,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The wall-mounted left arm begins to move.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, delaySeconds: 8, @@ -202,7 +202,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The wall-mounted left arm begins to move.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, delaySeconds: 10, @@ -236,7 +236,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'You hear frenzied movement from machines beneath.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, durationSeconds: 10, @@ -258,7 +258,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The conveyer belts whirr to life!.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, infoText: (_data, _matches, output) => output.text!(), @@ -278,7 +278,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Flammable oil is leaking from the floor.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, durationSeconds: 3, @@ -300,7 +300,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'Flammable oil is leaking from the floor.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, delaySeconds: 6, diff --git a/ui/raidboss/data/06-ew/dungeon/the_sildihn_subterrane.ts b/ui/raidboss/data/06-ew/dungeon/the_sildihn_subterrane.ts index 83bf119567..eb25a83ffa 100644 --- a/ui/raidboss/data/06-ew/dungeon/the_sildihn_subterrane.ts +++ b/ui/raidboss/data/06-ew/dungeon/the_sildihn_subterrane.ts @@ -1,6 +1,6 @@ -import { gameLogCodes } from '../../../../../resources/netregexes'; import Outputs from '../../../../../resources/outputs'; import { Responses } from '../../../../../resources/responses'; +import Util from '../../../../../resources/util'; import ZoneId from '../../../../../resources/zone_id'; import { RaidbossData } from '../../../../../types/data'; import { TriggerSet } from '../../../../../types/trigger'; @@ -125,7 +125,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The Silt Pump will be sealed off.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, // May be overwritten by Runaway Sludge below. @@ -157,7 +157,7 @@ const triggerSet: TriggerSet = { type: 'GameLog', netRegex: { line: 'The Settling Basin will be sealed off.*?', - code: gameLogCodes.message, + code: Util.gameLogCodes.message, capture: false, }, // May be overwritten by Suddenly Sewage below.