From c081565cf0712fdc4c86bc5c93cbbf72b9a0b05a Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 25 Jun 2023 21:21:13 +0000 Subject: [PATCH] triggers build: raidboss: convert NetRegexes.echo/message/dialog to params (#5451) Part of #4986. Closes #5452. 5f38b033baa6ecc895e2635c5dddabb89c6415a7 --- 00-misc/test.js | 14 +++-- 02-arr/dungeon/haukke_manor.js | 5 +- 02-arr/raid/t1.js | 5 +- 02-arr/raid/t8.js | 6 +- 03-hw/alliance/dun_scaith.js | 6 +- 03-hw/alliance/weeping_city.js | 16 ++++-- 04-sb/eureka/eureka_hydatos.js | 24 ++++++-- 04-sb/trial/byakko-ex.js | 5 +- 04-sb/trial/tsukuyomi-ex.js | 5 +- 04-sb/ultimate/unending_coil_ultimate.js | 70 +++++++++++++++--------- 05-shb/alliance/the_copied_factory.js | 45 +++++++++------ 06-ew/dungeon/the_sildihn_subterrane.js | 11 +++- 12 files changed, 140 insertions(+), 72 deletions(-) diff --git a/00-misc/test.js b/00-misc/test.js index 075685e730..922aa5f429 100644 --- a/00-misc/test.js +++ b/00-misc/test.js @@ -218,7 +218,7 @@ Options.Triggers.push({ id: 'Test Lang', type: 'GameLog', // In game: /echo cactbot lang - netRegex: NetRegexes.echo({ line: 'cactbot lang.*?', capture: false }), + netRegex: { line: 'cactbot lang.*?', code: Util.gameLogCodes.echo, capture: false }, infoText: (data, _matches, output) => output.text({ lang: data.parserLang }), outputStrings: { text: { @@ -234,7 +234,7 @@ Options.Triggers.push({ { id: 'Test Response', type: 'GameLog', - netRegex: NetRegexes.echo({ line: 'cactbot test response.*?', capture: false }), + netRegex: { line: 'cactbot test response.*?', code: Util.gameLogCodes.echo, capture: false }, response: (_data, _matches, output) => { // cactbot-builtin-response output.responseOutputStrings = { @@ -254,7 +254,7 @@ Options.Triggers.push({ { id: 'Test Watch', type: 'GameLog', - netRegex: NetRegexes.echo({ line: 'cactbot test watch.*?', capture: false }), + netRegex: { line: 'cactbot test watch.*?', code: Util.gameLogCodes.echo, capture: false }, promise: (data) => Util.watchCombatant({ names: [ @@ -296,7 +296,7 @@ Options.Triggers.push({ { id: 'Test Config', type: 'GameLog', - netRegex: NetRegexes.echo({ line: 'cactbot test config.*?', 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() }); }, @@ -312,7 +312,11 @@ Options.Triggers.push({ { id: 'Test Combatant Cast Enable', type: 'GameLog', - netRegex: NetRegexes.echo({ line: 'cactbot test combatant cast.*?', capture: false }), + netRegex: { + line: 'cactbot test combatant cast.*?', + code: Util.gameLogCodes.echo, + capture: false, + }, run: (data) => { data.watchingForCast = true; }, diff --git a/02-arr/dungeon/haukke_manor.js b/02-arr/dungeon/haukke_manor.js index ca74ea30bd..879816e1f5 100644 --- a/02-arr/dungeon/haukke_manor.js +++ b/02-arr/dungeon/haukke_manor.js @@ -43,10 +43,11 @@ Options.Triggers.push({ // Void Lamp Spawn id: 'Haukke Normal Void Lamps', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The void lamps have begun emitting an eerie glow', + code: Util.gameLogCodes.message, capture: false, - }), + }, infoText: (_data, _matches, output) => output.text(), outputStrings: { text: { diff --git a/02-arr/raid/t1.js b/02-arr/raid/t1.js index 03075617c9..814e743cfb 100644 --- a/02-arr/raid/t1.js +++ b/02-arr/raid/t1.js @@ -78,10 +78,11 @@ Options.Triggers.push({ { id: 'T1 Slime Timer First', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The Allagan megastructure will be sealed off.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, delaySeconds: 35, suppressSeconds: 5, infoText: (_data, _matches, output) => output.text(), diff --git a/02-arr/raid/t8.js b/02-arr/raid/t8.js index 89fc0005d7..52857502b9 100644 --- a/02-arr/raid/t8.js +++ b/02-arr/raid/t8.js @@ -17,7 +17,11 @@ Options.Triggers.push({ { id: 'T8 Landmine Start', type: 'GameLog', - netRegex: NetRegexes.message({ line: 'Landmines have been scattered.*?', capture: false }), + netRegex: { + line: 'Landmines have been scattered.*?', + code: Util.gameLogCodes.message, + capture: false, + }, alertText: (_data, _matches, output) => output.text(), run: (data) => data.landmines = {}, outputStrings: { diff --git a/03-hw/alliance/dun_scaith.js b/03-hw/alliance/dun_scaith.js index 002d37b364..c14ddbd29d 100644 --- a/03-hw/alliance/dun_scaith.js +++ b/03-hw/alliance/dun_scaith.js @@ -440,7 +440,11 @@ Options.Triggers.push({ // However, the RP text seems to be the only indicator. id: 'Dun Scaith Shadow Links', type: 'GameLog', - netRegex: NetRegexes.message({ line: 'Shadows gather on the floor.*?', capture: false }), + netRegex: { + line: 'Shadows gather on the floor.*?', + code: Util.gameLogCodes.message, + capture: false, + }, suppressSeconds: 5, response: Responses.stopMoving(), }, diff --git a/03-hw/alliance/weeping_city.js b/03-hw/alliance/weeping_city.js index a01ff93968..f374d0bd62 100644 --- a/03-hw/alliance/weeping_city.js +++ b/03-hw/alliance/weeping_city.js @@ -71,16 +71,21 @@ Options.Triggers.push({ // only when that boss is in progress. id: 'Weeping City HeadMarker Arachne', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The Queen\'s Room will be sealed off.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, run: (data) => data.arachneStarted = true, }, { id: 'Weeping City HeadMarker Ozma', type: 'GameLog', - netRegex: NetRegexes.message({ line: 'The Gloriole will be sealed off.*?', capture: false }), + netRegex: { + line: 'The Gloriole will be sealed off.*?', + code: Util.gameLogCodes.message, + capture: false, + }, run: (data) => { data.arachneStarted = false; data.ozmaStarted = true; @@ -89,10 +94,11 @@ Options.Triggers.push({ { id: 'Weeping City HeadMarker Calofisteri', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The Tomb Of The Nullstone will be sealed off.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, run: (data) => { data.ozmaStarted = false; data.calStarted = true; diff --git a/04-sb/eureka/eureka_hydatos.js b/04-sb/eureka/eureka_hydatos.js index 178af2d611..7d782371ef 100644 --- a/04-sb/eureka/eureka_hydatos.js +++ b/04-sb/eureka/eureka_hydatos.js @@ -76,13 +76,21 @@ Options.Triggers.push({ { id: 'BA Seal', type: 'GameLog', - netRegex: NetRegexes.message({ line: '.* will be sealed off.*?', 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: NetRegexes.message({ line: '.*is no longer sealed.*?', capture: false }), + netRegex: { + line: '.*is no longer sealed.*?', + code: Util.gameLogCodes.message, + capture: false, + }, run: (data) => { delete data.side; delete data.mythcall; @@ -234,7 +242,11 @@ Options.Triggers.push({ { id: 'BA Owain Fire Element', type: 'GameLog', - netRegex: NetRegexes.dialog({ line: '[^:]*:Munderg, turn flesh to ash.*?', capture: false }), + netRegex: { + line: '[^:]*:Munderg, turn flesh to ash.*?', + code: Util.gameLogCodes.dialog, + capture: false, + }, condition: (data) => data.side === 'east', alertText: (_data, _matches, output) => output.getToIce(), infoText: (_data, _matches, output) => output.switchMagia(), @@ -260,7 +272,11 @@ Options.Triggers.push({ { id: 'BA Owain Ice Element', type: 'GameLog', - netRegex: NetRegexes.dialog({ line: '[^:]*:Munderg, turn blood to ice.*?', capture: false }), + netRegex: { + line: '[^:]*:Munderg, turn blood to ice.*?', + code: Util.gameLogCodes.dialog, + capture: false, + }, condition: (data) => data.side === 'east', alertText: (_data, _matches, output) => output.getToFire(), infoText: (_data, _matches, output) => output.switchMagia(), diff --git a/04-sb/trial/byakko-ex.js b/04-sb/trial/byakko-ex.js index 0245a390a4..192ca1c45b 100644 --- a/04-sb/trial/byakko-ex.js +++ b/04-sb/trial/byakko-ex.js @@ -180,10 +180,11 @@ Options.Triggers.push({ { id: 'ByaEx Tiger Add', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: '[^:]*:Twofold is my wrath, twice-cursed my foes!.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, condition: (data) => data.role === 'tank', infoText: (_data, _matches, output) => output.text(), outputStrings: { diff --git a/04-sb/trial/tsukuyomi-ex.js b/04-sb/trial/tsukuyomi-ex.js index 8f5134339d..7e8ce655a4 100644 --- a/04-sb/trial/tsukuyomi-ex.js +++ b/04-sb/trial/tsukuyomi-ex.js @@ -144,10 +144,11 @@ Options.Triggers.push({ // There's no "starts using" here. She pushes at 35% to this ability. // This happens after 2nd meteors naturally, but if dps is good // then this could push unexpectedly earlier (or paired with buster). - netRegex: NetRegexes.dialog({ + netRegex: { line: '[^:]*:No\. No\.\.\. Not yet\. Not\. Yet\..*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, response: Responses.aoe(), }, { diff --git a/04-sb/ultimate/unending_coil_ultimate.js b/04-sb/ultimate/unending_coil_ultimate.js index 6bb2cd2617..6e6635faa7 100644 --- a/04-sb/ultimate/unending_coil_ultimate.js +++ b/04-sb/ultimate/unending_coil_ultimate.js @@ -395,10 +395,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6497?pretty=true id: 'UCU Nael Quote 1', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'From on high I descend, the hallowed moon to call.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, durationSeconds: 6, infoText: (_data, _matches, output) => output.text(), outputStrings: { @@ -416,10 +417,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6496?pretty=true id: 'UCU Nael Quote 2', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'From on high I descend, the iron path to walk.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, durationSeconds: 6, infoText: (_data, _matches, output) => output.text(), outputStrings: { @@ -437,7 +439,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6495?pretty=true id: 'UCU Nael Quote 3', type: 'GameLog', - netRegex: NetRegexes.dialog({ line: 'Take fire, O hallowed moon.*?', capture: false }), + netRegex: { + line: 'Take fire, O hallowed moon.*?', + code: Util.gameLogCodes.dialog, + capture: false, + }, durationSeconds: 6, infoText: (_data, _matches, output) => output.text(), outputStrings: { @@ -455,10 +461,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6494?pretty=true id: 'UCU Nael Quote 4', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'Blazing path, lead me to iron rule.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, infoText: (_data, _matches, output) => output.text(), outputStrings: { text: { @@ -475,10 +482,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6493?pretty=true id: 'UCU Nael Quote 5', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'O hallowed moon, take fire and scorch my foes.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, infoText: (_data, _matches, output) => output.text(), outputStrings: { text: { @@ -495,10 +503,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6492?pretty=true id: 'UCU Nael Quote 6', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'O hallowed moon, shine you the iron path.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, infoText: (_data, _matches, output) => output.text(), outputStrings: { text: { @@ -515,10 +524,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6501?pretty=true id: 'UCU Nael Quote 7', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'Fleeting light! \'Neath the red moon, scorch you the earth.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, delaySeconds: 4, durationSeconds: 6, // Make this alert so it doesn't overlap with the dive infoText occuring here. @@ -538,10 +548,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6500?pretty=true id: 'UCU Nael Quote 8', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'Fleeting light! Amid a rain of stars, exalt you the red moon.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, delaySeconds: 4, durationSeconds: 6, // Make this alert so it doesn't overlap with the dive infoText occuring here. @@ -561,10 +572,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6502?pretty=true id: 'UCU Nael Quote 9', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'From on high I descend, the moon and stars to bring.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, durationSeconds: 9, infoText: (_data, _matches, output) => output.text(), outputStrings: { @@ -582,10 +594,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6503?pretty=true id: 'UCU Nael Quote 10', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'From hallowed moon I descend, a rain of stars to bring.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, durationSeconds: 9, infoText: (_data, _matches, output) => output.text(), outputStrings: { @@ -603,10 +616,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6507?pretty=true id: 'UCU Nael Quote 11', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'From hallowed moon I bare iron, in my descent to wield.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, durationSeconds: 9, infoText: (_data, _matches, output) => output.text(), outputStrings: { @@ -624,10 +638,10 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6506?pretty=true id: 'UCU Nael Quote 12', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'From hallowed moon I descend, upon burning earth to tread.*?', capture: false, - }), + }, durationSeconds: 9, infoText: (_data, _matches, output) => output.text(), outputStrings: { @@ -645,10 +659,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6504?pretty=true id: 'UCU Nael Quote 13', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'Unbending iron, take fire and descend.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, durationSeconds: 9, infoText: (_data, _matches, output) => output.text(), outputStrings: { @@ -666,10 +681,11 @@ Options.Triggers.push({ // https://xivapi.com/NpcYell/6505?pretty=true id: 'UCU Nael Quote 14', type: 'GameLog', - netRegex: NetRegexes.dialog({ + netRegex: { line: 'Unbending iron, descend with fiery edge.*?', + code: Util.gameLogCodes.dialog, capture: false, - }), + }, durationSeconds: 9, infoText: (_data, _matches, output) => output.text(), outputStrings: { diff --git a/05-shb/alliance/the_copied_factory.js b/05-shb/alliance/the_copied_factory.js index 453beee10e..af85fea7fc 100644 --- a/05-shb/alliance/the_copied_factory.js +++ b/05-shb/alliance/the_copied_factory.js @@ -111,10 +111,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Right Arm', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The wall-mounted right arm begins to move.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, infoText: (_data, _matches, output) => output.text(), run: (data) => data.alliance = data.alliance ?? 'A', outputStrings: { @@ -131,10 +132,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Flamethrowers', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The wall-mounted flamethrowers activate\..*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, alertText: (_data, _matches, output) => output.text(), run: (data) => data.alliance = data.alliance || 'B', outputStrings: { @@ -151,10 +153,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Left Arm 1', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The wall-mounted left arm begins to move.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, durationSeconds: 6, response: Responses.getOut('info'), run: (data) => data.alliance = data.alliance || 'C', @@ -162,10 +165,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Left Arm 2', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The wall-mounted left arm begins to move.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, delaySeconds: 8, alertText: (_data, _matches, output) => output.text(), outputStrings: { @@ -182,10 +186,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Left Arm 3', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The wall-mounted left arm begins to move.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, delaySeconds: 10, alertText: (_data, _matches, output) => output.text(), outputStrings: { @@ -215,10 +220,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Electric Floor', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'You hear frenzied movement from machines beneath.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, durationSeconds: 10, suppressSeconds: 15, infoText: (_data, _matches, output) => output.text(), @@ -236,10 +242,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Conveyer Belts', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The conveyer belts whirr to life!.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, infoText: (_data, _matches, output) => output.text(), outputStrings: { text: { @@ -255,10 +262,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Oil 1', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'Flammable oil is leaking from the floor.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, durationSeconds: 3, suppressSeconds: 15, alertText: (_data, _matches, output) => output.text(), @@ -276,10 +284,11 @@ Options.Triggers.push({ { id: 'Copied Hobbes Oil 2', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'Flammable oil is leaking from the floor.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, delaySeconds: 6, durationSeconds: 3, suppressSeconds: 15, diff --git a/06-ew/dungeon/the_sildihn_subterrane.js b/06-ew/dungeon/the_sildihn_subterrane.js index 445e1c7ec7..4487e6bf64 100644 --- a/06-ew/dungeon/the_sildihn_subterrane.js +++ b/06-ew/dungeon/the_sildihn_subterrane.js @@ -93,7 +93,11 @@ Options.Triggers.push({ { id: 'Sildihn Geryon Seal Left Mechs', type: 'GameLog', - netRegex: NetRegexes.message({ line: 'The Silt Pump will be sealed off.*?', capture: false }), + netRegex: { + line: 'The Silt Pump will be sealed off.*?', + code: Util.gameLogCodes.message, + capture: false, + }, // May be overwritten by Runaway Sludge below. run: (data) => data.catapultMechs = leftDoorYesPump, }, @@ -121,10 +125,11 @@ Options.Triggers.push({ { id: 'Sildihn Geryon Seal Right Mechs', type: 'GameLog', - netRegex: NetRegexes.message({ + netRegex: { line: 'The Settling Basin will be sealed off.*?', + code: Util.gameLogCodes.message, capture: false, - }), + }, // May be overwritten by Suddenly Sewage below. run: (data) => data.catapultMechs = rightDoorNoCeruleum, },