Results 1 to 7 of 7

Thread: Undefinded function with recent mafia builds

  1. #1
    Senior Member
    Join Date
    Sep 2006
    Posts
    368

    Default Undefinded function with recent mafia builds

    After upgrading to KoLmafia-19890 (from KoLmafia-19885), I was unable to run my daily script due the the error msg:

    Code:
    Function 'int_to_string( int )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (TPSDrink.ash, line 279)
    I tried again with KoLmafia-19891, but still no luck. Has that function been deleted? Checking the kolmafia wiki, it looks like I could/should replace it with the more generic function to_string( any ). Will int_to_string( int ) be returning? Or do I need to update my code?

    Thanks KoLmfia devs for all the work you do updating and maintaining KoLmafia. I couldn't bear to play KoL without it.

  2. #2

    Default

    Support for that super old style was removed in r19887. You can stay on r19886 if you like or, as you suggested, update to using to_string!

  3. #3
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,920

    Default

    There is no function named "int_to_string". There was code that noticed that such a function was not defined and stripped off everything in front of "to_string" and just returned to_string. That means you could have "boogers_to_string" and it would "work".

    I was in there rewriting how we look up functions, and that irritated me, so I removed the kludge. I was hoping that very few ancient scripts still used that. Apparently, there still are some.

    I suggest/request that you update your script. I don't want to reinstate the kludge.

    Sorry/Thank you.

  4. #4
    Senior Member
    Join Date
    Oct 2013
    Posts
    247

    Default

    So I guess that applies to "Function 'string_to_int( string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (auto_mushroom.ash, line 482)" as well.
    Looks like the mushroom plot script generator still uses that function. As for auto_mushroom, I'll just make local changes.

  5. #5
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,920

    Default

    By the way - the previous behavior hid a bug in my Spacegate script. It had this function:

    Code:
    typedef int army;
    
    string army_detected_to_string( army a )
    {
        return ( ( a & DETECTED ) == DETECTED ) ? "detected" : "not detected";
    }
    and one of the calls was:

    army__detected_to_string( p1_detected )

    Notice the two "_". That is a typo. There is no such function. Howver, because of the "compatibility" kludge, I ended up getting to_string( int ) - exactly what I did not want.

    I suppose an improved "campatibility" kludge would strip off the prefix only if it were "int_", "string_", and so on, which would not hide typos like that, but it seemed better, to my eye, to remove "temporary" kludges.

  6. #6
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,920

    Default

    So I guess that applies to "Function 'string_to_int( string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (auto_mushroom.ash, line 482)" as well.
    Originally Posted by fractalnavel View Post
    I just fixed auto_mushroom.ash. "svn update" will fix it.

    Looks like the mushroom plot script generator still uses that function.
    Whoah. KoLmafia sure has extensive internal support for your mushroom plot.
    I haven't actually owned one for 300 ascensions.

    I found the generated ASH script with the obsolete function. I'll fix MushroomManager to not do that.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  7. #7
    Senior Member
    Join Date
    Oct 2013
    Posts
    247

    Default

    I just fixed auto_mushroom.ash. "svn update" will fix it.
    Originally Posted by Veracity View Post
    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •