diff --git a/bruno/neon-sprawl-server/combat-health/Get combat health after elite attack.bru b/bruno/neon-sprawl-server/combat-health/Get combat health after elite attack.bru index b953592..41314ea 100644 --- a/bruno/neon-sprawl-server/combat-health/Get combat health after elite attack.bru +++ b/bruno/neon-sprawl-server/combat-health/Get combat health after elite attack.bru @@ -64,10 +64,10 @@ script:pre-request { await axios.get(`${baseUrl}/game/world/npc-runtime-snapshot`); - await sleep(5000); + await sleep(bru, 5000); await axios.get(`${baseUrl}/game/world/npc-runtime-snapshot`); - await sleep(2500); + await sleep(bru, 2500); await axios.get(`${baseUrl}/game/world/npc-runtime-snapshot`); bru.setVar("neo95CastBody", JSON.stringify(castBody)); diff --git a/bruno/neon-sprawl-server/encounter-progress/Get encounter progress after defeat spine.bru b/bruno/neon-sprawl-server/encounter-progress/Get encounter progress after defeat spine.bru index d715e61..02e23b5 100644 --- a/bruno/neon-sprawl-server/encounter-progress/Get encounter progress after defeat spine.bru +++ b/bruno/neon-sprawl-server/encounter-progress/Get encounter progress after defeat spine.bru @@ -47,7 +47,7 @@ script:pre-request { { schemaVersion: 1, targetId }, jsonHeaders, ); - await sleep(PULSE_COOLDOWN_MS); + await sleep(bru, PULSE_COOLDOWN_MS); const castBody = { schemaVersion: 1, slotIndex, @@ -70,7 +70,7 @@ script:pre-request { return; } if (i < 3) { - await sleep(PULSE_COOLDOWN_MS); + await sleep(bru, PULSE_COOLDOWN_MS); } } throw new Error(`did not defeat ${targetId} within 4 pulses`); diff --git a/bruno/neon-sprawl-server/scripts/prototype-npc-bruno-helper.js b/bruno/neon-sprawl-server/scripts/prototype-npc-bruno-helper.js index 2638715..a1cd06c 100644 --- a/bruno/neon-sprawl-server/scripts/prototype-npc-bruno-helper.js +++ b/bruno/neon-sprawl-server/scripts/prototype-npc-bruno-helper.js @@ -10,8 +10,9 @@ const PROTOTYPE_NPC_ANCHORS = { /** prototype_pulse catalog cooldown (seconds) — real-time Bruno waits. */ const PULSE_COOLDOWN_MS = 3200; -function sleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); +/** Bruno sandbox has no setTimeout — use bru.sleep. */ +async function sleep(bru, ms) { + await bru.sleep(ms); } async function moveNearPrototypeNpc(baseUrl, playerId, targetId, jsonHeaders) {