bitburner-official / bitburner-src

Bitburner source code.
Other
838 stars 273 forks source link

API: ns.singularity.getCurrentWork().completion (when grafting) returns an empty object. #1706

Closed alainbryden closed 1 month ago

alainbryden commented 1 month ago

When grafting an augmentation, ns.singularity.getCurrentWork() returns an object such as this:

{
  "type": "GRAFTING",
  "cyclesWorked": 3692,
  "augmentation": "Bionic Legs",
  "completion": {}
}

It looks like "completion" is just an empty object. I expected it to be e.g. a decimal between 0.0 and 1.0

It's also not terribly clear what "cyclesWorked" infers. An expert player might know that a cycle is 200ms, in which case a player can use this in combination with ns.grafting.getAugmentationGraftTime to infer the completion / time remaining, but that's quite a bit to infer.

All that said, an argument could be made that the ability to await ns.grafting.waitForOngoingGrafting(), as well as the progress that is automatically displayed on the HUD, makes it relatively low-priority to surface this information to the API.

d0sboots commented 1 month ago

I agree that the "completion" thing is weird. The ship has probably sailed on "cyclesWorked".