How do I know the substat effect of eat(item)?

dj_d

Member
I want to measure the results of the eat(item) function - basically, find out how many subpoints, adventures, etc I gained. Adventures is easy, as I can just look before and after. But I don't know how to check stat #s with subpoint precision, so that doesn't work for subpoints. And I don't know how to capture the results text so I can parse it.

Any ideas?
 

jasonharper

Developer
That seems an odd oversight... In r6544, you'll be able to use my_basestat($stat[SubMuscle]) (and the other two obvious variations) to get the total substats, which you can compare before & after values to determine your exact gains.

There is no way to capture the text output of commands, by design; that would allow unlimited mall searching from scripts.
 

dj_d

Member
Thanks Jason! I added it to my script. Now I just have to get the build. :)

By the way, does that express your entire stat in subpoints, or just give you the subpoint fraction above the most recent point? If the latter, it's going to be extremely tricky since each point consists of a variable number of subpoints, so you could go from 58 subpoints to 2 and not know how many you gained without doing some tricky math.
 

jasonharper

Developer
[quote author=dj_d link=topic=2036.msg10049#msg10049 date=1227938004]does that express your entire stat in subpoints[/quote]
Yes - as you point out, it would be rather difficult to use otherwise. If someone really needs to know the number of substats past the last full point, they can subtract the square of the base stat.
 

jasonharper

Developer
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.
 

StormCrow42

Member
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.

The substat usage of the function is used in EatDrink.ash
 

dj_d

Member
Didn't see this until now (feel free to PM me for direct questions as I can't figure out how to check my active threads for replies!). Yes, eatdrink does make use of this. I find it very handy but it's not essential (it allows you to accurately judge the results of your diet, and theoretically to autospade foods, although this functionality is off by default). Bummer about NO's bot breaking - I was reading that thread with interest, didn't make the connection at the time.
 
Top