Joseph Carothers
← All projects

React · Javascript

Bitburner Custom UI

I built an in-game display for Bitburner that shows which servers the scripts are targeting and what each script is doing.

GitHub ↗September 2024 · 1 min read
My role
Developer
Focus
Game stats, target and node displays, and DOM updates.
Stack
ReactJSJavaScript
Bitburner Custom UI cover

Bitburner Custom UI

I built a custom HUD for Bitburner that displays player stats, server targets, and hack, grow, and weaken activity. The game environment led me to experiment with a small renderer instead of using React DOM.

The renderer turns component-like objects into DOM nodes and supports text, attributes, styles, and event handlers. A diff helper updates text and attributes and replaces nodes when their type changes. This is a project experiment rather than a general-purpose React renderer.

The attribute-removal check in the example is:

oldAttrs.forEach((attr) => {
  if (!newNode.hasAttribute(attr.name)) {
    oldNode.removeAttribute(attr.name);
  }
});

See the Bitburner scripts repository.