diff options
Diffstat (limited to '')
-rw-r--r-- | nodejs/automation/mining.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/nodejs/automation/mining.ts b/nodejs/automation/mining.ts index e1230fd..b9db7d4 100644 --- a/nodejs/automation/mining.ts +++ b/nodejs/automation/mining.ts @@ -20,12 +20,9 @@ export async function mineUntilFullOf(good: string, ship: Ship, asteroidSymbol: } } -// example ctx { symbol: 'ADYXAX-2' } -// extract the ship's cargo contents when more than 80% full then returns the ships cargo object async function mineUntilFull(ship: Ship): Promise<void> { - ship = dbShips.getShip(ship.symbol) as Ship; - while (ship.cargo.units <= ship.cargo.capacity * 0.9) { - ship.cargo = await libShips.extract(ship); + while (!libShips.isFull(ship)) { + await libShips.extract(ship); } } |