Skip to content

About

This plugin is meant to address the issue of transferring too much fuel or mass to foreign ships.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Planets.nu Ship Transfer Tracker

A userscript plugin for Planets.nu. It shows what a foreign ship will hold once this turn's transfers go through.

When one of your ships transfers cargo to a ship you don't own, the game's transfer screen only shows what this ship is sending. If several of your ships are transferring to the same target, or you want to know whether the target's hold will be full, you have to add it up yourself. This plugin does the adding for you.

What it does

On the ship-to-foreign-ship transfer screen, the plugin adds a yellow "Total" column to the right of the transfer column. For each cargo row (neutronium, duranium, tritanium, molybdenum, megacredits, supplies, clans, fighters/torpedoes) the column shows:

  • The cargo already on the target ship. This is only known when the target's owner shares full info with you, i.e. a full alliance in a game where allies share full info. If it isn't known, it's left out and the total gets a grey +? marker.
  • Plus this turn's transfers to the target from the ship on screen (using the live values as you edit them) and from all your other ships that are set to transfer to the same target.

You also get:

  • A cargo total row that sums the cargo-hold items (duranium, tritanium, molybdenum, supplies, clans, ammo). When the target's cargo is known, it also shows the hold size, e.g. 180 /200.
  • A header in line with the target ship's image showing the target hull's max cargo and fuel.
  • Hover breakdowns. Hover over any total to see where the number comes from: what's on the target, each of your ships transferring to it (with the current ship marked "this ship"), and the total.

The column refreshes every time you change something on the transfer screen. When it needs room, the plugin moves the transfer buttons to the right and widens the panel.

Installation

  1. Install a userscript manager such as Tampermonkey or Violentmonkey.
  2. Create a new script and paste in the contents of ShipTransferTracker.js, or open the file through your userscript manager to install it.
  3. Load (or reload) a game on planets.nu.

The script runs on planets.nu, play.planets.nu, test.planets.nu and mobile.planets.nu. It needs NU client version 3.0 or later. On older clients it logs a message to the console and does nothing.

Usage

  1. Select one of your ships that is at the same location as a ship you don't own.
  2. Open the transfer screen and choose the foreign ship as the target.
  3. Enter your transfer amounts. The yellow column shows the target's projected totals.

The plugin only reads data; it doesn't change your transfers or your orders.

Limitations

  • Only your own transfers are counted. Transfers that other players make to the target aren't visible to you.
  • The target's existing cargo is usually unknown. Unless the owner shares full info with you, the totals only cover what you're sending (hence +?).
  • Only ship-to-foreign-ship transfers get the column. Transfers to your own ships or to planets are left as they are.

How it works (for developers)

The script follows the standard NU plugin pattern. It injects a wrapper function into the page and registers itself with vgap.registerPlugin as shipTransferTrackerPlugin.

  • On processload, it wraps vgapTransferScreen.prototype.renderScreen (once) so that addTotalColumn runs after every render of the transfer screen.
  • incomingTransfers goes through vgap.myships and adds up the transfer* fields of every ship whose transfertargettype == 2 (ship) and transfertargetid matches the target. For the ship on screen it uses the screen's live values instead.
  • cargoKnown treats a target's cargo as known when you own it or when ship.fullinfo === true.
  • The cells are absolutely positioned on the transfer panel (vgap.more) and lined up with the game's rows, not inserted into them, so the game's own layout is left alone.

Changelog

  • 1.0 (2026-11-28): Initial release.

Author

sphere300

About

This plugin is meant to address the issue of transferring too much fuel or mass to foreign ships.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages