Challenge Description

HNF26 skill issue

The game involved clicking a moving red circle as many times as possible before the timer ran out. To get the flag, I needed to beat the high score of 9999.

HNF26 skill issue 2

After clicking “Start Game”, I inspected the red circle and found that its element ID was target. I could use that ID to select the circle in JavaScript and automate the clicks from the browser console.

No need to follow the circle

JavaScript can call .click() directly on the element, regardless of where it moves on the screen.

I used setInterval to click the target every 100 milliseconds:

JavaScript
const intervalTime = 100
 
const autoClicker = setInterval(() => {
  const element = document.getElementById("target")
  if (element) {
    element.click()
  } else {
    console.log("Element with id='target' not found.")
  }
}, intervalTime)
 
// Run clearInterval(autoClicker) to stop it.

While the game was running, the script looked up target and clicked it every 100 milliseconds. After the round, clearInterval(autoClicker) could be used to stop the script.

HNF26 skill issue 3

I finished with 18200 points, beating the high score and revealing the flag.

HNF26 skill issue 4

Flag

HNF26{trUst_m3_br0_1_g0t_th4t_sc0r3}

Similar