diff --git a/PLUGINS.md b/PLUGINS.md index eee376c0..69f7934e 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -655,6 +655,10 @@ Content of `state` (updated to the current journal entry): | `ShipType` | `str` | Internal name for the current ship type | | `HullValue` | `int` | Current ship value, excluding modules | | `ModulesValue` | `int` | Value of the current ship's modules | +| `UnladenMass` | `float` | Unladen mass of current ship | +| `CargoCapacity` | `int` | Max cargo capacity of current ship | +| `MaxJumpRange` | `float` | Unladen jump range of current ship | +| `FuelCapacity` | `dict[str,float]` | Current max capacity of Main & Reserve tanks | | `Rebuy` | `int` | Current ship's rebuy cost | | `Modules` | `dict` | Currently fitted modules | | `NavRoute` | `dict` | Last plotted multi-hop route[1] | diff --git a/monitor.py b/monitor.py index 9323f71d..4fd3a86f 100644 --- a/monitor.py +++ b/monitor.py @@ -141,6 +141,10 @@ class EDLogs(FileSystemEventHandler): 'ShipType': None, 'HullValue': None, 'ModulesValue': None, + 'UnladenMass': None, + 'CargoCapacity': None, + 'MaxJumpRange': None, + 'FuelCapacity': None, 'Rebuy': None, 'Modules': None, 'CargoJSON': None, # The raw data from the last time cargo.json was read @@ -680,6 +684,12 @@ class EDLogs(FileSystemEventHandler): self.state['ShipType'] = self.canonicalise(entry['Ship']) self.state['HullValue'] = entry.get('HullValue') # not present on exiting Outfitting self.state['ModulesValue'] = entry.get('ModulesValue') # not present on exiting Outfitting + self.state['UnladenMass'] = entry.get('UnladenMass') + self.state['CargoCapacity'] = entry.get('CargoCapacity') + self.state['MaxJumpRange'] = entry.get('MaxJumpRange') + self.state['FuelCapacity'] = {} + self.state['FuelCapacity']['Main'] = entry.get('FuelCapacity')['Main'] + self.state['FuelCapacity']['Reserve'] = entry.get('FuelCapacity')['Reserve'] self.state['Rebuy'] = entry.get('Rebuy') # Remove spurious differences between initial Loadout event and subsequent self.state['Modules'] = {}