MrEdge73's Item Handling Script Suite!

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

If you're interested in incorporating a patch, I can work it out and test it on my own and submit it later.

I'm thinking there ought to be a setting which is a threshold multiplier at which equipment is fed rather than autosold. So:

With a 10 lb slimeling, and MP worth 8.0...
A slimeling charge is worth 9.75 MP
Knob Goblin harem pants autosells for 27 but is worth 9.75 MP or 78.0 meat.
saucepan autosells for 1 but is worth 9.75 MP or 78.0 meat.

If the threshold is set around 10 to 20, the saucepan should get fed (worth 78x more as food) but the pants get autosold (worth only 2.9x as much when fed). Then again, how much someone might prefer MP over meat probably depends on where they are in their run and how much meat they already have. I suppose the weight of the slimeling factors this in somewhat, since at lower weights (earlier in the run) it produces less MP. With a 10lb slimeling, antique helmet autosells for 160 but is worth 195.0 MP or 1560.0 meat (less than 10x as much). And, at this stage of my run, I'd probably rather have the 160 meat. But then, I'm just level 6, so I'm not seeing too much antique stuff. Later, with a 15lb slimeling, the value climbs to 270.0 MP or 2160.0 meat (almost 14x as much) and it looks like a better deal. So I'd probably pick a threshold of around 13-15, but I imagine others would have different preferences.

I'll think about it some more and work on a little patch.
 
Currently as an accordion thief, one of the scripts is messing up and causing the whole script to quit, which stops the selling portion of the script, because it can't transfer my Squeezebox of the Ages to my closet
I'm going to assume it's the NS Closetier
it looks like this

Starting Execution...
Loading NS item List...
Checking Items in the Closet...
Closeting Gate 1 stuff...
Placing Items in Closet...
Placing items into closet...
Closeting Gate 2 stuff...
Closeting Gate 3 stuff...
Placing Items in Closet...
Placing items into closet...
Closeting Tower stuff...
Placing Items in Closet...
Placing items into closet...
Checking Items in the Closet...
Checking Items in the Closet...
Checking Items in the Closet...
Checking Items in the Closet...
Checking for Accordians...
Checking Items in Inventory...
Placing items into closet...
Transfer failed for Squeezebox of the Ages

HC Daily Inventory Control Taking Over...
Restoring Outfit Checkpoint...
 
Line 498...
Code:
if (haveItem(AccordianSort[i]) && !closetdone)
could be changed to...
Code:
if (haveItem(AccordianSort[i]) && !closetdone && is_displayable(AccordianSort[i]))
(is_displayable() only returns false for quest items, which incidentally also cannot be closeted.)

Also, the Functions link on the first post is invalid. Just a heads up.
 
Started to poke at a few bits here to make it more fun more me. First, the aliases I'm using from the function script. If you want to use any, put 'alias' on the front of each line and it should work.
classgear => ashq import <MrEdge73's Support Script -- Functions (Beta).ash> TryToBecomeEpic(); TryToBecomeLegendary();
fillcampground => ashq import <MrEdge73's Support Script -- Functions (Beta).ash> FillCampGround()
rollovertime => ashq import <MrEdge73's Support Script -- Functions (Beta).ash> print(MinutesToRollover() + " more minutes until rollover.")
showquests => ashq import <MrEdge73's Support Script -- Functions (Beta).ash> CheckGuildQuests(); nextQuest();
usestill => ashq import <MrEdge73's Support Script -- Functions (Beta).ash> boolean working = true; while (working) working = improve_spirits(false, true);

As you can see, usestill has 2 variables, not just one... This is because I wanted improve_spirits to be able to decide not just based on sell price, but also based on whether or not I already had the items for it in my inventory. The code for improvement and improve_spirits follows:
Code:
//Improvement -- Bale
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
item improvement(item [item] StillUpgrades, boolean nobuy)
{
	item best;
	int profit = 0;
	int test_profit;
	
	foreach key in StillUpgrades 
	{
		test_profit = MyPrice(StillUpgrades[key])-MyPrice(key);
                if(nobuy && item_amount(to_item(key)) == 0) continue;
                if(test_profit > profit)
		{
			best = key;
			profit = test_profit;
		}
	}
	if (profit > 0) vprint("Profit each is "+profit,"green",3);
	return best;
}
Code:
//Improve spirits --Bale
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
boolean improve_spirits(boolean sell, boolean nobuy)
{
        int howmany;
	if(my_class() != $class[disco bandit] && my_class() != $class[accordion thief]) 
	{
		vprint("You're not a moxie class, so no booze refinement for you.", "red",-2);
		return false;
	}
	LoadMMM();	
        item still = improvement(StillUpgrades, nobuy);
        if (nobuy) howmany = min(stills_available(), item_amount(to_item(still)));
        else howmany = stills_available();

	if(howmany == 0) 
	{
		vprint("you have nothing left with the still today", "#FFA500",2);
		return false;
	}
	
	vprint("Creating " + howmany+ " " +StillUpgrades[still],"blue",2);
	retrieve_item(howmany, still);
	create(howmany, StillUpgrades[still]);
	if (sell)
	{
		vprint("Selling " +howmany+" "+ StillUpgrades[still] +" for "+MyPrice(StillUpgrades[still])+" each, for a total of "+(howmany*MyPrice(StillUpgrades[still])), "blue",2);
		cli_execute("mallsell "+howmany+" "+ StillUpgrades[still]+ " @ "+ MyPrice(StillUpgrades[still]));
	}
	return true;
}

Basically, I added a 'nobuy' variable. If you don't have any of the item in inventory, it won't consider it a possible item to be changed. If you don't have 10 of the most valuable item in your inventory, it will only make as many as you actually have in inventory. This means if you manually call it, it may need to run multiple times to finish using up all your uses. The alias I have above SHOULD repeat until it's done, but I made my while loop after I finished still uses today, so... haven't gotten to test it when it works yet, but I know it runs when you're out of uses. Also, I moved the howmany check below so that it would actually abort when you have no items left to change, but still uses officially left.

Basically, I wanted something that would simplify my HC uses. I don't especially care what I'm converting as long as it's free... When I'm not just looping, I'll care about making items, but for now? Just want to finish my still uses with the items on hand. I'll let eatdrink create the best food it can with updated tasties, and that should be fun. :)

Edit: With that change, it now only displays profit if there actually is some... if profit returns as 0, that means that you didn't find an item to do, and item_amount(to_item(still)) should return 0 and not try to convert anything. It also means if you have 0 still uses remaining, it doesn't try to tell you that your profit is 0 anymore...
 
Last edited:
Small error in the item handling script which means that NSClosetier doesn't output that you need a disease for the tower if the telescope shows that it is a requirement.
Line 529:
Telescope[$item[disease]]= "part of a tall wooden frame";
should be
Telescope[$item[disease]]= "see part of a tall wooden frame";

Thanks for the awesome suite of scripts btw :)
 
It Has Been A Long Time... UPDATES!

HC Inventory Control.ash
version 20100914
removed spade prices, mafia does this now
removed annoying refresh all, user can refresh on their own
removed aftercore confirmation
removed expermental flea market routine
added routine to check if autoselling an item is better than mallselling it

NSClosetier.ash
version 20100914
rewrote some logic for ZapGodKeys()
added pass flag for gate2 if in moxie sign
added tower top level code
fixed closeting items that cannot be closeted

MrEdge73's Support Script -- Functions (Beta).ash
added Donate from the looter script
added campground limits
fixed unix timestamp
fixed Legendary Check, no longer removes weapon.
made some syntax changes

MrEdge73's Support Script -- Item Lists (Beta).ash
version 20100914
replaced price updating with the list maintained on kol mafia
keep 1 turtle totem
added black pepper to zap once list
fixed meat stacks doubled in price
added nemesis quest items
added tower top and set it up for NS closetier upgrade
fixed smiling man
shutdown of loathing map, did some work on price functions
added load price map to work with MMM
replaced average price with get value
added dueling banjo to guitar list
fix reported typo on disease

MrEdge73's Support Script -- ClanAdministrator(LITE).ash
version 20100914
fixed stuck in cage messages
cut some redundantacy on records
 
Aww, still need to edit my no-buy improvement feature back in. Ah well, done so. Thanks for the update. :D
 
Is there any chance that for us who are "scared" of selling things they don't want to, to add a sim option to the HC Inventory Control? It's be nice to see what would be sold/happen, before it actually does it.
 
That would be a large rewrite, I will look into it but don't expect it soon.
Some parts of the routine could use rewriting due to mafia updates anyway.

Keep in mind that the script will not sell anything in the closet or equipped, so if there is something that you are scared to loose place it in the closet. It is designed to be used during a HC run (I run it at least twice a day), so if it does sell something that I wish it hadn't (clown skin with a muscle class, I need to fix that) it only takes a few turns to gain it back.
Really the scariest time to run the script is at the end of the run where it evaluates your entire inventory. I am okay with what it does but others may be squeamish, that is the reason for the double prompt.
 
That's where I am now, end of run. While I'd like to be able to click and go, I'd be worried about loosing necessary items.

I guess I won't run it except while in ronin, since most of that isn't necessary.

Don't worry too much about the re-write, I need to just suck it up and clear out my inventory of crap :)
 
Justin,
Great script.
Don't know what happened, but it autosold 9 flareguns, leaving 0, though the war was not ended. Without a flaregun, it is more of a challenge to kill off The Man. (Killed off Hippy's as Frat, HC, no path, no clover as DB)
 
Sorry about that, I don't think I can help you on this problem. It is designed to keep one in inventory, I just double checked the code and verified it.
It is setup correctly so I am not sure what happened in your case. Maybe a Mafia hiccup with item_amount()?

Should it keep more than one in inventory? I don't know how useful they are since I only use one to get a Wossname.
 
Last edited:
When running HC Inventory Control I get this error:
Bad item value: "desert bus pass" (zlib.ash, line 394)

What can I do to fix it? Love this script, use it daily.
 
I'm curious why NSclosetier insists on making an NG even when I don't need one according to my telescope. Bug or a feature?
 
Bug.
Do you have at least 5 Telescope upgrades to know that it is not needed?

I cannot test this right now but replace Line 402-413 with this, let me know if it works:
Code:
if (Tower contains $item[NG] && !possessItem($item[NG]))
		{
			if (creatable_amount($item[NG])>0 )
			{	
				print("Creating NG...","blue");
				create(1,$item[NG]);
			}
			else
			{
				if(haveItem($item[lowercase N]) && closet_amount($item[lowercase N])==0)	put_closet(1,$item[lowercase N]);
				if(haveItem($item[original G]) && closet_amount($item[original G])==0)	put_closet(1, $item[original G]);
			}
		}
 
Brick You.ash

I made this little script for April Fools day and thought that I should share it.
It is very simple, it just bricks everyone in your clan.
It requires my support scripts to be placed in your script folder.
Enjoy!

View attachment BrickYou.ash
 
Back
Top