loathers / autoscend

An ascension script for KoLMafia
Other
45 stars 70 forks source link

Refactor regex for boombox song count to handle April 1st word salad #1435

Closed gszliu closed 6 months ago

gszliu commented 6 months ago

Description

On April 1st, noncombat text gets randomly garbled with "salad". This results in You grab your boombox and select the soundtrack for your life, which you can do 11 more times today. turning into variants like Salad grab your boombox and select the salad for your life, which salad can do 11 salad times today.

autoscend can't determine song count which isn't very problematic since it selects a song anyway, but this error

> [WARNING] Could not find how many songs we have left...

could be avoided by making the matcher more flexible.

How Has This Been Tested?

Before:

use 1 SongBoom™ BoomBox
Preference lastEncounter changed from Enter the Boxing Daycare to Choose a Soundtrack
Encounter: Choose a Soundtrack
Preference boomBoxSong changed from Total Eclipse of Your Meat to 
Preference boomBoxSong changed from  to Total Eclipse of Your Meat
> [WARNING] Could not find how many songs we have left...
Took choice 1312/6: Silence
choice.php?whichchoice=1312&option=6
Preference boomBoxSong changed from Total Eclipse of Your Meat to 
Switching soundtrack off

After:

use 1 SongBoom™ BoomBox
Preference lastEncounter changed from demonic icebox to Choose a Soundtrack
Encounter: Choose a Soundtrack
Preference boomBoxSong changed from Eye of the Giger to 
Preference boomBoxSong changed from  to Eye of the Giger
Took choice 1312/2: "Food Vibrations"
choice.php?whichchoice=1312&option=2
Preference boomBoxSong changed from Eye of the Giger to Food Vibrations
Preference _boomBoxSongsLeft changed from 7 to 6
Setting soundtrack to Food Vibrations

Checklist:

Malibu-Stacey commented 6 months ago

We should just use _boomBoxSongsLeft but this is fine. Cheesecookie had a habit of writing reams of code just to support an IoTM for a few days earlier than mafia adding support and then never actually updating the code to use mafias (much more robust) support & this predates autoscend/sl_ascend.