diff options
author | Julien Dessaux | 2023-05-24 23:03:19 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-05-24 23:03:19 +0200 |
commit | 9963ab79b7c7392d5f87c98cd55953ffa004efd9 (patch) | |
tree | efcd42cbe0f2614c863a05c77d797c7a4645b003 /main.js | |
parent | Implemented a basic extraction loop (diff) | |
download | spacetraders-9963ab79b7c7392d5f87c98cd55953ffa004efd9.tar.gz spacetraders-9963ab79b7c7392d5f87c98cd55953ffa004efd9.tar.bz2 spacetraders-9963ab79b7c7392d5f87c98cd55953ffa004efd9.zip |
Rewrote the api rate limiter with promises instead of callbacks
Diffstat (limited to 'main.js')
-rwxr-xr-x | main.js | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,6 +1,7 @@ import * as agent from './lib/agent.js'; import * as api from './lib/api.js'; import * as ships from './lib/ships.js'; +import * as systems from './lib/systems.js'; function usage() { console.log(`contracts\t\t\tList all of your contracts. @@ -72,11 +73,11 @@ default: case 'sell': ships.sell({ship: process.argv[3], good: process.argv[4], units: process.argv[5]}); break; - case 'shipyard': - api.send({endpoint: `/systems/${process.argv[3]}/waypoints/${process.argv[4]}/shipyard`}); + case 'asteroids': + api.debugLog(await systems.type({symbol: process.argv[3], type: 'ASTEROID_FIELD'})); break; - case 'waypoints': - api.send({endpoint: `/systems/${process.argv[3]}/waypoints?limit=20&page=1`}); + case 'shipyards': + api.debugLog(await systems.trait({symbol: process.argv[3], trait: 'SHIPYARD'})); break; default: usage(); |