TychoTheTaco / Twitch-Drops-Bot

A Node.js bot that will automatically watch Twitch streams and claim drop rewards.
MIT License
279 stars 36 forks source link

[Feature Request] Priority games queue #6

Closed agret closed 3 years ago

agret commented 3 years ago

games[] field currently instructs the app to only idle those games and ignore all others. Would not mind idling other games when none of my preferred games are available. Could probably just re-use the same games[] field but have a new config option for idling other games. Not sure if the current games[] field operates in a priority order or not though.

Needs some internal logic in the app:

Some games will only have a few twitch drop sessions a week from developer streams/update previews that last 2-3hrs so it is important to try and catch those.

TychoTheTaco commented 3 years ago

This is a bit outside of the scope that I intended for this project, so I'm not sure yet if I'll implement this. That being said, if anyone wants to work on it and open a pull request I would be happy to add it.

agret commented 3 years ago

I see your recent https://github.com/TychoTheTaco/Twitch-Drops-Bot/commit/ded7f78b05124b73ce4308a745e3f757aa6df49a commit adds this

Is it possible to tweak it slightly so we can have the list of preferred games but once those are completed it just moves onto doing non-listed ones? Another config variable or command line flag.

I have noticed recently some publisher/developer are running Twitch campaign that are only valid for 1hr on their particular stream, i'm not sure how you would detect that (I think on the drops page it might be able to detect campaigns with only one official account listed?) but might be worth investigating as I miss those drops while idling those week long 6hr drop campaigns. I have also had the Warframe stream detect as 'no progress made' and had the official stream ignored by the app but then on Twitch website the progress does update just very delayed. Maybe we need some way to specify the 'official' account for each game in games.csv or automatically from the drop campaign page and that bypasses the progress detection blacklist.

TychoTheTaco commented 3 years ago

That commit was supposed to fix the issue you mentioned (the app gets stuck watching a week long drop when there is a shorter, limited one available). Although that currently works on a per-game basis not on a per-campaign basis. If a game has multiple campaigns active, the app will work on them in order of which one ends first.

Yes, I can add another option to watch unlisted games.

The progress detection is a bit tricky. As you noticed, the progress is sometimes delayed on Twitch which sometimes makes the app skip a stream when we didn't have to. I've noticed that this happens more often after switching games. But we can't skip the progress check either because then we might be wasting time watching a stream that isn't giving us any progress (this can happen if the steam ends or we lose connection, etc.). I could maybe increase the time between progress checks which should reduce the chance of skipping streams for no reason.

agret commented 3 years ago

--watch_unlisted_games doesn't function fully

M:\Development\Twitch-Drops-Bot>node index.js --config config_idle.json --watch_unlisted_games [2021-09-13 22:25:52] [info] Loading config file: config_idle.json [2021-09-13 22:25:53] [info] Restoring cookies from last session. [2021-09-13 22:25:53] [info] Logged in as agret [2021-09-13 22:25:53] [info] Updating drop campaigns... [2021-09-13 22:25:54] [info] Found 46 active campaigns. [2021-09-13 22:25:54] [info] Found 4 pending campaigns. [2021-09-13 22:25:54] [info] 0) Don't Starve Together Don't Starve Together - Skittersquid Helm [2021-09-13 22:25:54] [info] 1) No Man's Sky Cartographers - Day 4 [2021-09-13 22:25:54] [info] 2) Knockout City KO City Season 2, Week 7 [2021-09-13 22:25:54] [info] 3) Knockout City Official KO City S2W7 [2021-09-13 22:25:54] [info] Processing campaign: Don't Starve Together Don't Starve Together - Skittersquid Helm [2021-09-13 22:25:54] [info] Drop: Skittersquid Helm - Icon [2021-09-13 22:25:56] [info] Drop already claimed [2021-09-13 22:25:56] [info] Drop: Skittersquid Portrait [2021-09-13 22:25:58] [info] Drop already claimed [2021-09-13 22:25:58] [info] Drop: Skittersquid Helm [2021-09-13 22:25:59] [info] Drop already claimed [2021-09-13 22:25:59] [info] Processing campaign: No Man's Sky Cartographers - Day 4 [2021-09-13 22:25:59] [info] Drop: -null- Figurine [2021-09-13 22:26:01] [info] Drop already claimed [2021-09-13 22:26:01] [info] Drop: Nada Decal [2021-09-13 22:26:02] [info] Drop already claimed [2021-09-13 22:26:02] [info] Drop: Iteration: Selene Visage [2021-09-13 22:26:04] [info] Drop already claimed [2021-09-13 22:26:04] [info] Drop: G.Oestridinzeus Companion [2021-09-13 22:26:05] [info] Drop already claimed [2021-09-13 22:26:05] [info] Drop: A-Class Explorer [2021-09-13 22:26:07] [info] Drop already claimed [2021-09-13 22:26:07] [info] Processing campaign: Knockout City KO City Season 2, Week 7 [2021-09-13 22:26:07] [info] Drop: Grenade-ade Energy Drink [2021-09-13 22:26:09] [info] Drop already claimed [2021-09-13 22:26:09] [info] Drop: 50 Holobux [2021-09-13 22:26:11] [info] Drop already claimed [2021-09-13 22:26:11] [info] Drop: 2-Pack Coconut Crash [2021-09-13 22:26:13] [info] Drop already claimed [2021-09-13 22:26:13] [info] Drop: 3 Style Chips [2021-09-13 22:26:14] [info] Drop already claimed [2021-09-13 22:26:14] [info] Drop: 4-Pack Dizzy Fizzy [2021-09-13 22:26:16] [info] Drop already claimed [2021-09-13 22:26:16] [info] Drop: 6-Pack Orange Overcharge [2021-09-13 22:26:17] [info] Drop already claimed [2021-09-13 22:26:17] [info] Drop: 50 Power Crystals [2021-09-13 22:26:19] [info] Drop already claimed [2021-09-13 22:26:19] [info] Processing campaign: Knockout City Official KO City S2W7 [2021-09-13 22:26:19] [info] Drop: 1 Style Chip [2021-09-13 22:26:22] [info] Found 0 active streams [2021-09-13 22:26:22] [info] No streams! [2021-09-13 22:26:22] [info] Sleeping for 15 minutes...

It just loops sleeping state rather than idling one of the unlisted games from my config. I'm guessing as-is it will have to complete all of the campaigns before it looks for other games?

TychoTheTaco commented 3 years ago

Actually there was an issue with the argument parsing so it ignored it but that should be fixed now. (its also been renamed to --watch-unlisted-games to be consistent with the rest of the arguments)