Profit from Effects (Penultimate version)
[size=+2]Profit_FX 1.65[/size]
[SIZE=-1]Profit_FX requires ZLib, revision 8356 or newer (profit_fx-old only requires 7915), and some intuition as to how to use it.[/SIZE]
I began this as a side-project with the idea that it'd eventually be incorporated into aqualectrix's PriceAdvisor script. Moved it away from that thread to stop wasting space and threadjacking and whatnot.
Basically, it's a modification of zarqon's profit.ash , except a lot of additional features:
This script requires ZLib.ash and revision 8014 or later. Just put this script in your scripts folder, and after importing it, you can use it in your scripts by calling the following function:
float meat_gain(location place, string itm).
Other possible site of interest: as of version 1.3, it now generates this following map upon execution:
drop[key].ct[i,m], where:
key is an item that is a possible drop from this zone,
i is an integer that allows Mafia to differentiate between multiple instances of the item,
m is the monster from which the item drops, which is used for olfaction and combat rate modifying purposes,
and the float yielded (drop[key].ct[i,m]) is the expected increase in drops of that item from using this additional item.
Also, another new variable as of 1.3: tot_meetz, the expected increase in raw meat from using this item, then adventuring at a specified location.
As of 1.55: Supports effects gained from resting (sort of). Just pass "rest" as the second parameter. Also, passing an empty string ("") as the second parameter now returns your estimated current MPA.
The only visible output if verbosity < 3 that this script produces tells the user which monster in this zone would be most profitable to olfact (verbosity = 2).
Notes: The function requests a string instead of an item to accommodate for cases such as sushi. Demon summoning is supported to an extent -- put the effect name instead of the item name. Finally, it does not support pickpocketing -- drop rates for PP-only items aren't even spaded out, are they?
This should not be the final version, because of unforeseen bugs that need squashing and additions that I feel like making. Automatically updates map files, which I'll upload as items get introduced to the game and people start yelling at me to update (It outputs a message to do so in the CLI if it encounters an unsupported item that affects MPA). Or when zones get added.
[SIZE=-1]
7/20: Various bugfixes. It's been a while.
4/4: Now uses the nifty item_drop_array(), which was introduced in revision 8356. This resulted in a noticeably smaller file. The old version is also included for those who don't use the newest revisions.
3/21: Not really an update, but this just replaces all instances of is_numeric() to is_integer in accordance with Mafia changes.
3/15: Wow, it's been a while. Added preliminary support for resting (pass "rest" as the second parameter). Also added an option to receive the standalone MPA of a zone, based on current modifiers (pass "" as the second parameter).
2/15: Fixed another possible error with the noncombat-parsing section. Added Dungeons of Doom to noncombats.txt. Why it wasn't there, I don't know. Fixed error with potion of detection.
2/6: Cleaned up some code (lines 174-237 expanded to 174-246 as a byproduct, but it's much easier to read). Also squished some Olfaction errors.
1/30: Bugfix -- previously, it would not work for items like Angry Farmer Candy, where there are multiple sources of the same effect not in relfx.txt (Just an example -- in the future, there might be other, relevant effects that it wouldn't have worked for). Also updated relfx.txt to include some other sources of Brined Liver. Also added stripping item names of trademarks.
1/27: Added some code, now requires revision 8014 or later (attempts to get duration if possible). Also made it return a value no matter what.
1/24: Added another two lines of code. You now have the option to have the script automatically set your valueOfAdventure each time it executes. False by default, of course.
1/24: Meh, felt like adding version checking for the script. Just one line of code, so it's not worthy of an entire update.
1/23 (Yeah, again): Added a sneaky map that actually contains all item drops. Also, a float that contains the increased meat. Whoo!
1/23: Erm, yeah. Change to ZLib and the adding of the type aggregate compel me to update using the new version of load_current_map. Whoo!
1/14: Added automatic data file update functionality. This should be the final version of this script, unless I find something that absolutely needs fixing.
1/12: Fixed the 8-Bit Realm screwiness and olfaction problems. Got even messier, though. =P
1/8: Added version numbers.
1/3: Stopped threadjacking and created this thread.
[/SIZE]
[size=+2]Profit_FX 1.65[/size]
[SIZE=-1]Profit_FX requires ZLib, revision 8356 or newer (profit_fx-old only requires 7915), and some intuition as to how to use it.[/SIZE]
I began this as a side-project with the idea that it'd eventually be incorporated into aqualectrix's PriceAdvisor script. Moved it away from that thread to stop wasting space and threadjacking and whatnot.
Basically, it's a modification of zarqon's profit.ash , except a lot of additional features:
- Uses duration of effects, as obtained from relfx.txt. Accurate for sauce potions, Crimbo09 campground items, and all sushi. And everything else that matters to farmers. I hope.
- Handles Slime Tube properly -- encounters are based on active ML.
- Takes Fishy into account if you're adventuring in the Sea.
- Factors in profit from noncombats, using information from noncombats.txt.
- Advises you whether maximizing combats or noncombats would be optimal; accounts removing Fresh/Hippy Scent and managing related skills. Does not cast any skills, in case you're worried about that.
- Does some sneaky stuff for script authors who might want to import it. It's a lot of crappy code (i.e. poorly-written) to include here, so they're not provided here.
- Takes Olfaction into account if you have the skill. Suggests the most profitable monster to olfact, if verbosity is set to 2 or higher.
- Figuring of revenue from each item is as follows: If the fifth mallprice (Mafia feature) is min-priced, assume that the item will be autosold. Otherwise, use fifth mallprice.
- Supports effects gained from resting, to some extent.
This script requires ZLib.ash and revision 8014 or later. Just put this script in your scripts folder, and after importing it, you can use it in your scripts by calling the following function:
float meat_gain(location place, string itm).
Other possible site of interest: as of version 1.3, it now generates this following map upon execution:
drop[key].ct[i,m], where:
key is an item that is a possible drop from this zone,
i is an integer that allows Mafia to differentiate between multiple instances of the item,
m is the monster from which the item drops, which is used for olfaction and combat rate modifying purposes,
and the float yielded (drop[key].ct[i,m]) is the expected increase in drops of that item from using this additional item.
Also, another new variable as of 1.3: tot_meetz, the expected increase in raw meat from using this item, then adventuring at a specified location.
As of 1.55: Supports effects gained from resting (sort of). Just pass "rest" as the second parameter. Also, passing an empty string ("") as the second parameter now returns your estimated current MPA.
The only visible output if verbosity < 3 that this script produces tells the user which monster in this zone would be most profitable to olfact (verbosity = 2).
Notes: The function requests a string instead of an item to accommodate for cases such as sushi. Demon summoning is supported to an extent -- put the effect name instead of the item name. Finally, it does not support pickpocketing -- drop rates for PP-only items aren't even spaded out, are they?
This should not be the final version, because of unforeseen bugs that need squashing and additions that I feel like making. Automatically updates map files, which I'll upload as items get introduced to the game and people start yelling at me to update (It outputs a message to do so in the CLI if it encounters an unsupported item that affects MPA). Or when zones get added.
[SIZE=-1]
7/20: Various bugfixes. It's been a while.
4/4: Now uses the nifty item_drop_array(), which was introduced in revision 8356. This resulted in a noticeably smaller file. The old version is also included for those who don't use the newest revisions.
3/21: Not really an update, but this just replaces all instances of is_numeric() to is_integer in accordance with Mafia changes.
3/15: Wow, it's been a while. Added preliminary support for resting (pass "rest" as the second parameter). Also added an option to receive the standalone MPA of a zone, based on current modifiers (pass "" as the second parameter).
2/15: Fixed another possible error with the noncombat-parsing section. Added Dungeons of Doom to noncombats.txt. Why it wasn't there, I don't know. Fixed error with potion of detection.
2/6: Cleaned up some code (lines 174-237 expanded to 174-246 as a byproduct, but it's much easier to read). Also squished some Olfaction errors.
1/30: Bugfix -- previously, it would not work for items like Angry Farmer Candy, where there are multiple sources of the same effect not in relfx.txt (Just an example -- in the future, there might be other, relevant effects that it wouldn't have worked for). Also updated relfx.txt to include some other sources of Brined Liver. Also added stripping item names of trademarks.
1/27: Added some code, now requires revision 8014 or later (attempts to get duration if possible). Also made it return a value no matter what.
1/24: Added another two lines of code. You now have the option to have the script automatically set your valueOfAdventure each time it executes. False by default, of course.
1/24: Meh, felt like adding version checking for the script. Just one line of code, so it's not worthy of an entire update.
1/23 (Yeah, again): Added a sneaky map that actually contains all item drops. Also, a float that contains the increased meat. Whoo!
1/23: Erm, yeah. Change to ZLib and the adding of the type aggregate compel me to update using the new version of load_current_map. Whoo!
1/14: Added automatic data file update functionality. This should be the final version of this script, unless I find something that absolutely needs fixing.
1/12: Fixed the 8-Bit Realm screwiness and olfaction problems. Got even messier, though. =P
1/8: Added version numbers.
1/3: Stopped threadjacking and created this thread.
[/SIZE]
Attachments
Last edited: