Many new api calls
This commit is contained in:
parent
e52378e03f
commit
d79a4485a6
6 changed files with 75 additions and 8 deletions
15
lib/ships.js
15
lib/ships.js
|
@ -30,10 +30,21 @@ export async function dock(ctx) {
|
|||
return response;
|
||||
}
|
||||
|
||||
export async function jump(ctx) {
|
||||
const response = await api.send({endpoint: `/my/ships/${ctx.ship}/jump`, method: 'POST', payload: { systemSymbol: ctx.system }});
|
||||
await api.sleep(response.data.cooldown.remainingSeconds*1000);
|
||||
return response;
|
||||
}
|
||||
|
||||
export async function navigate(ctx) {
|
||||
const response = await api.send({endpoint: `/my/ships/${ctx.ship}/navigate`, method: 'POST', payload: { waypointSymbol: ctx.waypoint }});
|
||||
const delay = new Date(response.data.nav.route.arrival) - new Date();
|
||||
await api.sleep(delay);
|
||||
return response;
|
||||
}
|
||||
|
||||
export async function negotiate(ctx) {
|
||||
return await api.send({endpoint: `/my/ships/${ctx.ship}/negotiate/contract`, method: 'POST'});
|
||||
}
|
||||
|
||||
export async function orbit(ctx) {
|
||||
|
@ -58,3 +69,7 @@ export async function sell(ctx) {
|
|||
export async function ship(ctx) {
|
||||
return await api.send({endpoint: `/my/ships/${ctx.ship}`});
|
||||
}
|
||||
|
||||
export async function survey(ctx) {
|
||||
return await api.send({endpoint: `/my/ships/${ctx.ship}/survey`, method: 'POST'});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue