dj_d, are you still using this function in any of your scripts? Is anyone else out there using it? It turns out that there's a problem here - substat values will overflow the 32-bit integers that ASH currently uses at about 1/4 of the way through level 216. The Noblesse Oblige buffbot is less than 1500 turns away from hitting that limit, and there will undoubtedly be other buffbots and powerlevellers to follow. Possible fixes being considered include changing ASH to use 64-bit integers (which would have a performance impact), adding an alternate way to get substat values that avoids huge integers, and simply declaring that this function is unusable by extremely high-level characters. It would help to make an appropriate decision if I had any idea of how widely the substat-returning forms of my_basestat() are being used, and what exactly is being done with the returned values.