Bug - Not A Bug r28432 seems to have made "rng" a reserved word and that breaks BatBrain

Magus_Prime

Well-known member
As it says in the title: r28432 seems to have made "rng" a reserved word and that breaks BatBrain.

Reserved word 'rng' cannot be a variable name (BatBrain.ash, line 427, char 12 to char 15)
Type given but not used to declare anything (BatBrain.ash, line 429, char 7 to char 11)
Expected numeric value, found reset (BatBrain.ash, line 429, char 11 to char 16)
Expected ;, found reset (BatBrain.ash, line 429, char 11 to char 16)
Function 'reset( string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (BatBrain.ash, line 429, char 11 to char 16)
Consult script 'SimpleSmack.ash' not found.
You're on your own, partner.
Click here to continue in the relay browser.

This is a major breaking change, at least for anyone who uses BatBrain. Sigh.
 
Solution is to fix BatBrain. Here is your new line 427-430

Code:
   matcher rng_matcher = create_matcher("\\{.+?,(.+?),.+?}","");
   string deranged(string sane) {
      rng_matcher.reset(sane);
      while (rng_matcher.find()) sane = sane.replace_string(rng_matcher.group(0),rng_matcher.group(1));
 
Going to mark as "Not a Bug" for now, if Ryo wants to work out a way to do backwards-compat then he can edit further!
 
Sorry, I forgot to check scripts this time. My apologies for the breakage.

Last time (with modifiers), I filed PRs to affected scripts. I think that is what you will have to do this time as well.
 
Back
Top