From fcbd9cf56c565bd5f7bfea5c683acb3aa88e568b Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 18 Mar 2024 01:16:01 +0100 Subject: [javascript] Implement the selling loop of the contracting automation --- nodejs/automation/contracting.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nodejs/automation/contracting.js') diff --git a/nodejs/automation/contracting.js b/nodejs/automation/contracting.js index 75bc96c..19183fb 100644 --- a/nodejs/automation/contracting.js +++ b/nodejs/automation/contracting.js @@ -1,4 +1,5 @@ import * as mining from './mining.js'; +import * as selling from './selling.js'; import * as dbContracts from '../database/contracts.js'; import * as dbShips from '../database/ships.js'; import * as api from '../lib/api.js'; @@ -43,7 +44,8 @@ async function runProcurement(contract, ships) { // Then it depends on where we are switch (ship.nav.waypointSymbol) { case asteroidSymbol: - let response = await mining.mineUntilFullOf({ + await mining.mineUntilFullOf({ + asteroidSymbol: asteroidSymbol, good: wantedCargo, symbol: ship.symbol }); @@ -59,6 +61,8 @@ async function runProcurement(contract, ships) { await libShips.navigate({symbol: ship.symbol, waypoint: asteroidSymbol}); break; default: + // we were either selling or started contracting + await selling.sell(ship, wantedCargo); await libShips.navigate({symbol: ship.symbol, waypoint: asteroidSymbol}); } } -- cgit v1.2.3