Best sushi for profit

I guess it depends how technical you want to get with it. On a complexity scale of 1 to EatDrink.ash I know which end I'd choose :P. When I run this script I expect to get a reliable number of turns of fishy for a good price. It's not going to worry me if the script isn't perfectly optimal, as long as I have more or less as many turns of fishy as I was expecting to get and as long as I didn't spend too much meat. Obviously that's just a personal insight, other people may use the script completely differently.
 
That sounds about right. I'll have to look at that some more when I get some time over (moving houses really eats up your time).
Also, on of my favorite quotes is: "There is nothing that is so simple, that you can't make it more complicated if you try"
 
I played about with this a little today. It kept trying to make melon-infused sake, but I didn't have the ingredients to do so. I had berry-infused sake in my inventory, but it refused to drink that.
 
Could have been because it decided that melon-infused sake was better than berry-infused sake, as you might make more meat from buying the melon-infused and selling the berry-infused.
 
The script currently ignores everything you have in your inventory and goes on mallprices only, so if one sake is cheaper in the mall than another it will use that even if you have another, of similar quality, in your inventory already.
 
I'm also having trouble figuring out how to call it. If I want to eat to maximum fullness with it, at 1000mpa, how do I call it? When I just specify 1000mpa, it just eats one sushi.
 
Something like this should work in a script that imports sushi.ash.
Code:
sorted_sushis best_sushi;
best_sushi = test_sushi(1000);
eat_sushi((fullness_limit()-current_fullness())/best_sushi.fullness, 1000);

or as a CLI-command:
Code:
ash import sushi.ash; sorted_sushis best_sushi; best_sushi = test_sushi(1000); eat_sushi((fullness_limit()-current_fullness())/best_sushi.fullness, 1000);
 
I'm also having trouble figuring out how to call it. If I want to eat to maximum fullness with it, at 1000mpa, how do I call it? When I just specify 1000mpa, it just eats one sushi.

LoL! The script works great, but it is definitely not user friendly.
 
I should perhaps make a friendly function that just fills you up with Sushi... Also, I should look into getting fish juice boxes supported properly as well.

Edit: It's been a while since I looked at the script. It should be enough to call:
Code:
ash import sushi.ash; eat_sushi(1000);

Which should eat as many sushis as you can (assuming that each sushi you eat has a 3-fullness). I've updated the script locally to do exactly what I posted above when calling that function in case 3 is not the fullness of your choosen sushi.
 
Last edited:
Actually: Version 1.8 released which makes the script easier to use for casual usage. If you call the script and specify any other number than -1 it'll fill you right up. If you specify -1 it'll print the same list it did before when called without an argument. Also includes the abovementioned fix for eat_sushi().
 
I was calling sushi from a script today, and had it fill me up, and it failed. It decided to make 5 slick maki I think, and I only had 4 white rice, so it punted and did nothing. I'm thinking maybe eat_sushi needs to happen in some kind of loop, where it re-evaluates your inventory after making each item?
 
Hmmm... Do you have any cli-output or log-output that you can post? Also, is Mafia allowed to buy from the mall at will?
 
Hrmm.. no.. I don't have mafia setup to allow mallbuying at will. I prefer to farm my daily food as part of my activities. So I guess that I would typically encounter a scenario where I only have X rice, Y seaweed, N salt, etc. What seems to happen, is it calculates that the best sushi it can make is, say, salty slick maki, but I only have enough ingredients for 1, then I call it to fill me up to max fullness with sorted_sushis.best, and it tries to make 5. In an ideal world, it would either calculate quantity in total up front, or loop, re-calculating best on each iteration.

Unfortunately, my logs don't really show anything.. If it happens again, I'll grab the cli output, but basically, it tried to make 5 of something, and I only had 4 rice on hand.
 
Well, if you don't allow purchases from the mall then there's the problem :)
The script is currently designed around that presumption and will gladly fail trying to buy things it can't. It could perhaps detect if it's allowed to buy from the mall and if not see what it can do with what it has, but that is a whole new level of complexity I'm not sure my programming skills are up to.
 
Version 1.9 released which incorporates Garbled's code for only eating things you can make from inventory. Enjoy :)
 
Version 2.0 released that fixes the small compile warning that recently showed up due to a missing return value.
 
Version 2.1 released to fix usage of to_item($item) which no longer works and which was a stupid thing to use from the beginning anyway...
 
Hey there, new sea content has me checking out this script for the first time and its very impressive. Good stuff! :)

One small issue I'm having is that if you run eat_sushi(amount,value_of_adventure) you always get the warning about not having a sushi mat, even if you have one installed in your campground. If you click through the warning it subsequently recognises and uses the mat, so its not a big problem.

Another issue that was completely my own fault - I got confused by the amount variable, thinking it represented fullness rather than number of sushis, so the script bought me ingredients for way more sushi than I could eat.
 
Last edited:
Thanks for the feedback. The first I shall have a look at and for the second I guess that might actually be more useful in some way. I'll think about it.
 
Back
Top