Maximizing and Simulating

me259259

Member
Short version of this question:

me259259 said:
How do I access _spec, when _spec is created using the maximize function?





Long version:

I have a question about the maximize function.

Code:
boolean maximize( string expression , boolean simulate )

I am writing a script to automatically dress me, based on a large number of factors. I had been using the maximize function (with "simulate" set to false), and then using numberic_modifier() to check the results. I don't want to hit the server that many times for what I plan to do in the near future. I know I have to set "simulate" to true, but how exactly do I access the numeric_modifier() data when everything is simulated? On the maximize() wiki page, it says:

Wiki said:
This function will set _spec so that it can be checked with numeric_modifier()

Here is what I tried so far (note, I tried this while wearing a birthday suit):

PHP:
maximize ("moxie", true) ;

print( numeric_modifier("_spec", "moxie")) ;

EDIT: 0.0 is printed. I have 407 moxie (I have no buffs active, or equipment... equipped). Here is the gCLI output:

Code:
Maximizing...
143 combinations checked, best score 998.00
0.0

If I try:

PHP:
cli_execute("whatif equip badass belt") ;

print( numeric_modifier("_spec", "moxie")) ;

Then 5.0 is printed. How do I access _spec, when _spec is created using the maximize function? Am I missing something really simple again?
 
Last edited:

Theraze

Active member
Looks like it does work, it's just a comparative check?
> ashq print_html( numeric_modifier("_spec", "moxie")) ;

0.0

> ashq maximize ("moxie", true); print_html( numeric_modifier("_spec", "moxie")) ;

Maximizing (1st time may take a while)...
884 combinations checked, best score 473.00
Visiting The Gnomish Micromicrobrewery...
Menu retrieved.
33.0

> ashq CLI_EXECUTE("maximize? moxie"); print_html( numeric_modifier("_spec", "moxie")) ;

Maximizing...
884 combinations checked, best score 473.00
33.0
But I'm on 369 moxie currently, and it gets up to 473 moxie, so +104 moxie. Weird.
 

Catch-22

Active member
Looks like you've uncovered quite a gotcha. What is happening is when you maximize moxie, the number printed to the CLI is your total moxie as a result of the outfit. When you return the numeric_modifier for "moxie" you're getting the "flat moxie increase" for the items that made up your maximized outfit. In reality, what you want is this:

PHP:
maximize( "Moxie", 0, 0, true );
print( my_basestat( $stat[Moxie] ) + ( ( numeric_modifier( "_spec", "Moxie percent" ) / 100 ) * my_basestat( $stat[Moxie] ) ) + numeric_modifier( "_spec", "Moxie" ) );

I hope by reading my example, you can understand what is happening and why you're getting unexpected results :)
 
Last edited:

me259259

Member
D'oh! Yep, that's exactly what I want. I should have known better. Thank you.


Edit:

Now that I think about it, is there a way to access _spec in a more in depth way? Is there a way to pull out the individual pieces of equipment that it has recommended?
 
Last edited:

Catch-22

Active member
Now that I think about it, is there a way to access _spec in a more in depth way? Is there a way to pull out the individual pieces of equipment that it has recommended?

I don't believe so, but it sounds like a nifty feature. Request it? :)
 

jasonharper

Developer
"buffed moxie" is the modifier name you want to use. It includes +Moxie, +Moxie%, equalizer potions, and anything else that might modify this stat.
 
Top