Mass puchasing Script Request

mrdinosaur

New member
I do a lot of cooking, and I often use the buy X CLI function to buy my ingredients. Unfortunately, often, I buy quite large amounts (sometimes several thousand at a time). Sometimes, if most store have very few, I end up spending far more than I intended. What I am looking for is a script (could not find an existing function) to limit the amount of meat I spend hile buying these. In particular, I have problems with elemental nuggest for sour sauces.
I admit this would be exploitable as an alternative to mallbotting, so I understand if you would not want to make this.
Thanks!
 

fronobulax

Developer
Staff member
I'm not sure what you really are asking for.

My current solution to limiting meat used by automation has been to set a budget, closet all but the budgeted amount, let mafia or a script do what they are told (and fail when they run out of meat) and then restore the meat from the closet.
 

heeheehee

Developer
Staff member
I'm pretty sure that the CLI buy command should have some way to limit how expensive the stuff you buy is...
"buy item @ maxprice", it looks like. (No quotes, of course.) Of course, the buy() function has similar (identical?) functionality.
 

slyz

Developer
The ASH version of the buy command has a functionality that the CLI version doesn't have: you can set a price limit (see here for more info).
I'm not really sure how this can be made into an alias though, since you would need to input the amount and the name of the item. The alias could be preset to buy only up to mall_price()+100 or 1.1*mall_price().

I suggest you use the Purchase tab instead, since it shows the total amount of meat you need to buy out all the stores you have selected.

EDIT: Just checked by doing help buy in the gCLI, and now I saw heeheehee's post: the CLI version does have that functionality! Yay for coherence.
 

Theraze

Active member
Yes... just be very sure you remember that's price per item, not price overall. That should help reduce some tears. :)

Also, it looks like if you give it a price, it returns an int (items bought?) instead of a bool. Something to keep in mind if using in scripting.
 
You can do a buy on say a giant needle and specify the number you want (say 100), and the price (say 1000).

Mafia will start buying them up to 100 of them, but it will stop once the price exceeds 1000 per item. So you should be able to just use the straight up buy command (or put it in a script) and be in good shape.
 
Top