replace scheduler with round robin every x minutes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
module.exports = async (client, torn, config) => {
|
||||
console.debug("Task: Executing autoUpdateUpgrades");
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const renderer = require('../utils/UpgradeRenderer.js');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module.exports = async (client, torn, config) => {
|
||||
console.debug("Task: Executing noItemOC");
|
||||
|
||||
const fs = require('fs');
|
||||
const channel = client.channels.resolve(config.channels.ocAlert);
|
||||
const now = new Date();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module.exports = async (client, torn, config) => {
|
||||
console.debug("Task: Executing unavailableOC");
|
||||
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const fs = require('fs');
|
||||
const channel = client.channels.resolve(config.channels.ocAlert);
|
||||
@@ -41,6 +41,10 @@ module.exports = async (client, torn, config) => {
|
||||
let embed = new EmbedBuilder()
|
||||
.setTitle('Crime Availability Check')
|
||||
await torn.faction.crimes({ category: 'recruiting', offset: 0, sort: 'DESC' }).then(crimeList => {
|
||||
if (!crimeList) {
|
||||
console.error("unavailableOC: API returned no crimes.");
|
||||
return;
|
||||
}
|
||||
const data = { crimes: crimeList };
|
||||
data.crimes.forEach(crime => {
|
||||
crimes.difficulty[crime.difficulty - 1].count++
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
module.exports = async (client, torn, config) => {
|
||||
console.debug("Task: Executing unpaidOC");
|
||||
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const fs = require('fs');
|
||||
const channel = client.channels.resolve(config.channels.ocAlert);
|
||||
const now = new Date();
|
||||
const state = require('../state.json');
|
||||
let embeds = [];
|
||||
const data = { crimes: await torn.faction.crimes({ category: 'successful', from: now.getTime() / 1000 - 7 * 24 * 60 * 60, sort: 'DESC' }) };
|
||||
const crimesList = await torn.faction.crimes({ category: 'successful', from: now.getTime() / 1000 - 7 * 24 * 60 * 60, sort: 'DESC' });
|
||||
if (!crimesList) {
|
||||
console.error("unpaidOC: API returned no crimes.");
|
||||
return;
|
||||
}
|
||||
const data = { crimes: crimesList };
|
||||
for (const crime of data.crimes) {
|
||||
if (!crime.rewards.payout) {
|
||||
console.debug(`unpaidOC: Found unpaid crime: ${crime.name}:${crime.id}`);
|
||||
|
||||
Reference in New Issue
Block a user