dankgrinder 6.8.1 → 6.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/grinder.js +20 -29
- package/package.json +1 -1
package/lib/grinder.js
CHANGED
|
@@ -3015,7 +3015,8 @@ async function start(apiKey, apiUrl) {
|
|
|
3015
3015
|
}
|
|
3016
3016
|
|
|
3017
3017
|
const before = workers.length;
|
|
3018
|
-
workers
|
|
3018
|
+
// Keep ALL workers visible — never remove from array (user wants to see gaps)
|
|
3019
|
+
// Only clean up workerMap entries for accounts fully removed from API
|
|
3019
3020
|
if (workers.length !== before) scheduleRender();
|
|
3020
3021
|
} catch {}
|
|
3021
3022
|
}, 10_000);
|
|
@@ -3124,6 +3125,7 @@ function setupKeyboardShortcuts() {
|
|
|
3124
3125
|
|
|
3125
3126
|
// Ctrl+C or q = quit
|
|
3126
3127
|
if (k === '\u0003' || k === 'q') {
|
|
3128
|
+
process.stdout.write(c.show);
|
|
3127
3129
|
console.log(`\n\n ${c.yellow}Shutting down gracefully...${c.reset}`);
|
|
3128
3130
|
process.emit('SIGINT');
|
|
3129
3131
|
return;
|
|
@@ -3131,51 +3133,40 @@ function setupKeyboardShortcuts() {
|
|
|
3131
3133
|
|
|
3132
3134
|
// p = pause all accounts
|
|
3133
3135
|
if (k === 'p') {
|
|
3134
|
-
let
|
|
3135
|
-
workers.forEach(w => { if (w.running && !w.paused) { w.paused = true;
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
console.log(` ${rgb(139, 92, 246)}╰${c.reset}${c.dim}${'─'.repeat(40)}${c.reset}${rgb(139, 92, 246)}╯${c.reset}`);
|
|
3136
|
+
let count = 0;
|
|
3137
|
+
workers.forEach(w => { if (w.running && !w.paused) { w.paused = true; count++; } });
|
|
3138
|
+
recentLogs.push(`>> PAUSED ${count} accounts (press R to resume)`);
|
|
3139
|
+
scheduleRender();
|
|
3139
3140
|
return;
|
|
3140
3141
|
}
|
|
3141
3142
|
|
|
3142
3143
|
// r = resume all accounts
|
|
3143
3144
|
if (k === 'r') {
|
|
3144
|
-
let
|
|
3145
|
-
workers.forEach(w => { if (w.paused) { w.paused = false;
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
console.log(` ${rgb(139, 92, 246)}╰${c.reset}${c.dim}${'─'.repeat(40)}${c.reset}${rgb(139, 92, 246)}╯${c.reset}`);
|
|
3145
|
+
let count = 0;
|
|
3146
|
+
workers.forEach(w => { if (w.paused) { w.paused = false; count++; } });
|
|
3147
|
+
recentLogs.push(`>> RESUMED ${count} accounts`);
|
|
3148
|
+
scheduleRender();
|
|
3149
3149
|
return;
|
|
3150
3150
|
}
|
|
3151
3151
|
|
|
3152
|
-
// s = show status summary
|
|
3152
|
+
// s = show status summary (pushed to log feed)
|
|
3153
3153
|
if (k === 's') {
|
|
3154
3154
|
const active = workers.filter(w => w.running && !w.paused).length;
|
|
3155
3155
|
const paused = workers.filter(w => w.paused).length;
|
|
3156
|
-
const
|
|
3156
|
+
const invalid = workers.filter(w => w._tokenInvalid).length;
|
|
3157
|
+
const offline = workers.filter(w => !w.running && !w._tokenInvalid).length;
|
|
3157
3158
|
const recovering = workers.filter(w => w._recoveryAttempts > 0 && w._errorCooldownUntil > Date.now()).length;
|
|
3158
3159
|
const totalEarn = workers.reduce((s, w) => s + (w.stats.coins || 0), 0);
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
console.log(` ${rgb(139, 92, 246)}║${c.reset} ${c.green}● ${active} active${c.reset} ${c.yellow}⏸ ${paused} paused${c.reset} ${c.red}○ ${offline} offline${c.reset} ${c.yellow}↻ ${recovering} recovering${c.reset} ${rgb(139, 92, 246)}║${c.reset}`);
|
|
3163
|
-
console.log(` ${rgb(139, 92, 246)}║${c.reset} ${c.dim}Total earnings:${c.reset} ${rgb(52, 211, 153)}⏣ ${totalEarn.toLocaleString()}${c.reset} ${rgb(139, 92, 246)}║${c.reset}`);
|
|
3164
|
-
console.log(` ${rgb(139, 92, 246)}╚${c.reset}${c.dim}${'═'.repeat(50)}${c.reset}${rgb(139, 92, 246)}╝${c.reset}`);
|
|
3160
|
+
recentLogs.push(`>> STATUS: ${active} active, ${paused} paused, ${invalid} invalid, ${offline} offline, ${recovering} recovering`);
|
|
3161
|
+
recentLogs.push(`>> EARNINGS: +${formatCoins(totalEarn)} this session | BALANCE: ${formatCoins(totalBalance)}`);
|
|
3162
|
+
scheduleRender();
|
|
3165
3163
|
return;
|
|
3166
3164
|
}
|
|
3167
3165
|
|
|
3168
|
-
// ? = show help
|
|
3166
|
+
// ? or h = show help
|
|
3169
3167
|
if (k === '?' || k === 'h') {
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
console.log(` ${rgb(139, 92, 246)}╠${c.reset}${c.dim}${'═'.repeat(50)}${c.reset}${rgb(139, 92, 246)}╣${c.reset}`);
|
|
3173
|
-
console.log(` ${rgb(139, 92, 246)}║${c.reset} ${c.white}p${c.reset} Pause all accounts ${rgb(139, 92, 246)}║${c.reset}`);
|
|
3174
|
-
console.log(` ${rgb(139, 92, 246)}║${c.reset} ${c.white}r${c.reset} Resume all accounts ${rgb(139, 92, 246)}║${c.reset}`);
|
|
3175
|
-
console.log(` ${rgb(139, 92, 246)}║${c.reset} ${c.white}s${c.reset} Show status summary ${rgb(139, 92, 246)}║${c.reset}`);
|
|
3176
|
-
console.log(` ${rgb(139, 92, 246)}║${c.reset} ${c.white}q${c.reset} Quit gracefully ${rgb(139, 92, 246)}║${c.reset}`);
|
|
3177
|
-
console.log(` ${rgb(139, 92, 246)}║${c.reset} ${c.white}?${c.reset} Show this help ${rgb(139, 92, 246)}║${c.reset}`);
|
|
3178
|
-
console.log(` ${rgb(139, 92, 246)}╚${c.reset}${c.dim}${'═'.repeat(50)}${c.reset}${rgb(139, 92, 246)}╝${c.reset}`);
|
|
3168
|
+
recentLogs.push('>> SHORTCUTS: P=pause R=resume S=status Q=quit ?=help');
|
|
3169
|
+
scheduleRender();
|
|
3179
3170
|
return;
|
|
3180
3171
|
}
|
|
3181
3172
|
});
|