Winterbay
Active member
Sushi 2.3
This script tries to look over your sushi-eating options and make the bets choices based on a given meat-per-adventure. It can be used directly or imported into another script as described further down. In order to get the script to your Mafia installation type the following command into the CLI and press enter:
In order to make sure the script is always up to date you can turn on the "Update installed SVN projects on login" in the Preferences (found at the bottom under General for now).
Requires zlib.
Features:
How to use:
Prints out a pretty list of all sushis, their total cost, turns of fishy given and average adventures gained from it.
Fills you up with the best sushi (up to your max fullness). Yay for userfriendliness!
If you set sushi_onhand to true this will only eat things you can make from your inventory.
Returns the cost of all sushis that contains name. Can also be called with an added boolean if you just want the one name (must be exact then).
A useful alias for this is:
Returns a record containing the sushi that gives the highest profit together with turns of fishy gained and which type of booze (if any) to drink it with.
Eats amount of sushi and drinks booze first. Booze can be:
This function is overloaded for easier use:
I think that's it. Comments and bug reports are more than welcome
Version history:
v1.0 - First release
v1.2 - Added two overloaded functions for eat_sushi so that you do not need to specify all information unless so wanted (Thanks bale!). Also added a prettier output of the table of results (Shamelessly stolen from one of the TP-scripts and adapted).
v1.3 - Fixed a bug that would stop you from eating sushi if you were at maximum inebriety
v1.4 - Fixed a very small bug in the version check, it pointed to the wrong thread (and also borrowed some code form zlib).
v1.5 - Fixed (for real) the bug with eating at full inebriety. Also circumvented potential prolems with CLI-execute returning false while it should've returned true (I hope).
v1.6 - Include zlib, change check-version to zlib's version, add two zlib settings (sushi_debug for debug printing and sushi_askme for asking to stop if you have no mat). Only include anything above basic meat if you have a mat.
v1.7 - Include basic support for fish juice boxes, fix printing of stuff if you have no mat,fix sorting of sushi to use the correct sorted sushi and not the latest one, also refactor some code to be more pleasing and add a new zlib setting, sushi_fish_juice_multiplier, indicating how to value a fish juice box, default 8
v1.8: - Make sure that eat_sushi fills you up and make main take an integer. If this integer is -1 print out costs of all sushis, otherwise fill you up on the best possible sushi.
v1.9: - Incorporate Garbled's (Thanks!) code for only eating things you have on hand. This is controlled by a new zlib-setting, sushi_onhand which if set to true will make you only eat things you can make from inventory
v2.0: - Fix for upcoming changes to script parsing, i.e. sloppy code...
v2.1: - to_item($item) is a completely useless conversion. Don't use that...
v2.2: - Add Bento Boxes and Sushi Doilies to the things to take into consideration (uses bento boxes if available, but won't buy for itself). Also remove version checking as the script is now handled via SVN.
v2.3: - Set autoBuyPriceLimit to either the max price of an ingredient or autoBuyPriceLimit so that we don't crash if an ingredient is expensive
Don't abort if the script decides that "no booze" is the correct option
This script tries to look over your sushi-eating options and make the bets choices based on a given meat-per-adventure. It can be used directly or imported into another script as described further down. In order to get the script to your Mafia installation type the following command into the CLI and press enter:
Code:
svn checkout https://svn.code.sf.net/p/winterbay-mafia/sushi/code/
In order to make sure the script is always up to date you can turn on the "Update installed SVN projects on login" in the Preferences (found at the bottom under General for now).
Requires zlib.
Features:
- Given a value_of_adventure, goes through all potential sushis (including simple fish meat) with and without the two sake versions and sorts by potential profit.
- Can use this information to eat that same sushi. It then eats as many of it as possible.
- Given a name of a sushi, or part of a name, returns the total cost for it.
- Sets two boolean zlib-variables at first run, sushi_debug for some debug-printing and sushi_askme which if set to true will pop a question if you try to call it to eat without having a sushi rolling mat.
- Also sets an integer zlib-variable, sushi_fish_juice_multiplier, which controls the relative value of fish juice boxes, defaults to 8
How to use:
Code:
sushi -1
Code:
sushi value_of_adventure
If you set sushi_onhand to true this will only eat things you can make from your inventory.
Code:
ash import <sushi.ash>; cost_of_sushi(string name)
A useful alias for this is:
Code:
sushicost => ash import <sushi.ash>; cost_of_sushi($string[%%]);
Code:
ash import <sushi.ash>; test_sushi(int value_of_adventure)
Code:
ash import <sushi.ash>; eat_sushi(int amount, int value_of_adventure, string booze)
- infused sake
- sake
- no booze (or basically any other string)
This function is overloaded for easier use:
Code:
eat_sushi(int amount,int value_of_adventure) //Eats the specified amount of the best kind of sushi
eat_sushi(int value_of_adventure) //Fills you up with the best kind of sushi
I think that's it. Comments and bug reports are more than welcome
Version history:
v1.0 - First release
v1.2 - Added two overloaded functions for eat_sushi so that you do not need to specify all information unless so wanted (Thanks bale!). Also added a prettier output of the table of results (Shamelessly stolen from one of the TP-scripts and adapted).
v1.3 - Fixed a bug that would stop you from eating sushi if you were at maximum inebriety
v1.4 - Fixed a very small bug in the version check, it pointed to the wrong thread (and also borrowed some code form zlib).
v1.5 - Fixed (for real) the bug with eating at full inebriety. Also circumvented potential prolems with CLI-execute returning false while it should've returned true (I hope).
v1.6 - Include zlib, change check-version to zlib's version, add two zlib settings (sushi_debug for debug printing and sushi_askme for asking to stop if you have no mat). Only include anything above basic meat if you have a mat.
v1.7 - Include basic support for fish juice boxes, fix printing of stuff if you have no mat,fix sorting of sushi to use the correct sorted sushi and not the latest one, also refactor some code to be more pleasing and add a new zlib setting, sushi_fish_juice_multiplier, indicating how to value a fish juice box, default 8
v1.8: - Make sure that eat_sushi fills you up and make main take an integer. If this integer is -1 print out costs of all sushis, otherwise fill you up on the best possible sushi.
v1.9: - Incorporate Garbled's (Thanks!) code for only eating things you have on hand. This is controlled by a new zlib-setting, sushi_onhand which if set to true will make you only eat things you can make from inventory
v2.0: - Fix for upcoming changes to script parsing, i.e. sloppy code...
v2.1: - to_item($item) is a completely useless conversion. Don't use that...
v2.2: - Add Bento Boxes and Sushi Doilies to the things to take into consideration (uses bento boxes if available, but won't buy for itself). Also remove version checking as the script is now handled via SVN.
v2.3: - Set autoBuyPriceLimit to either the max price of an ingredient or autoBuyPriceLimit so that we don't crash if an ingredient is expensive
Don't abort if the script decides that "no booze" is the correct option
Last edited: