Becoming an Omnivore

Theraze

Active member
The npc_price function uses NPCStoreDatabase.contains, with validating that you can actually purchase it. As such, if npc_price(item) > 0 and you can't buy it... mafia needs to realize that shop isn't open yet. :) Make the mafia bug report with as much info as possible on the store and your conditions so they can fix it.
 

Donavin69

Member
Since I didn't have that code when I ran into the issue, it might be resolved now...I'll check on that (the item that I needed I had someone else buy for me at the time)

I've also noticed an issue with the Omni_limit being above the autoPriceBuyLimit, I'm adding some code for the next version to adjust the limit appropriately (you can either choose to let the default of autoBuyPriceLimit replace the value in Omni_Limit, or temporarily set the autoBuyPriceLimit to the value in Omni_Limit)
 

adeyke

Member
When I ran the script, it took a long time searching for prices. It might be worth removing all consumed items from consideration first and only then checking prices on the remainder.
 

Donavin69

Member
I like that idea, it will also reduce server hits. I've changed the code, so that it only checks prices for the items you haven't consumed. v0.9
 

Donavin69

Member
It appears that the new drinks aren't all listed in the 'all food/drinks' yet?

When Omnivore runs, it doesn't find that I am missing several of them yet...am I missing something? Or has the master data not been updated to include the new siphoned drinks?
 

Theraze

Active member
Appears that the issue is when fullness or inebriety isn't set yet on an item, it isn't considered to be a food or drink item. As per this:
Code:
		if ((i.fullness > 0) && (!contains_text(consumed, to_upper_case(to_string(i))))){
			food[foodcount]=i;
			foodcount=foodcount+1;
		}
		if ((i.inebriety > 0) && (!contains_text(consumed, to_upper_case(to_string(i)))))  { 
			booze[boozecount]=i;
			boozecount=boozecount+1;
		}
But that's mafia not having the information yet... if you're trying to do an override, say for siphoned drinks, just do something like this:
Code:
		if ((i.to_int() >= 5573 && i.to_int() <= 5638) && (!contains_text(consumed, to_upper_case(to_string(i)))))  { 
			booze[boozecount]=i;
			boozecount=boozecount+1;
		}
Boom, done. We know all those numbers are the siphon drinks, and we don't really know necessarily (since mafia doesn't know) much much inebriety they have, but it would work great as drink/overdrink code for the end of the day.
 

Veracity

Developer
Staff member
we don't really know necessarily (since mafia doesn't know) much much inebriety they have
I am under the impression that we have inebriety - and adventure gains and stat gains - for all the siphon drinks.

What info do you think is missing?
 

Theraze

Active member
I am under the impression that we have inebriety - and adventure gains and stat gains - for all the siphon drinks.

What info do you think is missing?

It appears that the new drinks aren't all listed in the 'all food/drinks' yet?

When Omnivore runs, it doesn't find that I am missing several of them yet...am I missing something? Or has the master data not been updated to include the new siphoned drinks?

Donavin reported that it's missing some drinks. He didn't specify which exactly, making it rather hard to guess. I was just pulling out the relevant part of his script which decides, using inebriety and fullness, which items are food and which are drinks.
 

lostcalpolydude

Developer
Staff member
PHP:
> ash for i from 5573 to 5638 print(to_item(i) + ": " + to_item(i).inebriety)
According to that little check, mafia knows that all of the drinks are 2 inebriety (as of 10936 at least).
 

cardern

Member
It seems like it is not finding everything- there are a few siphoned spirits that I haven't consumed yet that are still not showing up.
 

Theraze

Active member
Code:
		if(price > 0 || (food[cntr].quest && creatable_amount(food[cntr]) > 0))
Code:
		if(price > 0 || (booze[cntr].quest && creatable_amount(booze[cntr]) > 0))
Code:
			if(((price > 0) || (item_amount(food[cntr]) > 0) || (food[cntr].quest && creatable_amount(food[cntr]) > 0))
Code:
			if(((price > 0) || (item_amount(booze[cntr]) > 0) || (booze[cntr].quest && creatable_amount(booze[cntr]) > 0))
Basically, if it's a quest item, override the required price check. This lets AoJ omnivores try to consume forwards.
 

Attachments

  • omnivore.ash
    7 KB · Views: 71

EdFox

Member
Small update to fix a fuzzy matching warning. No other changes have been made.
 

Attachments

  • omnivore.ash
    7 KB · Views: 74

fronobulax

Developer
Staff member
Not sure if anyone wants to fix but...

Omnivore wanted to consume Happy Birthday Claude Cake. Character had never ascended so cake was not available in the gift shop. Script failed to realize that and stopped after it rather than skip it.

Have not done enough digging to decide whether the script or KoLmafia incorrectly believed the cake could be purchased. I'm (probably) running EdFox's version if it matters.

Thanks.
 

fronobulax

Developer
Staff member
circa r15139

omnivore fails with "ice stein is not an alcoholic beverage".

Have not investigated further.
 

Veracity

Developer
Staff member
Which is correct. Using it properly gives you drunkenness, but it does not go on your consumption history as booze.
 
Top