summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authorJulien Dessaux2023-05-24 23:03:19 +0200
committerJulien Dessaux2023-05-24 23:03:19 +0200
commit9963ab79b7c7392d5f87c98cd55953ffa004efd9 (patch)
treeefcd42cbe0f2614c863a05c77d797c7a4645b003 /main.js
parentImplemented a basic extraction loop (diff)
downloadspacetraders-9963ab79b7c7392d5f87c98cd55953ffa004efd9.tar.gz
spacetraders-9963ab79b7c7392d5f87c98cd55953ffa004efd9.tar.bz2
spacetraders-9963ab79b7c7392d5f87c98cd55953ffa004efd9.zip
Rewrote the api rate limiter with promises instead of callbacks
Diffstat (limited to '')
-rwxr-xr-xmain.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/main.js b/main.js
index 6be7931..e19a059 100755
--- a/main.js
+++ b/main.js
@@ -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();