maybe this option is better?
AutoQuestComplete.plugin.js
const randomInterval = Math.floor(Math.random() * 4) + 6;
const timestamp = secondsDone + remain;
try {
const response = await api.post({ url: /quests/${quest.id}/video-progress, body: { timestamp: Math.min(secondsNeeded, timestamp) } });
isFinished = response.body.completed_at != null;
secondsDone = Math.min(secondsNeeded, timestamp);
Logger.info(this._config.info.name, Video progress: ${secondsDone}/${secondsNeeded} sec.);
} catch (err) {
Logger.error(this._config.info.name, "Error sending video progress, retrying in 5s...", err);
await new Promise(resolve => setTimeout(resolve, 5000));
continue;
}
if (timestamp >= secondsNeeded || isFinished) {
break;
}
catch (err)
variables inside onConfirm have been replaced with err.message and err.stack
maybe this option is better?
AutoQuestComplete.plugin.js
const randomInterval = Math.floor(Math.random() * 4) + 6;
const timestamp = secondsDone + remain;
try {
const response = await api.post({ url:
/quests/${quest.id}/video-progress, body: { timestamp: Math.min(secondsNeeded, timestamp) } });isFinished = response.body.completed_at != null;
secondsDone = Math.min(secondsNeeded, timestamp);
Logger.info(this._config.info.name,
Video progress: ${secondsDone}/${secondsNeeded} sec.);} catch (err) {
Logger.error(this._config.info.name, "Error sending video progress, retrying in 5s...", err);
await new Promise(resolve => setTimeout(resolve, 5000));
continue;
}
if (timestamp >= secondsNeeded || isFinished) {
break;
}
catch (err)
variables inside onConfirm have been replaced with err.message and err.stack