MrEdge73's Item Handling Script Suite!

Marcyroni

New member
I usually don't get a cola outfit in (HC) ascensions, but I do get a shield, as it's the easiest to get shield (shieldbutt) at low levels and for a long time after that. I would be annoyed if my shield was sold, and it's for another reason than use-outfit-for-mp :) Keeping 1 shield, while in ronin/hardcore would be a good separate consideration to add.
 

mredge73

Member
Update

Alright
It has been a while since I have updated the script online so here it goes:
Note: Now requires Zlib and mafia version above r7525
Look for an update soon that will use the new historical price instead of value.ash and bring in the new Zlib saved constants functionality (not included in this update).

MrEdge73's Support Script -- Functions (Beta).ash
version 20090828
added include Zlib
removed Kmail and Gift routines since they are included in Zlib
added parse_mail by zarqon from registry.ash
added DeleteMail
added DumpJunkMail
added more functionallity to Dusty() and DrinkBestDusty()
updated r7525 iterations over items to use items[] instead of 1 to 4000
adjusted make epic weapon function to operate correctly in muscle sign
adjusted check wand slightly
added get_time()
added BestDusty()
added MinutesToRollover()
added get_clan()

MrEdge73's Support Script -- Item Lists (Beta).ash
version 20090828
added dwarven quest junk
fixed typo on telescope[diesease]
added check telescope on first run
added request list
added time variables
added message record
added floaty sand and pebbles to Malas List
removed white rice from mall sell list

NSClosetier.ash (formally MrEdge73's NS Item Closetier! (Beta) .ash)
version 20090828
Shagadelic Disco Banjo cannot be closeted
added a reset property, future use
now only askes the accordian question once per ascention

HC Inventory Control.ash (formally MrEdge73's HC Daily Inventory Control! (Beta) .ash)
version 20090828
removed some possessItem functions and replaced them with haveItem functions
made the annoying dumped clown message to only occur once an ascention
made some formating changes
added an addition check to make sure you really want to end your run
 
Last edited:

mredge73

Member
new updates!
Incorporated Historical Pricing in the script, you may need to update mafia to use it: http://builds.kolmafia.us/
This will improve the speed of the script on the last day of the run, alleviate server hits, and help provide pricing information to the scripting community.

Please update the library scripts, Item and Functions.

**The Item script had a bug in it for the MeatCar quest, it would sell your parts before creating the meat car. It is now squashed in version 20090921

version 20090921
added spade prices

version 20090921
added improve spirits by bale
added equip familiar
added item[int] GetIngredients(item IT) for simplesity
added ComeBack() and LessCombats()
added store_name()

version 20090921
added MyPrice() to consider historical prices
added Historical Price Updating
improved pricing in the endofrun OCD
added more batstuff
fixed meatcar typo error
 
Last edited:

mredge73

Member
If you are using HC Inventory Control to clean out your inventory at the end of your run you need to download the Item List update 20091001.
These changes will not affect daily use of the script but is a big deal on the your last day.

This fixed a few bugs that I created by introducing myprice() and AvgPrice() to consider recent historical prices. I removed historic_age() and I improved the efficiently of the list builder by only iterating over items in inventory.

MyPrice(item i) now returns the historical price of an item if it is greater than 0
GetValue(item i) is the old value.ash function that uses ItemsOfLoathing.com for pricing
AvgPrice(item i) now returns the average of MyPrice() and GetValue()

Mafia will not return the current lowest price in the mall to an ash script.
So the goal is to build a work around to get a better round about pricing of an item by taking the lowest value in the mall from the previous day (GetValue) and averaging it with the 5th in the mall (MyPrice). Hopefully this will be a closer estimate of where the market price really is without having to actually search for it. Historic price depends highly on the scripting community regulary spading prices for the use of others. Items not bought or sold often may not get updated so that is what historic_age() is for. I found that hundreds of items were not regulary spaded so I am removing the historic_age() check for now to decrease server hits caused by having to run mall_price() to refresh it.

If you are using a better way of estimating cost please share. Historical_Price() is new and experimental.
 
Last edited:

Skystriker

New member
MrEdge73's Support Script -- Item Lists
version 20091001SI
Created by Justin Edge (mredge73)
To Be used with all of MrEdge73's Scripts, included in the Function script
Designed to be highly customizable for individual purposes.

^ invalid link now :s.

Will this work without it?
 

mredge73

Member
Updates!!!

I fixed the Link but if it ever doesn't work again the attachments at the bottom of the first post contain the required files.:)

Updates!!!

MrEdge73's Support Script -- ClanAdministrator(LITE).ash
version 20091207
slight change, added ComeBack to runintochoice
WaitIfStuck is more annoying and now exits if left in the cage forever.
Slight adjustment to StuckInCage to reduce server hits.
removed chat_reply()
commented out clan bot busy because of changes to mafia chatbot script execution

NSClosetier.ash
version 20091207
fixed bug on detection of musical instruments
fixed passfail() bugs
accordion and guitar log special case
removed user_confirm for piles of candy

MrEdge73's Support Script -- Functions (Beta).ash
version 20091207
improved GotOde
added get_time(seconds)
improved get epic
improved get legendary
added get_title
updated delete junk to include IocaineBot and Testudinata
added finditem by Rinn and Zarqon + alias
replaced print commands with debug commands for parse_mail

MrEdge73's Support Script -- Item Lists (Beta).ash
version 20091207
added debug constant and function
made linux capable
 

bleary

Member
Angry Farmer candy is a Gate One item

HC Inventory Control.ash just did this:

Code:
Closeting Gate 1 stuff...
Using 4 pile of candy...
You acquire marzipan skull (3)
You acquire Angry Farmer candy (6)
You acquire Tasty Fun Good rice candy (2)
You acquire Yummy Tummy bean (4)
Finished using 4 pile of candy.
Closeting Gate 2 stuff...

And then later said this:

Code:
You have a 11.111112% chance of passing the Gate One Test with the items in your closet.
To have a 100% of passing Gate One you need one of each of the following items: 
Angry Farmer candy, Black No. 2, Mick's IcyVapoHotness Rub, adder bladder, gremlin juice, pygmy pygment, super-spiky hair gel, thin black candle
You currently have these items in your closet: 
wussiness potion

And after that, it autosold all 6 of my Angry Farmer candies. I'll certainly see more in the L10 quest, but it's the principle of the thing, right?

Can you move the candy-opening logic to before the Gate One stuff gets closeted?
 

mredge73

Member
I never noticed that before, I guess it just did not click with me that you can get angry farmer candy from the piles of candy. I will fix it on the next update.

This also brings up another point, angry farmer candy is not specifically required for gate one since you possibly will need the effect "sugar rush" and you can get that from more than one kind of candy. It is much easier to script in a requirement of the angry farmer one since it is easy to get, do you think I should include other kind of candies for that requirement?
 

Veracity

Developer
Staff member
I always save a Tasty Fun Good candy for the gate and autosell the (twice as expensive) Angry Farmer candy.
 

mredge73

Member
First 2010 update!

NSClosetier.ash
version 20100111
moved pile of candy use before gate 1
removed user confirm on version check, now silently kmails link as well, check all versions

HC Inventory Control.ash
version 20100111
improved First Day Routines
replaced print commands with vprint()
removed user confirm on upgrade, silently kmails links
added check for all scripts required

MrEdge73's Support Script -- ClanAdministrator(LITE).ash
version 20100111
rewrote accept applications to work with OEM version
replaced error with vprint
checks all file versions now
added abort error for GetRankID

MrEdge73's Support Script -- Item Lists (Beta).ash
version 20100111
added PriceAnalyzer

MrEdge73's Support Script -- Functions (Beta).ash
version 20100111
Added: int DumpJunkMail(string Dump)
updated print commands to vprint(), debug is at level 5, commands at level 2
removed user confirm on update for kmail, now silently kmails link to player automatically
 

bleary

Member
zapping

I've got:
To have a 100% of passing Tower Monsters you need one of each of the following items:
NG, black pepper, bronzed locust, chaos butterfly, fancy bath salts, frigid ninja stars, hair spray, inkwell, leftovers of indeterminate origin, plot hole, powdered organs, pygmy blowgun, sonar-in-a-biscuit, stick of dynamite
You currently have these items in your closet:
Knob Goblin firecracker, barbed-wire fence, baseball, disease, mariachi G-string, meat vortex, photoprotoneutron torpedo, razor-sharp can lid, spider web, tropical orchid

HC Inventory Control.ash just zapped a 33398 scroll into a 30669 scroll, even though I'm done with the Orc Chasm quest and have two extra tropical orchids (don't ask) in inventory. This doesn't seem ideal to me. Shouldn't it have tried to make a stick of dynamite? I've also got dehydrated caviar in inventory. Shouldn't it have tried to make black pepper? I guess I'm asking either for logic which will figure this kind of thing out, or at least tell me what it's going to zap when asking for my okay.
 

mredge73

Member
well
The zap logic is not very intelligent outside of the logic designed to get you your NS keys.

I have never developed the zap logic to do more than get your keys and then zap a few items from a limited list. It will zap dungeon of doom rings until it turns them all into ring of conflict or teleport. Once you are out of them it will zap crap scrolls into 337 scrolls and crap ores into chrome ore for aftercore profit. This list can be edited in the Item List support script ZapMeList().

It would be a rather large task to get it to do what you ask. I would need to create a prioritized list of items to be zapped and check them against items that it would create. I am open to suggestions on how I would go about building such a list. As of now, the script will not do what you suggest unless you modify the zap list yourself to what you feel would be priority zaps. The zap routine does not function if you have already zapped today so you should probably do manual zapping of items that you need before running the script.

UPDATE
MrEdge73's Support Script -- Functions (Beta).ash
version 20100219
Changed how zaponce() works by moving the user_confirm box, It will now tell you what item it wishes to zap before before asking your okay.
 
Last edited:

bleary

Member
It would be a rather large task to get it to do what you ask. I would need to create a prioritized list of items to be zapped and check them against items that it would create.

Thanks for the quick update. The NS zap groups are pretty simple, I think. There's the various gums for Gate Two, the bang potions for Gate Three, and the fence/orchid/dynamite and the black pepper for the tower.

The logic is easiest for Gate Three, since the whole list of potions is also the zap group. "If we're missing one or more potions, and we have an extra in inventory, zap it."

The gums and the fence/orchid/dynamite groups are similar. "If we're missing one or more of this group, and we have an extra member of this group in inventory, zap it."

The black pepper is the only NS item for which the other members of its zap group aren't also NS items. Since the code doesn't currently pay attention to caviar or ancient spice, it's a little more work to figure out if we've got one in inventory.

As for priority, I guess the pepper is probably at the top, since it's pretty hard to get, followed by the fence/orchid/dynamite (if the island is already unlocked). The gums and potions are pretty easy to farm (the gum much easier as a moxie sign).

I can see about whipping up a patch to Item Lists that'll conditionally add these things to ZapMeList. I suppose the NS items would bump everything else down a rank.
 

mredge73

Member
I think this could be quickly fixed by an easy edit to the ZapMeList(). I can make obtaining a black pepper the first goal and getting the beach rewards the second goal. As far as the potions and gums, since they are so easy to farm I won't have the ZapOnce() function in HC inventory control zap them.

As of adding intelligent Zap functionality to NSClosetier, I can look into that as well but I don't know how often it would be used. For example, my typical HC ascension is about 2 weeks. If I get the wand I only have it for a couple days so only a few zaps will be used. So, I would need logic to prioritize each missing item from the rarest to the most plentiful before calculating what to zap. I would need some logic to have it get the keys first, black pepper second, beach items third and all the way down to the hair spray. I will think about this some more.

NSClosetier is past due for an update anyway.
 
Last edited:

Tsolarok

New member
MrEdge73's Support Script -- Functions (Beta).ash
version 20100219SF
Created by Justin Edge (mredge73)
To Be Included with all of MrEdge73's Scripts

^This is returning an invalid attachment error for me, even on the front page.
 

bleary

Member
autosell or feed to slimeling?

I've been thinking about when it's worth autoselling junk equipment and when it's better to feed it to the slimeling. I've written some code which attempts to do this math, and maybe it's worth putting something like it into this suite. Here's a demonstration script:

Code:
import <MrEdge73's Support Script -- Item Lists (Beta).ash>
// '

// meatpermp logic stolen from SmartStasis.ash, will use the UniversalRecovery value if set.
float meatpermp;
if (get_property("_meatpermp") != "") 
    meatpermp = to_float(get_property("_meatpermp"));
else {
    meatpermp = 8;  // seltzer base calc
    if (my_primestat() == $stat[mysticality] || (my_class() == $class[accordion thief] && my_level() > 8))
	meatpermp = 100.0 / (1.5 * to_float(my_level()) + 5); // mmj calc if available
 }


// starfish restores int((X+3)/2) to (X+3), where X is the weight of the familiar.
// slimeling has a greater range, but maybe the same mean?
float slimeling_mp(item ItemToFeed) 
{

    // stuff with no power is not feedable. this probably ought to check for other unfeedable items.
    if (get_power(ItemToFeed) >= 1)
	// starfish mean is .75(wt + 3)
	// number of charges is power/10 plus-or-minus 1, which is an average of power/10
	// (except for items with power < 10, which give either 0 or 1 charges, or a mean of .5
	return (.75 * (familiar_weight( $familiar[Slimeling]) + 3) *  max(get_power(ItemToFeed) / 10, .5));

return 0;

}

void main() {

    // let's check out the Hardcore junk list

    LoadHardCoreList();
    

    print("With a " + to_string(familiar_weight( $familiar[Slimeling])) + " lb slimeling, and MP worth " + to_string(meatpermp) + "...");
    print("A slimeling charge is worth " + to_string( .75 * (familiar_weight( $familiar[Slimeling]) + 3)) + " MP");

    foreach i in Auto_Sell
    {
	int price= autosell_price (i);
	if ((price / meatpermp) <= slimeling_mp(i))
	    print(to_string(i) + " autosells for " + to_string(price) + " but is worth " + to_string(slimeling_mp(i)) + " MP or " + to_string(slimeling_mp(i) * meatpermp) + " meat.");
	
	
    }
}

This finds over 70 items for me (7 lb slimeling, MMJ available) which are worth more to fed to the slimeling and turned into MP than autosold. Maybe something like this logic could make its way into HC Inventory Control? Or maybe it ought to be a separate script. Just throwing it out there.
 

mredge73

Member
I will see if I can find a place to add this in.
Unfortunately, I don't have a slimeling to test it on so you will have to be the guinea pig
 
Top